Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
2400 | Should this be a helper in UnrankedMemRefDescriptor? This will likely get used in other places (we already to it in some hlo cast operation I think). Something like getOffsetPtr getSizesPtr and getStridesPtr which return the pointer to index? | |
2439 | Just fall through to the implementation below? If it is dynamic, i being constant does not help. | |
2451 | Why does this need rank explicit and the above does not? | |
mlir/lib/Dialect/StandardOps/IR/Ops.cpp | ||
1345–1346 | Nit: You could cast to ShapedType and then query hasRank. We have a cast to shaped type below already. | |
1346 | Remove extra {} |
Address the comments and fix mlir-cpu-runner tests in cmake.
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
2400 | Definitely, I was planning to do that when lowering memrefcast ops. It is also not trivial, because this code uses TypeConverter and addressSpace that are not a part of UnrankedMemRefDescriptor. I don't think it should be a member of the descriptor. But it can be a useful utility. Not in this CL. | |
2439 | i left the old code pretty much untouched. Thanks for noticing. These two different size methods are emit different code. See the comment below. | |
2451 | the one with the rank emits GEPs and they use rank to construct array type with shapes (it is not really needed though). |
Thanks for clarifying!
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
2439 | So, discussed this offline. The difference here is that using this form of size creates better code and hence is used here. Having a static index enables this. Maybe it would be nice if size could do this internally but that is not for this PR. @ftynse WDYT |
Should this be a helper in UnrankedMemRefDescriptor? This will likely get used in other places (we already to it in some hlo cast operation I think). Something like getOffsetPtr getSizesPtr and getStridesPtr which return the pointer to index?