[clang] [CIR] Add math and builtin intrinsics support (PR #175233)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 13 14:09:12 PST 2026
================
@@ -2196,7 +2197,44 @@ void CIRGenModule::setCIRFunctionAttributesForDefinition(
} else if (codeGenOpts.getInlining() == CodeGenOptions::OnlyAlwaysInlining) {
// If inlining is disabled, force everything that isn't always_inline
// to carry an explicit noinline attribute.
+ // However, don't mark functions as noinline if they only contain
----------------
adams381 wrote:
This change aligns the `isConstant` calculation with classic codegen's `EmitGlobalVarDefinition`. The original code set the constant flag after the global was created, which caused inconsistencies. By calculating `isConstant` before `createGlobalOp` and using `ExcludeCtor=true` (constructors run at init time, not storage time) and `ExcludeDtor=!needsDtor` (only consider destructor if needed), we match OGCG behavior.
https://github.com/llvm/llvm-project/pull/175233
More information about the cfe-commits
mailing list