forked from OSchip/llvm-project
parent
cf661fc12a
commit
31167c61d5
|
@ -371,12 +371,8 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
|
||||||
/// PHINode may not have an entry for the original pre-header.
|
/// PHINode may not have an entry for the original pre-header.
|
||||||
void LoopRotate::updateExitBlock() {
|
void LoopRotate::updateExitBlock() {
|
||||||
|
|
||||||
for (BasicBlock::iterator I = Exit->begin(), E = Exit->end();
|
for (BasicBlock::iterator I = Exit->begin();
|
||||||
I != E; ++I) {
|
PHINode *PN = dyn_cast<PHINode>(I); ++I) {
|
||||||
|
|
||||||
PHINode *PN = dyn_cast<PHINode>(I);
|
|
||||||
if (!PN)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// There is already one incoming value from original pre-header block.
|
// There is already one incoming value from original pre-header block.
|
||||||
if (PN->getBasicBlockIndex(OrigPreHeader) != -1)
|
if (PN->getBasicBlockIndex(OrigPreHeader) != -1)
|
||||||
|
@ -384,7 +380,7 @@ void LoopRotate::updateExitBlock() {
|
||||||
|
|
||||||
const RenameData *ILoopHeaderInfo;
|
const RenameData *ILoopHeaderInfo;
|
||||||
Value *V = PN->getIncomingValueForBlock(OrigHeader);
|
Value *V = PN->getIncomingValueForBlock(OrigHeader);
|
||||||
if (isa<Instruction>(V) &&
|
if (isa<Instruction>(V) &&
|
||||||
(ILoopHeaderInfo = findReplacementData(cast<Instruction>(V)))) {
|
(ILoopHeaderInfo = findReplacementData(cast<Instruction>(V)))) {
|
||||||
assert(ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction");
|
assert(ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction");
|
||||||
PN->addIncoming(ILoopHeaderInfo->PreHeader, OrigPreHeader);
|
PN->addIncoming(ILoopHeaderInfo->PreHeader, OrigPreHeader);
|
||||||
|
|
Loading…
Reference in New Issue