[llvm-commits] [llvm] r96135 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp

John McCall rjmccall at apple.com
Sat Feb 13 15:40:17 PST 2010


Author: rjmccall
Date: Sat Feb 13 17:40:16 2010
New Revision: 96135

URL: http://llvm.org/viewvc/llvm-project?rev=96135&view=rev
Log:
Make LSR not crash if invoked without target lowering info, e.g. if invoked
from opt.


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

Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=96135&r1=96134&r2=96135&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Sat Feb 13 17:40:16 2010
@@ -1535,10 +1535,10 @@
             const Type *AccessTy = getAccessType(UI->getUser());
             TargetLowering::AddrMode AM;
             AM.Scale = D->getValue()->getSExtValue();
-            if (TLI->isLegalAddressingMode(AM, AccessTy))
+            if (TLI && TLI->isLegalAddressingMode(AM, AccessTy))
               goto decline_post_inc;
             AM.Scale = -AM.Scale;
-            if (TLI->isLegalAddressingMode(AM, AccessTy))
+            if (TLI && TLI->isLegalAddressingMode(AM, AccessTy))
               goto decline_post_inc;
           }
         }





More information about the llvm-commits mailing list