[llvm] r234653 - [RewriteStatepointsForGC] Missed review comment from 234651 & build fix

Philip Reames listmail at philipreames.com
Fri Apr 10 15:16:59 PDT 2015


Author: reames
Date: Fri Apr 10 17:16:58 2015
New Revision: 234653

URL: http://llvm.org/viewvc/llvm-project?rev=234653&view=rev
Log:
[RewriteStatepointsForGC] Missed review comment from 234651 & build fix

After submitting 234651, I noticed I hadn't responded to a review comment by mjacob.  This patch addresses that comment and fixes a Release only build problem due to an unused variable.  


Modified:
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=234653&r1=234652&r2=234653&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Fri Apr 10 17:16:58 2015
@@ -382,6 +382,7 @@ static Value *findBaseDefiningValue(Valu
   if (auto *EEI = dyn_cast<ExtractElementInst>(I)) {
     Value *VectorOperand = EEI->getVectorOperand();
     Value *VectorBase = findBaseOfVector(VectorOperand);
+    (void)VectorBase;
     assert(VectorBase && "extract element not known to be a trivial base");
     return EEI;
   }
@@ -2060,14 +2061,14 @@ bool RewriteStatepointsForGC::runOnFunct
   // consider those in reachable code since we need to ask dominance queries
   // when rewriting.  We'll delete the unreachable ones in a moment.
   SmallVector<CallSite, 64> ParsePointNeeded;
-  SmallVector<CallSite, 16> UnreachableStatepoints;
+  bool HasUnreachableStatepoint = false;
   for (Instruction &I : inst_range(F)) {
     // TODO: only the ones with the flag set!
     if (isStatepoint(I)) {
       if (DT.isReachableFromEntry(I.getParent()))
         ParsePointNeeded.push_back(CallSite(&I));
       else
-        UnreachableStatepoints.push_back(CallSite(&I));
+        HasUnreachableStatepoint = true;
     }
   }
 
@@ -2077,7 +2078,7 @@ bool RewriteStatepointsForGC::runOnFunct
   // statepoints surviving this pass.  This makes testing easier and the
   // resulting IR less confusing to human readers.  Rather than be fancy, we
   // just reuse a utility function which removes the unreachable blocks.
-  if (!UnreachableStatepoints.empty())
+  if (HasUnreachableStatepoint)
     MadeChange |= removeUnreachableBlocks(F);
 
   // Return early if no work to do.





More information about the llvm-commits mailing list