[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp LoopSimplify.cpp LowerSwitch.cpp TailRecursionElimination.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Nov 21 10:53:01 PST 2003


Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.67 -> 1.68
LoopSimplify.cpp updated: 1.25 -> 1.26
LowerSwitch.cpp updated: 1.8 -> 1.9
TailRecursionElimination.cpp updated: 1.7 -> 1.8

---
Log message:

Minor cleanups and simplifications


---
Diffs of the changes:  (+7 -7)

Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.67 llvm/lib/Transforms/Scalar/ADCE.cpp:1.68
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.67	Thu Nov 20 12:25:22 2003
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Fri Nov 21 10:52:01 2003
@@ -302,7 +302,7 @@
     //
     if (!AliveBlocks.count(&Func->front())) {
       BasicBlock *NewEntry = new BasicBlock();
-      new BranchInst(&Func->front(), 0, 0, NewEntry);
+      new BranchInst(&Func->front(), NewEntry);
       Func->getBasicBlockList().push_front(NewEntry);
       AliveBlocks.insert(NewEntry);    // This block is always alive!
       LiveSet.insert(NewEntry->getTerminator());  // The branch is live


Index: llvm/lib/Transforms/Scalar/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.25 llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.26
--- llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.25	Thu Nov 20 12:25:22 2003
+++ llvm/lib/Transforms/Scalar/LoopSimplify.cpp	Fri Nov 21 10:52:01 2003
@@ -153,7 +153,7 @@
   BasicBlock *NewBB = new BasicBlock(BB->getName()+Suffix, BB);
 
   // The preheader first gets an unconditional branch to the loop header...
-  BranchInst *BI = new BranchInst(BB, 0, 0, NewBB);
+  BranchInst *BI = new BranchInst(BB, NewBB);
   
   // For every PHI node in the block, insert a PHI node into NewBB where the
   // incoming values from the out of loop edges are moved to NewBB.  We have two
@@ -379,7 +379,7 @@
 
   // Create and insert the new backedge block...
   BasicBlock *BEBlock = new BasicBlock(Header->getName()+".backedge", F);
-  BranchInst *BETerminator = new BranchInst(Header, 0, 0, BEBlock);
+  BranchInst *BETerminator = new BranchInst(Header, BEBlock);
 
   // Move the new backedge block to right after the last backedge block.
   Function::iterator InsertPos = BackedgeBlocks.back(); ++InsertPos;


Index: llvm/lib/Transforms/Scalar/LowerSwitch.cpp
diff -u llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.8 llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.9
--- llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.8	Thu Nov 20 12:25:22 2003
+++ llvm/lib/Transforms/Scalar/LowerSwitch.cpp	Fri Nov 21 10:52:01 2003
@@ -186,7 +186,7 @@
 
   // If there is only the default destination, don't bother with the code below.
   if (SI->getNumOperands() == 2) {
-    new BranchInst(SI->getDefaultDest(), 0, 0, CurBlock);
+    new BranchInst(SI->getDefaultDest(), CurBlock);
     delete SI;
     return;
   }
@@ -196,7 +196,7 @@
   BasicBlock* NewDefault = new BasicBlock("NewDefault");
   F->getBasicBlockList().insert(Default, NewDefault);
 
-  new BranchInst(Default, 0, 0, NewDefault);
+  new BranchInst(Default, NewDefault);
 
   // If there is an entry in any PHI nodes for the default edge, make sure
   // to update them as well.
@@ -219,7 +219,7 @@
                                           OrigBlock, NewDefault);
 
   // Branch to our shiny new if-then stuff...
-  new BranchInst(SwitchBlock, 0, 0, OrigBlock);
+  new BranchInst(SwitchBlock, OrigBlock);
 
   // We are now done with the switch instruction, delete it.
   delete SI;


Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.7 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.8
--- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.7	Thu Nov 20 12:25:22 2003
+++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp	Fri Nov 21 10:52:01 2003
@@ -76,7 +76,7 @@
               // us to branch back to the old entry block.
               OldEntry = &F.getEntryBlock();
               BasicBlock *NewEntry = new BasicBlock("tailrecurse", OldEntry);
-              new BranchInst(OldEntry, 0, 0, NewEntry);
+              new BranchInst(OldEntry, NewEntry);
               
               // Now that we have created a new block, which jumps to the entry
               // block, insert a PHI node for each argument of the function.





More information about the llvm-commits mailing list