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

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 11:31:21 PDT 2016


hfinkel 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();
----------------
arsenm wrote:
> 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
Do you mean a verifier check that a function that might throw is marked as speculatable? I'm not sure that's a good idea.


https://reviews.llvm.org/D22413





More information about the llvm-commits mailing list