llvm.org GIT mirror llvm / d163758
[PGO] Avoid instrumenting direct callee's at value sites. Direct callees' that are cast to other function prototypes, show up in the Call/Invoke instructions as ConstantExpr's. Currently llvm::CallSite's getCalledFunction() fails to return the callees in such expressions as direct calls. Value profiling should avoid instrumenting such cases. Mostly NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265330 91177308-0d34-0410-b5e6-96231b3b80d8 Betul Buyukkurt 3 years ago
2 changed file(s) with 12 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
2727 if (CI->isInlineAsm())
2828 return;
2929 }
30 if (isa(CS.getCalledValue()))
31 return;
3032 IndirectCallInsts.push_back(I);
3133 }
3234 };
1313 ret i32 0
1414 }
1515
16 define i32 @f2() {
17 entry:
18 ; CHECK: call void @llvm.instrprof.increment
19 ; CHECK-NOT: call void @llvm.instrprof.value.profile
20 call void (i32, ...) bitcast (void (...)* @foo to void (i32, ...)*)(i32 21)
21 ret i32 0
22 }
23
24 declare void @foo(...) #0
25
1626 attributes #0 = { nounwind }