diff options
author | Chris Lattner <sabre@nondot.org> | 2004-04-05 01:30:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-04-05 01:30:19 +0000 |
commit | 69193f93b689d3cc03ec9e685d662003d06134ea (patch) | |
tree | ed36e2aa107383c32cc79bfb71deb1547afed277 /llvm/lib/Transforms/LevelRaise.cpp | |
parent | fd9fbe187d9d4143f07f575f0722f185ab0ce945 (diff) | |
download | bcm5719-llvm-69193f93b689d3cc03ec9e685d662003d06134ea.tar.gz bcm5719-llvm-69193f93b689d3cc03ec9e685d662003d06134ea.zip |
Support getelementptr instructions which use uint's to index into structure
types and can have arbitrary 32- and 64-bit integer types indexing into
sequential types.
llvm-svn: 12653
Diffstat (limited to 'llvm/lib/Transforms/LevelRaise.cpp')
-rw-r--r-- | llvm/lib/Transforms/LevelRaise.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/LevelRaise.cpp b/llvm/lib/Transforms/LevelRaise.cpp index edc42b7a56c..aeb836d4b7e 100644 --- a/llvm/lib/Transforms/LevelRaise.cpp +++ b/llvm/lib/Transforms/LevelRaise.cpp @@ -370,9 +370,8 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { // Build the index vector, full of all zeros std::vector<Value*> Indices; - Indices.push_back(ConstantSInt::get(Type::LongTy, 0)); // FIXME, PR82 + Indices.push_back(Constant::getNullValue(Type::UIntTy)); while (CurCTy && !isa<PointerType>(CurCTy)) { - const Type *IdxType; if (const StructType *CurSTy = dyn_cast<StructType>(CurCTy)) { // Check for a zero element struct type... if we have one, bail. if (CurSTy->getNumElements() == 0) break; @@ -381,14 +380,12 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) { // offset zero in the struct. // ElTy = CurSTy->getElementType(0); - IdxType = Type::UByteTy; // FIXME when PR82 is fixed. } else { ElTy = cast<ArrayType>(CurCTy)->getElementType(); - IdxType = Type::LongTy; // FIXME when PR82 is fixed. } // Insert a zero to index through this type... - Indices.push_back(Constant::getNullValue(IdxType)); + Indices.push_back(Constant::getNullValue(Type::UIntTy)); // Did we find what we're looking for? if (ElTy->isLosslesslyConvertibleTo(DestPointedTy)) break; |