diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-18 20:35:00 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-18 20:35:00 +0000 |
commit | d62284a8040024afeb8777b514c34912e939b801 (patch) | |
tree | 9f8aa3d5d2b2c9957164dbea8f4cb05310957d55 /lib/Transforms/Scalar/CodeGenPrepare.cpp | |
parent | 15c94d08ab2be2e3d00de4edbfc7adde6545a7db (diff) |
Fix rdar://6505632, an llc crash on 483.xalancbmk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index be7ed9c508..59c6586532 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -688,7 +688,8 @@ bool AddressingModeMatcher::MatchScaledValue(Value *ScaleReg, int64_t Scale, // to see if ScaleReg is actually X+C. If so, we can turn this into adding // X*Scale + C*Scale to addr mode. ConstantInt *CI; Value *AddLHS; - if (match(ScaleReg, m_Add(m_Value(AddLHS), m_ConstantInt(CI)))) { + if (isa<Instruction>(ScaleReg) && // not a constant expr. + match(ScaleReg, m_Add(m_Value(AddLHS), m_ConstantInt(CI)))) { TestAddrMode.ScaledReg = AddLHS; TestAddrMode.BaseOffs += CI->getSExtValue()*TestAddrMode.Scale; |