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 | 7aa41cfa88ae99880e86e5091266900982db4a75 (patch) | |
| tree | 9eae8a64bf7b50550f2823f4e2020c8630e5a046 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
| parent | b12e290f8a2d3872a972aa39431699f2ff28cbfc (diff) | |
| download | bcm5719-llvm-7aa41cfa88ae99880e86e5091266900982db4a75.tar.gz bcm5719-llvm-7aa41cfa88ae99880e86e5091266900982db4a75.zip | |
Fix a compile crash on spiff
llvm-svn: 19552
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 948eb329040..840dbd47d43 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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, |

