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
This commit is contained in:
Evan Cheng 2007-10-26 17:24:46 +00:00
parent 8d9d74eaa8
commit f1fc54f951

View File

@ -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;