[compiler-rt] [llvm] [Transforms][IPO] Add func suffix in ArgumentPromotion and DeadArgumentElimination (PR #109899)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 20:28:26 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: None (yonghong-song)

<details>
<summary>Changes</summary>

The goal is to add suffix to Argument Promotion and Dead Argument Elimination passes. So users will know that function signature get changed. One of motivation is to help kernel tracing with bpf technology.
Previous patch is [1] and it is reverted due to some test failures. This patch fixed a test failure on top of [1].

For details of the description for the patch, see [1].

  [1]  https://github.com/llvm/llvm-project/pull/105742 for details

---

Patch is 123.85 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/109899.diff


80 Files Affected:

- (modified) compiler-rt/test/cfi/stats.cpp (+2-2) 
- (modified) llvm/lib/Transforms/IPO/ArgumentPromotion.cpp (+1) 
- (modified) llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp (+4) 
- (modified) llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll (+2-2) 
- (modified) llvm/test/BugPoint/remove_arguments_test.ll (+1-1) 
- (modified) llvm/test/CodeGen/AArch64/arg_promotion.ll (+8-8) 
- (modified) llvm/test/CodeGen/AMDGPU/internalize.ll (+1-1) 
- (modified) llvm/test/ThinLTO/X86/memprof-aliased-location1.ll (+12-12) 
- (modified) llvm/test/ThinLTO/X86/memprof-aliased-location2.ll (+12-12) 
- (modified) llvm/test/ThinLTO/X86/memprof-basic.ll (+18-1) 
- (modified) llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll (+13-1) 
- (modified) llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll (+18-1) 
- (modified) llvm/test/ThinLTO/X86/memprof-indirectcall.ll (+14-1) 
- (modified) llvm/test/ThinLTO/X86/memprof-inlined.ll (+14-1) 
- (modified) llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/BPF/argpromotion.ll (+1-1) 
- (modified) llvm/test/Transforms/ArgumentPromotion/X86/attributes.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/X86/min-legal-vector-width.ll (+16-16) 
- (modified) llvm/test/Transforms/ArgumentPromotion/X86/thiscall.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/actual-arguments.ll (+5-5) 
- (modified) llvm/test/Transforms/ArgumentPromotion/aggregate-promote-dead-gep.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/aggregate-promote.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/align.ll (+8-8) 
- (modified) llvm/test/Transforms/ArgumentPromotion/allocsize.ll (+8-8) 
- (modified) llvm/test/Transforms/ArgumentPromotion/attrs.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/basictest.ll (+4-4) 
- (modified) llvm/test/Transforms/ArgumentPromotion/bitcasts.ll (+4-4) 
- (modified) llvm/test/Transforms/ArgumentPromotion/byval-2.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/byval-with-padding.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/byval.ll (+10-10) 
- (modified) llvm/test/Transforms/ArgumentPromotion/chained.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/control-flow2.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/crash.ll (+1-1) 
- (modified) llvm/test/Transforms/ArgumentPromotion/dbg.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/fp80.ll (+6-6) 
- (modified) llvm/test/Transforms/ArgumentPromotion/inalloca.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/invalidation.ll (+3-3) 
- (modified) llvm/test/Transforms/ArgumentPromotion/load-alignment-value-overflows-addrspace-size.ll (+4-4) 
- (modified) llvm/test/Transforms/ArgumentPromotion/max-elements-limit.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/metadata.ll (+4-4) 
- (modified) llvm/test/Transforms/ArgumentPromotion/min-legal-vector-width.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/nonzero-address-spaces.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/opaque-ptr.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/pr27568.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/pr32917.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll (+1-1) 
- (modified) llvm/test/Transforms/ArgumentPromotion/profile.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/propagate-remove-dead-args.ll (+9-9) 
- (modified) llvm/test/Transforms/ArgumentPromotion/recursion/aggregate-promote-recursive.ll (+3-3) 
- (modified) llvm/test/Transforms/ArgumentPromotion/recursion/argpromotion-recursion-pr1259.ll (+4-4) 
- (modified) llvm/test/Transforms/ArgumentPromotion/recursion/recursion-mixed-calls.ll (+6-6) 
- (modified) llvm/test/Transforms/ArgumentPromotion/recursion/recursion-non-zero-offset.ll (+4-4) 
- (modified) llvm/test/Transforms/ArgumentPromotion/reserve-tbaa.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/sret.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/store-into-inself.ll (+2-2) 
- (modified) llvm/test/Transforms/ArgumentPromotion/unused-argument.ll (+4-4) 
- (modified) llvm/test/Transforms/Attributor/reduced/clear_cached_analysis_for_deleted_functions.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/2007-02-07-FuncRename.ll (+1-1) 
- (modified) llvm/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/aggregates.ll (+5-5) 
- (modified) llvm/test/Transforms/DeadArgElim/call_profile.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/comdat.ll (+1-1) 
- (modified) llvm/test/Transforms/DeadArgElim/dbginfo-update-dbgval-local.ll (+3-3) 
- (modified) llvm/test/Transforms/DeadArgElim/dbginfo.ll (+1-1) 
- (modified) llvm/test/Transforms/DeadArgElim/deadretval.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/fct_ptr.ll (+1-1) 
- (modified) llvm/test/Transforms/DeadArgElim/func_metadata.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/funclet.ll (+1-1) 
- (modified) llvm/test/Transforms/DeadArgElim/keepalive.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/nonzero-address-spaces.ll (+2-2) 
- (modified) llvm/test/Transforms/DeadArgElim/returned.ll (+5-5) 
- (modified) llvm/test/Transforms/DeadArgElim/variadic_safety.ll (+1-1) 
- (modified) llvm/test/Transforms/FunctionSpecialization/function-specialization2.ll (+6-6) 
- (modified) llvm/test/Transforms/FunctionSpecialization/global-var-constants.ll (+7-7) 
- (modified) llvm/test/Transforms/FunctionSpecialization/non-argument-tracked.ll (+12-12) 
- (modified) llvm/test/Transforms/FunctionSpecialization/specialization-order.ll (+6-6) 
- (modified) llvm/test/Transforms/PhaseOrdering/dae-dce.ll (+4-2) 
- (modified) llvm/test/Transforms/PhaseOrdering/dce-after-argument-promotion.ll (+2-2) 
- (modified) llvm/test/Transforms/SCCP/recursion.ll (+3-3) 


``````````diff
diff --git a/compiler-rt/test/cfi/stats.cpp b/compiler-rt/test/cfi/stats.cpp
index ca6b3bf0df4814..9c4900e86129aa 100644
--- a/compiler-rt/test/cfi/stats.cpp
+++ b/compiler-rt/test/cfi/stats.cpp
@@ -26,12 +26,12 @@ extern "C" __attribute__((noinline)) void nvcall(A *a) {
 }
 
 extern "C" __attribute__((noinline)) A *dcast(A *a) {
-  // CHECK: stats.cpp:[[@LINE+1]] {{_?}}dcast cfi-derived-cast 24
+  // CHECK: stats.cpp:[[@LINE+1]] {{_?}}dcast.retelim cfi-derived-cast 24
   return (A *)(ABase *)a;
 }
 
 extern "C" __attribute__((noinline)) A *ucast(A *a) {
-  // CHECK: stats.cpp:[[@LINE+1]] {{_?}}ucast cfi-unrelated-cast 81
+  // CHECK: stats.cpp:[[@LINE+1]] {{_?}}ucast.retelim cfi-unrelated-cast 81
   return (A *)(char *)a;
 }
 
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 1f9b546ed29996..c8b75dd475ae44 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -215,6 +215,7 @@ doPromotion(Function *F, FunctionAnalysisManager &FAM,
 
   F->getParent()->getFunctionList().insert(F->getIterator(), NF);
   NF->takeName(F);
+  NF->setName(NF->getName() + ".argprom");
 
   // Loop over all the callers of the function, transforming the call sites to
   // pass in the loaded pointers.
diff --git a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
index d1548592b1ce26..b912cc66d19db5 100644
--- a/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
@@ -889,6 +889,10 @@ bool DeadArgumentEliminationPass::removeDeadStuffFromFunction(Function *F) {
   // it again.
   F->getParent()->getFunctionList().insert(F->getIterator(), NF);
   NF->takeName(F);
+  if (NumArgumentsEliminated)
+    NF->setName(NF->getName() + ".argelim");
+  else
+    NF->setName(NF->getName() + ".retelim");
   NF->IsNewDbgInfoFormat = F->IsNewDbgInfoFormat;
 
   // Loop over all the callers of the function, transforming the call sites to
diff --git a/llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll b/llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll
index 2bc486f541c71f..4f16c02b1473ff 100644
--- a/llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll
+++ b/llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll
@@ -9,7 +9,7 @@ define internal void @a() alwaysinline {
 }
 
 define internal void @b(ptr) noinline {
-; CHECK-LABEL: @b(
+; CHECK-LABEL: @b.argprom(
 ; CHECK-NEXT:    ret void
 ;
   ret void
@@ -17,7 +17,7 @@ define internal void @b(ptr) noinline {
 
 define internal void @c() noinline {
 ; CHECK-LABEL: @c(
-; CHECK-NEXT:    call void @b()
+; CHECK-NEXT:    call void @b.argprom()
 ; CHECK-NEXT:    ret void
 ;
   call void @b(ptr @a)
diff --git a/llvm/test/BugPoint/remove_arguments_test.ll b/llvm/test/BugPoint/remove_arguments_test.ll
index 9e9c51eaafc383..bb93e45e4b46ef 100644
--- a/llvm/test/BugPoint/remove_arguments_test.ll
+++ b/llvm/test/BugPoint/remove_arguments_test.ll
@@ -11,7 +11,7 @@
 
 declare i32 @test2()
 
-; CHECK: define void @test() {
+; CHECK: define void @test.argelim() {
 define i32 @test(i32 %A, ptr %B, float %C) {
 	call i32 @test2()
 	ret i32 %1
diff --git a/llvm/test/CodeGen/AArch64/arg_promotion.ll b/llvm/test/CodeGen/AArch64/arg_promotion.ll
index cc37d230c6cbe4..724a7f109f1e29 100644
--- a/llvm/test/CodeGen/AArch64/arg_promotion.ll
+++ b/llvm/test/CodeGen/AArch64/arg_promotion.ll
@@ -38,16 +38,16 @@ define dso_local void @caller_4xi32(ptr noalias %src, ptr noalias %dst) #1 {
 ; CHECK-LABEL: define dso_local void @caller_4xi32(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[SRC_VAL:%.*]] = load <4 x i32>, ptr [[SRC:%.*]], align 16
-; CHECK-NEXT:    call fastcc void @callee_4xi32(<4 x i32> [[SRC_VAL]], ptr noalias [[DST:%.*]])
+; CHECK-NEXT:    call fastcc void @callee_4xi32.argprom.argprom(<4 x i32> [[SRC_VAL]], ptr noalias [[DST:%.*]])
 ; CHECK-NEXT:    ret void
 ;
 entry:
-  call fastcc void @callee_4xi32(ptr noalias %src, ptr noalias %dst)
+  call fastcc void @callee_4xi32.argprom(ptr noalias %src, ptr noalias %dst)
   ret void
 }
 
-define internal fastcc void @callee_4xi32(ptr noalias %src, ptr noalias %dst) #1 {
-; CHECK-LABEL: define internal fastcc void @callee_4xi32(
+define internal fastcc void @callee_4xi32.argprom(ptr noalias %src, ptr noalias %dst) #1 {
+; CHECK-LABEL: define internal fastcc void @callee_4xi32.argprom.argprom(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    store <4 x i32> [[SRC_0_VAL:%.*]], ptr [[DST:%.*]], align 16
 ; CHECK-NEXT:    ret void
@@ -65,7 +65,7 @@ define dso_local void @caller_i256(ptr noalias %src, ptr noalias %dst) #0 {
 ; CHECK-LABEL: define dso_local void @caller_i256(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    [[SRC_VAL:%.*]] = load i256, ptr [[SRC:%.*]], align 16
-; CHECK-NEXT:    call fastcc void @callee_i256(i256 [[SRC_VAL]], ptr noalias [[DST:%.*]])
+; CHECK-NEXT:    call fastcc void @callee_i256.argprom(i256 [[SRC_VAL]], ptr noalias [[DST:%.*]])
 ; CHECK-NEXT:    ret void
 ;
 entry:
@@ -74,7 +74,7 @@ entry:
 }
 
 define internal fastcc void @callee_i256(ptr noalias %src, ptr noalias %dst) #0 {
-; CHECK-LABEL: define internal fastcc void @callee_i256(
+; CHECK-LABEL: define internal fastcc void @callee_i256.argprom(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    store i256 [[SRC_0_VAL:%.*]], ptr [[DST:%.*]], align 16
 ; CHECK-NEXT:    ret void
@@ -159,7 +159,7 @@ define dso_local void @caller_struct4xi32(ptr noalias %src, ptr noalias %dst) #1
 ; CHECK-NEXT:    [[SRC_VAL:%.*]] = load <4 x i32>, ptr [[SRC:%.*]], align 16
 ; CHECK-NEXT:    [[TMP0:%.*]] = getelementptr i8, ptr [[SRC]], i64 16
 ; CHECK-NEXT:    [[SRC_VAL1:%.*]] = load <4 x i32>, ptr [[TMP0]], align 16
-; CHECK-NEXT:    call fastcc void @callee_struct4xi32(<4 x i32> [[SRC_VAL]], <4 x i32> [[SRC_VAL1]], ptr noalias [[DST:%.*]])
+; CHECK-NEXT:    call fastcc void @callee_struct4xi32.argprom(<4 x i32> [[SRC_VAL]], <4 x i32> [[SRC_VAL1]], ptr noalias [[DST:%.*]])
 ; CHECK-NEXT:    ret void
 ;
 entry:
@@ -168,7 +168,7 @@ entry:
 }
 
 define internal fastcc void @callee_struct4xi32(ptr noalias %src, ptr noalias %dst) #1 {
-; CHECK-LABEL: define internal fastcc void @callee_struct4xi32(
+; CHECK-LABEL: define internal fastcc void @callee_struct4xi32.argprom(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    store <4 x i32> [[SRC_0_VAL:%.*]], ptr [[DST:%.*]], align 16
 ; CHECK-NEXT:    [[DST2:%.*]] = getelementptr inbounds [[STRUCT_4XI32:%.*]], ptr [[DST]], i64 0, i32 1
diff --git a/llvm/test/CodeGen/AMDGPU/internalize.ll b/llvm/test/CodeGen/AMDGPU/internalize.ll
index 6b2a4d5fc328b4..08b42f93bf5f47 100644
--- a/llvm/test/CodeGen/AMDGPU/internalize.ll
+++ b/llvm/test/CodeGen/AMDGPU/internalize.ll
@@ -10,7 +10,7 @@
 ; ALL: gvar_used
 @gvar_used = addrspace(1) global i32 undef, align 4
 
-; OPT: define internal fastcc void @func_used_noinline(
+; OPT: define internal fastcc void @func_used_noinline.argelim(
 ; OPT-NONE: define fastcc void @func_used_noinline(
 define fastcc void @func_used_noinline(ptr addrspace(1) %out, i32 %tid) #1 {
 entry:
diff --git a/llvm/test/ThinLTO/X86/memprof-aliased-location1.ll b/llvm/test/ThinLTO/X86/memprof-aliased-location1.ll
index 42819d5421ca0f..8be9727b316d28 100644
--- a/llvm/test/ThinLTO/X86/memprof-aliased-location1.ll
+++ b/llvm/test/ThinLTO/X86/memprof-aliased-location1.ll
@@ -84,22 +84,22 @@ attributes #0 = { noinline optnone }
 ;; The first call to foo does not allocate cold memory. It should call the
 ;; original functions, which ultimately call the original allocation decorated
 ;; with a "notcold" attribute.
-; IR:   call {{.*}} @_Z3foov()
+; IR:   call {{.*}} @_Z3foov.retelim()
 ;; The second call to foo allocates cold memory. It should call cloned functions
 ;; which ultimately call a cloned allocation decorated with a "cold" attribute.
-; IR:   call {{.*}} @_Z3foov.memprof.1()
-; IR: define internal {{.*}} @_Z3barv()
+; IR:   call {{.*}} @_Z3foov.memprof.1.retelim()
+; IR: define internal {{.*}} @_Z3barv.retelim()
 ; IR:   call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
-; IR: define internal {{.*}} @_Z3bazv()
-; IR:   call {{.*}} @_Z3barv()
-; IR: define internal {{.*}} @_Z3foov()
-; IR:   call {{.*}} @_Z3bazv()
-; IR: define internal {{.*}} @_Z3barv.memprof.1()
+; IR: define internal {{.*}} @_Z3bazv.retelim()
+; IR:   call {{.*}} @_Z3barv.retelim()
+; IR: define internal {{.*}} @_Z3foov.retelim()
+; IR:   call {{.*}} @_Z3bazv.retelim()
+; IR: define internal {{.*}} @_Z3barv.memprof.1.retelim()
 ; IR:   call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
-; IR: define internal {{.*}} @_Z3bazv.memprof.1()
-; IR:   call {{.*}} @_Z3barv.memprof.1()
-; IR: define internal {{.*}} @_Z3foov.memprof.1()
-; IR:   call {{.*}} @_Z3bazv.memprof.1()
+; IR: define internal {{.*}} @_Z3bazv.memprof.1.retelim()
+; IR:   call {{.*}} @_Z3barv.memprof.1.retelim()
+; IR: define internal {{.*}} @_Z3foov.memprof.1.retelim()
+; IR:   call {{.*}} @_Z3bazv.memprof.1.retelim()
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
diff --git a/llvm/test/ThinLTO/X86/memprof-aliased-location2.ll b/llvm/test/ThinLTO/X86/memprof-aliased-location2.ll
index 663f8525043c2f..4c18cf8226c8bb 100644
--- a/llvm/test/ThinLTO/X86/memprof-aliased-location2.ll
+++ b/llvm/test/ThinLTO/X86/memprof-aliased-location2.ll
@@ -84,22 +84,22 @@ attributes #0 = { noinline optnone }
 ;; The first call to foo does not allocate cold memory. It should call the
 ;; original functions, which ultimately call the original allocation decorated
 ;; with a "notcold" attribute.
-; IR:   call {{.*}} @_Z3foov()
+; IR:   call {{.*}} @_Z3foov.retelim()
 ;; The second call to foo allocates cold memory. It should call cloned functions
 ;; which ultimately call a cloned allocation decorated with a "cold" attribute.
-; IR:   call {{.*}} @_Z3foov.memprof.1()
-; IR: define internal {{.*}} @_Z3barv()
+; IR:   call {{.*}} @_Z3foov.memprof.1.retelim()
+; IR: define internal {{.*}} @_Z3barv.retelim()
 ; IR:   call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
-; IR: define internal {{.*}} @_Z3bazv()
-; IR:   call {{.*}} @_Z3barv()
-; IR: define internal {{.*}} @_Z3foov()
-; IR:   call {{.*}} @_Z3bazv()
-; IR: define internal {{.*}} @_Z3barv.memprof.1()
+; IR: define internal {{.*}} @_Z3bazv.retelim()
+; IR:   call {{.*}} @_Z3barv.retelim()
+; IR: define internal {{.*}} @_Z3foov.retelim()
+; IR:   call {{.*}} @_Z3bazv.retelim()
+; IR: define internal {{.*}} @_Z3barv.memprof.1.retelim()
 ; IR:   call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
-; IR: define internal {{.*}} @_Z3bazv.memprof.1()
-; IR:   call {{.*}} @_Z3barv.memprof.1()
-; IR: define internal {{.*}} @_Z3foov.memprof.1()
-; IR:   call {{.*}} @_Z3bazv.memprof.1()
+; IR: define internal {{.*}} @_Z3bazv.memprof.1.retelim()
+; IR:   call {{.*}} @_Z3barv.memprof.1.retelim()
+; IR: define internal {{.*}} @_Z3foov.memprof.1.retelim()
+; IR:   call {{.*}} @_Z3bazv.memprof.1.retelim()
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
diff --git a/llvm/test/ThinLTO/X86/memprof-basic.ll b/llvm/test/ThinLTO/X86/memprof-basic.ll
index 6922dbfd368467..b7aadf8e32a771 100644
--- a/llvm/test/ThinLTO/X86/memprof-basic.ll
+++ b/llvm/test/ThinLTO/X86/memprof-basic.ll
@@ -53,7 +53,7 @@
 ;; We should have cloned bar, baz, and foo, for the cold memory allocation.
 ; RUN:	cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
 
-; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
 
 
 ;; Try again but with distributed ThinLTO
@@ -303,6 +303,23 @@ attributes #0 = { noinline optnone }
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
+; IRNODIST: define {{.*}} @main
+; IRNODIST:   call {{.*}} @_Z3foov.retelim()
+; IRNODIST:   call {{.*}} @_Z3foov.memprof.1.retelim()
+; IRNODIST: define internal {{.*}} @_Z3barv.retelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
+; IRNODIST: define internal {{.*}} @_Z3bazv.retelim()
+; IRNODIST:   call {{.*}} @_Z3barv.retelim()
+; IRNODIST: define internal {{.*}} @_Z3foov.retelim()
+; IRNODIST:   call {{.*}} @_Z3bazv.retelim()
+; IRNODIST: define internal {{.*}} @_Z3barv.memprof.1.retelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
+; IRNODIST: define internal {{.*}} @_Z3bazv.memprof.1.retelim()
+; IRNODIST:   call {{.*}} @_Z3barv.memprof.1.retelim()
+; IRNODIST: define internal {{.*}} @_Z3foov.memprof.1.retelim()
+; IRNODIST:   call {{.*}} @_Z3bazv.memprof.1.retelim()
+; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
+; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
 
 ; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
 ; STATS-BE: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
diff --git a/llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll b/llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll
index 65d794e9cba87c..bfc7b02a956c6f 100644
--- a/llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll
+++ b/llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll
@@ -68,7 +68,7 @@
 ; RUN:  -o %t.out 2>&1 | FileCheck %s --check-prefix=DUMP \
 ; RUN:  --check-prefix=STATS --check-prefix=STATS-BE --check-prefix=REMARKS
 
-; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
 
 
 ;; Try again but with distributed ThinLTO
@@ -247,6 +247,18 @@ attributes #0 = { noinline optnone}
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
+; IRNODIST: define internal {{.*}} @_Z1Dv.retelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
+; IRNODIST: define internal {{.*}} @_Z1Fv.retelim()
+; IRNODIST:   call {{.*}} @_Z1Dv.retelim()
+; IRNODIST: define internal {{.*}} @_Z1Bv.retelim()
+; IRNODIST:   call {{.*}} @_Z1Dv.memprof.1.retelim()
+; IRNODIST: define internal {{.*}} @_Z1Ev.retelim()
+; IRNODIST:   call {{.*}} @_Z1Dv.memprof.1.retelim()
+; IRNODIST: define internal {{.*}} @_Z1Dv.memprof.1.retelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
+; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
+; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
 
 ; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
 ; STATS-BE: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
diff --git a/llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll b/llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll
index f1a494d077fefc..4153524bf44706 100644
--- a/llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll
+++ b/llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll
@@ -61,7 +61,7 @@
 ; RUN:  -o %t.out 2>&1 | FileCheck %s --check-prefix=DUMP \
 ; RUN:  --check-prefix=STATS --check-prefix=STATS-BE --check-prefix=REMARKS
 
-; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
 
 
 ;; Try again but with distributed ThinLTO
@@ -283,6 +283,23 @@ attributes #0 = { noinline optnone }
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
+; IRNODIST: define internal {{.*}} @_Z1EPPcS0_.argelim(
+; IRNODIST:   call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD:[0-9]+]]
+; IRNODIST:   call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD]]
+; IRNODIST: define internal {{.*}} @_Z1BPPcS0_(
+; IRNODIST:   call {{.*}} @_Z1EPPcS0_.argelim(
+; IRNODIST: define internal {{.*}} @_Z1CPPcS0_(
+; IRNODIST:   call {{.*}} @_Z1EPPcS0_.memprof.3.argelim(
+; IRNODIST: define internal {{.*}} @_Z1DPPcS0_(
+; IRNODIST:   call {{.*}} @_Z1EPPcS0_.memprof.2.argelim(
+; IRNODIST: define internal {{.*}} @_Z1EPPcS0_.memprof.2.argelim(
+; IRNODIST:   call {{.*}} @_Znam(i64 noundef 10) #[[COLD:[0-9]+]]
+; IRNODIST:   call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD]]
+; IRNODIST: define internal {{.*}} @_Z1EPPcS0_.memprof.3.argelim(
+; IRNODIST:   call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD]]
+; IRNODIST:   call {{.*}} @_Znam(i64 noundef 10) #[[COLD]]
+; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
+; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
 
 ; STATS: 2 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
 ; STATS-BE: 2 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
diff --git a/llvm/test/ThinLTO/X86/memprof-indirectcall.ll b/llvm/test/ThinLTO/X86/memprof-indirectcall.ll
index 07a52f441ca278..ba8811b46175e3 100644
--- a/llvm/test/ThinLTO/X86/memprof-indirectcall.ll
+++ b/llvm/test/ThinLTO/X86/memprof-indirectcall.ll
@@ -74,7 +74,7 @@
 ;; from main allocating cold memory.
 ; RUN:  cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
 
-; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
 
 
 ;; Try again but with distributed ThinLTO
@@ -419,6 +419,19 @@ attributes #0 = { noinline optnone }
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
+; IRNODIST: define {{.*}} @main(
+; IRNODIST:   call {{.*}} @_Z3foov.argelim()
+; IRNODIST:   call {{.*}} @_Z3foov.memprof.1.argelim()
+; IRNODIST:   call {{.*}} @_Z3barP1A.argelim(
+; IRNODIST:   call {{.*}} @_Z3barP1A.argelim(
+; IRNODIST:   call {{.*}} @_Z3barP1A.argelim(
+; IRNODIST:   call {{.*}} @_Z3barP1A.argelim(
+; IRNODIST: define internal {{.*}} @_Z3foov.argelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
+; IRNODIST: define internal {{.*}} @_Z3foov.memprof.1.argelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
+; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
+; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
 
 ; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
 ; STATS-BE: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
diff --git a/llvm/test/ThinLTO/X86/memprof-inlined.ll b/llvm/test/ThinLTO/X86/memprof-inlined.ll
index 89df345b220423..7111a536a3110a 100644
--- a/llvm/test/ThinLTO/X86/memprof-inlined.ll
+++ b/llvm/test/ThinLTO/X86/memprof-inlined.ll
@@ -63,7 +63,7 @@
 ;; cold memory.
 ; RUN:	cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
 
-; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
+; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
 
 
 ;; Try again but with distributed ThinLTO
@@ -323,6 +323,19 @@ attributes #0 = { noinline optnone }
 ; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
 ; IR: attributes #[[COLD]] = { "memprof"="cold" }
 
+; IRNODIST: define internal {{.*}} @_Z3barv.retelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
+; IRNODIST: define internal {{.*}} @_Z3foov.retelim()
+; IRNODIST:   call {{.*}} @_Z3barv.retelim()
+; IRNODIST: define {{.*}} @main()
+; IRNODIST:   call {{.*}} @_Z3foov.retelim()
+; IRNODIST:   call {{.*}} @_Z3foov.memprof.1.retelim()
+; IRNODIST: define internal {{.*}} @_Z3barv.memprof.1.retelim()
+; IRNODIST:   call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
+; IRNODIST: define internal {{.*}} @_Z3foov.memprof.1.retelim()
+; IRNODIST:   call {{.*}} @_Z3barv.memprof.1.retelim()
+; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
+; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
 
 ; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
 ; STATS-BE: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend
diff --git a/llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
index daa4e1fb757d21..51839033177034 100644
--- a/llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
+++ b/llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll
@@ -3,7 +3,7 @@
 ; RUN: cat %t | FileChe...
[truncated]

``````````

</details>


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


More information about the llvm-commits mailing list