From f1fc54f9516b1a6729bfaf70c543aa61b1b15123 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 26 Oct 2007 17:24:46 +0000 Subject: [PATCH] Fix a crash. Make sure TLI is not null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43384 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/LoopStrengthReduce.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index d81ea2b7994..c5fdc097345 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -972,7 +972,7 @@ bool LoopStrengthReduce::ValidStride(bool HasBaseReg, AM.Scale = Scale; // If load[imm+r*scale] is illegal, bail out. - if (!TLI->isLegalAddressingMode(AM, AccessTy)) + if (TLI && !TLI->isLegalAddressingMode(AM, AccessTy)) return false; } return true; -- 2.34.1