[llvm] r254416 - [LIR] Push check into helper function. NFC.

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 06:26:36 PST 2015


Author: mcrosier
Date: Tue Dec  1 08:26:35 2015
New Revision: 254416

URL: http://llvm.org/viewvc/llvm-project?rev=254416&view=rev
Log:
[LIR] Push check into helper function. NFC.

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

Modified: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp?rev=254416&r1=254415&r2=254416&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp Tue Dec  1 08:26:35 2015
@@ -257,6 +257,10 @@ static unsigned getStoreStride(const SCE
 }
 
 bool LoopIdiomRecognize::isLegalStore(StoreInst *SI) {
+  // Don't touch volatile stores.
+  if (!SI->isSimple())
+    return false;
+
   Value *StoredVal = SI->getValueOperand();
   Value *StorePtr = SI->getPointerOperand();
 
@@ -287,10 +291,6 @@ void LoopIdiomRecognize::collectStores(B
     if (!SI)
       continue;
 
-    // Don't touch volatile stores.
-    if (!SI->isSimple())
-      continue;
-
     // Make sure this is a strided store with a constant stride.
     if (!isLegalStore(SI))
       continue;




More information about the llvm-commits mailing list