[clang] [CIR] Split side_effect into memory effects, nounwind, and willreturn (PR #223890)
Adam Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 18 08:55:05 PDT 2026
================
@@ -2816,13 +2799,35 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
if (parser.parseOptionalAttrDictWithKeyword(parsedAttrs))
return failure();
+ // memory_effects is the only declared attribute with no dedicated syntax, so
+ // it is the only one the explicit list may carry.
for (StringRef disallowed : cir::FuncOp::getAttributeNames()) {
+ if (disallowed == CIRDialect::getMemoryEffectsAttrName())
+ continue;
if (parsedAttrs.get(disallowed))
return parser.emitError(loc, "attribute '")
<< disallowed
<< "' should not be specified in the explicit attribute list";
}
+ // Being a declared attribute, memory_effects is stored as a property, so a
+ // value of the wrong kind would be dropped without a diagnostic.
+ if (mlir::Attribute effects =
+ parsedAttrs.get(CIRDialect::getMemoryEffectsAttrName()))
----------------
adams381 wrote:
It's in FuncOp::print, which elides every declared attribute except this one, so it prints in the dictionary.
https://github.com/llvm/llvm-project/pull/223890
More information about the cfe-commits
mailing list