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 | 64b7bd7f9e1d1965d90d20f4324c0c6ea66726e6 (patch) | |
| tree | aea46e08817f1ba8e9303d4eb4710b07635b9fc4 /llvm/lib | |
| parent | 9018ca711a4c61a031fcaddcb71492dda0bc221e (diff) | |
| download | bcm5719-llvm-64b7bd7f9e1d1965d90d20f4324c0c6ea66726e6.tar.gz bcm5719-llvm-64b7bd7f9e1d1965d90d20f4324c0c6ea66726e6.zip | |
Fix rdar://6505632, an llc crash on 483.xalancbmk
llvm-svn: 62470
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index be7ed9c508c..59c6586532c 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/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; |

