[Mlir-commits] [mlir] [mlir][spirv][memref] Calculate alignment for `PhysicalStorageBuffer`s (PR #80243)

Quinn Dawkins llvmlistbot at llvm.org
Thu Feb 1 14:14:11 PST 2024


================
@@ -508,11 +568,15 @@ IntLoadOpPattern::matchAndRewrite(memref::LoadOp loadOp, OpAdaptor adaptor,
   assert(accessChainOp.getIndices().size() == 2);
   Value adjustedPtr = adjustAccessChainForBitwidth(typeConverter, accessChainOp,
                                                    srcBits, dstBits, rewriter);
-  Value spvLoadOp = rewriter.create<spirv::LoadOp>(
-      loc, dstType, adjustedPtr,
-      loadOp->getAttrOfType<spirv::MemoryAccessAttr>(
-          spirv::attributeName<spirv::MemoryAccess>()),
-      loadOp->getAttrOfType<IntegerAttr>("alignment"));
----------------
qedawkins wrote:

I'm not familiar with this path; if `PhysicalStorageBuffer` is not the storage class, is it possible to have a memory access attribute without an alignment or vice-versa? The new logic looks to return two empty attributes in this case.

https://github.com/llvm/llvm-project/pull/80243


More information about the Mlir-commits mailing list