[llvm] [Attr] Add `noipa` function attribute (PR #203304)
J. Ryan Stinnett via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 09:51:14 PDT 2026
================
@@ -428,6 +428,7 @@ static bool hasDistinctMetadataIntrinsic(const Function &F) {
/// Check whether \p F is eligible for function merging.
static bool isEligibleForMerging(Function &F) {
return !F.isDeclaration() && !F.hasAvailableExternallyLinkage() &&
+ !F.hasFnAttribute(Attribute::NoIPA) &&
----------------
jryans wrote:
I initially tried to use `hasExactDefinition` in this pass (similar to other adjusted passes in this PR), but it appears from the `MergeFunctions` test cases that this pass is meant to activate for cases like weak linkage, which `hasExactDefinition` would prevent. So, I have conservatively only checked the new `noipa` attribute for this pass.
https://github.com/llvm/llvm-project/pull/203304
More information about the llvm-commits
mailing list