Skip to content

Commit 5be37d8

Browse files
author
Yonghong Song
committed
[Transforms][IPO] Add func suffix in ArgumentPromotion and DeadArgumentElimination
ArgumentPromotion and DeadArgumentElimination passes could change function signatures but the function name remains the same as before the transformation. This makes it hard for tracing with bpf programs where user tends to use function signature in the source. See discussion [1] for details. This patch added suffix to functions whose signatures are changed. The suffix lets users know that function signature has changed and they need to impact the IR or binary to find modified signature before tracing those functions. The suffix for ArgumentPromotion is ".argprom" and the suffix for DeadArgumentElimination is ".argelim". The suffix also gives user hints about what kind of transformation has been done. With this patch, I built a recent linux kernel with full LTO enabled. I got 4 functions with only argpromotion like set_track_update.argelim.argprom pmd_trans_huge_lock.argprom ... I got 1058 functions with only deadargelim like process_bit0.argelim pci_io_ecs_init.argelim ... I got 3 functions with both argpromotion and deadargelim set_track_update.argelim.argprom zero_pud_populate.argelim.argprom zero_pmd_populate.argelim.argprom [1] #104678
1 parent 4a505e1 commit 5be37d8

File tree

68 files changed

+248
-213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+248
-213
lines changed

llvm/lib/Transforms/IPO/ArgumentPromotion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ doPromotion(Function *F, FunctionAnalysisManager &FAM,
215215

216216
F->getParent()->getFunctionList().insert(F->getIterator(), NF);
217217
NF->takeName(F);
218+
NF->setName(NF->getName() + ".argprom");
218219

219220
// Loop over all the callers of the function, transforming the call sites to
220221
// pass in the loaded pointers.

llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,8 @@ bool DeadArgumentEliminationPass::removeDeadStuffFromFunction(Function *F) {
889889
// it again.
890890
F->getParent()->getFunctionList().insert(F->getIterator(), NF);
891891
NF->takeName(F);
892+
if (NumArgumentsEliminated)
893+
NF->setName(NF->getName() + ".argelim");
892894
NF->IsNewDbgInfoFormat = F->IsNewDbgInfoFormat;
893895

894896
// Loop over all the callers of the function, transforming the call sites to

llvm/test/Analysis/LazyCallGraph/remove-dead-function-spurious-ref-edge.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ define internal void @a() alwaysinline {
99
}
1010

1111
define internal void @b(ptr) noinline {
12-
; CHECK-LABEL: @b(
12+
; CHECK-LABEL: @b.argprom(
1313
; CHECK-NEXT: ret void
1414
;
1515
ret void
1616
}
1717

1818
define internal void @c() noinline {
1919
; CHECK-LABEL: @c(
20-
; CHECK-NEXT: call void @b()
20+
; CHECK-NEXT: call void @b.argprom()
2121
; CHECK-NEXT: ret void
2222
;
2323
call void @b(ptr @a)

llvm/test/BugPoint/remove_arguments_test.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
declare i32 @test2()
1313

14-
; CHECK: define void @test() {
14+
; CHECK: define void @test.argelim() {
1515
define i32 @test(i32 %A, ptr %B, float %C) {
1616
call i32 @test2()
1717
ret i32 %1

llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=DUMP \
6262
; RUN: --check-prefix=STATS --check-prefix=STATS-BE --check-prefix=REMARKS
6363

64-
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
64+
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
6565

6666

6767
;; Try again but with distributed ThinLTO
@@ -283,6 +283,23 @@ attributes #0 = { noinline optnone }
283283
; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
284284
; IR: attributes #[[COLD]] = { "memprof"="cold" }
285285

286+
; IRNODIST: define internal {{.*}} @_Z1EPPcS0_.argelim(
287+
; IRNODIST: call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD:[0-9]+]]
288+
; IRNODIST: call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD]]
289+
; IRNODIST: define internal {{.*}} @_Z1BPPcS0_(
290+
; IRNODIST: call {{.*}} @_Z1EPPcS0_.argelim(
291+
; IRNODIST: define internal {{.*}} @_Z1CPPcS0_(
292+
; IRNODIST: call {{.*}} @_Z1EPPcS0_.memprof.3.argelim(
293+
; IRNODIST: define internal {{.*}} @_Z1DPPcS0_(
294+
; IRNODIST: call {{.*}} @_Z1EPPcS0_.memprof.2.argelim(
295+
; IRNODIST: define internal {{.*}} @_Z1EPPcS0_.memprof.2.argelim(
296+
; IRNODIST: call {{.*}} @_Znam(i64 noundef 10) #[[COLD:[0-9]+]]
297+
; IRNODIST: call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD]]
298+
; IRNODIST: define internal {{.*}} @_Z1EPPcS0_.memprof.3.argelim(
299+
; IRNODIST: call {{.*}} @_Znam(i64 noundef 10) #[[NOTCOLD]]
300+
; IRNODIST: call {{.*}} @_Znam(i64 noundef 10) #[[COLD]]
301+
; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
302+
; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
286303

287304
; STATS: 2 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
288305
; STATS-BE: 2 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend

llvm/test/ThinLTO/X86/memprof-indirectcall.ll

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
;; from main allocating cold memory.
7575
; RUN: cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
7676

77-
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR
77+
; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IRNODIST
7878

7979

8080
;; Try again but with distributed ThinLTO
@@ -419,6 +419,19 @@ attributes #0 = { noinline optnone }
419419
; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
420420
; IR: attributes #[[COLD]] = { "memprof"="cold" }
421421

422+
; IRNODIST: define {{.*}} @main(
423+
; IRNODIST: call {{.*}} @_Z3foov.argelim()
424+
; IRNODIST: call {{.*}} @_Z3foov.memprof.1.argelim()
425+
; IRNODIST: call {{.*}} @_Z3barP1A.argelim(
426+
; IRNODIST: call {{.*}} @_Z3barP1A.argelim(
427+
; IRNODIST: call {{.*}} @_Z3barP1A.argelim(
428+
; IRNODIST: call {{.*}} @_Z3barP1A.argelim(
429+
; IRNODIST: define internal {{.*}} @_Z3foov.argelim()
430+
; IRNODIST: call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
431+
; IRNODIST: define internal {{.*}} @_Z3foov.memprof.1.argelim()
432+
; IRNODIST: call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
433+
; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
434+
; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
422435

423436
; STATS: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned)
424437
; STATS-BE: 1 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend

llvm/test/Transforms/ArgumentPromotion/2008-02-01-ReturnAttrs.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
; RUN: cat %t | FileCheck -check-prefix=REMARK %s
44

55
define internal i32 @deref(ptr %x) nounwind {
6-
; CHECK-LABEL: define {{[^@]+}}@deref
6+
; CHECK-LABEL: define {{[^@]+}}@deref.argprom
77
; CHECK-SAME: (i32 [[X_0_VAL:%.*]]) #[[ATTR0:[0-9]+]] {
88
; CHECK-NEXT: entry:
99
; CHECK-NEXT: ret i32 [[X_0_VAL]]
@@ -29,7 +29,7 @@ define i32 @f(i32 %x) {
2929
; CHECK-NEXT: [[X_ADDR:%.*]] = alloca i32, align 4
3030
; CHECK-NEXT: store i32 [[X]], ptr [[X_ADDR]], align 4
3131
; CHECK-NEXT: [[X_ADDR_VAL:%.*]] = load i32, ptr [[X_ADDR]], align 4
32-
; CHECK-NEXT: [[TEMP1:%.*]] = call i32 @deref(i32 [[X_ADDR_VAL]])
32+
; CHECK-NEXT: [[TEMP1:%.*]] = call i32 @deref.argprom(i32 [[X_ADDR_VAL]])
3333
; CHECK-NEXT: ret i32 [[TEMP1]]
3434
;
3535
entry:

llvm/test/Transforms/ArgumentPromotion/BPF/argpromotion.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ entry:
8585
; Without number-of-argument constraint, argpromotion will create a function signature with 5 arguments, which equals
8686
; the maximum number of argument permitted by bpf backend, so argpromotion result code does work.
8787
;
88-
; CHECK: i32 @foo2(i32 %p1.0.val, i32 %p1.4.val, i32 %p2.8.val, i32 %p2.16.val, i32 %p3.20.val)
88+
; CHECK: i32 @foo2.argprom(i32 %p1.0.val, i32 %p1.4.val, i32 %p2.8.val, i32 %p2.16.val, i32 %p3.20.val)

llvm/test/Transforms/ArgumentPromotion/X86/attributes.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ bb:
4242
}
4343

4444
define internal fastcc void @promote_avx2(ptr %arg, ptr readonly %arg1) #0 {
45-
; CHECK-LABEL: define {{[^@]+}}@promote_avx2
45+
; CHECK-LABEL: define {{[^@]+}}@promote_avx2.argprom
4646
; CHECK-SAME: (ptr [[ARG:%.*]], <4 x i64> [[ARG1_VAL:%.*]])
4747
; CHECK-NEXT: bb:
4848
; CHECK-NEXT: store <4 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -62,7 +62,7 @@ define void @promote(ptr %arg) #0 {
6262
; CHECK-NEXT: [[TMP2:%.*]] = alloca <4 x i64>, align 32
6363
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
6464
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <4 x i64>, ptr [[TMP]]
65-
; CHECK-NEXT: call fastcc void @promote_avx2(ptr [[TMP2]], <4 x i64> [[TMP_VAL]])
65+
; CHECK-NEXT: call fastcc void @promote_avx2.argprom(ptr [[TMP2]], <4 x i64> [[TMP_VAL]])
6666
; CHECK-NEXT: [[TMP4:%.*]] = load <4 x i64>, ptr [[TMP2]], align 32
6767
; CHECK-NEXT: store <4 x i64> [[TMP4]], ptr [[ARG]], align 2
6868
; CHECK-NEXT: ret void

llvm/test/Transforms/ArgumentPromotion/X86/min-legal-vector-width.ll

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ target triple = "x86_64-unknown-linux-gnu"
77

88
; This should promote
99
define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr %arg, ptr readonly %arg1) #0 {
10-
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512
10+
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512.argprom
1111
; CHECK-SAME: (ptr [[ARG:%.*]], <8 x i64> [[ARG1_VAL:%.*]])
1212
; CHECK-NEXT: bb:
1313
; CHECK-NEXT: store <8 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -27,7 +27,7 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr %arg)
2727
; CHECK-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
2828
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
2929
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <8 x i64>, ptr [[TMP]]
30-
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
30+
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer512.argprom(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
3131
; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 32
3232
; CHECK-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
3333
; CHECK-NEXT: ret void
@@ -44,7 +44,7 @@ bb:
4444

4545
; This should promote
4646
define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr %arg, ptr readonly %arg1) #1 {
47-
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256
47+
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256.argprom
4848
; CHECK-SAME: (ptr [[ARG:%.*]], <8 x i64> [[ARG1_VAL:%.*]])
4949
; CHECK-NEXT: bb:
5050
; CHECK-NEXT: store <8 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -64,7 +64,7 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr %arg)
6464
; CHECK-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
6565
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
6666
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <8 x i64>, ptr [[TMP]]
67-
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
67+
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer256.argprom(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
6868
; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 32
6969
; CHECK-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
7070
; CHECK-NEXT: ret void
@@ -81,7 +81,7 @@ bb:
8181

8282
; This should promote
8383
define internal fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr %arg, ptr readonly %arg1) #1 {
84-
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256
84+
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256.argprom
8585
; CHECK-SAME: (ptr [[ARG:%.*]], <8 x i64> [[ARG1_VAL:%.*]])
8686
; CHECK-NEXT: bb:
8787
; CHECK-NEXT: store <8 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -101,7 +101,7 @@ define void @avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr %arg)
101101
; CHECK-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
102102
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
103103
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <8 x i64>, ptr [[TMP]]
104-
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
104+
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer512_call_avx512_legal512_prefer256.argprom(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
105105
; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 32
106106
; CHECK-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
107107
; CHECK-NEXT: ret void
@@ -118,7 +118,7 @@ bb:
118118

119119
; This should promote
120120
define internal fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr %arg, ptr readonly %arg1) #0 {
121-
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512
121+
; CHECK-LABEL: define {{[^@]+}}@callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512.argprom
122122
; CHECK-SAME: (ptr [[ARG:%.*]], <8 x i64> [[ARG1_VAL:%.*]])
123123
; CHECK-NEXT: bb:
124124
; CHECK-NEXT: store <8 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -138,7 +138,7 @@ define void @avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr %arg)
138138
; CHECK-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
139139
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
140140
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <8 x i64>, ptr [[TMP]]
141-
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
141+
; CHECK-NEXT: call fastcc void @callee_avx512_legal512_prefer256_call_avx512_legal512_prefer512.argprom(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
142142
; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 32
143143
; CHECK-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
144144
; CHECK-NEXT: ret void
@@ -229,7 +229,7 @@ bb:
229229

230230
; This should promote
231231
define internal fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr %arg, ptr readonly %arg1) #3 {
232-
; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256
232+
; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256.argprom
233233
; CHECK-SAME: (ptr [[ARG:%.*]], <8 x i64> [[ARG1_VAL:%.*]])
234234
; CHECK-NEXT: bb:
235235
; CHECK-NEXT: store <8 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -249,7 +249,7 @@ define void @avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr %arg) #4 {
249249
; CHECK-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
250250
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
251251
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <8 x i64>, ptr [[TMP]]
252-
; CHECK-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
252+
; CHECK-NEXT: call fastcc void @callee_avx2_legal256_prefer256_call_avx2_legal512_prefer256.argprom(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
253253
; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 32
254254
; CHECK-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
255255
; CHECK-NEXT: ret void
@@ -266,7 +266,7 @@ bb:
266266

267267
; This should promote
268268
define internal fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr %arg, ptr readonly %arg1) #4 {
269-
; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256
269+
; CHECK-LABEL: define {{[^@]+}}@callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256.argprom
270270
; CHECK-SAME: (ptr [[ARG:%.*]], <8 x i64> [[ARG1_VAL:%.*]])
271271
; CHECK-NEXT: bb:
272272
; CHECK-NEXT: store <8 x i64> [[ARG1_VAL]], ptr [[ARG]]
@@ -286,7 +286,7 @@ define void @avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr %arg) #3 {
286286
; CHECK-NEXT: [[TMP2:%.*]] = alloca <8 x i64>, align 32
287287
; CHECK-NEXT: call void @llvm.memset.p0.i64(ptr align 32 [[TMP]], i8 0, i64 32, i1 false)
288288
; CHECK-NEXT: [[TMP_VAL:%.*]] = load <8 x i64>, ptr [[TMP]]
289-
; CHECK-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
289+
; CHECK-NEXT: call fastcc void @callee_avx2_legal512_prefer256_call_avx2_legal256_prefer256.argprom(ptr [[TMP2]], <8 x i64> [[TMP_VAL]])
290290
; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i64>, ptr [[TMP2]], align 32
291291
; CHECK-NEXT: store <8 x i64> [[TMP4]], ptr [[ARG]], align 2
292292
; CHECK-NEXT: ret void
@@ -303,7 +303,7 @@ bb:
303303

304304
; If the arguments are scalar, its ok to promote.
305305
define internal i32 @scalar_callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr %X, ptr %Y) #2 {
306-
; CHECK-LABEL: define {{[^@]+}}@scalar_callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256
306+
; CHECK-LABEL: define {{[^@]+}}@scalar_callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256.argprom
307307
; CHECK-SAME: (i32 [[X_VAL:%.*]], i32 [[Y_VAL:%.*]])
308308
; CHECK-NEXT: [[C:%.*]] = add i32 [[X_VAL]], [[Y_VAL]]
309309
; CHECK-NEXT: ret i32 [[C]]
@@ -321,7 +321,7 @@ define i32 @scalar_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr
321321
; CHECK-NEXT: store i32 1, ptr [[A]]
322322
; CHECK-NEXT: [[A_VAL:%.*]] = load i32, ptr [[A]]
323323
; CHECK-NEXT: [[B_VAL:%.*]] = load i32, ptr [[B]]
324-
; CHECK-NEXT: [[C:%.*]] = call i32 @scalar_callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256(i32 [[A_VAL]], i32 [[B_VAL]])
324+
; CHECK-NEXT: [[C:%.*]] = call i32 @scalar_callee_avx512_legal256_prefer256_call_avx512_legal512_prefer256.argprom(i32 [[A_VAL]], i32 [[B_VAL]])
325325
; CHECK-NEXT: ret i32 [[C]]
326326
;
327327
%A = alloca i32
@@ -332,7 +332,7 @@ define i32 @scalar_avx512_legal256_prefer256_call_avx512_legal512_prefer256(ptr
332332

333333
; If the arguments are scalar, its ok to promote.
334334
define internal i32 @scalar_callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr %X, ptr %Y) #2 {
335-
; CHECK-LABEL: define {{[^@]+}}@scalar_callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256
335+
; CHECK-LABEL: define {{[^@]+}}@scalar_callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256.argprom
336336
; CHECK-SAME: (i32 [[X_VAL:%.*]], i32 [[Y_VAL:%.*]])
337337
; CHECK-NEXT: [[C:%.*]] = add i32 [[X_VAL]], [[Y_VAL]]
338338
; CHECK-NEXT: ret i32 [[C]]
@@ -350,7 +350,7 @@ define i32 @scalar_avx512_legal512_prefer256_call_avx512_legal256_prefer256(ptr
350350
; CHECK-NEXT: store i32 1, ptr [[A]]
351351
; CHECK-NEXT: [[A_VAL:%.*]] = load i32, ptr [[A]]
352352
; CHECK-NEXT: [[B_VAL:%.*]] = load i32, ptr [[B]]
353-
; CHECK-NEXT: [[C:%.*]] = call i32 @scalar_callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256(i32 [[A_VAL]], i32 [[B_VAL]])
353+
; CHECK-NEXT: [[C:%.*]] = call i32 @scalar_callee_avx512_legal512_prefer256_call_avx512_legal256_prefer256.argprom(i32 [[A_VAL]], i32 [[B_VAL]])
354354
; CHECK-NEXT: ret i32 [[C]]
355355
;
356356
%A = alloca i32

llvm/test/Transforms/ArgumentPromotion/X86/thiscall.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ define internal x86_thiscallcc void @internalfun(ptr %this, ptr inalloca(<{ %str
2323
; ARGPROMOTION-NEXT: call void @ext(ptr inalloca(<{ [[STRUCT_A]] }>) [[ARGMEM]])
2424
; ARGPROMOTION-NEXT: ret void
2525
;
26-
; GLOBALOPT_ARGPROMOTION-LABEL: define {{[^@]+}}@internalfun
26+
; GLOBALOPT_ARGPROMOTION-LABEL: define {{[^@]+}}@internalfun.argprom
2727
; GLOBALOPT_ARGPROMOTION-SAME: (ptr [[TMP0:%.*]]) unnamed_addr {
2828
; GLOBALOPT_ARGPROMOTION-NEXT: entry:
2929
; GLOBALOPT_ARGPROMOTION-NEXT: [[A:%.*]] = getelementptr inbounds <{ [[STRUCT_A:%.*]] }>, ptr [[TMP0]], i32 0, i32 0
@@ -56,7 +56,7 @@ define void @exportedfun(ptr %a) {
5656
; GLOBALOPT_ARGPROMOTION-SAME: (ptr [[A:%.*]]) local_unnamed_addr {
5757
; GLOBALOPT_ARGPROMOTION-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave.p0()
5858
; GLOBALOPT_ARGPROMOTION-NEXT: [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
59-
; GLOBALOPT_ARGPROMOTION-NEXT: call fastcc void @internalfun(ptr [[ARGMEM]])
59+
; GLOBALOPT_ARGPROMOTION-NEXT: call fastcc void @internalfun.argprom(ptr [[ARGMEM]])
6060
; GLOBALOPT_ARGPROMOTION-NEXT: call void @llvm.stackrestore.p0(ptr [[INALLOCA_SAVE]])
6161
; GLOBALOPT_ARGPROMOTION-NEXT: ret void
6262
;

llvm/test/Transforms/ArgumentPromotion/aggregate-promote-dead-gep.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@G = constant %T { i32 0, i32 0, i32 17, i32 25 }
66

77
define internal i32 @test(ptr %p) {
8-
; CHECK-LABEL: define {{[^@]+}}@test
8+
; CHECK-LABEL: define {{[^@]+}}@test.argprom
99
; CHECK-SAME: (i32 [[P_12_VAL:%.*]]) {
1010
; CHECK-NEXT: entry:
1111
; CHECK-NEXT: [[V:%.*]] = add i32 [[P_12_VAL]], 10
@@ -24,7 +24,7 @@ define i32 @caller() {
2424
; CHECK-NEXT: entry:
2525
; CHECK-NEXT: [[TMP0:%.*]] = getelementptr i8, ptr @G, i64 12
2626
; CHECK-NEXT: [[G_VAL:%.*]] = load i32, ptr [[TMP0]], align 4
27-
; CHECK-NEXT: [[V:%.*]] = call i32 @test(i32 [[G_VAL]])
27+
; CHECK-NEXT: [[V:%.*]] = call i32 @test.argprom(i32 [[G_VAL]])
2828
; CHECK-NEXT: ret i32 [[V]]
2929
;
3030
entry:

llvm/test/Transforms/ArgumentPromotion/aggregate-promote.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@G = constant %T { i32 0, i32 0, i32 17, i32 25 }
66

77
define internal i32 @test(ptr %p) {
8-
; CHECK-LABEL: define {{[^@]+}}@test
8+
; CHECK-LABEL: define {{[^@]+}}@test.argprom
99
; CHECK-SAME: (i32 [[P_8_VAL:%.*]], i32 [[P_12_VAL:%.*]]) {
1010
; CHECK-NEXT: entry:
1111
; CHECK-NEXT: [[V:%.*]] = add i32 [[P_12_VAL]], [[P_8_VAL]]
@@ -27,7 +27,7 @@ define i32 @caller() {
2727
; CHECK-NEXT: [[G_VAL:%.*]] = load i32, ptr [[TMP0]], align 4
2828
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr i8, ptr @G, i64 12
2929
; CHECK-NEXT: [[G_VAL1:%.*]] = load i32, ptr [[TMP1]], align 4
30-
; CHECK-NEXT: [[V:%.*]] = call i32 @test(i32 [[G_VAL]], i32 [[G_VAL1]])
30+
; CHECK-NEXT: [[V:%.*]] = call i32 @test.argprom(i32 [[G_VAL]], i32 [[G_VAL1]])
3131
; CHECK-NEXT: ret i32 [[V]]
3232
;
3333
entry:

0 commit comments

Comments
 (0)