[PATCH] D22413: [ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable attribute

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 11:28:35 PDT 2016


arsenm added inline comments.

================
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();
----------------
hfinkel wrote:
> tstellarAMD wrote:
> > hfinkel wrote:
> > > 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.
> > So do I need to check for invoke here, or is it safe to assume that functions referenced by invoke will never have the speculatable attribute.?
> No, I don't think so.
A verifier check should probably be added in the other patch for this if it isn't already there


https://reviews.llvm.org/D22413





More information about the llvm-commits mailing list