We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43aef4c commit 869962fCopy full SHA for 869962f
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -257,6 +257,10 @@ static unsigned getStoreStride(const SCEVAddRecExpr *StoreEv) {
257
}
258
259
bool LoopIdiomRecognize::isLegalStore(StoreInst *SI) {
260
+ // Don't touch volatile stores.
261
+ if (!SI->isSimple())
262
+ return false;
263
+
264
Value *StoredVal = SI->getValueOperand();
265
Value *StorePtr = SI->getPointerOperand();
266
@@ -287,10 +291,6 @@ void LoopIdiomRecognize::collectStores(BasicBlock *BB) {
287
291
if (!SI)
288
292
continue;
289
293
290
- // Don't touch volatile stores.
- if (!SI->isSimple())
- continue;
-
294
// Make sure this is a strided store with a constant stride.
295
if (!isLegalStore(SI))
296
0 commit comments