487 lines · plain
1;; Test that cloning of an indirect call works. We should perform ICP and update2;; promoted call to the correct clone.3 4;; This was created from the following source code, for which both memprof and5;; instrumentation PGO was collected and then applied, then the IR was reduced6;; using llvm-reduce with the expected FileCheck input.7;; TODO: Consider adding a sample PGO based test, however, that uses the same VP8;; metadata and should behave the same.9 10;; -- virtfunc.h: --11;; void external(int *x);12;;13;; class B0 {14;; public:15;; virtual int bar(unsigned s);16;; };17;;18;; class B : public B0 {19;; public:20;; int bar(unsigned s) override;21;; };22;;23;; int foo(B0 &b, unsigned s);24 25;; -- virtfunc.cc: --26;; #include "virtfunc.h"27;;28;; int foo(B0 &b, unsigned s) {29;; return b.bar(s);30;; }31 32;; -- virtfunc_main.cc: --33;; #include "virtfunc.h"34;; #include <stdio.h>35;; #include <unistd.h>36;;37;; int main() {38;; B b;39;; int x = foo(b, 1);40;; printf("%d\n", x);41;; int y = foo(b, 10);42;; printf("%d\n", y);43;; B0 b0;44;; x = foo(b0, 1);45;; printf("%d\n", x);46;; y = foo(b0, 10);47;; printf("%d\n", y);48;; return 0;49;; }50;;51;; int B0::bar(unsigned s) {52;; int *x = new int;53;; sleep(s);54;; external(x);55;; delete x;56;; return 1;57;; }58;;59;; int B::bar(unsigned s) {60;; int *x = new int;61;; sleep(s);62;; external(x);63;; delete x;64;; return 2;65;; }66 67;; -stats requires asserts68; REQUIRES: asserts69 70; RUN: split-file %s %t71 72; RUN: opt -thinlto-bc %t/main.ll >%t/main.o73; RUN: opt -thinlto-bc %t/foo.ll >%t/foo.o74 75;; Check that we get the synthesized callsite records. There should be 2, one76;; for each profiled target in the VP metadata. They will have the same stackIds77;; since the debug information for the callsite is the same.78; RUN: llvm-dis %t/foo.o -o - | FileCheck %s --check-prefix=CALLSITES79; CALLSITES: gv: (name: "_Z3fooR2B0j", {{.*}} callsites: ((callee: ^{{[0-9]+}}, clones: (0), stackIds: (16345663650247127235)), (callee: ^{{[0-9]+}}, clones: (0), stackIds: (16345663650247127235))80 81;; Make sure that we don't get the synthesized callsite records if the82;; -enable-memprof-indirect-call-support flag is false.83; RUN: opt -thinlto-bc %t/foo.ll -enable-memprof-indirect-call-support=false >%t/foo.noicp.o84; RUN: llvm-dis %t/foo.noicp.o -o - | FileCheck %s --implicit-check-not "stackIds: (16345663650247127235)"85 86;; First perform in-process ThinLTO87; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \88; RUN: -enable-memprof-indirect-call-support=true \89; RUN: -supports-hot-cold-new \90; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \91; RUN: -r=%t/foo.o,_ZN2B03barEj.abc,plx \92; RUN: -r=%t/foo.o,_Z3xyzR2B0j, \93; RUN: -r=%t/foo.o,_ZN2B03barEj, \94; RUN: -r=%t/foo.o,_ZN1B3barEj, \95; RUN: -r=%t/main.o,_Z3fooR2B0j, \96; RUN: -r=%t/main.o,_Znwm, \97; RUN: -r=%t/main.o,_ZdlPvm, \98; RUN: -r=%t/main.o,_Z8externalPi, \99; RUN: -r=%t/main.o,main,plx \100; RUN: -r=%t/main.o,_ZN2B03barEj,plx \101; RUN: -r=%t/main.o,_ZN1B3barEj,plx \102; RUN: -r=%t/main.o,_ZTV1B,plx \103; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \104; RUN: -r=%t/main.o,_ZTS1B,plx \105; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \106; RUN: -r=%t/main.o,_ZTS2B0,plx \107; RUN: -r=%t/main.o,_ZTI2B0,plx \108; RUN: -r=%t/main.o,_ZTI1B,plx \109; RUN: -r=%t/main.o,_ZTV2B0,plx \110; RUN: -thinlto-threads=1 \111; RUN: -memprof-verify-ccg -memprof-verify-nodes -stats \112; RUN: -pass-remarks=. -save-temps \113; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=STATS \114; RUN: --check-prefix=STATS-BE --check-prefix=REMARKS-MAIN \115; RUN: --check-prefix=REMARKS-FOO --check-prefix=REMARKS-FOO-IMPORT116 117; RUN: llvm-dis %t.out.2.4.opt.bc -o - | FileCheck %s --check-prefix=IR --check-prefix=IR-IMPORT118 119;; Try again but with distributed ThinLTO120; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \121; RUN: -supports-hot-cold-new \122; RUN: -thinlto-distributed-indexes \123; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \124; RUN: -r=%t/foo.o,_ZN2B03barEj.abc,plx \125; RUN: -r=%t/foo.o,_Z3xyzR2B0j, \126; RUN: -r=%t/foo.o,_ZN2B03barEj, \127; RUN: -r=%t/foo.o,_ZN1B3barEj, \128; RUN: -r=%t/main.o,_Z3fooR2B0j, \129; RUN: -r=%t/main.o,_Znwm, \130; RUN: -r=%t/main.o,_ZdlPvm, \131; RUN: -r=%t/main.o,_Z8externalPi, \132; RUN: -r=%t/main.o,main,plx \133; RUN: -r=%t/main.o,_ZN2B03barEj,plx \134; RUN: -r=%t/main.o,_ZN1B3barEj,plx \135; RUN: -r=%t/main.o,_ZTV1B,plx \136; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \137; RUN: -r=%t/main.o,_ZTS1B,plx \138; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \139; RUN: -r=%t/main.o,_ZTS2B0,plx \140; RUN: -r=%t/main.o,_ZTI2B0,plx \141; RUN: -r=%t/main.o,_ZTI1B,plx \142; RUN: -r=%t/main.o,_ZTV2B0,plx \143; RUN: -memprof-verify-ccg -memprof-verify-nodes -stats \144; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=STATS145 146;; Run ThinLTO backend147; RUN: opt -import-all-index -passes=function-import,memprof-context-disambiguation,inline \148; RUN: -enable-memprof-indirect-call-support=true \149; RUN: -summary-file=%t/foo.o.thinlto.bc -memprof-import-summary=%t/foo.o.thinlto.bc \150; RUN: -enable-import-metadata -stats -pass-remarks=. \151; RUN: %t/foo.o -S 2>&1 | FileCheck %s --check-prefix=IR --check-prefix=IR-IMPORT \152; RUN: --check-prefix=STATS-BE-DISTRIB --check-prefix=REMARKS-FOO \153; RUN: --check-prefix=REMARKS-FOO-IMPORT154 155;; Retry with the ICP-disabled object file, and make sure we disable it again156;; so we don't look for the synthesized callsite records when applying imports.157;; We should not get any cloning.158; RUN: llvm-lto2 run %t/main.o %t/foo.noicp.o -enable-memprof-context-disambiguation \159; RUN: -enable-memprof-indirect-call-support=false \160; RUN: -supports-hot-cold-new \161; RUN: -r=%t/foo.noicp.o,_Z3fooR2B0j,plx \162; RUN: -r=%t/foo.noicp.o,_ZN2B03barEj.abc,plx \163; RUN: -r=%t/foo.noicp.o,_Z3xyzR2B0j, \164; RUN: -r=%t/foo.noicp.o,_ZN2B03barEj, \165; RUN: -r=%t/foo.noicp.o,_ZN1B3barEj, \166; RUN: -r=%t/main.o,_Z3fooR2B0j, \167; RUN: -r=%t/main.o,_Znwm, \168; RUN: -r=%t/main.o,_ZdlPvm, \169; RUN: -r=%t/main.o,_Z8externalPi, \170; RUN: -r=%t/main.o,main,plx \171; RUN: -r=%t/main.o,_ZN2B03barEj,plx \172; RUN: -r=%t/main.o,_ZN1B3barEj,plx \173; RUN: -r=%t/main.o,_ZTV1B,plx \174; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \175; RUN: -r=%t/main.o,_ZTS1B,plx \176; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \177; RUN: -r=%t/main.o,_ZTS2B0,plx \178; RUN: -r=%t/main.o,_ZTI2B0,plx \179; RUN: -r=%t/main.o,_ZTI1B,plx \180; RUN: -r=%t/main.o,_ZTV2B0,plx \181; RUN: -thinlto-threads=1 \182; RUN: -memprof-verify-ccg -memprof-verify-nodes \183; RUN: -pass-remarks=. -save-temps \184; RUN: -o %t.noicp.out 2>&1 | FileCheck %s --implicit-check-not "created clone"185 186;; Verify that we did not do any cloning of the function with the indirect call187;; when memprof ICP is off. However, we should still have removed the callsite188;; metadata.189; RUN: llvm-dis %t.noicp.out.2.4.opt.bc -o - | FileCheck %s --implicit-check-not "_Z3fooR2B0j.memprof" --implicit-check-not "!callsite"190 191;; Run in-process ThinLTO again, but with importing disabled by setting the192;; instruction limit to 0. Ensure that the existing declarations of B::bar193;; and B0::bar are sufficient to allow for the promotion and cloning.194; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \195; RUN: -import-instr-limit=0 \196; RUN: -enable-memprof-indirect-call-support=true \197; RUN: -supports-hot-cold-new \198; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \199; RUN: -r=%t/foo.o,_ZN2B03barEj.abc,plx \200; RUN: -r=%t/foo.o,_Z3xyzR2B0j, \201; RUN: -r=%t/foo.o,_ZN2B03barEj, \202; RUN: -r=%t/foo.o,_ZN1B3barEj, \203; RUN: -r=%t/main.o,_Z3fooR2B0j, \204; RUN: -r=%t/main.o,_Znwm, \205; RUN: -r=%t/main.o,_ZdlPvm, \206; RUN: -r=%t/main.o,_Z8externalPi, \207; RUN: -r=%t/main.o,main,plx \208; RUN: -r=%t/main.o,_ZN2B03barEj,plx \209; RUN: -r=%t/main.o,_ZN1B3barEj,plx \210; RUN: -r=%t/main.o,_ZTV1B,plx \211; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \212; RUN: -r=%t/main.o,_ZTS1B,plx \213; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \214; RUN: -r=%t/main.o,_ZTS2B0,plx \215; RUN: -r=%t/main.o,_ZTI2B0,plx \216; RUN: -r=%t/main.o,_ZTI1B,plx \217; RUN: -r=%t/main.o,_ZTV2B0,plx \218; RUN: -thinlto-threads=1 \219; RUN: -memprof-verify-ccg -memprof-verify-nodes -stats \220; RUN: -pass-remarks=. -save-temps \221; RUN: -o %t.out 2>&1 | FileCheck %s --check-prefix=STATS \222; RUN: --check-prefix=STATS-BE-NOIMPORT --check-prefix=REMARKS-MAIN \223; RUN: --check-prefix=REMARKS-FOO224 225; RUN: llvm-dis %t.out.2.4.opt.bc -o - | FileCheck %s --check-prefix=IR --check-prefix=IR-NOIMPORT226 227;; Run it gain but with -memprof-require-definition-for-promotion, and confirm228;; that no promotions occur.229; RUN: llvm-lto2 run %t/main.o %t/foo.o -enable-memprof-context-disambiguation \230; RUN: -import-instr-limit=0 \231; RUN: -memprof-require-definition-for-promotion \232; RUN: -icp-allow-decls=false \233; RUN: -enable-memprof-indirect-call-support=true \234; RUN: -supports-hot-cold-new \235; RUN: -r=%t/foo.o,_Z3fooR2B0j,plx \236; RUN: -r=%t/foo.o,_ZN2B03barEj.abc,plx \237; RUN: -r=%t/foo.o,_Z3xyzR2B0j, \238; RUN: -r=%t/foo.o,_ZN2B03barEj, \239; RUN: -r=%t/foo.o,_ZN1B3barEj, \240; RUN: -r=%t/main.o,_Z3fooR2B0j, \241; RUN: -r=%t/main.o,_Znwm, \242; RUN: -r=%t/main.o,_ZdlPvm, \243; RUN: -r=%t/main.o,_Z8externalPi, \244; RUN: -r=%t/main.o,main,plx \245; RUN: -r=%t/main.o,_ZN2B03barEj,plx \246; RUN: -r=%t/main.o,_ZN1B3barEj,plx \247; RUN: -r=%t/main.o,_ZTV1B,plx \248; RUN: -r=%t/main.o,_ZTVN10__cxxabiv120__si_class_type_infoE,plx \249; RUN: -r=%t/main.o,_ZTS1B,plx \250; RUN: -r=%t/main.o,_ZTVN10__cxxabiv117__class_type_infoE,plx \251; RUN: -r=%t/main.o,_ZTS2B0,plx \252; RUN: -r=%t/main.o,_ZTI2B0,plx \253; RUN: -r=%t/main.o,_ZTI1B,plx \254; RUN: -r=%t/main.o,_ZTV2B0,plx \255; RUN: -thinlto-threads=1 \256; RUN: -memprof-verify-ccg -memprof-verify-nodes \257; RUN: -pass-remarks=. \258; RUN: -o %t.out 2>&1 | FileCheck %s --implicit-check-not Promote259 260; REMARKS-MAIN: call in clone main assigned to call function clone _Z3fooR2B0j.memprof.1261; REMARKS-MAIN: call in clone main assigned to call function clone _Z3fooR2B0j.memprof.1262; REMARKS-MAIN: created clone _ZN2B03barEj.memprof.1263; REMARKS-MAIN: call in clone _ZN2B03barEj marked with memprof allocation attribute notcold264; REMARKS-MAIN: call in clone _ZN2B03barEj.memprof.1 marked with memprof allocation attribute cold265; REMARKS-MAIN: call in clone _ZN2B03barEj marked with memprof allocation attribute notcold266; REMARKS-MAIN: call in clone _ZN2B03barEj.memprof.1 marked with memprof allocation attribute cold267; REMARKS-MAIN: created clone _ZN1B3barEj.memprof.1268; REMARKS-MAIN: call in clone _ZN1B3barEj marked with memprof allocation attribute notcold269; REMARKS-MAIN: call in clone _ZN1B3barEj.memprof.1 marked with memprof allocation attribute cold270; REMARKS-MAIN: call in clone _ZN1B3barEj marked with memprof allocation attribute notcold271; REMARKS-MAIN: call in clone _ZN1B3barEj.memprof.1 marked with memprof allocation attribute cold272; REMARKS-FOO: created clone _Z3fooR2B0j.memprof.1273;; In each version of foo we should have promoted the indirect call to two conditional274;; direct calls, one to B::bar and one to B0::bar. The cloned version of foo should call275;; the cloned versions of bar for both promotions.276; REMARKS-FOO: Promote indirect call to _ZN1B3barEj with count 2 out of 4277; REMARKS-FOO: call in clone _Z3fooR2B0j promoted and assigned to call function clone _ZN1B3barEj278; REMARKS-FOO: Promote indirect call to _ZN1B3barEj with count 2 out of 4279; REMARKS-FOO: call in clone _Z3fooR2B0j.memprof.1 promoted and assigned to call function clone _ZN1B3barEj.memprof.1280; REMARKS-FOO: Promote indirect call to _ZN2B03barEj with count 2 out of 2281; REMARKS-FOO: call in clone _Z3fooR2B0j promoted and assigned to call function clone _ZN2B03barEj282; REMARKS-FOO: Promote indirect call to _ZN2B03barEj with count 2 out of 2283; REMARKS-FOO: call in clone _Z3fooR2B0j.memprof.1 promoted and assigned to call function clone _ZN2B03barEj.memprof.1284; REMARKS-FOO-IMPORT: created clone _ZN2B03barEj.memprof.1285; REMARKS-FOO-IMPORT: call in clone _ZN2B03barEj marked with memprof allocation attribute notcold286; REMARKS-FOO-IMPORT: call in clone _ZN2B03barEj.memprof.1 marked with memprof allocation attribute cold287; REMARKS-FOO-IMPORT: created clone _ZN1B3barEj.memprof.1288; REMARKS-FOO-IMPORT: call in clone _ZN1B3barEj marked with memprof allocation attribute notcold289; REMARKS-FOO-IMPORT: call in clone _ZN1B3barEj.memprof.1 marked with memprof allocation attribute cold290 291; STATS: 4 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during whole program analysis292; STATS-BE: 8 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend293; STATS-BE-NOIMPORT: 4 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend294; STATS: 4 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during whole program analysis295; STATS-BE: 8 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend296; STATS-BE-NOIMPORT: 4 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend297; STATS: 3 memprof-context-disambiguation - Number of function clones created during whole program analysis298; STATS-BE: 5 memprof-context-disambiguation - Number of function clones created during ThinLTO backend299; STATS-BE-NOIMPORT: 3 memprof-context-disambiguation - Number of function clones created during ThinLTO backend300 301; IR-NOIMPORT: foo302; IR: define {{.*}} @_Z3fooR2B0j(303; IR: %[[R1:[0-9]+]] = icmp eq ptr %0, @_ZN1B3barEj304; IR: br i1 %[[R1]], label %if.true.direct_targ, label %if.false.orig_indirect305; IR: if.true.direct_targ:306; IR-IMPORT: call {{.*}} @_Znwm(i64 noundef 4) #[[NOTCOLD:[0-9]+]]307; IR-NOIMPORT: call {{.*}} @_ZN1B3barEj(308; IR: if.false.orig_indirect:309; IR: %[[R2:[0-9]+]] = icmp eq ptr %0, @_ZN2B03barEj310; IR: br i1 %[[R2]], label %if.true.direct_targ1, label %if.false.orig_indirect2311; IR: if.true.direct_targ1:312; IR-IMPORT: call {{.*}} @_Znwm(i64 noundef 4) #[[NOTCOLD]]313; IR-NOIMPORT: call {{.*}} @_ZN2B03barEj(314; IR: if.false.orig_indirect2:315; IR: call {{.*}} %0316 317; IR: define {{.*}} @_Z3fooR2B0j.memprof.1(318;; We should still compare against the original versions of bar since that is319;; what is in the vtable. However, we should have called the cloned versions320;; that perform cold allocations, which were subsequently inlined.321; IR: %[[R3:[0-9]+]] = icmp eq ptr %0, @_ZN1B3barEj322; IR: br i1 %[[R3]], label %if.true.direct_targ, label %if.false.orig_indirect323; IR: if.true.direct_targ:324; IR-IMPORT: call {{.*}} @_Znwm(i64 noundef 4) #[[COLD:[0-9]+]]325; IR-NOIMPORT: call {{.*}} @_ZN1B3barEj.memprof.1(326; IR: if.false.orig_indirect:327; IR: %[[R4:[0-9]+]] = icmp eq ptr %0, @_ZN2B03barEj328; IR: br i1 %[[R4]], label %if.true.direct_targ1, label %if.false.orig_indirect2329; IR: if.true.direct_targ1:330; IR-IMPORT: call {{.*}} @_Znwm(i64 noundef 4) #[[COLD]]331; IR-NOIMPORT: call {{.*}} @_ZN2B03barEj.memprof.1(332; IR: if.false.orig_indirect2:333; IR: call {{.*}} %0334 335; IR-IMPORT: attributes #[[NOTCOLD]] = {{.*}} "memprof"="notcold"336; IR-IMPORT: attributes #[[COLD]] = {{.*}} "memprof"="cold"337 338; STATS-BE-DISTRIB: 4 memprof-context-disambiguation - Number of cold static allocations (possibly cloned) during ThinLTO backend339; STATS-BE-DISTRIB: 4 memprof-context-disambiguation - Number of not cold static allocations (possibly cloned) during ThinLTO backend340; STATS-BE-DISTRIB: 3 memprof-context-disambiguation - Number of function clones created during ThinLTO backend341 342;--- foo.ll343target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"344target triple = "x86_64-unknown-linux-gnu"345 346declare i32 @_Z3xyzR2B0j(ptr %b)347 348;; Add a function that has the same name as one of the indirect callees, but349;; with a suffix, to make sure we don't incorrectly pick the wrong one as the350;; promoted target (which happens if we attempt to canonicalize the names351;; when building the ICP symtab).352define i32 @_ZN2B03barEj.abc(ptr %this, i32 %s) {353 ret i32 0354}355 356declare i32 @_ZN2B03barEj(ptr %this, i32 %s)357declare i32 @_ZN1B3barEj(ptr %this, i32 %s)358 359define i32 @_Z3fooR2B0j(ptr %b) {360entry:361 %0 = load ptr, ptr %b, align 8362 %call = tail call i32 %0(ptr null, i32 0), !prof !0, !callsite !1363 ;; Add a dummy call to ensure that we have some callsite metadata,364 ;; which triggers callsite record checking in the ThinLTO backend365 ;; even with -enable-memprof-indirect-call-support=false.366 %call2 = call i32 @_Z3xyzR2B0j(ptr null, i32 0), !callsite !2367 ret i32 0368}369 370!0 = !{!"VP", i32 0, i64 4, i64 4445083295448962937, i64 2, i64 -2718743882639408571, i64 2}371!1 = !{i64 -2101080423462424381}372!2 = !{i64 1234}373 374;--- main.ll375target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"376target triple = "x86_64-unknown-linux-gnu"377 378@_ZTV1B = external constant { [3 x ptr] }379@_ZTVN10__cxxabiv120__si_class_type_infoE = external global [0 x ptr]380@_ZTS1B = external constant [3 x i8]381@_ZTVN10__cxxabiv117__class_type_infoE = external global [0 x ptr]382@_ZTS2B0 = external constant [4 x i8]383@_ZTI2B0 = external constant { ptr, ptr }384@_ZTI1B = external constant { ptr, ptr, ptr }385@_ZTV2B0 = external constant { [3 x ptr] }386 387define i32 @main() !prof !29 {388entry:389 %call2 = call i32 @_Z3fooR2B0j(ptr null, i32 0), !callsite !30390 %call4 = call i32 @_Z3fooR2B0j(ptr null, i32 0), !callsite !31391 %call6 = call i32 @_Z3fooR2B0j(ptr null, i32 0), !callsite !32392 ret i32 0393}394 395declare i32 @_Z3fooR2B0j(ptr, i32)396 397define i32 @_ZN2B03barEj(ptr %this, i32 %s) {398entry:399 %call = tail call ptr @_Znwm(i64 noundef 4) #0, !memprof !33, !callsite !38400 ;; Second allocation in this function, to ensure that indirect edges to the401 ;; same callee are partitioned correctly.402 %call2 = tail call ptr @_Znwm(i64 noundef 4) #0, !memprof !45, !callsite !50403 store volatile i32 0, ptr %call, align 4404 ret i32 0405}406 407declare ptr @_Znwm(i64)408 409declare void @_Z8externalPi()410 411declare void @_ZdlPvm()412 413define i32 @_ZN1B3barEj(ptr %this, i32 %s) {414entry:415 %call = tail call ptr @_Znwm(i64 noundef 4) #0, !memprof !39, !callsite !44416 ;; Second allocation in this function, to ensure that indirect edges to the417 ;; same callee are partitioned correctly.418 %call2 = tail call ptr @_Znwm(i64 noundef 4) #0, !memprof !51, !callsite !56419 store volatile i32 0, ptr %call, align 4420 ret i32 0421}422 423; uselistorder directives424uselistorder ptr @_Z3fooR2B0j, { 2, 1, 0 }425 426attributes #0 = { builtin allocsize(0) }427 428!llvm.module.flags = !{!0}429 430!0 = !{i32 1, !"ProfileSummary", !1}431!1 = !{!2, !3, !4, !5, !6, !7, !8, !9, !10, !11}432!2 = !{!"ProfileFormat", !"InstrProf"}433!3 = !{!"TotalCount", i64 13}434!4 = !{!"MaxCount", i64 4}435!5 = !{!"MaxInternalCount", i64 0}436!6 = !{!"MaxFunctionCount", i64 4}437!7 = !{!"NumCounts", i64 5}438!8 = !{!"NumFunctions", i64 5}439!9 = !{!"IsPartialProfile", i64 0}440!10 = !{!"PartialProfileRatio", double 0.000000e+00}441!11 = !{!"DetailedSummary", !12}442!12 = !{!13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28}443!13 = !{i32 10000, i64 0, i32 0}444!14 = !{i32 100000, i64 4, i32 2}445!15 = !{i32 200000, i64 4, i32 2}446!16 = !{i32 300000, i64 4, i32 2}447!17 = !{i32 400000, i64 4, i32 2}448!18 = !{i32 500000, i64 4, i32 2}449!19 = !{i32 600000, i64 4, i32 2}450!20 = !{i32 700000, i64 2, i32 4}451!21 = !{i32 800000, i64 2, i32 4}452!22 = !{i32 900000, i64 2, i32 4}453!23 = !{i32 950000, i64 2, i32 4}454!24 = !{i32 990000, i64 2, i32 4}455!25 = !{i32 999000, i64 2, i32 4}456!26 = !{i32 999900, i64 2, i32 4}457!27 = !{i32 999990, i64 2, i32 4}458!28 = !{i32 999999, i64 2, i32 4}459!29 = !{!"function_entry_count", i64 1}460!30 = !{i64 -6490791336773930154}461!31 = !{i64 5188446645037944434}462!32 = !{i64 5583420417449503557}463!33 = !{!34, !36}464!34 = !{!35, !"notcold"}465!35 = !{i64 -852997907418798798, i64 -2101080423462424381, i64 5188446645037944434}466!36 = !{!37, !"cold"}467!37 = !{i64 -852997907418798798, i64 -2101080423462424381, i64 5583420417449503557}468!38 = !{i64 -852997907418798798}469!39 = !{!40, !42}470!40 = !{!41, !"notcold"}471!41 = !{i64 4457553070050523782, i64 -2101080423462424381, i64 132626519179914298}472!42 = !{!43, !"cold"}473!43 = !{i64 4457553070050523782, i64 -2101080423462424381, i64 -6490791336773930154}474!44 = !{i64 4457553070050523782}475!45 = !{!46, !48}476!46 = !{!47, !"notcold"}477!47 = !{i64 456, i64 -2101080423462424381, i64 5188446645037944434}478!48 = !{!49, !"cold"}479!49 = !{i64 456, i64 -2101080423462424381, i64 5583420417449503557}480!50 = !{i64 456}481!51 = !{!52, !54}482!52 = !{!53, !"notcold"}483!53 = !{i64 789, i64 -2101080423462424381, i64 132626519179914298}484!54 = !{!55, !"cold"}485!55 = !{i64 789, i64 -2101080423462424381, i64 -6490791336773930154}486!56 = !{i64 789}487