aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
committerGabor Greif <ggreif@gmail.com>2008-04-06 20:25:17 +0000
commit051a950000e21935165db56695e35bade668193b (patch)
tree76db4bc690c153a1cfbd2989849c3b1d95500390 /lib/Transforms/Scalar/LoopRotation.cpp
parentd963ab1f58adb6daa028533ff3285841d7e45f80 (diff)
API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopRotation.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp
index 153f09563d..51e2cd8900 100644
--- a/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/lib/Transforms/Scalar/LoopRotation.cpp
@@ -208,7 +208,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
// Create new PHI node with two incoming values for NewHeader.
// One incoming value is from OrigLatch (through OrigHeader) and
// second incoming value is from original pre-header.
- PHINode *NH = new PHINode(In->getType(), In->getName());
+ PHINode *NH = PHINode::Create(In->getType(), In->getName());
NH->addIncoming(PN->getIncomingValueForBlock(OrigLatch), OrigHeader);
NH->addIncoming(NPV, OrigPreHeader);
NewHeader->getInstList().push_front(NH);
@@ -249,7 +249,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
// create new PHINode for this instruction.
Instruction *NewHeaderReplacement = NULL;
if (usedOutsideOriginalHeader(In)) {
- PHINode *PN = new PHINode(In->getType(), In->getName());
+ PHINode *PN = PHINode::Create(In->getType(), In->getName());
PN->addIncoming(In, OrigHeader);
PN->addIncoming(C, OrigPreHeader);
NewHeader->getInstList().push_front(PN);
@@ -336,7 +336,7 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) {
} else {
// Used outside Exit block. Create a new PHI node from exit block
// to receive value from ne new header ane pre header.
- PHINode *PN = new PHINode(U->getType(), U->getName());
+ PHINode *PN = PHINode::Create(U->getType(), U->getName());
PN->addIncoming(ILoopHeaderInfo.PreHeader, OrigPreHeader);
PN->addIncoming(OldPhi, OrigHeader);
Exit->getInstList().push_front(PN);
@@ -447,12 +447,12 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) {
// Right now original pre-header has two successors, new header and
// exit block. Insert new block between original pre-header and
// new header such that loop's new pre-header has only one successor.
- BasicBlock *NewPreHeader = new BasicBlock("bb.nph", OrigHeader->getParent(),
- NewHeader);
+ BasicBlock *NewPreHeader = BasicBlock::Create("bb.nph", OrigHeader->getParent(),
+ NewHeader);
LoopInfo &LI = LPM.getAnalysis<LoopInfo>();
if (Loop *PL = LI.getLoopFor(OrigPreHeader))
PL->addBasicBlockToLoop(NewPreHeader, LI.getBase());
- new BranchInst(NewHeader, NewPreHeader);
+ BranchInst::Create(NewHeader, NewPreHeader);
BranchInst *OrigPH_BI = cast<BranchInst>(OrigPreHeader->getTerminator());
if (OrigPH_BI->getSuccessor(0) == NewHeader)
@@ -560,7 +560,7 @@ void LoopRotate::preserveCanonicalLoopForm(LPPassManager &LPM) {
BasicBlock::iterator I = Exit->begin(), E = Exit->end();
PHINode *PN = NULL;
for (; (PN = dyn_cast<PHINode>(I)); ++I) {
- PHINode *NewPN = new PHINode(PN->getType(), PN->getName());
+ PHINode *NewPN = PHINode::Create(PN->getType(), PN->getName());
unsigned N = PN->getNumIncomingValues();
for (unsigned index = 0; index < N; ++index)
if (PN->getIncomingBlock(index) == NExit) {