diff options
author | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-24 02:37:54 +0000 |
---|---|---|
committer | Sanjiv Gupta <sanjiv.gupta@microchip.com> | 2009-04-24 02:37:54 +0000 |
commit | 7787d4a34b8db6dec10142ef8d85f28f881897cf (patch) | |
tree | 132bd2093c206fa866bd472837015d5b6610ea6c /lib/Transforms/Scalar | |
parent | ad62f53795ac3da0353afba7e83464679c91ce5c (diff) | |
download | external_llvm-7787d4a34b8db6dec10142ef8d85f28f881897cf.zip external_llvm-7787d4a34b8db6dec10142ef8d85f28f881897cf.tar.gz external_llvm-7787d4a34b8db6dec10142ef8d85f28f881897cf.tar.bz2 |
Allow i16 type indices to gep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69946 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 0d32eac..a2658b3 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -10695,12 +10695,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) { gep_type_iterator GTI = gep_type_begin(GEP); for (User::op_iterator i = GEP.op_begin() + 1, e = GEP.op_end(); i != e; ++i, ++GTI) { - // Before trying to eliminate/introduce cast/ext/trunc to make - // indices as pointer types, make sure that the pointer size - // makes a valid sequential index. - const SequentialType *ST = dyn_cast<SequentialType>(*GTI); - Value *PtrTypeVal = Constant::getNullValue(TD->getIntPtrType()); - if (ST && ST->indexValid(PtrTypeVal)) { + if (isa<SequentialType>(*GTI)) { if (CastInst *CI = dyn_cast<CastInst>(*i)) { if (CI->getOpcode() == Instruction::ZExt || CI->getOpcode() == Instruction::SExt) { |