|
54 | 54 | ; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=STATS \
|
55 | 55 | ; RUN: --check-prefix=REMARKS
|
56 | 56 |
|
57 |
| -; RUN: llvm-dis %t.out.2.4.opt.bc -o - | FileCheck %s --check-prefix=IR |
| 57 | +; RUN: llvm-dis %t.out.2.4.opt.bc -o - | FileCheck %s --check-prefixes=IR,IR-INLINE |
| 58 | + |
| 59 | +;; Next, add a threshold to prevent inlining of the promoted calls which have |
| 60 | +;; count 2 (the default threshold of 2 means they are inlinable by default). |
| 61 | +; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \ |
| 62 | +; RUN: -memprof-icp-noinline-threshold=3 \ |
| 63 | +; RUN: -enable-memprof-indirect-call-support=true \ |
| 64 | +; RUN: -memprof-allow-recursive-callsites \ |
| 65 | +; RUN: -supports-hot-cold-new \ |
| 66 | +; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \ |
| 67 | +; RUN: -r=%t/foo.o,_ZN2B03barEj, \ |
| 68 | +; RUN: -r=%t/foo.o,_ZN1B3barEj, \ |
| 69 | +; RUN: -r=%t/main.o,_Z3fooR2B0j, \ |
| 70 | +; RUN: -r=%t/main.o,_Znwm, \ |
| 71 | +; RUN: -r=%t/main.o,_ZdlPvm, \ |
| 72 | +; RUN: -r=%t/main.o,_Z8externalPi, \ |
| 73 | +; RUN: -r=%t/main.o,main,plx \ |
| 74 | +; RUN: -r=%t/main.o,_ZN2B03barEj,plx \ |
| 75 | +; RUN: -r=%t/main.o,_ZN1B3barEj,plx \ |
| 76 | +; RUN: -r=%t/main.o,_ZTV1B,plx \ |
| 77 | +; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \ |
| 78 | +; RUN: -r=%t/main.o,_ZTS1B,plx \ |
| 79 | +; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \ |
| 80 | +; RUN: -r=%t/main.o,_ZTS2B0,plx \ |
| 81 | +; RUN: -r=%t/main.o,_ZTI2B0,plx \ |
| 82 | +; RUN: -r=%t/main.o,_ZTI1B,plx \ |
| 83 | +; RUN: -r=%t/main.o,_ZTV2B0,plx \ |
| 84 | +; RUN: -thinlto-threads=1 \ |
| 85 | +; RUN: -memprof-verify-ccg -memprof-verify-nodes -stats \ |
| 86 | +; RUN: -pass-remarks=. -save-temps \ |
| 87 | +; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=STATS \ |
| 88 | +; RUN: --check-prefix=REMARKS |
| 89 | + |
| 90 | +; RUN: llvm-dis %t.out.2.4.opt.bc -o - | FileCheck %s --check-prefixes=IR,IR-NOINLINE |
58 | 91 |
|
59 | 92 | ; REMARKS: call in clone main assigned to call function clone _Z3fooR2B0j.memprof.1
|
60 | 93 | ; REMARKS: call in clone main assigned to call function clone _Z3fooR2B0j.memprof.1
|
|
98 | 131 | ; IR: %[[R1:[0-9]+]] = icmp eq ptr %0, @_ZN1B3barEj
|
99 | 132 | ; IR: br i1 %[[R1]], label %if.true.direct_targ, label %if.false.orig_indirect
|
100 | 133 | ; IR: if.true.direct_targ:
|
101 |
| -; IR: call {{.*}} @_Znwm(i64 noundef 4) #[[NOTCOLD:[0-9]+]] |
| 134 | +; IR-INLINE: call {{.*}} @_Znwm(i64 noundef 4) #[[NOTCOLD:[0-9]+]] |
| 135 | +; IR-NOINLINE: call {{.*}} @_ZN1B3barEj(ptr null, i32 0) #[[NOINLINE:[0-9]+]] |
102 | 136 | ; IR: if.false.orig_indirect:
|
103 | 137 | ; IR: %[[R2:[0-9]+]] = icmp eq ptr %0, @_ZN2B03barEj
|
104 | 138 | ; IR: br i1 %[[R2]], label %if.true.direct_targ1, label %if.false.orig_indirect2
|
105 | 139 | ; IR: if.true.direct_targ1:
|
106 |
| -; IR: call {{.*}} @_Znwm(i64 noundef 4) #[[NOTCOLD]] |
| 140 | +; IR-INLINE: call {{.*}} @_Znwm(i64 noundef 4) #[[NOTCOLD]] |
| 141 | +; IR-NOINLINE: call {{.*}} @_ZN2B03barEj(ptr null, i32 0) #[[NOINLINE]] |
107 | 142 | ; IR: if.false.orig_indirect2:
|
108 | 143 | ; IR: call {{.*}} %0
|
109 | 144 |
|
|
114 | 149 | ; IR: %[[R3:[0-9]+]] = icmp eq ptr %0, @_ZN1B3barEj
|
115 | 150 | ; IR: br i1 %[[R3]], label %if.true.direct_targ, label %if.false.orig_indirect
|
116 | 151 | ; IR: if.true.direct_targ:
|
117 |
| -; IR: call {{.*}} @_Znwm(i64 noundef 4) #[[COLD:[0-9]+]] |
| 152 | +; IR-INLINE: call {{.*}} @_Znwm(i64 noundef 4) #[[COLD:[0-9]+]] |
| 153 | +; IR-NOINLINE: call {{.*}} @_ZN1B3barEj.memprof.1(ptr null, i32 0) #[[NOINLINE]] |
118 | 154 | ; IR: if.false.orig_indirect:
|
119 | 155 | ; IR: %[[R4:[0-9]+]] = icmp eq ptr %0, @_ZN2B03barEj
|
120 | 156 | ; IR: br i1 %[[R4]], label %if.true.direct_targ1, label %if.false.orig_indirect2
|
121 | 157 | ; IR: if.true.direct_targ1:
|
122 |
| -; IR: call {{.*}} @_Znwm(i64 noundef 4) #[[COLD]] |
| 158 | +; IR-INLINE: call {{.*}} @_Znwm(i64 noundef 4) #[[COLD]] |
| 159 | +; IR-NOINLINE: call {{.*}} @_ZN2B03barEj.memprof.1(ptr null, i32 0) #[[NOINLINE]] |
123 | 160 | ; IR: if.false.orig_indirect2:
|
124 | 161 | ; IR: call {{.*}} %0
|
125 | 162 |
|
126 |
| -; IR: attributes #[[NOTCOLD]] = {{.*}} "memprof"="notcold" |
127 |
| -; IR: attributes #[[COLD]] = {{.*}} "memprof"="cold" |
| 163 | +; IR-INLINE: attributes #[[NOTCOLD]] = {{.*}} "memprof"="notcold" |
| 164 | +; IR-INLINE: attributes #[[COLD]] = {{.*}} "memprof"="cold" |
| 165 | +; IR-NOINLINE: attributes #[[NOINLINE]] = { noinline } |
128 | 166 |
|
129 | 167 | ;--- foo.ll
|
130 | 168 | target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
|
0 commit comments