Skip to content

Commit 869962f

Browse files
author
Chad Rosier
committed
[LIR] Push check into helper function. NFC.
llvm-svn: 254416
1 parent 43aef4c commit 869962f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ static unsigned getStoreStride(const SCEVAddRecExpr *StoreEv) {
257257
}
258258

259259
bool LoopIdiomRecognize::isLegalStore(StoreInst *SI) {
260+
// Don't touch volatile stores.
261+
if (!SI->isSimple())
262+
return false;
263+
260264
Value *StoredVal = SI->getValueOperand();
261265
Value *StorePtr = SI->getPointerOperand();
262266

@@ -287,10 +291,6 @@ void LoopIdiomRecognize::collectStores(BasicBlock *BB) {
287291
if (!SI)
288292
continue;
289293

290-
// Don't touch volatile stores.
291-
if (!SI->isSimple())
292-
continue;
293-
294294
// Make sure this is a strided store with a constant stride.
295295
if (!isLegalStore(SI))
296296
continue;

0 commit comments

Comments
 (0)