summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-09-11 01:21:33 +0000
committerChris Lattner <sabre@nondot.org>2002-09-11 01:21:33 +0000
commit136dab7d86c77c69aae948501065432e8b9b1ced (patch)
tree730693988d2738a05db45fa22d2d43c00cc94528 /llvm/lib/Transforms
parentb9d9e0ff8d4c5c505212448109bf5d2825bde9c5 (diff)
downloadbcm5719-llvm-136dab7d86c77c69aae948501065432e8b9b1ced.tar.gz
bcm5719-llvm-136dab7d86c77c69aae948501065432e8b9b1ced.zip
- Change getelementptr instruction to use long indexes instead of uint
indexes for sequential types. llvm-svn: 3682
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp4
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
index a6d7e37cdb6..7a2ad4b03e1 100644
--- a/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
+++ b/llvm/lib/Transforms/Scalar/DecomposeMultiDimRefs.cpp
@@ -94,7 +94,7 @@ DecomposePass::decomposeArrayRef(GetElementPtrInst &GEP)
continue;
} else {
// Not the first index: include initial [0] to deref the last ptr
- Indices.push_back(Constant::getNullValue(Type::UIntTy));
+ Indices.push_back(Constant::getNullValue(Type::LongTy));
}
Indices.push_back(*OI);
@@ -110,7 +110,7 @@ DecomposePass::decomposeArrayRef(GetElementPtrInst &GEP)
// Get the final index vector, including an initial [0] as before.
std::vector<Value*> Indices;
- Indices.push_back(Constant::getNullValue(Type::UIntTy));
+ Indices.push_back(Constant::getNullValue(Type::LongTy));
Indices.push_back(*OI);
Value *NewVal = new GetElementPtrInst(LastPtr, Indices, GEP.getName(),
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 9c1076e4481..179f3b296ab 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -649,7 +649,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
// Is it 'getelementptr %P, uint 0' or 'getelementptr %P'
// If so, eliminate the noop.
if ((GEP.getNumOperands() == 2 &&
- GEP.getOperand(1) == Constant::getNullValue(Type::UIntTy)) ||
+ GEP.getOperand(1) == Constant::getNullValue(Type::LongTy)) ||
GEP.getNumOperands() == 1)
return ReplaceInstUsesWith(GEP, GEP.getOperand(0));
@@ -669,7 +669,7 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
*cast<Constant>(GEP.getOperand(1));
assert(Indices[0] != 0 && "Constant folding of uint's failed!?");
- } else if (*GEP.idx_begin() == ConstantUInt::get(Type::UIntTy, 0)) {
+ } else if (*GEP.idx_begin() == ConstantUInt::getNullValue(Type::LongTy)) {
// Otherwise we can do the fold if the first index of the GEP is a zero
Indices.insert(Indices.end(), Src->idx_begin(), Src->idx_end());
Indices.insert(Indices.end(), GEP.idx_begin()+1, GEP.idx_end());
OpenPOWER on IntegriCloud