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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 13:40:33 PDT 2016


arsenm added inline comments.

================
Comment at: lib/Analysis/ValueTracking.cpp:3120-3125
@@ -3119,4 +3119,8 @@
   }
   case Instruction::Call: {
+    auto *CI = cast<const CallInst>(Inst);
+    const Function *Callee = CI->getCalledFunction();
+    if (Callee && Callee->isSpeculatable())
+      return true;
     if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) {
       switch (II->getIntrinsicID()) {
----------------
I mean the opposite, that an invoke never has a speculatable 


https://reviews.llvm.org/D22413





More information about the llvm-commits mailing list