This patch makes the SPIRVTypeConverter to account for the difference between static cases and dynamic cases for OpenCL.
Fixes https://github.com/llvm/llvm-project/issues/58058
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Nice, thanks for fixing it! Just some minor issues.
mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp | ||
---|---|---|
349 | Can we put comments here like "For OpenCL Kernel, dynamic shaped memrefs convert into a pointer pointing to the element. And then move the comment at L341 down to before L348? | |
349 | This can happen before L344? (So we don't need to build the arryType at all.) | |
410 | Same here. | |
785 | We can do the if-else just for the return builder.create apart? Concretely: c++ Value linearIndex; if (baseType...) { ... } else { ... } Type pointeeType = basePtr.getType().cast<spirv::PointerType>().getPointeeType(); if (pointeeType.isa<spirv::ArrayType) return builder.create<spirv::AccessChainOp> ... else return builder.create<spirv::PtrAccessChainOp> ... |
Can we put comments here like "For OpenCL Kernel, dynamic shaped memrefs convert into a pointer pointing to the element.
And then move the comment at L341 down to before L348?