From 6979eb43962a1a5ad230f01cb5213f3490d22afd Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 1 Dec 2015 14:26:35 +0000 Subject: [PATCH] [LIR] Push check into helper function. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254416 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index a3658ed6497..9dc41ba2f32 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -257,6 +257,10 @@ static unsigned getStoreStride(const SCEVAddRecExpr *StoreEv) { } 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(BasicBlock *BB) { 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; -- 2.34.1