[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:59 PDT 2026
================
@@ -221,20 +220,19 @@ static LogicalResult verifySourceMemoryAccessAttribute(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.getSourceMemoryAccessAttrName());
+ auto memAccessAttr = memoryOp.getSourceMemoryAccessAttr();
if (!memAccessAttr) {
// Alignment attribute shouldn't be present if memory access attribute is
// not present.
- if (op->getAttr(memoryOp.getSourceAlignmentAttrName())) {
+ if (memoryOp.getSourceAlignmentAttr()) {
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