1 ; RUN: opt < %s -pgo-icall-prom -pass-remarks-missed=pgo-icall-prom -S 2>& 1 | FileCheck %s 2 ; RUN: opt < %s -passes=pgo-icall-prom -pass-remarks-missed=pgo-icall-prom -S 2>& 1 | FileCheck %s 3 4 ; CHECK: remark: <unknown>:0:0: Cannot promote indirect call to func4 with count of 1234: The number of arguments mismatch 5 ; CHECK: remark: <unknown>:0:0: Cannot promote indirect call to 11517462787082255043 with count of 2345: Cannot find the target 6 ; CHECK: remark: <unknown>:0:0: Cannot promote indirect call to func2 with count of 7890: Return type mismatch 7 8 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 9 target triple = "x86_64-unknown-linux-gnu" 10 11 @foo = common global i32 ()* null, align 8 12 @foo2 = common global i32 ()* null, align 8 13 @foo3 = common global i32 ()* null, align 8 14 15 define i32 @func4(i32 %i) { 16 entry: 17 ret i32 %i 18 } 19 20 define void @func2() { 21 entry: 22 ret void 23 } 24 25 define i32 @bar() { 26 entry: 27 %tmp = load i32 ()*, i32 ()** @foo, align 8 28 %call = call i32 %tmp(), !prof !1 29 %tmp2 = load i32 ()*, i32 ()** @foo2, align 8 30 %call1 = call i32 %tmp2(), !prof !2 31 %add = add nsw i32 %call1, %call 32 %tmp3 = load i32 ()*, i32 ()** @foo3, align 8 33 %call2 = call i32 %tmp3(), !prof !3 34 %add2 = add nsw i32 %add, %call2 35 ret i32 %add2 36 } 37 38 !1 = !{!"VP", i32 0, i64 1801, i64 7651369219802541373, i64 1234, i64 -4377547752858689819, i64 567} 39 !2 = !{!"VP", i32 0, i64 3023, i64 -6929281286627296573, i64 2345, i64 -4377547752858689819, i64 678} 40 !3 = !{!"VP", i32 0, i64 7890, i64 -4377547752858689819, i64 7890} 41