[Mlir-commits] [mlir] [mlir] Migrate users to explicitly discardable/inherent attribute APIs (PR #217233)
Igor Wodiany
llvmlistbot at llvm.org
Wed Aug 19 02:55:58 PDT 2026
================
@@ -177,20 +177,19 @@ static LogicalResult verifyMemoryAccessAttribute(MemoryOpTy memoryOp) {
// ODS checks for attributes values. Just need to verify that if the
// memory-access attribute is Aligned, then the alignment attribute must be
// present.
- auto *op = memoryOp.getOperation();
- auto memAccessAttr = op->getAttr(memoryOp.getMemoryAccessAttrName());
+ auto memAccessAttr = memoryOp.getMemoryAccessAttr();
if (!memAccessAttr) {
// Alignment attribute shouldn't be present if memory access attribute is
// not present.
- if (op->getAttr(memoryOp.getAlignmentAttrName())) {
+ if (memoryOp.getAlignmentAttr()) {
return memoryOp.emitOpError(
"invalid alignment specification without aligned memory access "
"specification");
}
return success();
}
- auto memAccess = cast<spirv::MemoryAccessAttr>(memAccessAttr);
+ auto memAccess = memAccessAttr;
----------------
IgWod wrote:
nit: Please spell out the type
https://github.com/llvm/llvm-project/pull/217233
More information about the Mlir-commits
mailing list