[llvm] [Attr] Add `noipa` function attribute (PR #203304)

J. Ryan Stinnett via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 07:04:38 PDT 2026


================
@@ -0,0 +1,18 @@
+; RUN: opt -passes=argpromotion -S < %s | FileCheck %s
+
+; Test: ArgumentPromotion promoting a by-ref argument of a noipa function.
+; If noipa is working, argpromotion should NOT promote the pointer argument,
+; because it requires inspecting the function body to determine load patterns.
+
+; CHECK: define internal i32 @foo(ptr %p)
+define internal i32 @foo(ptr %p) noipa noinline {
+  %v = load i32, ptr %p
+  ret i32 %v
+}
----------------
jryans wrote:

Thanks for the suggestion. I have extended most of the tests in this fashion. I believe the risk here is low, since functions without `noipa` are well covered by existing tests, but it's still a good idea in general to cover both sides where easy to do so.

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


More information about the llvm-commits mailing list