[Mlir-commits] [mlir] [mlir] Migrate users to explicitly discardable/inherent attribute APIs (PR #217233)

Mehdi Amini llvmlistbot at llvm.org
Wed Aug 19 03:58:48 PDT 2026


================
@@ -42,11 +42,7 @@ static LogicalResult verifyAtomicUpdateOp(Operation *op) {
                              << stringifyTypeName<ExpectedElementType>()
                              << " value, found " << elementType;
 
-  StringAttr semanticsAttrName =
-      AtomicOpTy::getSemanticsAttrName(op->getName());
-  auto memorySemantics =
-      op->getAttrOfType<spirv::MemorySemanticsAttr>(semanticsAttrName)
-          .getValue();
+  auto memorySemantics = cast<AtomicOpTy>(op).getSemantics();
----------------
joker-eph wrote:

In general we don't in such cases where the type is already spelled out (the cast on the RHS)

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


More information about the Mlir-commits mailing list