diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-23 00:34:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-23 00:34:11 +0000 |
commit | fa1211f69bff82013a10a89298229398da8fab9b (patch) | |
tree | 279ecc560c7cae19b38bbac7b9d902befed21361 /llvm/lib/Transforms/Scalar/LoopRotation.cpp | |
parent | a2b4b4ad9929a9a1031f262c5820227ac0cc5afb (diff) | |
download | bcm5719-llvm-fa1211f69bff82013a10a89298229398da8fab9b.tar.gz bcm5719-llvm-fa1211f69bff82013a10a89298229398da8fab9b.zip |
Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.
The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.
llvm-svn: 53941
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopRotation.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp index 38364c15877..f0dd40bd339 100644 --- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -249,35 +249,11 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) { // create new PHINode for this instruction. Instruction *NewHeaderReplacement = NULL; if (usedOutsideOriginalHeader(In)) { - // FIXME: remove this when we have first-class aggregates. - if (isa<StructType>(In->getType())) { - // Can't create PHI nodes for this type. If there are any getResults - // not defined in this block, move them back to this block. PHI - // nodes will be created for all getResults later. - BasicBlock::iterator InsertPoint; - if (InvokeInst *II = dyn_cast<InvokeInst>(In)) { - InsertPoint = II->getNormalDest()->getFirstNonPHI(); - } else { - InsertPoint = I; // call - ++InsertPoint; - } - for (Value::use_iterator UI = In->use_begin(), UE = In->use_end(); - UI != UE; ++UI) { - GetResultInst *InGR = cast<GetResultInst>(UI); - if (InGR->getParent() != OrigHeader) { - // Move InGR to immediately after the call or in the normal dest of - // the invoke. It will be picked up, cloned and PHI'd on the next - // iteration. - InGR->moveBefore(InsertPoint); - } - } - } else { - PHINode *PN = PHINode::Create(In->getType(), In->getName(), - NewHeader->begin()); - PN->addIncoming(In, OrigHeader); - PN->addIncoming(C, OrigPreHeader); - NewHeaderReplacement = PN; - } + PHINode *PN = PHINode::Create(In->getType(), In->getName(), + NewHeader->begin()); + PN->addIncoming(In, OrigHeader); + PN->addIncoming(C, OrigPreHeader); + NewHeaderReplacement = PN; } LoopHeaderInfo.push_back(RenameData(In, C, NewHeaderReplacement)); } |