Skip to content

Commit becc02c

Browse files
author
Yonghong Song
committed
Revert "[Transforms][IPO] Add func suffix in ArgumentPromotion and DeadArgume… (#105742)"
This reverts commit 959448f. Reverting because multiple test failures e.g. https://lab.llvm.org/buildbot/#/builders/187/builds/1290 https://lab.llvm.org/buildbot/#/builders/153/builds/9389 and maybe a few others.
1 parent f1ff3a2 commit becc02c

File tree

79 files changed

+263
-342
lines changed

Some content is hidden

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

79 files changed

+263
-342
lines changed

llvm/lib/Transforms/IPO/ArgumentPromotion.cpp

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

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

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

llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -889,10 +889,6 @@ 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");
894-
else
895-
NF->setName(NF->getName() + ".retelim");
896892
NF->IsNewDbgInfoFormat = F->IsNewDbgInfoFormat;
897893

898894
// 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.argprom(
12+
; CHECK-LABEL: @b(
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.argprom()
20+
; CHECK-NEXT: call void @b()
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.argelim() {
14+
; CHECK: define void @test() {
1515
define i32 @test(i32 %A, ptr %B, float %C) {
1616
call i32 @test2()
1717
ret i32 %1

llvm/test/CodeGen/AArch64/arg_promotion.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ define dso_local void @caller_4xi32(ptr noalias %src, ptr noalias %dst) #1 {
3838
; CHECK-LABEL: define dso_local void @caller_4xi32(
3939
; CHECK-NEXT: entry:
4040
; CHECK-NEXT: [[SRC_VAL:%.*]] = load <4 x i32>, ptr [[SRC:%.*]], align 16
41-
; CHECK-NEXT: call fastcc void @callee_4xi32.argprom.argprom(<4 x i32> [[SRC_VAL]], ptr noalias [[DST:%.*]])
41+
; CHECK-NEXT: call fastcc void @callee_4xi32(<4 x i32> [[SRC_VAL]], ptr noalias [[DST:%.*]])
4242
; CHECK-NEXT: ret void
4343
;
4444
entry:
45-
call fastcc void @callee_4xi32.argprom(ptr noalias %src, ptr noalias %dst)
45+
call fastcc void @callee_4xi32(ptr noalias %src, ptr noalias %dst)
4646
ret void
4747
}
4848

49-
define internal fastcc void @callee_4xi32.argprom(ptr noalias %src, ptr noalias %dst) #1 {
50-
; CHECK-LABEL: define internal fastcc void @callee_4xi32.argprom.argprom(
49+
define internal fastcc void @callee_4xi32(ptr noalias %src, ptr noalias %dst) #1 {
50+
; CHECK-LABEL: define internal fastcc void @callee_4xi32(
5151
; CHECK-NEXT: entry:
5252
; CHECK-NEXT: store <4 x i32> [[SRC_0_VAL:%.*]], ptr [[DST:%.*]], align 16
5353
; CHECK-NEXT: ret void
@@ -65,7 +65,7 @@ define dso_local void @caller_i256(ptr noalias %src, ptr noalias %dst) #0 {
6565
; CHECK-LABEL: define dso_local void @caller_i256(
6666
; CHECK-NEXT: entry:
6767
; CHECK-NEXT: [[SRC_VAL:%.*]] = load i256, ptr [[SRC:%.*]], align 16
68-
; CHECK-NEXT: call fastcc void @callee_i256.argprom(i256 [[SRC_VAL]], ptr noalias [[DST:%.*]])
68+
; CHECK-NEXT: call fastcc void @callee_i256(i256 [[SRC_VAL]], ptr noalias [[DST:%.*]])
6969
; CHECK-NEXT: ret void
7070
;
7171
entry:
@@ -74,7 +74,7 @@ entry:
7474
}
7575

7676
define internal fastcc void @callee_i256(ptr noalias %src, ptr noalias %dst) #0 {
77-
; CHECK-LABEL: define internal fastcc void @callee_i256.argprom(
77+
; CHECK-LABEL: define internal fastcc void @callee_i256(
7878
; CHECK-NEXT: entry:
7979
; CHECK-NEXT: store i256 [[SRC_0_VAL:%.*]], ptr [[DST:%.*]], align 16
8080
; CHECK-NEXT: ret void
@@ -159,7 +159,7 @@ define dso_local void @caller_struct4xi32(ptr noalias %src, ptr noalias %dst) #1
159159
; CHECK-NEXT: [[SRC_VAL:%.*]] = load <4 x i32>, ptr [[SRC:%.*]], align 16
160160
; CHECK-NEXT: [[TMP0:%.*]] = getelementptr i8, ptr [[SRC]], i64 16
161161
; CHECK-NEXT: [[SRC_VAL1:%.*]] = load <4 x i32>, ptr [[TMP0]], align 16
162-
; CHECK-NEXT: call fastcc void @callee_struct4xi32.argprom(<4 x i32> [[SRC_VAL]], <4 x i32> [[SRC_VAL1]], ptr noalias [[DST:%.*]])
162+
; CHECK-NEXT: call fastcc void @callee_struct4xi32(<4 x i32> [[SRC_VAL]], <4 x i32> [[SRC_VAL1]], ptr noalias [[DST:%.*]])
163163
; CHECK-NEXT: ret void
164164
;
165165
entry:
@@ -168,7 +168,7 @@ entry:
168168
}
169169

170170
define internal fastcc void @callee_struct4xi32(ptr noalias %src, ptr noalias %dst) #1 {
171-
; CHECK-LABEL: define internal fastcc void @callee_struct4xi32.argprom(
171+
; CHECK-LABEL: define internal fastcc void @callee_struct4xi32(
172172
; CHECK-NEXT: entry:
173173
; CHECK-NEXT: store <4 x i32> [[SRC_0_VAL:%.*]], ptr [[DST:%.*]], align 16
174174
; CHECK-NEXT: [[DST2:%.*]] = getelementptr inbounds [[STRUCT_4XI32:%.*]], ptr [[DST]], i64 0, i32 1

llvm/test/CodeGen/AMDGPU/internalize.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
; ALL: gvar_used
1111
@gvar_used = addrspace(1) global i32 undef, align 4
1212

13-
; OPT: define internal fastcc void @func_used_noinline.argelim(
13+
; OPT: define internal fastcc void @func_used_noinline(
1414
; OPT-NONE: define fastcc void @func_used_noinline(
1515
define fastcc void @func_used_noinline(ptr addrspace(1) %out, i32 %tid) #1 {
1616
entry:

llvm/test/ThinLTO/X86/memprof-aliased-location1.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ attributes #0 = { noinline optnone }
8484
;; The first call to foo does not allocate cold memory. It should call the
8585
;; original functions, which ultimately call the original allocation decorated
8686
;; with a "notcold" attribute.
87-
; IR: call {{.*}} @_Z3foov.retelim()
87+
; IR: call {{.*}} @_Z3foov()
8888
;; The second call to foo allocates cold memory. It should call cloned functions
8989
;; which ultimately call a cloned allocation decorated with a "cold" attribute.
90-
; IR: call {{.*}} @_Z3foov.memprof.1.retelim()
91-
; IR: define internal {{.*}} @_Z3barv.retelim()
90+
; IR: call {{.*}} @_Z3foov.memprof.1()
91+
; IR: define internal {{.*}} @_Z3barv()
9292
; IR: call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
93-
; IR: define internal {{.*}} @_Z3bazv.retelim()
94-
; IR: call {{.*}} @_Z3barv.retelim()
95-
; IR: define internal {{.*}} @_Z3foov.retelim()
96-
; IR: call {{.*}} @_Z3bazv.retelim()
97-
; IR: define internal {{.*}} @_Z3barv.memprof.1.retelim()
93+
; IR: define internal {{.*}} @_Z3bazv()
94+
; IR: call {{.*}} @_Z3barv()
95+
; IR: define internal {{.*}} @_Z3foov()
96+
; IR: call {{.*}} @_Z3bazv()
97+
; IR: define internal {{.*}} @_Z3barv.memprof.1()
9898
; IR: call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
99-
; IR: define internal {{.*}} @_Z3bazv.memprof.1.retelim()
100-
; IR: call {{.*}} @_Z3barv.memprof.1.retelim()
101-
; IR: define internal {{.*}} @_Z3foov.memprof.1.retelim()
102-
; IR: call {{.*}} @_Z3bazv.memprof.1.retelim()
99+
; IR: define internal {{.*}} @_Z3bazv.memprof.1()
100+
; IR: call {{.*}} @_Z3barv.memprof.1()
101+
; IR: define internal {{.*}} @_Z3foov.memprof.1()
102+
; IR: call {{.*}} @_Z3bazv.memprof.1()
103103
; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
104104
; IR: attributes #[[COLD]] = { "memprof"="cold" }
105105

llvm/test/ThinLTO/X86/memprof-aliased-location2.ll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ attributes #0 = { noinline optnone }
8484
;; The first call to foo does not allocate cold memory. It should call the
8585
;; original functions, which ultimately call the original allocation decorated
8686
;; with a "notcold" attribute.
87-
; IR: call {{.*}} @_Z3foov.retelim()
87+
; IR: call {{.*}} @_Z3foov()
8888
;; The second call to foo allocates cold memory. It should call cloned functions
8989
;; which ultimately call a cloned allocation decorated with a "cold" attribute.
90-
; IR: call {{.*}} @_Z3foov.memprof.1.retelim()
91-
; IR: define internal {{.*}} @_Z3barv.retelim()
90+
; IR: call {{.*}} @_Z3foov.memprof.1()
91+
; IR: define internal {{.*}} @_Z3barv()
9292
; IR: call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
93-
; IR: define internal {{.*}} @_Z3bazv.retelim()
94-
; IR: call {{.*}} @_Z3barv.retelim()
95-
; IR: define internal {{.*}} @_Z3foov.retelim()
96-
; IR: call {{.*}} @_Z3bazv.retelim()
97-
; IR: define internal {{.*}} @_Z3barv.memprof.1.retelim()
93+
; IR: define internal {{.*}} @_Z3bazv()
94+
; IR: call {{.*}} @_Z3barv()
95+
; IR: define internal {{.*}} @_Z3foov()
96+
; IR: call {{.*}} @_Z3bazv()
97+
; IR: define internal {{.*}} @_Z3barv.memprof.1()
9898
; IR: call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
99-
; IR: define internal {{.*}} @_Z3bazv.memprof.1.retelim()
100-
; IR: call {{.*}} @_Z3barv.memprof.1.retelim()
101-
; IR: define internal {{.*}} @_Z3foov.memprof.1.retelim()
102-
; IR: call {{.*}} @_Z3bazv.memprof.1.retelim()
99+
; IR: define internal {{.*}} @_Z3bazv.memprof.1()
100+
; IR: call {{.*}} @_Z3barv.memprof.1()
101+
; IR: define internal {{.*}} @_Z3foov.memprof.1()
102+
; IR: call {{.*}} @_Z3bazv.memprof.1()
103103
; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
104104
; IR: attributes #[[COLD]] = { "memprof"="cold" }
105105

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

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
;; We should have cloned bar, baz, and foo, for the cold memory allocation.
5454
; RUN: cat %t.ccg.cloned.dot | FileCheck %s --check-prefix=DOTCLONED
5555

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

5858

5959
;; Try again but with distributed ThinLTO
@@ -303,23 +303,6 @@ attributes #0 = { noinline optnone }
303303
; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
304304
; IR: attributes #[[COLD]] = { "memprof"="cold" }
305305

306-
; IRNODIST: define {{.*}} @main
307-
; IRNODIST: call {{.*}} @_Z3foov.retelim()
308-
; IRNODIST: call {{.*}} @_Z3foov.memprof.1.retelim()
309-
; IRNODIST: define internal {{.*}} @_Z3barv.retelim()
310-
; IRNODIST: call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
311-
; IRNODIST: define internal {{.*}} @_Z3bazv.retelim()
312-
; IRNODIST: call {{.*}} @_Z3barv.retelim()
313-
; IRNODIST: define internal {{.*}} @_Z3foov.retelim()
314-
; IRNODIST: call {{.*}} @_Z3bazv.retelim()
315-
; IRNODIST: define internal {{.*}} @_Z3barv.memprof.1.retelim()
316-
; IRNODIST: call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
317-
; IRNODIST: define internal {{.*}} @_Z3bazv.memprof.1.retelim()
318-
; IRNODIST: call {{.*}} @_Z3barv.memprof.1.retelim()
319-
; IRNODIST: define internal {{.*}} @_Z3foov.memprof.1.retelim()
320-
; IRNODIST: call {{.*}} @_Z3bazv.memprof.1.retelim()
321-
; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
322-
; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
323306

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

llvm/test/ThinLTO/X86/memprof-duplicate-context-ids.ll

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=DUMP \
6969
; RUN: --check-prefix=STATS --check-prefix=STATS-BE --check-prefix=REMARKS
7070

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

7373

7474
;; Try again but with distributed ThinLTO
@@ -247,18 +247,6 @@ attributes #0 = { noinline optnone}
247247
; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
248248
; IR: attributes #[[COLD]] = { "memprof"="cold" }
249249

250-
; IRNODIST: define internal {{.*}} @_Z1Dv.retelim()
251-
; IRNODIST: call {{.*}} @_Znam(i64 0) #[[NOTCOLD:[0-9]+]]
252-
; IRNODIST: define internal {{.*}} @_Z1Fv.retelim()
253-
; IRNODIST: call {{.*}} @_Z1Dv.retelim()
254-
; IRNODIST: define internal {{.*}} @_Z1Bv.retelim()
255-
; IRNODIST: call {{.*}} @_Z1Dv.memprof.1.retelim()
256-
; IRNODIST: define internal {{.*}} @_Z1Ev.retelim()
257-
; IRNODIST: call {{.*}} @_Z1Dv.memprof.1.retelim()
258-
; IRNODIST: define internal {{.*}} @_Z1Dv.memprof.1.retelim()
259-
; IRNODIST: call {{.*}} @_Znam(i64 0) #[[COLD:[0-9]+]]
260-
; IRNODIST: attributes #[[NOTCOLD]] = { "memprof"="notcold" }
261-
; IRNODIST: attributes #[[COLD]] = { "memprof"="cold" }
262250

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

0 commit comments

Comments
 (0)