[clang] [CIR] Split side_effect into memory effects, nounwind, and willreturn (PR #223890)

Adam Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 20 16:25:33 PDT 2026


================
@@ -391,19 +390,24 @@ void CIRGenModule::constructAttributeList(
 
     assert(!cir::MissingFeatures::opCallAttrs());
 
-    // 'const', 'pure' and 'noalias' attributed functions are also nounwind.
-    if (targetDecl->hasAttr<ConstAttr>()) {
-      // gcc specifies that 'const' functions have greater restrictions than
-      // 'pure' functions, so they also cannot have infinite loops.
-      sideEffect = cir::SideEffect::Const;
-    } else if (targetDecl->hasAttr<PureAttr>()) {
-      // gcc specifies that 'pure' functions cannot have infinite loops.
-      sideEffect = cir::SideEffect::Pure;
+    std::optional<cir::ModRefInfo> access;
+    if (targetDecl->hasAttr<ConstAttr>())
+      access = cir::ModRefInfo::NoModRef;
----------------
adams381 wrote:

Added all eleven with the same names, so this reads `MemoryEffectsAttr::none` now.

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


More information about the cfe-commits mailing list