1; RUN: opt < %s -inline -pass-remarks=inline -pass-remarks-missed=inline \ 2; RUN: -pass-remarks-analysis=inline -S 2>&1 | \ 3; RUN: FileCheck -check-prefix=CHECK -check-prefix=NO_HOTNESS %s 4; RUN: opt < %s -inline -pass-remarks=inline -pass-remarks-missed=inline \ 5; RUN: -pass-remarks-analysis=inline -pass-remarks-with-hotness -S 2>&1 | \ 6; RUN: FileCheck -check-prefix=CHECK -check-prefix=HOTNESS %s 7 8; RUN: opt < %s -passes=inline -pass-remarks=inline -pass-remarks-missed=inline \ 9; RUN: -pass-remarks-analysis=inline -S 2>&1 | \ 10; RUN: FileCheck -check-prefix=CHECK -check-prefix=NO_HOTNESS %s 11; RUN: opt < %s -passes=inline -pass-remarks=inline -pass-remarks-missed=inline \ 12; RUN: -pass-remarks-analysis=inline -pass-remarks-with-hotness -S 2>&1 | \ 13; RUN: FileCheck -check-prefix=CHECK -check-prefix=HOTNESS_NEW %s 14 15; HOTNESS: fox will not be inlined into bar because its definition is unavailable 16; NO_HOTNESS-NOT: fox will not be inlined into bar because its definition is unavailable 17; NewPM's inliner does not emit the following remark: 18; HOTNESS_NEW-NOT: fox will not be inlined into bar because its definition is unavailable 19; CHECK: foo inlined into bar with cost=always 20; CHECK: foz not inlined into bar because it should never be inlined (cost=never) 21 22; Function Attrs: alwaysinline nounwind uwtable 23define i32 @foo(i32 %x, i32 %y) #0 !prof !1 { 24entry: 25 %x.addr = alloca i32, align 4 26 %y.addr = alloca i32, align 4 27 store i32 %x, i32* %x.addr, align 4 28 store i32 %y, i32* %y.addr, align 4 29 %0 = load i32, i32* %x.addr, align 4 30 %1 = load i32, i32* %y.addr, align 4 31 %add = add nsw i32 %0, %1 32 ret i32 %add 33} 34 35; Function Attrs: noinline nounwind uwtable 36define float @foz(i32 %x, i32 %y) #1 !prof !1 { 37entry: 38 %x.addr = alloca i32, align 4 39 %y.addr = alloca i32, align 4 40 store i32 %x, i32* %x.addr, align 4 41 store i32 %y, i32* %y.addr, align 4 42 %0 = load i32, i32* %x.addr, align 4 43 %1 = load i32, i32* %y.addr, align 4 44 %mul = mul nsw i32 %0, %1 45 %conv = sitofp i32 %mul to float 46 ret float %conv 47} 48 49declare i32 @fox() 50 51; Function Attrs: nounwind uwtable 52define i32 @bar(i32 %j) #2 !prof !1 { 53entry: 54 %j.addr = alloca i32, align 4 55 store i32 %j, i32* %j.addr, align 4 56 %0 = load i32, i32* %j.addr, align 4 57 %1 = load i32, i32* %j.addr, align 4 58 %sub = sub nsw i32 %1, 2 59 %call = call i32 @foo(i32 %0, i32 %sub) 60 %conv = sitofp i32 %call to float 61 %2 = load i32, i32* %j.addr, align 4 62 %sub1 = sub nsw i32 %2, 2 63 %3 = load i32, i32* %j.addr, align 4 64 %call2 = call float @foz(i32 %sub1, i32 %3) 65 %mul = fmul float %conv, %call2 66 %conv3 = fptosi float %mul to i32 67 %call3 = call i32 @fox() 68 %add = add i32 %conv3, %call 69 ret i32 %add 70} 71 72attributes #0 = { alwaysinline nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 73attributes #1 = { noinline nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 74attributes #2 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } 75 76!llvm.ident = !{!0} 77 78!0 = !{!"clang version 3.5.0 "} 79!1 = !{!"function_entry_count", i64 10} 80