[PATCH] D29306: Expose isLegalToPromot as a global helper function so that SamplePGO pass can call it for legality check.
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 30 14:42:45 PST 2017
danielcdh added inline comments.
================
Comment at: lib/Transforms/Instrumentation/IndirectCallPromotion.cpp:233
+ TargetFunction = Symtab->getFunction(Target);
+ if (TargetFunction == nullptr) {
+ *Reason = "Cannot find the target";
----------------
davidxl wrote:
> why hoisting this into the caller?
Because sample PGO does not take "Target" to identify TargetFunction. Instead, it directly uses Module->getFunction(Function_name) to get the "Function *".
https://reviews.llvm.org/D29306
More information about the llvm-commits
mailing list