brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.8 KiB · 8303d6d Raw
146 lines · plain
1;; Make sure we assign the original callsite to a function clone (which will be2;; the original function clone), even when we cannot update its caller (due to3;; missing metadata e.g. from mismatched profiles). Otherwise we will try to use4;; the original function for a different clone, leading to confusion later when5;; rewriting the calls.6 7;; -stats requires asserts8; REQUIRES: asserts9 10; RUN: opt -thinlto-bc %s >%t.o11; RUN: llvm-lto2 run %t.o -enable-memprof-context-disambiguation \12; RUN:  -supports-hot-cold-new \13; RUN:  -r=%t.o,A,plx \14; RUN:  -r=%t.o,B,plx \15; RUN:  -r=%t.o,C,plx \16; RUN:  -r=%t.o,D,plx \17; RUN:  -r=%t.o,E,plx \18; RUN:  -r=%t.o,F,plx \19; RUN:  -r=%t.o,G,plx \20; RUN:  -r=%t.o,A1,plx \21; RUN:  -r=%t.o,B1,plx \22; RUN:  -r=%t.o,_Znwm, \23; RUN:  -memprof-verify-ccg -memprof-verify-nodes -debug-only=memprof-context-disambiguation \24; RUN:  -stats -pass-remarks=memprof-context-disambiguation -save-temps \25; RUN:  -o %t.out 2>&1 | FileCheck %s \26; RUN:	--implicit-check-not="Mismatch in call clone assignment" \27; RUN:	--implicit-check-not="Number of callsites assigned to call multiple non-matching clones"28 29; RUN: llvm-dis %t.out.1.4.opt.bc -o - | FileCheck %s --check-prefix=IR30 31; ModuleID = '<stdin>'32source_filename = "reduced.ll"33target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"34target triple = "x86_64-unknown-linux-gnu"35 36; IR-LABEL: define dso_local void @A()37define void @A() #0 {38  ; IR: call void @C()39  call void @C()40  ret void41}42 43; IR-LABEL: define dso_local void @B()44define void @B() #0 {45  ; IR: call void @C.memprof.1()46  call void @C(), !callsite !147  ret void48}49 50; IR-LABEL: define dso_local void @C()51define void @C() #0 {52  ; IR: call void @F()53  call void @F(), !callsite !1654  ; IR: call void @D()55  call void @D(), !callsite !256  ret void57}58 59; IR-LABEL: define dso_local void @D()60define void @D() #0 {61  ; IR: call void @E()62  call void @E(), !callsite !363  ; IR: call void @G()64  call void @G(), !callsite !1765  ret void66}67 68; IR-LABEL: define dso_local void @E()69define void @E() #0 {70  ; IR: call ptr @_Znwm(i64 0) #[[NOTCOLD:[0-9]+]]71  %1 = call ptr @_Znwm(i64 0), !memprof !4, !callsite !972  ret void73}74 75; IR-LABEL: define dso_local void @F()76define void @F() #0 {77  ; IR: call void @G()78  call void @G(), !callsite !1779  ret void80}81 82; IR-LABEL: define dso_local void @G()83define void @G() #0 {84  ; IR: call ptr @_Znwm(i64 0) #[[NOTCOLD]]85  %2 = call ptr @_Znwm(i64 0), !memprof !10, !callsite !1586  ret void87}88 89; IR-LABEL: define dso_local void @A1()90define void @A1() #0 {91  ; IR: call void @C()92  call void @C(), !callsite !1893  ret void94}95 96; IR-LABEL: define dso_local void @B1()97define void @B1() #0 {98  ; IR: call void @C.memprof.1()99  call void @C(), !callsite !19100  ret void101}102 103; IR-LABEL: define dso_local void @C.memprof.1()104  ; IR: call void @F.memprof.1()105  ; IR: call void @D.memprof.1()106 107; IR-LABEL: define dso_local void @D.memprof.1()108  ; IR: call void @E.memprof.1()109  ; IR: call void @G()110 111; IR-LABEL: define dso_local void @E.memprof.1()112  ; IR: call ptr @_Znwm(i64 0) #[[COLD:[0-9]+]]113 114; IR-LABEL: define dso_local void @F.memprof.1()115  ; IR: call void @G.memprof.1()116 117; IR-LABEL: define dso_local void @G.memprof.1()118  ; IR: call ptr @_Znwm(i64 0) #[[COLD]]119 120declare ptr @_Znwm(i64)121 122attributes #0 = { noinline optnone }123; IR: attributes #[[NOTCOLD]] = { "memprof"="notcold" }124; IR: attributes #[[COLD]] = { "memprof"="cold" }125 126!0 = !{i64 123}127!1 = !{i64 234}128!2 = !{i64 345}129!3 = !{i64 456}130!4 = !{!5, !7}131!5 = !{!6, !"notcold"}132!6 = !{i64 567, i64 456, i64 345, i64 123}133!7 = !{!8, !"cold"}134!8 = !{i64 567, i64 456, i64 345, i64 234}135!9 = !{i64 567}136!10 = !{!11, !13}137!11 = !{!12, !"notcold"}138!12 = !{i64 678, i64 891, i64 789, i64 912}139!13 = !{!14, !"cold"}140!14 = !{i64 678, i64 891, i64 789, i64 812}141!15 = !{i64 678}142!16 = !{i64 789}143!17 = !{i64 891}144!18 = !{i64 912}145!19 = !{i64 812}146