betulb added inline comments. ================ Comment at: lib/CodeGen/CodeGenPGO.cpp:758 @@ -757,1 +757,3 @@ + if (dyn_cast<llvm::Constant>(ValuePtr)) + return; ---------------- davidxl wrote: > Is it the bitcast guaranteed to be already stripped here? No. ConstantExpr is derived from the Constant class. A ConstantExpr can only have other constants i.e. all immutable values as its operands. 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, thus they are instrumented in both clang FE and I believe in the IR based instrumentation as well . Instrumenting such calls is a waste of counters, runtime calls and dynamic memory at run time.
Repository: rL LLVM http://reviews.llvm.org/D18636 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits