Fix a spelling error in the description of a statistic. NFC
[oota-llvm.git] / lib / CodeGen / Analysis.cpp
index 33ad88358e57517593e5d182041545a3c6582a3d..98d4c8afc7b98b0c2ce53e390f1b0c1669e0957b 100644 (file)
@@ -506,16 +506,18 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, const TargetMachine &TM) {
 
   // If I will have a chain, make sure no other instruction that will have a
   // chain interposes between I and the return.
-  for (BasicBlock::const_iterator BBI = std::prev(ExitBB->end(), 2);; --BBI) {
-    if (&*BBI == I)
-      break;
-    // Debug info intrinsics do not get in the way of tail call optimization.
-    if (isa<DbgInfoIntrinsic>(BBI))
-      continue;
-    if (BBI->mayHaveSideEffects() || BBI->mayReadFromMemory() ||
-        !isSafeToSpeculativelyExecute(BBI))
-      return false;
-  }
+  if (I->mayHaveSideEffects() || I->mayReadFromMemory() ||
+      !isSafeToSpeculativelyExecute(I))
+    for (BasicBlock::const_iterator BBI = std::prev(ExitBB->end(), 2);; --BBI) {
+      if (&*BBI == I)
+        break;
+      // Debug info intrinsics do not get in the way of tail call optimization.
+      if (isa<DbgInfoIntrinsic>(BBI))
+        continue;
+      if (BBI->mayHaveSideEffects() || BBI->mayReadFromMemory() ||
+          !isSafeToSpeculativelyExecute(BBI))
+        return false;
+    }
 
   const Function *F = ExitBB->getParent();
   return returnTypeIsEligibleForTailCall(