[PATCH] D22413: [ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable attribute
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 10:05:17 PDT 2016
hfinkel accepted this revision.
hfinkel added a comment.
This revision is now accepted and ready to land.
In https://reviews.llvm.org/D22413#485588, @arsenm wrote:
> Doesn't the SpeculativeExecution already considered the TTI cost for this anyway?
SimplifyCFG does, so we seem to be okay there.
This LGTM.
================
Comment at: lib/Analysis/ValueTracking.cpp:3120-3121
@@ -3119,2 +3119,4 @@
}
case Instruction::Call: {
+ const CallInst *CI = cast<CallInst>(Inst);
+ const Function *Callee = CI->getCalledFunction();
----------------
arsenm wrote:
> Is invoke allowed to be speculatable?
No. The invoked function might throw. If it can't throw, then we'll convert it into a regular call during simplification.
https://reviews.llvm.org/D22413
More information about the llvm-commits
mailing list