Shape can be memref of index type, so memref::LoadOp result need to be converted into llvm type.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Trying to understand if it can be anything else?
It can be also a memref of plain integer type (there are tests for i64, but I doubt existing code will work for i32 or other integer types).
mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp | ||
---|---|---|
1163–1169 | It somehow feels that this (ab)uses the rewriter API. There is no remapped value for dimSize because it is created in the line above, so this just forces the rewriter to call the target materialization in case of type mismatch. Given the amount of TODO in that part of the rewriter, it is not unlikely that the behavior may change and break this in unexpected ways. I would rather call the materialization directly from type converter if the loaded type is index. ReshapeOp only supports memref of integer or index anyway. |
It somehow feels that this (ab)uses the rewriter API. There is no remapped value for dimSize because it is created in the line above, so this just forces the rewriter to call the target materialization in case of type mismatch. Given the amount of TODO in that part of the rewriter, it is not unlikely that the behavior may change and break this in unexpected ways.
I would rather call the materialization directly from type converter if the loaded type is index. ReshapeOp only supports memref of integer or index anyway.