Skip to content
9 changes: 9 additions & 0 deletions lib/PTO/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ add_mlir_dialect_library(PTOTransforms
TileFusion/PTOFlattenFusionRegion.cpp
VPTOLLVMEmitter.cpp
VPTOCANN900LLVMEmitter.cpp
VPTOCANN900LLVMEmitterArithmeticPatterns.cpp
VPTOCANN900LLVMEmitterCalleeCore.cpp
VPTOCANN900LLVMEmitterCalleeMemory.cpp
VPTOCANN900LLVMEmitterMemoryPatterns.cpp
VPTOCANN900LLVMEmitterPacking.cpp
VPTOCANN900LLVMEmitterPipeline.cpp
VPTOCANN900LLVMEmitterScalarPatterns.cpp
VPTOCANN900LLVMEmitterTypeHelpers.cpp
VPTOCANN900LLVMEmitterTypePatterns.cpp
VPTOLLVMEmitterDispatcher.cpp
VPTOLLVMEmitterHelper.cpp
VPTOPtrNormalize.cpp
Expand Down
12 changes: 5 additions & 7 deletions lib/PTO/Transforms/VPTOBufferMaterialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ static AddressSpaceAttr getNormalizedPtrMemorySpace(Attribute memorySpace,
return AddressSpaceAttr::get(context, AddressSpace::GM);
}

static Value materializeMemRefView(Value value, ArrayRef<int64_t> shape,
Type elementType, Attribute memorySpace,
static Value materializeMemRefView(Value value, MemRefType memrefType,
PatternRewriter &rewriter, Location loc) {
auto memrefType =
MemRefType::get(shape, elementType, AffineMap(), memorySpace);
if (value.getType() == memrefType) {
return value;
}
Expand All @@ -53,9 +50,10 @@ static Value materializeTileBufferView(Value value, PatternRewriter &rewriter,
return {};
}

return materializeMemRefView(value, tileType.getShape(),
tileType.getElementType(),
tileType.getMemorySpace(), rewriter, loc);
auto memrefType =
MemRefType::get(tileType.getShape(), tileType.getElementType(),
AffineMap(), tileType.getMemorySpace());
return materializeMemRefView(value, memrefType, rewriter, loc);
}

} // namespace
Expand Down
Loading
Loading