summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-24 02:37:54 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-24 02:37:54 +0000
commit46c97e626f0c99bc271f212242446186ed3c2474 (patch)
treede4eec7fce067e013c111f5af13b55fbdc5a8d44 /llvm/lib/Transforms
parentac3531247ffee105e0c0c9ac07f625e92546319c (diff)
downloadbcm5719-llvm-46c97e626f0c99bc271f212242446186ed3c2474.tar.gz
bcm5719-llvm-46c97e626f0c99bc271f212242446186ed3c2474.zip
Allow i16 type indices to gep.
llvm-svn: 69946
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 0d32eacbb17..a2658b3e3f1 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud