diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-14 17:17:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-14 17:17:59 +0000 |
commit | 6f7f02fdeccf33f5d3a1684945a04a3c1eaee72e (patch) | |
tree | d74d2d5b05f58464df900db3e3d0fdfcc4c2f42c /lib/Transforms | |
parent | 3ca6d8bf85f80f8dbd134342b10dd77b21554c43 (diff) |
Fix a compile crash on spiff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 948eb32904..840dbd47d4 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2123,16 +2123,13 @@ static Value *EmitGEPOffset(User *GEP, Instruction &I, InstCombiner &IC) { } } } else { - //if (Op->getType() != Scale->getType()) - if (Size != 1) { - // Convert to correct type. - Op = IC.InsertNewInstBefore(new CastInst(Op, SIntPtrTy, - Op->getName()+".c"), I); - + // Convert to correct type. + Op = IC.InsertNewInstBefore(new CastInst(Op, SIntPtrTy, + Op->getName()+".c"), I); + if (Size != 1) // We'll let instcombine(mul) convert this to a shl if possible. Op = IC.InsertNewInstBefore(BinaryOperator::createMul(Op, Scale, GEP->getName()+".idx"), I); - } // Emit an add instruction. Result = IC.InsertNewInstBefore(BinaryOperator::createAdd(Op, Result, |