fix a crasher in disabled code (on variable stride loops)
authorChris Lattner <sabre@nondot.org>
Mon, 21 Feb 2011 17:02:55 +0000 (17:02 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Feb 2011 17:02:55 +0000 (17:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126125 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopIdiomRecognize.cpp

index 568a143742350bcbb39bea4af0f2f54141af96b4..f8ce214750acaffd51b0c5465d0435e5470d8155 100644 (file)
@@ -281,7 +281,7 @@ bool LoopIdiomRecognize::processLoopStore(StoreInst *SI, const SCEV *BECount) {
     // TODO: Could also handle negative stride here someday, that will require
     // the validity check in mayLoopAccessLocation to be updated though.
     // Enable this to print exact negative strides.
-    if (0 && StoreSize == -Stride->getValue()->getValue()) {
+    if (0 && Stride && StoreSize == -Stride->getValue()->getValue()) {
       dbgs() << "NEGATIVE STRIDE: " << *SI << "\n";
       dbgs() << "BB: " << *SI->getParent();
     }