665 lines · plain
1;; Test behavior of -optimize-hot-cold-new and related options.2 3;; Check that we don't get hot/cold new calls without enabling it explicitly.4; RUN: opt < %s -passes=instcombine -S | FileCheck %s --check-prefix=OFF5; OFF-NOT: hot_cold_t6; OFF-LABEL: @new_hot_cold()7 8;; First check with the default hint values (254 = -2, 128 = -128, 222 = -34).9; RUN: opt < %s -passes=instcombine -optimize-hot-cold-new -S | FileCheck %s --check-prefixes=HOTCOLD,NOBUILTIN-OFF -DCOLD=1 -DHOT=-2 -DNOTCOLD=-128 -DAMBIG=-34 -DPREVHINTCOLD=7 -DPREVHINTNOTCOLD=7 -DPREVHINTHOT=7 -DPREVHINTAMBIG=710 11;; Next check with the non-default cold and hot hint values (200 =-56).12; RUN: opt < %s -passes=instcombine -optimize-hot-cold-new -cold-new-hint-value=5 -hot-new-hint-value=200 -notcold-new-hint-value=99 -ambiguous-new-hint-value=44 -S | FileCheck %s --check-prefixes=HOTCOLD,NOBUILTIN-OFF -DCOLD=5 -DHOT=-56 -DAMBIG=44 -DNOTCOLD=99 -DPREVHINTCOLD=7 -DPREVHINTNOTCOLD=7 -DPREVHINTHOT=7 -DPREVHINTAMBIG=713 14;; Next check with the same non-default cold and hot hint values (200 =-56),15;; but with transformation of nobuiltin calls enabled.16; RUN: opt < %s -passes=instcombine -optimize-hot-cold-new -optimize-nobuiltin-hot-cold-new-new -cold-new-hint-value=5 -hot-new-hint-value=200 -notcold-new-hint-value=99 -ambiguous-new-hint-value=44 -S | FileCheck %s --check-prefixes=HOTCOLD,NOBUILTIN-ON -DCOLD=5 -DHOT=-56 -DAMBIG=44 -DNOTCOLD=99 -DPREVHINTCOLD=7 -DPREVHINTNOTCOLD=7 -DPREVHINTHOT=7 -DPREVHINTAMBIG=717 18;; Try again with the non-default cold and hot hint values (200 =-56), and this19;; time specify that existing hints should be updated.20; RUN: opt < %s -passes=instcombine -optimize-hot-cold-new -cold-new-hint-value=5 -notcold-new-hint-value=100 -hot-new-hint-value=200 -ambiguous-new-hint-value=44 -optimize-existing-hot-cold-new -S | FileCheck %s --check-prefixes=HOTCOLD,NOBUILTIN-OFF -DCOLD=5 -DHOT=-56 -DNOTCOLD=100 -DAMBIG=44 -DPREVHINTCOLD=5 -DPREVHINTNOTCOLD=100 -DPREVHINTHOT=-56 -DPREVHINTAMBIG=4421 22;; Make sure that values not in 0..255 are flagged with an error23; RUN: not opt < %s -passes=instcombine -optimize-hot-cold-new -cold-new-hint-value=256 -S 2>&1 | FileCheck %s --check-prefix=ERROR24; RUN: not opt < %s -passes=instcombine -optimize-hot-cold-new -hot-new-hint-value=5000 -S 2>&1 | FileCheck %s --check-prefix=ERROR25; ERROR: value must be in the range [0, 255]!26 27;; Check that operator new(unsigned long) converted to28;; operator new(unsigned long, __hot_cold_t) with a hot or cold attribute.29; HOTCOLD-LABEL: @new()30define void @new() {31 ;; Attribute cold converted to __hot_cold_t cold value.32 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[COLD]])33 %call = call ptr @_Znwm(i64 10) #034 call void @dummy(ptr %call)35 ;; Attribute notcold converted to __hot_cold_t notcold value.36 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[NOTCOLD]])37 %call1 = call ptr @_Znwm(i64 10) #138 call void @dummy(ptr %call1)39 ;; Attribute hot converted to __hot_cold_t hot value.40 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[HOT]])41 %call2 = call ptr @_Znwm(i64 10) #242 call void @dummy(ptr %call2)43 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.44 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[AMBIG]])45 %call4 = call ptr @_Znwm(i64 10) #746 call void @dummy(ptr %call4)47 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.48 ; NOBUILTIN-OFF: @_Znwm(i64 10)49 ; NOBUILTIN-ON: @_Znwm12__hot_cold_t(i64 10, i8 [[COLD]])50 %call3 = call ptr @_Znwm(i64 10) #651 call void @dummy(ptr %call3)52 ret void53}54 55;; Check that operator new(unsigned long, std::align_val_t) converted to56;; operator new(unsigned long, std::align_val_t, __hot_cold_t) with a hot or57;; cold attribute.58; HOTCOLD-LABEL: @new_align()59define void @new_align() {60 ;; Attribute cold converted to __hot_cold_t cold value.61 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[COLD]])62 %call = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #063 call void @dummy(ptr %call)64 ;; Attribute notcold converted to __hot_cold_t notcold value.65 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[NOTCOLD]])66 %call1 = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #167 call void @dummy(ptr %call1)68 ;; Attribute hot converted to __hot_cold_t hot value.69 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[HOT]])70 %call2 = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #271 call void @dummy(ptr %call2)72 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.73 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[AMBIG]])74 %call4 = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #775 call void @dummy(ptr %call4)76 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.77 ; NOBUILTIN-OFF: @_ZnwmSt11align_val_t(i64 10, i64 8)78 ; NOBUILTIN-ON: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[COLD]])79 %call3 = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #680 call void @dummy(ptr %call3)81 ret void82}83 84;; Check that operator new(unsigned long, const std::nothrow_t&) converted to85;; operator new(unsigned long, const std::nothrow_t&, __hot_cold_t) with a hot or86;; cold attribute.87; HOTCOLD-LABEL: @new_nothrow()88define void @new_nothrow() {89 %nt = alloca i890 ;; Attribute cold converted to __hot_cold_t cold value.91 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[COLD]])92 %call = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #093 call void @dummy(ptr %call)94 ;; Attribute notcold converted to __hot_cold_t notcold value.95 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[NOTCOLD]])96 %call1 = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #197 call void @dummy(ptr %call1)98 ;; Attribute hot converted to __hot_cold_t hot value.99 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[HOT]])100 %call2 = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #2101 call void @dummy(ptr %call2)102 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.103 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[AMBIG]])104 %call4 = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #7105 call void @dummy(ptr %call4)106 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.107 ; NOBUILTIN-OFF: @_ZnwmRKSt9nothrow_t(i64 10, ptr nonnull %nt)108 ; NOBUILTIN-ON: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[COLD]])109 %call3 = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #6110 call void @dummy(ptr %call3)111 ret void112}113 114;; Check that operator new(unsigned long, std::align_val_t, const std::nothrow_t&)115;; converted to116;; operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)117;; with a hot or cold attribute.118; HOTCOLD-LABEL: @new_align_nothrow()119define void @new_align_nothrow() {120 %nt = alloca i8121 ;; Attribute cold converted to __hot_cold_t cold value.122 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[COLD]])123 %call = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #0124 call void @dummy(ptr %call)125 ;; Attribute notcold converted to __hot_cold_t notcold value.126 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[NOTCOLD]])127 %call1 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #1128 call void @dummy(ptr %call1)129 ;; Attribute hot converted to __hot_cold_t hot value.130 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[HOT]])131 %call2 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #2132 call void @dummy(ptr %call2)133 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.134 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[AMBIG]])135 %call4 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #7136 call void @dummy(ptr %call4)137 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.138 ; NOBUILTIN-OFF: @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull %nt)139 ; NOBUILTIN-ON: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[COLD]])140 %call3 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #6141 call void @dummy(ptr %call3)142 ret void143}144 145;; Check that operator new[](unsigned long) converted to146;; operator new[](unsigned long, __hot_cold_t) with a hot or cold attribute.147; HOTCOLD-LABEL: @array_new()148define void @array_new() {149 ;; Attribute cold converted to __hot_cold_t cold value.150 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[COLD]])151 %call = call ptr @_Znam(i64 10) #0152 call void @dummy(ptr %call)153 ;; Attribute notcold converted to __hot_cold_t notcold value.154 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[NOTCOLD]])155 %call1 = call ptr @_Znam(i64 10) #1156 call void @dummy(ptr %call1)157 ;; Attribute hot converted to __hot_cold_t hot value.158 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[HOT]])159 %call2 = call ptr @_Znam(i64 10) #2160 call void @dummy(ptr %call2)161 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.162 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[AMBIG]])163 %call4 = call ptr @_Znam(i64 10) #7164 call void @dummy(ptr %call4)165 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.166 ; NOBUILTIN-OFF: @_Znam(i64 10)167 ; NOBUILTIN-ON: @_Znam12__hot_cold_t(i64 10, i8 [[COLD]])168 %call3 = call ptr @_Znam(i64 10) #6169 call void @dummy(ptr %call3)170 ret void171}172 173;; Check that operator new[](unsigned long, std::align_val_t) converted to174;; operator new[](unsigned long, std::align_val_t, __hot_cold_t) with a hot or175;; cold attribute.176; HOTCOLD-LABEL: @array_new_align()177define void @array_new_align() {178 ;; Attribute cold converted to __hot_cold_t cold value.179 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[COLD]])180 %call = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #0181 call void @dummy(ptr %call)182 ;; Attribute notcold converted to __hot_cold_t notcold value.183 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[NOTCOLD]])184 %call1 = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #1185 call void @dummy(ptr %call1)186 ;; Attribute hot converted to __hot_cold_t hot value.187 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[HOT]])188 %call2 = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #2189 call void @dummy(ptr %call2)190 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.191 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[AMBIG]])192 %call4 = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #7193 call void @dummy(ptr %call4)194 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.195 ; NOBUILTIN-OFF: @_ZnamSt11align_val_t(i64 10, i64 8)196 ; NOBUILTIN-ON: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[COLD]])197 %call3 = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #6198 call void @dummy(ptr %call3)199 ret void200}201 202;; Check that operator new[](unsigned long, const std::nothrow_t&) converted to203;; operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t) with a hot or204;; cold attribute.205; HOTCOLD-LABEL: @array_new_nothrow()206define void @array_new_nothrow() {207 %nt = alloca i8208 ;; Attribute cold converted to __hot_cold_t cold value.209 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[COLD]])210 %call = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #0211 call void @dummy(ptr %call)212 ;; Attribute notcold converted to __hot_cold_t notcold value.213 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[NOTCOLD]])214 %call1 = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #1215 call void @dummy(ptr %call1)216 ;; Attribute hot converted to __hot_cold_t hot value.217 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[HOT]])218 %call2 = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #2219 call void @dummy(ptr %call2)220 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.221 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[AMBIG]])222 %call4 = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #7223 call void @dummy(ptr %call4)224 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.225 ; NOBUILTIN-OFF: @_ZnamRKSt9nothrow_t(i64 10, ptr nonnull %nt)226 ; NOBUILTIN-ON: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[COLD]])227 %call3 = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #6228 call void @dummy(ptr %call3)229 ret void230}231 232;; Check that operator new[](unsigned long, std::align_val_t, const std::nothrow_t&)233;; converted to234;; operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)235;; with a hot or cold attribute.236; HOTCOLD-LABEL: @array_new_align_nothrow()237define void @array_new_align_nothrow() {238 %nt = alloca i8239 ;; Attribute cold converted to __hot_cold_t cold value.240 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[COLD]])241 %call = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #0242 call void @dummy(ptr %call)243 ;; Attribute notcold converted to __hot_cold_t notcold value.244 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[NOTCOLD]])245 %call1 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #1246 call void @dummy(ptr %call1)247 ;; Attribute hot converted to __hot_cold_t hot value.248 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[HOT]])249 %call2 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #2250 call void @dummy(ptr %call2)251 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.252 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[AMBIG]])253 %call4 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #7254 call void @dummy(ptr %call4)255 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.256 ; NOBUILTIN-OFF: @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull %nt)257 ; NOBUILTIN-ON: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[COLD]])258 %call3 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #6259 call void @dummy(ptr %call3)260 ret void261}262 263;; Check that operator new(unsigned long, __hot_cold_t)264;; optionally has its hint updated.265; HOTCOLD-LABEL: @new_hot_cold()266define void @new_hot_cold() {267 ;; Attribute cold converted to __hot_cold_t cold value.268 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTCOLD]])269 %call = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #0270 call void @dummy(ptr %call)271 ;; Attribute notcold converted to __hot_cold_t notcold value.272 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTNOTCOLD]])273 %call1 = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #1274 call void @dummy(ptr %call1)275 ;; Attribute hot converted to __hot_cold_t hot value.276 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTHOT]])277 %call2 = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #2278 call void @dummy(ptr %call2)279 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.280 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTAMBIG]])281 %call4 = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #7282 call void @dummy(ptr %call4)283 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.284 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTCOLD]])285 %call3 = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #6286 call void @dummy(ptr %call3)287 ret void288}289 290;; Check that operator new(unsigned long, std::align_val_t, __hot_cold_t)291;; optionally has its hint updated.292; HOTCOLD-LABEL: @new_align_hot_cold()293define void @new_align_hot_cold() {294 ;; Attribute cold converted to __hot_cold_t cold value.295 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTCOLD]])296 %call = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #0297 call void @dummy(ptr %call)298 ;; Attribute notcold converted to __hot_cold_t notcold value.299 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTNOTCOLD]])300 %call1 = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #1301 call void @dummy(ptr %call1)302 ;; Attribute hot converted to __hot_cold_t hot value.303 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTHOT]])304 %call2 = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #2305 call void @dummy(ptr %call2)306 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.307 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTAMBIG]])308 %call4 = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #7309 call void @dummy(ptr %call4)310 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.311 ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTCOLD]])312 %call3 = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #6313 call void @dummy(ptr %call3)314 ret void315}316 317;; Check that operator new(unsigned long, const std::nothrow_t&, __hot_cold_t)318;; optionally has its hint updated.319; HOTCOLD-LABEL: @new_nothrow_hot_cold()320define void @new_nothrow_hot_cold() {321 %nt = alloca i8322 ;; Attribute cold converted to __hot_cold_t cold value.323 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTCOLD]])324 %call = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #0325 call void @dummy(ptr %call)326 ;; Attribute notcold converted to __hot_cold_t notcold value.327 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])328 %call1 = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #1329 call void @dummy(ptr %call1)330 ;; Attribute hot converted to __hot_cold_t hot value.331 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTHOT]])332 %call2 = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #2333 call void @dummy(ptr %call2)334 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.335 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTAMBIG]])336 %call4 = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #7337 call void @dummy(ptr %call4)338 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.339 ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTCOLD]])340 %call3 = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #6341 call void @dummy(ptr %call3)342 ret void343}344 345;; Check that operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)346;; optionally has its hint updated.347; HOTCOLD-LABEL: @new_align_nothrow_hot_cold()348define void @new_align_nothrow_hot_cold() {349 %nt = alloca i8350 ;; Attribute cold converted to __hot_cold_t cold value.351 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTCOLD]])352 %call = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #0353 call void @dummy(ptr %call)354 ;; Attribute notcold converted to __hot_cold_t notcold value.355 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])356 %call1 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #1357 call void @dummy(ptr %call1)358 ;; Attribute hot converted to __hot_cold_t hot value.359 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTHOT]])360 %call2 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #2361 call void @dummy(ptr %call2)362 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.363 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTAMBIG]])364 %call4 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #7365 call void @dummy(ptr %call4)366 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.367 ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTCOLD]])368 %call3 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #6369 call void @dummy(ptr %call3)370 ret void371}372 373;; Check that operator new[](unsigned long, __hot_cold_t)374;; optionally has its hint updated.375; HOTCOLD-LABEL: @array_new_hot_cold()376define void @array_new_hot_cold() {377 ;; Attribute cold converted to __hot_cold_t cold value.378 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTCOLD]])379 %call = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #0380 call void @dummy(ptr %call)381 ;; Attribute notcold converted to __hot_cold_t notcold value.382 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTNOTCOLD]])383 %call1 = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #1384 call void @dummy(ptr %call1)385 ;; Attribute hot converted to __hot_cold_t hot value.386 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTHOT]])387 %call2 = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #2388 call void @dummy(ptr %call2)389 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.390 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTAMBIG]])391 %call4 = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #7392 call void @dummy(ptr %call4)393 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.394 ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTCOLD]])395 %call3 = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #6396 call void @dummy(ptr %call3)397 ret void398}399 400;; Check that operator new[](unsigned long, std::align_val_t, __hot_cold_t)401;; optionally has its hint updated.402; HOTCOLD-LABEL: @array_new_align_hot_cold()403define void @array_new_align_hot_cold() {404 ;; Attribute cold converted to __hot_cold_t cold value.405 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTCOLD]])406 %call = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #0407 call void @dummy(ptr %call)408 ;; Attribute notcold converted to __hot_cold_t notcold value.409 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTNOTCOLD]])410 %call1 = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #1411 call void @dummy(ptr %call1)412 ;; Attribute hot converted to __hot_cold_t hot value.413 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTHOT]])414 %call2 = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #2415 call void @dummy(ptr %call2)416 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.417 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTAMBIG]])418 %call4 = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #7419 call void @dummy(ptr %call4)420 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.421 ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTCOLD]])422 %call3 = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #6423 call void @dummy(ptr %call3)424 ret void425}426 427;; Check that operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t)428;; optionally has its hint updated.429; HOTCOLD-LABEL: @array_new_nothrow_hot_cold()430define void @array_new_nothrow_hot_cold() {431 %nt = alloca i8432 ;; Attribute cold converted to __hot_cold_t cold value.433 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTCOLD]])434 %call = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #0435 call void @dummy(ptr %call)436 ;; Attribute notcold converted to __hot_cold_t notcold value.437 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])438 %call1 = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #1439 call void @dummy(ptr %call1)440 ;; Attribute hot converted to __hot_cold_t hot value.441 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTHOT]])442 %call2 = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #2443 call void @dummy(ptr %call2)444 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.445 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTAMBIG]])446 %call4 = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #7447 call void @dummy(ptr %call4)448 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.449 ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTCOLD]])450 %call3 = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #6451 call void @dummy(ptr %call3)452 ret void453}454 455;; Check that operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)456;; optionally has its hint updated.457; HOTCOLD-LABEL: @array_new_align_nothrow_hot_cold()458define void @array_new_align_nothrow_hot_cold() {459 %nt = alloca i8460 ;; Attribute cold converted to __hot_cold_t cold value.461 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTCOLD]])462 %call = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #0463 call void @dummy(ptr %call)464 ;; Attribute notcold converted to __hot_cold_t notcold value.465 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])466 %call1 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #1467 call void @dummy(ptr %call1)468 ;; Attribute hot converted to __hot_cold_t hot value.469 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTHOT]])470 %call2 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #2471 call void @dummy(ptr %call2)472 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.473 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTAMBIG]])474 %call4 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #7475 call void @dummy(ptr %call4)476 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.477 ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTCOLD]])478 %call3 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #6479 call void @dummy(ptr %call3)480 ret void481}482 483;; Check that operator __size_returning_new(unsigned long) converted to484;; __size_returning_new(unsigned long, __hot_cold_t) with a hot or cold attribute.485; HOTCOLD-LABEL: @size_returning_test()486define void @size_returning_test() {487 ;; Attribute cold converted to __hot_cold_t cold value.488 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[COLD]])489 %call = call {ptr, i64} @__size_returning_new(i64 10) #3490 %p = extractvalue {ptr, i64} %call, 0491 call void @dummy(ptr %p)492 ;; Attribute notcold converted to __hot_cold_t notcold value.493 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[NOTCOLD]])494 %call1 = call {ptr, i64} @__size_returning_new(i64 10) #4495 %p1 = extractvalue {ptr, i64} %call1, 0496 call void @dummy(ptr %p1)497 ;; Attribute hot converted to __hot_cold_t hot value.498 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[HOT]])499 %call2 = call {ptr, i64} @__size_returning_new(i64 10) #5500 %p2 = extractvalue {ptr, i64} %call2, 0501 call void @dummy(ptr %p2)502 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.503 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[AMBIG]])504 %call4 = call {ptr, i64} @__size_returning_new(i64 10) #8505 %p4 = extractvalue {ptr, i64} %call4, 0506 call void @dummy(ptr %p4)507 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.508 ; NOBUILTIN-OFF: @__size_returning_new(i64 10)509 ; NOBUILTIN-ON: @__size_returning_new_hot_cold(i64 10, i8 [[COLD]])510 %call3 = call {ptr, i64} @__size_returning_new(i64 10) #6511 %p3 = extractvalue {ptr, i64} %call3, 0512 call void @dummy(ptr %p3)513 ret void514}515 516;; Check that operator __size_returning_new_aligned(unsigned long, std::align_val_t) converted to517;; __size_returning_new_aligned(unsigned long, std::align_val_t, __hot_cold_t) with a hot or cold attribute.518; HOTCOLD-LABEL: @size_returning_aligned_test()519define void @size_returning_aligned_test() {520 ;; Attribute cold converted to __hot_cold_t cold value.521 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[COLD]])522 %call = call {ptr, i64} @__size_returning_new_aligned(i64 10, i64 8) #3523 %p = extractvalue {ptr, i64} %call, 0524 call void @dummy(ptr %p)525 ;; Attribute notcold converted to __hot_cold_t notcold value.526 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[NOTCOLD]])527 %call1 = call {ptr, i64} @__size_returning_new_aligned(i64 10, i64 8) #4528 %p1 = extractvalue {ptr, i64} %call1, 0529 call void @dummy(ptr %p1)530 ;; Attribute hot converted to __hot_cold_t hot value.531 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[HOT]])532 %call2 = call {ptr, i64} @__size_returning_new_aligned(i64 10, i64 8) #5533 %p2 = extractvalue {ptr, i64} %call2, 0534 call void @dummy(ptr %p2)535 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.536 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[AMBIG]])537 %call4 = call {ptr, i64} @__size_returning_new_aligned(i64 10, i64 8) #8538 %p4 = extractvalue {ptr, i64} %call4, 0539 call void @dummy(ptr %p4)540 ;; Attribute cold on a nobuiltin call has no effect, unless optionally enabled.541 ; NOBUILTIN-OFF: @__size_returning_new_aligned(i64 10, i64 8)542 ; NOBUILTIN-ON: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[COLD]])543 %call3 = call {ptr, i64} @__size_returning_new_aligned(i64 10, i64 8) #6544 %p3 = extractvalue {ptr, i64} %call3, 0545 call void @dummy(ptr %p3)546 ret void547}548 549;; Check that __size_returning_new_hot_cold(unsigned long, __hot_cold_t)550;; optionally has its hint updated.551; HOTCOLD-LABEL: @size_returning_update_test()552define void @size_returning_update_test() {553 ;; Attribute cold converted to __hot_cold_t cold value.554 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[PREVHINTCOLD]])555 %call = call {ptr, i64} @__size_returning_new_hot_cold(i64 10, i8 7) #3556 %p = extractvalue {ptr, i64} %call, 0557 call void @dummy(ptr %p)558 ;; Attribute notcold converted to __hot_cold_t notcold value.559 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[PREVHINTNOTCOLD]])560 %call1 = call {ptr, i64} @__size_returning_new_hot_cold(i64 10, i8 7) #4561 %p1 = extractvalue {ptr, i64} %call1, 0562 call void @dummy(ptr %p1)563 ;; Attribute hot converted to __hot_cold_t hot value.564 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[PREVHINTHOT]])565 %call2 = call {ptr, i64} @__size_returning_new_hot_cold(i64 10, i8 7) #5566 %p2 = extractvalue {ptr, i64} %call2, 0567 call void @dummy(ptr %p2)568 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.569 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[PREVHINTAMBIG]])570 %call4 = call {ptr, i64} @__size_returning_new_hot_cold(i64 10, i8 7) #8571 %p4 = extractvalue {ptr, i64} %call4, 0572 call void @dummy(ptr %p4)573 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.574 ; HOTCOLD: @__size_returning_new_hot_cold(i64 10, i8 [[PREVHINTCOLD]])575 %call3 = call {ptr, i64} @__size_returning_new_hot_cold(i64 10, i8 7) #6576 %p3 = extractvalue {ptr, i64} %call3, 0577 call void @dummy(ptr %p3)578 ret void579}580 581;; Check that __size_returning_new_aligned_hot_cold(unsigned long, __hot_cold_t)582;; optionally has its hint updated.583; HOTCOLD-LABEL: @size_returning_aligned_update_test()584define void @size_returning_aligned_update_test() {585 ;; Attribute cold converted to __hot_cold_t cold value.586 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[PREVHINTCOLD]])587 %call = call {ptr, i64} @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 7) #3588 %p = extractvalue {ptr, i64} %call, 0589 call void @dummy(ptr %p)590 ;; Attribute notcold converted to __hot_cold_t notcold value.591 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[PREVHINTNOTCOLD]])592 %call1 = call {ptr, i64} @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 7) #4593 %p1 = extractvalue {ptr, i64} %call1, 0594 call void @dummy(ptr %p1)595 ;; Attribute hot converted to __hot_cold_t hot value.596 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[PREVHINTHOT]])597 %call2 = call {ptr, i64} @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 7) #5598 %p2 = extractvalue {ptr, i64} %call2, 0599 call void @dummy(ptr %p2)600 ;; Attribute ambiguous converted to __hot_cold_t ambiguous value.601 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[PREVHINTAMBIG]])602 %call4 = call {ptr, i64} @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 7) #8603 %p4 = extractvalue {ptr, i64} %call4, 0604 call void @dummy(ptr %p4)605 ;; Attribute cold on a nobuiltin existing hot/cold call updates the hint.606 ; HOTCOLD: @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 [[PREVHINTCOLD]])607 %call3 = call {ptr, i64} @__size_returning_new_aligned_hot_cold(i64 10, i64 8, i8 7) #6608 %p3 = extractvalue {ptr, i64} %call3, 0609 call void @dummy(ptr %p3)610 ret void611}612 613;; Check that !alloc_token is preserved.614; HOTCOLD-LABEL: @new_alloc_token()615define void @new_alloc_token() {616 ;; Attribute cold converted to __hot_cold_t cold value.617 ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[COLD]]), !alloc_token ![[ALLOC_TOKEN:[0-9]+]]618 %call = call ptr @_Znwm(i64 10) #0, !alloc_token !0619 call void @dummy(ptr %call)620 ret void621}622 623;; So that instcombine doesn't optimize out the call.624declare void @dummy(ptr)625 626declare ptr @_Znwm(i64)627declare ptr @_ZnwmSt11align_val_t(i64, i64)628declare ptr @_ZnwmRKSt9nothrow_t(i64, ptr)629declare ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64, i64, ptr)630declare ptr @_Znam(i64)631declare ptr @_ZnamSt11align_val_t(i64, i64)632declare ptr @_ZnamRKSt9nothrow_t(i64, ptr)633declare ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64, i64, ptr)634declare ptr @_Znwm12__hot_cold_t(i64, i8)635declare ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64, i64, i8)636declare ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64, ptr, i8)637declare ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64, i64, ptr, i8)638declare ptr @_Znam12__hot_cold_t(i64, i8)639declare ptr @_ZnamSt11align_val_t12__hot_cold_t(i64, i64, i8)640declare ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64, ptr, i8)641declare ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64, i64, ptr, i8)642 643 644declare {ptr, i64} @__size_returning_new(i64)645declare {ptr, i64} @__size_returning_new_hot_cold(i64, i8)646declare {ptr, i64} @__size_returning_new_aligned(i64, i64)647declare {ptr, i64} @__size_returning_new_aligned_hot_cold(i64, i64, i8)648 649attributes #0 = { builtin allocsize(0) "memprof"="cold" }650attributes #1 = { builtin allocsize(0) "memprof"="notcold" }651attributes #2 = { builtin allocsize(0) "memprof"="hot" }652attributes #7 = { builtin allocsize(0) "memprof"="ambiguous" }653 654;; Use separate attributes for __size_returning_new variants since they are not655;; treated as builtins.656attributes #3 = { "memprof" = "cold" }657attributes #4 = { "memprof" = "notcold" }658attributes #5 = { "memprof" = "hot" }659attributes #8 = { "memprof" = "ambiguous" }660 661attributes #6 = { nobuiltin allocsize(0) "memprof"="cold" }662 663; CHECK: [[ALLOC_TOKEN]] = !{!"MyType", i1 false}664!0 = !{!"MyType", i1 false}665