[llvm-commits] CVS: llvm/lib/Transforms/Scalar/ADCE.cpp BasicBlockPlacement.cpp CondPropagate.cpp ConstantProp.cpp CorrelatedExprs.cpp DCE.cpp DeadStoreElimination.cpp GCSE.cpp IndVarSimplify.cpp InstructionCombining.cpp LICM.cpp LoopSimplify.cpp LoopStrengthReduce.cpp LoopUnroll.cpp LoopUnswitch.cpp LowerAllocations.cpp LowerConstantExprs.cpp LowerGC.cpp LowerInvoke.cpp LowerPacked.cpp LowerSelect.cpp LowerSwitch.cpp Mem2Reg.cpp PRE.cpp Reassociate.cpp SCCP.cpp ScalarReplAggregates.cpp SimplifyCFG.cpp TailDuplication.cpp TailRecursionElimination.cpp

Misha Brukman brukman at cs.uiuc.edu
Thu Apr 21 16:45:23 PDT 2005



Changes in directory llvm/lib/Transforms/Scalar:

ADCE.cpp updated: 1.90 -> 1.91
BasicBlockPlacement.cpp updated: 1.4 -> 1.5
CondPropagate.cpp updated: 1.2 -> 1.3
ConstantProp.cpp updated: 1.50 -> 1.51
CorrelatedExprs.cpp updated: 1.28 -> 1.29
DCE.cpp updated: 1.56 -> 1.57
DeadStoreElimination.cpp updated: 1.11 -> 1.12
GCSE.cpp updated: 1.45 -> 1.46
IndVarSimplify.cpp updated: 1.76 -> 1.77
InstructionCombining.cpp updated: 1.323 -> 1.324
LICM.cpp updated: 1.72 -> 1.73
LoopSimplify.cpp updated: 1.55 -> 1.56
LoopStrengthReduce.cpp updated: 1.12 -> 1.13
LoopUnroll.cpp updated: 1.16 -> 1.17
LoopUnswitch.cpp updated: 1.4 -> 1.5
LowerAllocations.cpp updated: 1.52 -> 1.53
LowerConstantExprs.cpp updated: 1.3 -> 1.4
LowerGC.cpp updated: 1.7 -> 1.8
LowerInvoke.cpp updated: 1.20 -> 1.21
LowerPacked.cpp updated: 1.4 -> 1.5
LowerSelect.cpp updated: 1.2 -> 1.3
LowerSwitch.cpp updated: 1.16 -> 1.17
Mem2Reg.cpp updated: 1.13 -> 1.14
PRE.cpp updated: 1.14 -> 1.15
Reassociate.cpp updated: 1.35 -> 1.36
SCCP.cpp updated: 1.122 -> 1.123
ScalarReplAggregates.cpp updated: 1.30 -> 1.31
SimplifyCFG.cpp updated: 1.13 -> 1.14
TailDuplication.cpp updated: 1.27 -> 1.28
TailRecursionElimination.cpp updated: 1.15 -> 1.16
---
Log message:

Remove trailing whitespace


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

 ADCE.cpp                     |   28 ++--
 BasicBlockPlacement.cpp      |   14 +-
 CondPropagate.cpp            |    6 
 ConstantProp.cpp             |    6 
 CorrelatedExprs.cpp          |   44 +++----
 DCE.cpp                      |   10 -
 DeadStoreElimination.cpp     |   12 -
 GCSE.cpp                     |   10 -
 IndVarSimplify.cpp           |   26 ++--
 InstructionCombining.cpp     |  270 +++++++++++++++++++++----------------------
 LICM.cpp                     |   52 ++++----
 LoopSimplify.cpp             |   44 +++----
 LoopStrengthReduce.cpp       |   26 ++--
 LoopUnroll.cpp               |   16 +-
 LoopUnswitch.cpp             |   18 +-
 LowerAllocations.cpp         |   20 +--
 LowerConstantExprs.cpp       |   46 +++----
 LowerGC.cpp                  |   18 +-
 LowerInvoke.cpp              |   24 +--
 LowerPacked.cpp              |   88 +++++++-------
 LowerSelect.cpp              |    6 
 LowerSwitch.cpp              |    4 
 Mem2Reg.cpp                  |    6 
 PRE.cpp                      |   20 +--
 Reassociate.cpp              |   10 -
 SCCP.cpp                     |   68 +++++-----
 ScalarReplAggregates.cpp     |   24 +--
 SimplifyCFG.cpp              |    6 
 TailDuplication.cpp          |   12 -
 TailRecursionElimination.cpp |   14 +-
 30 files changed, 474 insertions(+), 474 deletions(-)


Index: llvm/lib/Transforms/Scalar/ADCE.cpp
diff -u llvm/lib/Transforms/Scalar/ADCE.cpp:1.90 llvm/lib/Transforms/Scalar/ADCE.cpp:1.91
--- llvm/lib/Transforms/Scalar/ADCE.cpp:1.90	Tue Feb 22 17:22:58 2005
+++ llvm/lib/Transforms/Scalar/ADCE.cpp	Thu Apr 21 18:45:12 2005
@@ -1,14 +1,14 @@
 //===- ADCE.cpp - Code to perform aggressive dead code elimination --------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements "aggressive" dead code elimination.  ADCE is DCe where
-// values are assumed to be dead until proven otherwise.  This is similar to 
+// values are assumed to be dead until proven otherwise.  This is similar to
 // SCCP, except applied to the liveness of values.
 //
 //===----------------------------------------------------------------------===//
@@ -116,11 +116,11 @@
   if (It != CDG.end()) {
     // Get the blocks that this node is control dependent on...
     const PostDominanceFrontier::DomSetType &CDB = It->second;
-    for (PostDominanceFrontier::DomSetType::const_iterator I = 
+    for (PostDominanceFrontier::DomSetType::const_iterator I =
            CDB.begin(), E = CDB.end(); I != E; ++I)
       markTerminatorLive(*I);   // Mark all their terminators as live
   }
-  
+
   // If this basic block is live, and it ends in an unconditional branch, then
   // the branch is alive as well...
   if (BranchInst *BI = dyn_cast<BranchInst>(BB->getTerminator()))
@@ -162,7 +162,7 @@
   // Remove entries from PHI nodes to avoid confusing ourself later...
   for (unsigned i = 1, e = TI->getNumSuccessors(); i != e; ++i)
     TI->getSuccessor(i)->removePredecessor(BB);
-  
+
   // Delete the old branch itself...
   BB->getInstList().erase(TI);
   return NB;
@@ -203,7 +203,7 @@
         }
 
   // Iterate over all of the instructions in the function, eliminating trivially
-  // dead instructions, and marking instructions live that are known to be 
+  // dead instructions, and marking instructions live that are known to be
   // needed.  Perform the walk in depth first order so that we avoid marking any
   // instructions live in basic blocks that are unreachable.  These blocks will
   // be eliminated later, along with the instructions inside.
@@ -338,7 +338,7 @@
 
     return MadeChanges;
   }
-  
+
 
   // If the entry node is dead, insert a new entry node to eliminate the entry
   // node as a special case.
@@ -350,7 +350,7 @@
     AliveBlocks.insert(NewEntry);    // This block is always alive!
     LiveSet.insert(NewEntry->getTerminator());  // The branch is live
   }
-    
+
   // Loop over all of the alive blocks in the function.  If any successor
   // blocks are not alive, we adjust the outgoing branches to branch to the
   // first live postdominator of the live block, adjusting any PHI nodes in
@@ -360,7 +360,7 @@
     if (AliveBlocks.count(I)) {
       BasicBlock *BB = I;
       TerminatorInst *TI = BB->getTerminator();
-      
+
       // If the terminator instruction is alive, but the block it is contained
       // in IS alive, this means that this terminator is a conditional branch on
       // a condition that doesn't matter.  Make it an unconditional branch to
@@ -392,7 +392,7 @@
                 break;
               }
             }
-          }          
+          }
 
           // There is a special case here... if there IS no post-dominator for
           // the block we have nowhere to point our branch to.  Instead, convert
@@ -411,12 +411,12 @@
               // branch into an infinite loop into a return instruction!
               //
               RemoveSuccessor(TI, i);
-              
+
               // RemoveSuccessor may replace TI... make sure we have a fresh
               // pointer.
               //
               TI = BB->getTerminator();
-              
+
               // Rescan this successor...
               --i;
             } else {
@@ -443,7 +443,7 @@
                 int OldIdx = PN->getBasicBlockIndex(LastDead);
                 assert(OldIdx != -1 &&"LastDead is not a pred of NextAlive!");
                 Value *InVal = PN->getIncomingValue(OldIdx);
-                  
+
                 // Add an incoming value for BB now...
                 PN->addIncoming(InVal, BB);
               }


Index: llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp
diff -u llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.4 llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.5
--- llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp:1.4	Sat Jan  8 11:21:40 2005
+++ llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===-- BasicBlockPlacement.cpp - Basic Block Code Layout optimization ----===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements a very simple profile guided basic block placement
@@ -37,7 +37,7 @@
 
 namespace {
   Statistic<> NumMoved("block-placement", "Number of basic blocks moved");
-  
+
   struct BlockPlacement : public FunctionPass {
     virtual bool runOnFunction(Function &F);
 
@@ -78,11 +78,11 @@
   PI = &getAnalysis<ProfileInfo>();
 
   NumMovedBlocks = 0;
-  InsertPos = F.begin(); 
+  InsertPos = F.begin();
 
   // Recursively place all blocks.
   PlaceBlocks(F.begin());
-  
+
   PlacedBlocks.clear();
   NumMoved += NumMovedBlocks;
   return NumMovedBlocks != 0;
@@ -115,12 +115,12 @@
   while (1) {
     // Okay, now place any unplaced successors.
     succ_iterator SI = succ_begin(BB), E = succ_end(BB);
-    
+
     // Scan for the first unplaced successor.
     for (; SI != E && PlacedBlocks.count(*SI); ++SI)
       /*empty*/;
     if (SI == E) return;  // No more successors to place.
-    
+
     unsigned MaxExecutionCount = PI->getExecutionCount(*SI);
     BasicBlock *MaxSuccessor = *SI;
 


Index: llvm/lib/Transforms/Scalar/CondPropagate.cpp
diff -u llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.2 llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.3
--- llvm/lib/Transforms/Scalar/CondPropagate.cpp:1.2	Mon Apr 18 00:26:21 2005
+++ llvm/lib/Transforms/Scalar/CondPropagate.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===-- CondPropagate.cpp - Propagate Conditional Expressions -------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass propagates information about conditional expressions through the
@@ -73,7 +73,7 @@
     if (BI->isConditional() && isa<PHINode>(BI->getCondition()) &&
         cast<PHINode>(BI->getCondition())->getParent() == BB)
       SimplifyPredecessors(BI);
-    
+
   } else if (SwitchInst *SI = dyn_cast<SwitchInst>(BB->getTerminator())) {
     if (isa<PHINode>(SI->getCondition()) &&
         cast<PHINode>(SI->getCondition())->getParent() == BB)


Index: llvm/lib/Transforms/Scalar/ConstantProp.cpp
diff -u llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.50 llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.51
--- llvm/lib/Transforms/Scalar/ConstantProp.cpp:1.50	Sun Sep 19 23:43:14 2004
+++ llvm/lib/Transforms/Scalar/ConstantProp.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- ConstantProp.cpp - Code to perform Simple Constant Propagation -----===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements constant propagation and merging:
@@ -66,7 +66,7 @@
         for (Value::use_iterator UI = I->use_begin(), UE = I->use_end();
              UI != UE; ++UI)
           WorkList.insert(cast<Instruction>(*UI));
-        
+
         // Replace all of the uses of a variable with uses of the constant.
         I->replaceAllUsesWith(C);
 


Index: llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp
diff -u llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.28 llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.29
--- llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp:1.28	Mon Mar 14 22:54:21 2005
+++ llvm/lib/Transforms/Scalar/CorrelatedExprs.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- CorrelatedExprs.cpp - Pass to detect and eliminated c.e.'s ---------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // Correlated Expression Elimination propagates information from conditional
@@ -178,7 +178,7 @@
 
     // empty - return true if this region has no information known about it.
     bool empty() const { return ValueMap.empty(); }
-    
+
     const RegionInfo &operator=(const RegionInfo &RI) {
       ValueMap = RI.ValueMap;
       return *this;
@@ -204,7 +204,7 @@
       if (I != ValueMap.end()) return &I->second;
       return 0;
     }
-    
+
     /// removeValueInfo - Remove anything known about V from our records.  This
     /// works whether or not we know anything about V.
     ///
@@ -281,7 +281,7 @@
 
     bool SimplifyBasicBlock(BasicBlock &BB, const RegionInfo &RI);
     bool SimplifyInstruction(Instruction *Inst, const RegionInfo &RI);
-  }; 
+  };
   RegisterOpt<CEE> X("cee", "Correlated Expression Elimination");
 }
 
@@ -299,7 +299,7 @@
   // blocks.
   DS = &getAnalysis<DominatorSet>();
   DT = &getAnalysis<DominatorTree>();
-  
+
   std::set<BasicBlock*> VisitedBlocks;
   bool Changed = TransformRegion(&F.getEntryBlock(), VisitedBlocks);
 
@@ -458,13 +458,13 @@
   for (BasicBlock::iterator I = OldSucc->begin(), E = OldSucc->end(); I!=E; ++I)
     if (I->getType() != Type::VoidTy)
       NewRI.removeValueInfo(I);
-    
+
   // Put the newly discovered information into the RegionInfo...
   for (BasicBlock::iterator I = OldSucc->begin(), E = OldSucc->end(); I!=E; ++I)
     if (PHINode *PN = dyn_cast<PHINode>(I)) {
       int OpNum = PN->getBasicBlockIndex(BB);
       assert(OpNum != -1 && "PHI doesn't have incoming edge for predecessor!?");
-      PropagateEquality(PN, PN->getIncomingValue(OpNum), NewRI);      
+      PropagateEquality(PN, PN->getIncomingValue(OpNum), NewRI);
     } else if (SetCondInst *SCI = dyn_cast<SetCondInst>(I)) {
       Relation::KnownResult Res = getSetCCResult(SCI, NewRI);
       if (Res == Relation::Unknown) return false;
@@ -472,7 +472,7 @@
     } else {
       assert(isa<BranchInst>(*I) && "Unexpected instruction type!");
     }
-  
+
   // Compute the facts implied by what we have discovered...
   ComputeReplacements(NewRI);
 
@@ -486,7 +486,7 @@
     ForwardSuccessorTo(TI, SuccNo, BI->getSuccessor(!CB->getValue()), NewRI);
     return true;
   }
-  
+
   return false;
 }
 
@@ -582,7 +582,7 @@
     // node yet though if this is the last edge into it.
     Value *EdgeValue = PN->removeIncomingValue(BB, false);
 
-    // Make sure that anything that used to use PN now refers to EdgeValue    
+    // Make sure that anything that used to use PN now refers to EdgeValue
     ReplaceUsesOfValueInRegion(PN, EdgeValue, Dest);
 
     // If there is only one value left coming into the PHI node, replace the PHI
@@ -603,7 +603,7 @@
       ++I;  // Otherwise, move on to the next PHI node
     }
   }
-  
+
   // Actually revector the branch now...
   TI->setSuccessor(SuccNo, Dest);
 
@@ -689,7 +689,7 @@
   } else {
     // Header does not dominate this block, but we have a predecessor that does
     // dominate us.  Add ourself to the list.
-    RegionExitBlocks.push_back(BB);    
+    RegionExitBlocks.push_back(BB);
   }
 }
 
@@ -703,7 +703,7 @@
 
   // Recursively calculate blocks we are interested in...
   CalcRegionExitBlocks(BB, BB, Visited, *DS, RegionExitBlocks);
-  
+
   // Filter out blocks that are not dominated by OldSucc...
   for (unsigned i = 0; i != RegionExitBlocks.size(); ) {
     if (DS->dominates(OldSucc, RegionExitBlocks[i]))
@@ -738,7 +738,7 @@
       // otherwise use OldVal.
       NewPN->addIncoming(DS->dominates(BB, *PI) ? BBVal : OldVal, *PI);
     }
-    
+
     // Now make everyone dominated by this block use this new value!
     ReplaceUsesOfValueInRegion(OldVal, NewPN, FBlock);
   }
@@ -783,7 +783,7 @@
   //
   PropagateEquality(BI->getCondition(), ConstantBool::True,
                     getRegionInfo(BI->getSuccessor(0)));
-  
+
   // Propagate information into the false block...
   //
   PropagateEquality(BI->getCondition(), ConstantBool::False,
@@ -825,7 +825,7 @@
         PropagateEquality(Inst->getOperand(0), CB, RI);
         PropagateEquality(Inst->getOperand(1), CB, RI);
       }
-      
+
       // If we know that this instruction is an OR instruction, and the result
       // is false, this means that both operands to the OR are know to be false
       // as well.
@@ -834,7 +834,7 @@
         PropagateEquality(Inst->getOperand(0), CB, RI);
         PropagateEquality(Inst->getOperand(1), CB, RI);
       }
-      
+
       // If we know that this instruction is a NOT instruction, we know that the
       // operand is known to be the inverse of whatever the current value is.
       //
@@ -857,7 +857,7 @@
         } else {               // If we know the condition is false...
           // We know the opposite of the condition is true...
           Instruction::BinaryOps C = SCI->getInverseCondition();
-          
+
           PropagateRelation(C, SCI->getOperand(0), SCI->getOperand(1), RI);
           PropagateRelation(SetCondInst::getSwappedCondition(C),
                             SCI->getOperand(1), SCI->getOperand(0), RI);
@@ -1065,7 +1065,7 @@
                                           const RegionInfo &RI) {
   Value *Op0 = SCI->getOperand(0), *Op1 = SCI->getOperand(1);
   Instruction::BinaryOps Opcode = SCI->getOpcode();
-  
+
   if (isa<Constant>(Op0)) {
     if (isa<Constant>(Op1)) {
       if (Constant *Result = ConstantFoldInstruction(SCI)) {
@@ -1098,7 +1098,7 @@
 
       // If the intersection of the two ranges is empty, then the condition
       // could never be true!
-      // 
+      //
       if (Int.isEmptySet()) {
         Result = Relation::KnownFalse;
 
@@ -1254,7 +1254,7 @@
 // print - Implement the standard print form to print out analysis information.
 void CEE::print(std::ostream &O, const Module *M) const {
   O << "\nPrinting Correlated Expression Info:\n";
-  for (std::map<BasicBlock*, RegionInfo>::const_iterator I = 
+  for (std::map<BasicBlock*, RegionInfo>::const_iterator I =
          RegionInfoMap.begin(), E = RegionInfoMap.end(); I != E; ++I)
     I->second.print(O);
 }


Index: llvm/lib/Transforms/Scalar/DCE.cpp
diff -u llvm/lib/Transforms/Scalar/DCE.cpp:1.56 llvm/lib/Transforms/Scalar/DCE.cpp:1.57
--- llvm/lib/Transforms/Scalar/DCE.cpp:1.56	Sun Sep 19 23:43:14 2004
+++ llvm/lib/Transforms/Scalar/DCE.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- DCE.cpp - Code to perform dead code elimination --------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements dead inst elimination and dead code elimination.
@@ -49,7 +49,7 @@
       AU.setPreservesCFG();
     }
   };
-  
+
   RegisterOpt<DeadInstElimination> X("die", "Dead Instruction Elimination");
 }
 
@@ -81,7 +81,7 @@
       WorkList.push_back(&*i);
   }
   std::set<Instruction*> DeadInsts;
-  
+
   // Loop over the worklist finding instructions that are dead.  If they are
   // dead make them drop all of their uses, making other instructions
   // potentially dead, and work until the worklist is empty.
@@ -89,7 +89,7 @@
   while (!WorkList.empty()) {
     Instruction *I = WorkList.back();
     WorkList.pop_back();
-    
+
     if (isInstructionTriviallyDead(I)) {       // If the instruction is dead...
       // Loop over all of the values that the instruction uses, if there are
       // instructions being used, add them to the worklist, because they might


Index: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
diff -u llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.11 llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.12
--- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1.11	Fri Jan 28 18:39:08 2005
+++ llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- DeadStoreElimination.cpp - Dead Store Elimination ------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements a trivial dead store elimination that only considers
@@ -39,9 +39,9 @@
         Changed |= runOnBasicBlock(*I);
       return Changed;
     }
-    
+
     bool runOnBasicBlock(BasicBlock &BB);
-    
+
     void DeleteDeadInstructionChains(Instruction *I,
                                      SetVector<Instruction*> &DeadInsts);
 
@@ -87,7 +87,7 @@
   bool MadeChange = false;
   for (BasicBlock::iterator BBI = BB.end(); BBI != BB.begin(); ) {
     Instruction *I = --BBI;   // Keep moving iterator backwards
-    
+
     // If this is a free instruction, it makes the free'd location dead!
     if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
       // Free instructions make any stores to the free'd location dead.
@@ -161,7 +161,7 @@
       DeadInsts.insert(Op);      // Attempt to nuke it later.
     I->setOperand(i, 0);         // Drop from the operand list.
   }
-  
+
   I->eraseFromParent();
   ++NumOther;
 }


Index: llvm/lib/Transforms/Scalar/GCSE.cpp
diff -u llvm/lib/Transforms/Scalar/GCSE.cpp:1.45 llvm/lib/Transforms/Scalar/GCSE.cpp:1.46
--- llvm/lib/Transforms/Scalar/GCSE.cpp:1.45	Mon Mar 14 22:54:21 2005
+++ llvm/lib/Transforms/Scalar/GCSE.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===-- GCSE.cpp - SSA-based Global Common Subexpression Elimination ------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass is designed to be a very quick global transformation that
@@ -116,7 +116,7 @@
           else {
             I = Inst; --I;
           }
-          
+
           // First check to see if we were able to value number this instruction
           // to a non-instruction value.  If so, prefer that value over other
           // instructions which may compute the same thing.
@@ -186,14 +186,14 @@
   getAnalysis<ValueNumbering>().deleteValue(I);
 
   I->replaceAllUsesWith(V);
-  
+
   if (InvokeInst *II = dyn_cast<InvokeInst>(I)) {
     // Removing an invoke instruction requires adding a branch to the normal
     // destination and removing PHI node entries in the exception destination.
     new BranchInst(II->getNormalDest(), II);
     II->getUnwindDest()->removePredecessor(II->getParent());
   }
-  
+
   // Erase the instruction from the program.
   I->getParent()->getInstList().erase(I);
 }


Index: llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.76 llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.77
--- llvm/lib/Transforms/Scalar/IndVarSimplify.cpp:1.76	Mon Feb 14 14:11:45 2005
+++ llvm/lib/Transforms/Scalar/IndVarSimplify.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- IndVarSimplify.cpp - Induction Variable Elimination ----------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This transformation analyzes and transforms the induction variables (and
@@ -76,7 +76,7 @@
     bool isInsertedInstruction(Instruction *I) const {
       return InsertedInstructions.count(I);
     }
-    
+
     /// getOrInsertCanonicalInductionVariable - This method returns the
     /// canonical induction variable of the specified type for the specified
     /// loop (inserting one if there is none).  A canonical induction variable
@@ -128,7 +128,7 @@
           return ConstantExpr::getCast(C, Ty);
         else if (Instruction *I = dyn_cast<Instruction>(V)) {
           // Check to see if there is already a cast.  If there is, use it.
-          for (Value::use_iterator UI = I->use_begin(), E = I->use_end(); 
+          for (Value::use_iterator UI = I->use_begin(), E = I->use_end();
                UI != E; ++UI) {
             if ((*UI)->getType() == Ty)
               if (CastInst *CI = dyn_cast<CastInst>(cast<Instruction>(*UI))) {
@@ -206,10 +206,10 @@
   if (SCEVConstant *SC = dyn_cast<SCEVConstant>(S->getOperand(0)))
     if (SC->getValue()->isAllOnesValue())
       FirstOp = 1;
-    
+
   int i = S->getNumOperands()-2;
   Value *V = expandInTy(S->getOperand(i+1), Ty);
-    
+
   // Emit a bunch of multiply instructions
   for (; i >= FirstOp; --i)
     V = BinaryOperator::createMul(V, expandInTy(S->getOperand(i), Ty),
@@ -358,7 +358,7 @@
 /// EliminatePointerRecurrence - Check to see if this is a trivial GEP pointer
 /// recurrence.  If so, change it into an integer recurrence, permitting
 /// analysis by the SCEV routines.
-void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN, 
+void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN,
                                                 BasicBlock *Preheader,
                                             std::set<Instruction*> &DeadInsts) {
   assert(PN->getNumIncomingValues() == 2 && "Noncanonicalized loop!");
@@ -368,7 +368,7 @@
       dyn_cast<GetElementPtrInst>(PN->getIncomingValue(BackedgeIdx)))
     if (GEPI->getOperand(0) == PN) {
       assert(GEPI->getNumOperands() == 2 && "GEP types must mismatch!");
-          
+
       // Okay, we found a pointer recurrence.  Transform this pointer
       // recurrence into an integer recurrence.  Compute the value that gets
       // added to the pointer at every iteration.
@@ -383,10 +383,10 @@
       Value *NewAdd = BinaryOperator::createAdd(NewPhi, AddedVal,
                                                 GEPI->getName()+".rec", GEPI);
       NewPhi->addIncoming(NewAdd, PN->getIncomingBlock(BackedgeIdx));
-          
+
       // Update the existing GEP to use the recurrence.
       GEPI->setOperand(0, PN->getIncomingValue(PreheaderIdx));
-          
+
       // Update the GEP to use the new recurrence we just inserted.
       GEPI->setOperand(1, NewAdd);
 
@@ -547,7 +547,7 @@
   bool HasConstantItCount = isa<SCEVConstant>(SE->getIterationCount(L));
 
   std::set<Instruction*> InstructionsToDelete;
-  
+
   for (unsigned i = 0, e = L->getBlocks().size(); i != e; ++i)
     if (LI->getLoopFor(L->getBlocks()[i]) == L) {  // Not in a subloop...
       BasicBlock *BB = L->getBlocks()[i];
@@ -599,7 +599,7 @@
   //
   BasicBlock *Header    = L->getHeader();
   BasicBlock *Preheader = L->getLoopPreheader();
-  
+
   std::set<Instruction*> DeadInsts;
   for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
     PHINode *PN = cast<PHINode>(I);
@@ -748,7 +748,7 @@
             DeadInsts.insert(I);
             ++NumRemoved;
             Changed = true;
-          }          
+          }
         }
     }
 #endif


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.323 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.324
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.323	Thu Apr 21 00:43:13 2005
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- InstructionCombining.cpp - Combine multiple instructions -----------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // InstructionCombining - Combine instructions to form fewer, simple
@@ -103,7 +103,7 @@
     //    null        - No change was made
     //     I          - Change was made, I is still valid, I may be dead though
     //   otherwise    - Change was made, replace I with returned instruction
-    //   
+    //
     Instruction *visitAdd(BinaryOperator &I);
     Instruction *visitSub(BinaryOperator &I);
     Instruction *visitMul(BinaryOperator &I);
@@ -159,7 +159,7 @@
     /// cast.
     Value *InsertCastBefore(Value *V, const Type *Ty, Instruction &Pos) {
       if (V->getType() == Ty) return V;
-      
+
       Instruction *C = new CastInst(V, Ty, V->getName(), &Pos);
       WorkList.push_back(C);
       return C;
@@ -275,7 +275,7 @@
   bool Changed = false;
   if (getComplexity(I.getOperand(0)) < getComplexity(I.getOperand(1)))
     Changed = !I.swapOperands();
-  
+
   if (!I.isAssociative()) return Changed;
   Instruction::BinaryOps Opcode = I.getOpcode();
   if (BinaryOperator *Op = dyn_cast<BinaryOperator>(I.getOperand(0)))
@@ -302,7 +302,7 @@
           I.setOperand(0, New);
           I.setOperand(1, Folded);
           return true;
-        }      
+        }
     }
   return Changed;
 }
@@ -427,7 +427,7 @@
     // reassociate the expression from ((? op A) op B) to (? op (A op B))
     if (ShouldApply) {
       BasicBlock *BB = Root.getParent();
-      
+
       // Now all of the instructions are in the current basic block, go ahead
       // and perform the reassociation.
       Instruction *TmpLHSI = cast<Instruction>(Root.getOperand(0));
@@ -463,12 +463,12 @@
         TmpLHSI = NextLHSI;
         ExtraOperand = NextOp;
       }
-      
+
       // Now that the instructions are reassociated, have the functor perform
       // the transformation...
       return F.apply(Root);
     }
-    
+
     LHSI = dyn_cast<Instruction>(LHSI->getOperand(0));
   }
   return 0;
@@ -493,7 +493,7 @@
   AddMaskingAnd(Constant *c) : C2(c) {}
   bool shouldApply(Value *LHS) const {
     ConstantInt *C1;
-    return match(LHS, m_And(m_Value(), m_ConstantInt(C1))) && 
+    return match(LHS, m_And(m_Value(), m_ConstantInt(C1))) &&
            ConstantExpr::getAnd(C1, C2)->isNullValue();
   }
   Instruction *apply(BinaryOperator &Add) const {
@@ -506,7 +506,7 @@
   if (isa<CastInst>(I)) {
     if (Constant *SOC = dyn_cast<Constant>(SO))
       return ConstantExpr::getCast(SOC, I.getType());
-    
+
     return IC->InsertNewInstBefore(new CastInst(SO, I.getType(),
                                                 SO->getName() + ".cast"), I);
   }
@@ -615,7 +615,7 @@
     if (!I.getType()->isFloatingPoint() && // -0 + +0 = +0, so it's not a noop
         RHSC->isNullValue())
       return ReplaceInstUsesWith(I, LHS);
-    
+
     // X + (signbit) --> X ^ signbit
     if (ConstantInt *CI = dyn_cast<ConstantInt>(RHSC)) {
       unsigned NumBits = CI->getType()->getPrimitiveSize()*8;
@@ -654,7 +654,7 @@
     if (Value *V = dyn_castNegVal(RHS))
       return BinaryOperator::createSub(LHS, V);
 
-  
+
   ConstantInt *C2;
   if (Value *X = dyn_castFoldableMul(LHS, C2)) {
     if (X == RHS)   // X*C + X --> X * (C+1)
@@ -696,7 +696,7 @@
 
         // See if the and mask includes all of these bits.
         uint64_t AddRHSHighBitsAnd = AddRHSHighBits & C2->getRawValue();
-        
+
         if (AddRHSHighBits == AddRHSHighBitsAnd) {
           // Okay, the xform is safe.  Insert the new add pronto.
           Value *NewAdd = InsertNewInstBefore(BinaryOperator::createAdd(X, CRHS,
@@ -832,7 +832,7 @@
         Value *IIOp0 = Op1I->getOperand(0), *IIOp1 = Op1I->getOperand(1);
         Op1I->setOperand(0, IIOp1);
         Op1I->setOperand(1, IIOp0);
-        
+
         // Create the new top level add instruction...
         return BinaryOperator::createAdd(Op0, Op1);
       }
@@ -853,13 +853,13 @@
         if (ConstantSInt *CSI = dyn_cast<ConstantSInt>(Op0))
           if (CSI->isNullValue())
             if (Constant *DivRHS = dyn_cast<Constant>(Op1I->getOperand(1)))
-              return BinaryOperator::createDiv(Op1I->getOperand(0), 
+              return BinaryOperator::createDiv(Op1I->getOperand(0),
                                                ConstantExpr::getNeg(DivRHS));
 
       // X - X*C --> X * (1-C)
       ConstantInt *C2;
       if (dyn_castFoldableMul(Op1I, C2) == Op0) {
-        Constant *CP1 = 
+        Constant *CP1 =
           ConstantExpr::getSub(ConstantInt::get(I.getType(), 1), C2);
         return BinaryOperator::createMul(Op0, CP1);
       }
@@ -877,7 +877,7 @@
         if (Op0I->getOperand(0) == Op1)             // (X-Y)-X == -Y
           return BinaryOperator::createNeg(Op0I->getOperand(1), I.getName());
       }
-  
+
   ConstantInt *C1;
   if (Value *X = dyn_castFoldableMul(Op0, C1)) {
     if (X == Op1) { // X*C - X --> X * (C-1)
@@ -929,7 +929,7 @@
           if (Constant *ShOp = dyn_cast<Constant>(SI->getOperand(1)))
             return BinaryOperator::createMul(SI->getOperand(0),
                                              ConstantExpr::getShl(CI, ShOp));
-      
+
       if (CI->isNullValue())
         return ReplaceInstUsesWith(I, Op1);  // X * 0  == 0
       if (CI->equalsInt(1))                  // X * 1  == X
@@ -1004,7 +1004,7 @@
         // or truncate to the multiply type.
         if (I.getType() != V->getType())
           V = InsertNewInstBefore(new CastInst(V, I.getType(), V->getName()),I);
-        
+
         Value *OtherOp = Op0 == BoolCast ? I.getOperand(1) : Op0;
         return BinaryOperator::createAnd(V, OtherOp);
       }
@@ -1069,10 +1069,10 @@
       if (ConstantUInt *SFO = dyn_cast<ConstantUInt>(SI->getOperand(2))) {
         if (STO->getValue() == 0) { // Couldn't be this argument.
           I.setOperand(1, SFO);
-          return &I;          
+          return &I;
         } else if (SFO->getValue() == 0) {
           I.setOperand(2, STO);
-          return &I;          
+          return &I;
         }
 
         uint64_t TVA = STO->getValue(), FVA = SFO->getValue();
@@ -1083,7 +1083,7 @@
           Instruction *TSI = new ShiftInst(Instruction::Shr, Op0,
                                            TC, SI->getName()+".t");
           TSI = InsertNewInstBefore(TSI, I);
-          
+
           Constant *FC = ConstantUInt::get(Type::UByteTy, FSA);
           Instruction *FSI = new ShiftInst(Instruction::Shr, Op0,
                                            FC, SI->getName()+".f");
@@ -1091,7 +1091,7 @@
           return new SelectInst(SI->getOperand(0), TSI, FSI);
         }
       }
-  
+
   // 0 / X == 0, we don't need to preserve faults!
   if (ConstantInt *LHS = dyn_cast<ConstantInt>(Op0))
     if (LHS->equalsInt(0))
@@ -1147,10 +1147,10 @@
       if (ConstantUInt *SFO = dyn_cast<ConstantUInt>(SI->getOperand(2))) {
         if (STO->getValue() == 0) { // Couldn't be this argument.
           I.setOperand(1, SFO);
-          return &I;          
+          return &I;
         } else if (SFO->getValue() == 0) {
           I.setOperand(1, STO);
-          return &I;          
+          return &I;
         }
 
         if (!(STO->getValue() & (STO->getValue()-1)) &&
@@ -1162,7 +1162,7 @@
           return new SelectInst(SI->getOperand(0), TrueAnd, FalseAnd);
         }
       }
-  
+
   // 0 % X == 0, we don't need to preserve faults!
   if (ConstantInt *LHS = dyn_cast<ConstantInt>(Op0))
     if (LHS->equalsInt(0))
@@ -1182,7 +1182,7 @@
   }
 
   const ConstantSInt *CS = cast<ConstantSInt>(C);
-  
+
   // Calculate 0111111111..11111
   unsigned TypeBits = C->getType()->getPrimitiveSize()*8;
   int64_t Val = INT64_MAX;             // All ones
@@ -1196,8 +1196,8 @@
     return CU->getValue() == 1;
 
   const ConstantSInt *CS = cast<ConstantSInt>(C);
-  
-  // Calculate 1111111111000000000000 
+
+  // Calculate 1111111111000000000000
   unsigned TypeBits = C->getType()->getPrimitiveSize()*8;
   int64_t Val = -1;                    // All ones
   Val <<= TypeBits-1;                  // Shift over to the right spot
@@ -1325,7 +1325,7 @@
     return true;
   if (ConstantIntegral *CI = dyn_cast<ConstantIntegral>(V))
     return ConstantExpr::getAnd(CI, Mask)->isNullValue();
-  
+
   if (Instruction *I = dyn_cast<Instruction>(V)) {
     switch (I->getOpcode()) {
     case Instruction::And:
@@ -1336,11 +1336,11 @@
       break;
     case Instruction::Or:
       // If the LHS and the RHS are MaskedValueIsZero, the result is also zero.
-      return MaskedValueIsZero(I->getOperand(1), Mask) && 
+      return MaskedValueIsZero(I->getOperand(1), Mask) &&
              MaskedValueIsZero(I->getOperand(0), Mask);
     case Instruction::Select:
       // If the T and F values are MaskedValueIsZero, the result is also zero.
-      return MaskedValueIsZero(I->getOperand(2), Mask) && 
+      return MaskedValueIsZero(I->getOperand(2), Mask) &&
              MaskedValueIsZero(I->getOperand(1), Mask);
     case Instruction::Cast: {
       const Type *SrcTy = I->getOperand(0)->getType();
@@ -1414,7 +1414,7 @@
   case Instruction::Or:
     if (Together == AndRHS) // (X | C) & C --> C
       return ReplaceInstUsesWith(TheAnd, AndRHS);
-      
+
     if (Op->hasOneUse() && Together != OpRHS) {
       // (X | C1) & C2 --> (X | (C1&C2)) & C2
       std::string Op0Name = Op->getName(); Op->setName("");
@@ -1439,7 +1439,7 @@
         // ADD down to exactly one bit.  If the constant we are adding has
         // no bits set below this bit, then we can eliminate the ADD.
         uint64_t AddRHS = cast<ConstantInt>(OpRHS)->getRawValue();
-            
+
         // Check to see if any bits below the one bit set in AndRHSV are set.
         if ((AddRHS & (AndRHSV-1)) == 0) {
           // If not, the only thing that can effect the output of the AND is
@@ -1468,7 +1468,7 @@
     Constant *AllOne = ConstantIntegral::getAllOnesValue(AndRHS->getType());
     Constant *ShlMask = ConstantExpr::getShl(AllOne, OpRHS);
     Constant *CI = ConstantExpr::getAnd(AndRHS, ShlMask);
-                                        
+
     if (CI == ShlMask) {   // Masking out bits that the shift already masks
       return ReplaceInstUsesWith(TheAnd, Op);   // No need for the and.
     } else if (CI != AndRHS) {                  // Reducing bits set in and.
@@ -1476,7 +1476,7 @@
       return &TheAnd;
     }
     break;
-  } 
+  }
   case Instruction::Shr:
     // We know that the AND will not produce any of the bits shifted in, so if
     // the anded constant includes them, clear them now!  This only applies to
@@ -1536,7 +1536,7 @@
       return new SetCondInst(Instruction::SetNE, V, V);
     if (cast<ConstantIntegral>(Lo)->isMinValue())
       return new SetCondInst(Instruction::SetLT, V, Hi);
-    
+
     Constant *AddCST = ConstantExpr::getNeg(Lo);
     Instruction *Add = BinaryOperator::createAdd(V, AddCST,V->getName()+".off");
     InsertNewInstBefore(Add, IB);
@@ -1589,9 +1589,9 @@
 
     // If the mask is not masking out any bits, there is no reason to do the
     // and in the first place.
-    ConstantIntegral *NotAndRHS = 
+    ConstantIntegral *NotAndRHS =
       cast<ConstantIntegral>(ConstantExpr::getNot(AndRHS));
-    if (MaskedValueIsZero(Op0, NotAndRHS))                          
+    if (MaskedValueIsZero(Op0, NotAndRHS))
       return ReplaceInstUsesWith(I, Op0);
 
     // Optimize a variety of ((val OP C1) & C2) combinations...
@@ -1605,9 +1605,9 @@
         // (X ^ V) & C2 --> (X & C2) iff (V & C2) == 0
         // (X | V) & C2 --> (X & C2) iff (V & C2) == 0
         if (MaskedValueIsZero(Op0LHS, AndRHS))
-          return BinaryOperator::createAnd(Op0RHS, AndRHS);      
+          return BinaryOperator::createAnd(Op0RHS, AndRHS);
         if (MaskedValueIsZero(Op0RHS, AndRHS))
-          return BinaryOperator::createAnd(Op0LHS, AndRHS);      
+          return BinaryOperator::createAnd(Op0LHS, AndRHS);
 
         // If the mask is only needed on one incoming arm, push it up.
         if (Op0I->hasOneUse()) {
@@ -1618,7 +1618,7 @@
             InsertNewInstBefore(NewRHS, I);
             return BinaryOperator::create(
                        cast<BinaryOperator>(Op0I)->getOpcode(), Op0LHS, NewRHS);
-          }  
+          }
           if (!isa<Constant>(NotAndRHS) &&
               MaskedValueIsZero(Op0RHS, NotAndRHS)) {
             // Not masking anything out for the RHS, move to LHS.
@@ -1727,7 +1727,7 @@
       if (match(RHS, m_SetCond(RHSCC, m_Value(RHSVal), m_ConstantInt(RHSCst))))
         if (LHSVal == RHSVal &&    // Found (X setcc C1) & (X setcc C2)
             // Set[GL]E X, CST is folded to Set[GL]T elsewhere.
-            LHSCC != Instruction::SetGE && LHSCC != Instruction::SetLE && 
+            LHSCC != Instruction::SetGE && LHSCC != Instruction::SetLE &&
             RHSCC != Instruction::SetGE && RHSCC != Instruction::SetLE) {
           // Ensure that the larger constant is on the RHS.
           Constant *Cmp = ConstantExpr::getSetGT(LHSCst, RHSCst);
@@ -1869,7 +1869,7 @@
 
   if (match(Op0, m_Not(m_Value(A)))) {   // ~A | Op1
     if (A == Op1)   // ~A | A == -1
-      return ReplaceInstUsesWith(I, 
+      return ReplaceInstUsesWith(I,
                                 ConstantIntegral::getAllOnesValue(I.getType()));
   } else {
     A = 0;
@@ -1877,7 +1877,7 @@
 
   if (match(Op1, m_Not(m_Value(B)))) {   // Op0 | ~B
     if (Op0 == B)
-      return ReplaceInstUsesWith(I, 
+      return ReplaceInstUsesWith(I,
                                 ConstantIntegral::getAllOnesValue(I.getType()));
 
     // (~A | ~B) == (~(A & B)) - De Morgan's Law
@@ -1900,7 +1900,7 @@
       if (match(RHS, m_SetCond(RHSCC, m_Value(RHSVal), m_ConstantInt(RHSCst))))
         if (LHSVal == RHSVal &&    // Found (X setcc C1) | (X setcc C2)
             // Set[GL]E X, CST is folded to Set[GL]T elsewhere.
-            LHSCC != Instruction::SetGE && LHSCC != Instruction::SetLE && 
+            LHSCC != Instruction::SetGE && LHSCC != Instruction::SetLE &&
             RHSCC != Instruction::SetGE && RHSCC != Instruction::SetLE) {
           // Ensure that the larger constant is on the RHS.
           Constant *Cmp = ConstantExpr::getSetGT(LHSCst, RHSCst);
@@ -2035,13 +2035,13 @@
         if (dyn_castNotVal(Op0I->getOperand(1))) Op0I->swapOperands();
         if (Value *Op0NotVal = dyn_castNotVal(Op0I->getOperand(0))) {
           Instruction *NotY =
-            BinaryOperator::createNot(Op0I->getOperand(1), 
+            BinaryOperator::createNot(Op0I->getOperand(1),
                                       Op0I->getOperand(1)->getName()+".not");
           InsertNewInstBefore(NotY, I);
           return BinaryOperator::createOr(Op0NotVal, NotY);
         }
       }
-          
+
       if (ConstantInt *Op0CI = dyn_cast<ConstantInt>(Op0I->getOperand(1)))
         switch (Op0I->getOpcode()) {
         case Instruction::Add:
@@ -2096,7 +2096,7 @@
       } else if (Op1I->getOperand(1) == Op0) {       // B^(A|B) == (A|B)^B
         I.swapOperands();
         std::swap(Op0, Op1);
-      }      
+      }
     } else if (Op1I->getOpcode() == Instruction::Xor) {
       if (Op0 == Op1I->getOperand(0))                        // A^(A^B) == B
         return ReplaceInstUsesWith(I, Op1I->getOperand(1));
@@ -2242,13 +2242,13 @@
             EmitIt = false;
           else if (TD->getTypeSize(GTI.getIndexedType()) == 0) {
             EmitIt = false;  // This is indexing into a zero sized array?
-          } else if (isa<ConstantInt>(C)) 
+          } else if (isa<ConstantInt>(C))
             return ReplaceInstUsesWith(I, // No comparison is needed here.
                                  ConstantBool::get(Cond == Instruction::SetNE));
         }
 
         if (EmitIt) {
-          Instruction *Comp = 
+          Instruction *Comp =
             new SetCondInst(Cond, GEPLHS->getOperand(i),
                     Constant::getNullValue(GEPLHS->getOperand(i)->getType()));
           if (InVal == 0)
@@ -2312,7 +2312,7 @@
       unsigned DiffOperand = 0;     // The operand that differs.
       for (unsigned i = 1, e = GEPRHS->getNumOperands(); i != e; ++i)
         if (GEPLHS->getOperand(i) != GEPRHS->getOperand(i)) {
-          if (GEPLHS->getOperand(i)->getType()->getPrimitiveSize() != 
+          if (GEPLHS->getOperand(i)->getType()->getPrimitiveSize() !=
                      GEPRHS->getOperand(i)->getType()->getPrimitiveSize()) {
             // Irreconcilable differences.
             NumDifferences = 2;
@@ -2364,9 +2364,9 @@
 
   // setcc <global/alloca*/null>, <global/alloca*/null> - Global/Stack value
   // addresses never equal each other!  We already know that Op0 != Op1.
-  if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) || 
-       isa<ConstantPointerNull>(Op0)) && 
-      (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) || 
+  if ((isa<GlobalValue>(Op0) || isa<AllocaInst>(Op0) ||
+       isa<ConstantPointerNull>(Op0)) &&
+      (isa<GlobalValue>(Op1) || isa<AllocaInst>(Op1) ||
        isa<ConstantPointerNull>(Op1)))
     return ReplaceInstUsesWith(I, ConstantBool::get(!isTrueWhenEqual(I)));
 
@@ -2466,7 +2466,7 @@
           ShAmt = Shift ? dyn_cast<ConstantUInt>(Shift->getOperand(1)) : 0;
           ConstantInt *AndCST = cast<ConstantInt>(LHSI->getOperand(1));
           const Type *Ty = LHSI->getType();
-          
+
           // We can fold this as long as we can't shift unknown bits
           // into the mask.  This can only happen with signed shift
           // rights, as they sign-extend.
@@ -2476,14 +2476,14 @@
             if (!CanFold) {
               // To test for the bad case of the signed shr, see if any
               // of the bits shifted in could be tested after the mask.
-              Constant *OShAmt = ConstantUInt::get(Type::UByteTy, 
+              Constant *OShAmt = ConstantUInt::get(Type::UByteTy,
                                    Ty->getPrimitiveSize()*8-ShAmt->getValue());
-              Constant *ShVal = 
+              Constant *ShVal =
                 ConstantExpr::getShl(ConstantInt::getAllOnesValue(Ty), OShAmt);
               if (ConstantExpr::getAnd(ShVal, AndCST)->isNullValue())
                 CanFold = true;
             }
-            
+
             if (CanFold) {
               Constant *NewCst;
               if (Shift->getOpcode() == Instruction::Shl)
@@ -2521,7 +2521,7 @@
 
       // (setcc (cast X to larger), CI)
       case Instruction::Cast:
-        if (Instruction *R = 
+        if (Instruction *R =
                 visitSetCondInstWithCastAndConstant(I,cast<CastInst>(LHSI),CI))
           return R;
         break;
@@ -2534,7 +2534,7 @@
           case Instruction::SetNE: {
             // If we are comparing against bits always shifted out, the
             // comparison cannot succeed.
-            Constant *Comp = 
+            Constant *Comp =
               ConstantExpr::getShl(ConstantExpr::getShr(CI, ShAmt), ShAmt);
             if (Comp != CI) {// Comparing against a bit that we know is zero.
               bool IsSetNE = I.getOpcode() == Instruction::SetNE;
@@ -2556,7 +2556,7 @@
               } else {
                 Mask = ConstantInt::getAllOnesValue(CI->getType());
               }
-              
+
               Instruction *AndI =
                 BinaryOperator::createAnd(LHSI->getOperand(0),
                                           Mask, LHSI->getName()+".mask");
@@ -2577,15 +2577,15 @@
           case Instruction::SetNE: {
             // If we are comparing against bits always shifted out, the
             // comparison cannot succeed.
-            Constant *Comp = 
+            Constant *Comp =
               ConstantExpr::getShr(ConstantExpr::getShl(CI, ShAmt), ShAmt);
-            
+
             if (Comp != CI) {// Comparing against a bit that we know is zero.
               bool IsSetNE = I.getOpcode() == Instruction::SetNE;
               Constant *Cst = ConstantBool::get(IsSetNE);
               return ReplaceInstUsesWith(I, Cst);
             }
-              
+
             if (LHSI->hasOneUse() || CI->isNullValue()) {
               unsigned ShAmtVal = (unsigned)ShAmt->getValue();
 
@@ -2602,7 +2602,7 @@
               } else {
                 Mask = ConstantSInt::get(CI->getType(), Val);
               }
-              
+
               Instruction *AndI =
                 BinaryOperator::createAnd(LHSI->getOperand(0),
                                           Mask, LHSI->getName()+".mask");
@@ -2727,12 +2727,12 @@
                                                       I.getName()), I);
           }
         }
-        
+
         if (Op1)
           return new SelectInst(LHSI->getOperand(0), Op1, Op2);
         break;
       }
-    
+
     // Simplify seteq and setne instructions...
     if (I.getOpcode() == Instruction::SetEQ ||
         I.getOpcode() == Instruction::SetNE) {
@@ -2758,7 +2758,7 @@
               return BinaryOperator::create(I.getOpcode(), NewRem,
                                             Constant::getNullValue(UTy));
             }
-          break;          
+          break;
 
         case Instruction::Add:
           // Replace ((add A, B) != C) with (A != C-B) if B & C are constants.
@@ -2770,7 +2770,7 @@
             // Replace ((add A, B) != 0) with (A != -B) if A or B is
             // efficiently invertible, or if the add has just this one use.
             Value *BOp0 = BO->getOperand(0), *BOp1 = BO->getOperand(1);
-            
+
             if (Value *NegVal = dyn_castNegVal(BOp1))
               return new SetCondInst(I.getOpcode(), BOp0, NegVal);
             else if (Value *NegVal = dyn_castNegVal(BOp0))
@@ -2835,7 +2835,7 @@
                                          Instruction::SetGE, X,
                                      Constant::getNullValue(X->getType()));
             }
-            
+
             // ((X & ~7) == 0) --> X < 8
             if (CI->isNullValue() && isHighOnes(BOC)) {
               Value *X = BO->getOperand(0);
@@ -2857,14 +2857,14 @@
         }
       }
     } else {  // Not a SetEQ/SetNE
-      // If the LHS is a cast from an integral value of the same size, 
+      // If the LHS is a cast from an integral value of the same size,
       if (CastInst *Cast = dyn_cast<CastInst>(Op0)) {
         Value *CastOp = Cast->getOperand(0);
         const Type *SrcTy = CastOp->getType();
         unsigned SrcTySize = SrcTy->getPrimitiveSize();
         if (SrcTy != Cast->getType() && SrcTy->isInteger() &&
             SrcTySize == Cast->getType()->getPrimitiveSize()) {
-          assert((SrcTy->isSigned() ^ Cast->getType()->isSigned()) && 
+          assert((SrcTy->isSigned() ^ Cast->getType()->isSigned()) &&
                  "Source and destination signednesses should differ!");
           if (Cast->getType()->isSigned()) {
             // If this is a signed comparison, check for comparisons in the
@@ -2916,14 +2916,14 @@
       // We keep moving the cast from the left operand over to the right
       // operand, where it can often be eliminated completely.
       Op0 = CastOp0;
-      
+
       // If operand #1 is a cast instruction, see if we can eliminate it as
       // well.
       if (CastInst *CI2 = dyn_cast<CastInst>(Op1))
         if (CI2->getOperand(0)->getType()->isLosslesslyConvertibleTo(
                                                                Op0->getType()))
           Op1 = CI2->getOperand(0);
-      
+
       // If Op1 is a constant, we can fold the cast into the constant.
       if (Op1->getType() != Op0->getType())
         if (Constant *Op1C = dyn_cast<Constant>(Op1)) {
@@ -2978,7 +2978,7 @@
             return ReplaceInstUsesWith(I, ConstantBool::False);
           }
         }
-        
+
         // Otherwise, we can replace the setcc with a setcc of the smaller
         // operand value.
         Op1 = ConstantExpr::getCast(cast<Constant>(Op1), SrcTy);
@@ -2989,10 +2989,10 @@
   return Changed ? &I : 0;
 }
 
-// visitSetCondInstWithCastAndConstant - this method is part of the 
+// visitSetCondInstWithCastAndConstant - this method is part of the
 // visitSetCondInst method. It handles the situation where we have:
 //   (setcc (cast X to larger), CI)
-// It tries to remove the cast and even the setcc if the CI value 
+// It tries to remove the cast and even the setcc if the CI value
 // and range of the cast allow it.
 Instruction *
 InstCombiner::visitSetCondInstWithCastAndConstant(BinaryOperator&I,
@@ -3005,9 +3005,9 @@
 
   unsigned SrcBits = SrcTy->getPrimitiveSize()*8;
   unsigned DestBits = DestTy->getPrimitiveSize()*8;
-  if (SrcTy == Type::BoolTy) 
+  if (SrcTy == Type::BoolTy)
     SrcBits = 1;
-  if (DestTy == Type::BoolTy) 
+  if (DestTy == Type::BoolTy)
     DestBits = 1;
   if (SrcBits < DestBits) {
     // There are fewer bits in the source of the cast than in the result
@@ -3015,25 +3015,25 @@
     // value won't have changed due to sign extension.
     Constant *NewCst = ConstantExpr::getCast(CI, SrcTy);
     if (ConstantExpr::getCast(NewCst, DestTy) == CI) {
-      // The constant value operand of the setCC before and after a 
-      // cast to the source type of the cast instruction is the same 
-      // value, so we just replace with the same setcc opcode, but 
-      // using the source value compared to the constant casted to the 
-      // source type. 
+      // The constant value operand of the setCC before and after a
+      // cast to the source type of the cast instruction is the same
+      // value, so we just replace with the same setcc opcode, but
+      // using the source value compared to the constant casted to the
+      // source type.
       if (SrcTy->isSigned() && DestTy->isUnsigned()) {
         CastInst* Cst = new CastInst(LHSI->getOperand(0),
                                      SrcTy->getUnsignedVersion(),
                                      LHSI->getName());
         InsertNewInstBefore(Cst,I);
-        return new SetCondInst(I.getOpcode(), Cst, 
+        return new SetCondInst(I.getOpcode(), Cst,
                                ConstantExpr::getCast(CI,
                                                  SrcTy->getUnsignedVersion()));
       }
       return new SetCondInst(I.getOpcode(), LHSI->getOperand(0),NewCst);
     }
 
-    // The constant value before and after a cast to the source type 
-    // is different, so various cases are possible depending on the 
+    // The constant value before and after a cast to the source type
+    // is different, so various cases are possible depending on the
     // opcode and the signs of the types involved in the cast.
     switch (I.getOpcode()) {
     case Instruction::SetLT: {
@@ -3052,14 +3052,14 @@
       // We're looking for equality, and we know the values are not
       // equal so replace with constant False.
       return ReplaceInstUsesWith(I, ConstantBool::False);
-    case Instruction::SetNE: 
+    case Instruction::SetNE:
       // We're testing for inequality, and we know the values are not
       // equal so replace with constant True.
       return ReplaceInstUsesWith(I, ConstantBool::True);
-    case Instruction::SetLE: 
-    case Instruction::SetGE: 
+    case Instruction::SetLE:
+    case Instruction::SetGE:
       assert(0 && "SetLE and SetGE should be handled elsewhere");
-    default: 
+    default:
       assert(0 && "unknown integer comparison");
     }
   }
@@ -3123,7 +3123,7 @@
         if (Constant *BOOp = dyn_cast<Constant>(BO->getOperand(1)))
           return BinaryOperator::createMul(BO->getOperand(0),
                                            ConstantExpr::getShl(BOOp, CUI));
-    
+
     // Try to fold constant and into select arguments.
     if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
       if (Instruction *R = FoldOpIntoSelect(I, SI, this))
@@ -3219,7 +3219,7 @@
                                  dyn_cast<ConstantUInt>(Op0SI->getOperand(1))) {
         unsigned ShiftAmt1 = (unsigned)ShiftAmt1C->getValue();
         unsigned ShiftAmt2 = (unsigned)CUI->getValue();
-        
+
         // Check for (A << c1) << c2   and   (A >> c1) >> c2
         if (I.getOpcode() == Op0SI->getOpcode()) {
           unsigned Amt = ShiftAmt1+ShiftAmt2;   // Fold into one big shift...
@@ -3228,7 +3228,7 @@
           return new ShiftInst(I.getOpcode(), Op0SI->getOperand(0),
                                ConstantUInt::get(Type::UByteTy, Amt));
         }
-        
+
         // Check for (A << c1) >> c2 or visaversa.  If we are dealing with
         // signed types, we can only support the (A >> c1) << c2 configuration,
         // because it can not turn an arbitrary bit of A into a sign bit.
@@ -3239,12 +3239,12 @@
             C = ConstantExpr::getShl(C, ShiftAmt1C);
           else
             C = ConstantExpr::getShr(C, ShiftAmt1C);
-          
+
           Instruction *Mask =
             BinaryOperator::createAnd(Op0SI->getOperand(0), C,
                                       Op0SI->getOperand(0)->getName()+".mask");
           InsertNewInstBefore(Mask, I);
-          
+
           // Figure out what flavor of shift we should use...
           if (ShiftAmt1 == ShiftAmt2)
             return ReplaceInstUsesWith(I, Mask);  // (A << c) >> c  === A & c2
@@ -3293,7 +3293,7 @@
                                           const Type *DstTy, TargetData *TD) {
 
   // It is legal to eliminate the instruction if casting A->B->A if the sizes
-  // are identical and the bits don't get reinterpreted (for example 
+  // are identical and the bits don't get reinterpreted (for example
   // int->float->int would not be allowed).
   if (SrcTy == DstTy && SrcTy->isLosslesslyConvertibleTo(MidTy))
     return true;
@@ -3341,7 +3341,7 @@
       CastType ResultCast = getCastType(SrcTy, DstTy);
       if (ResultCast == Noop || ResultCast == Truncate)
         return true;
-      // Otherwise we are still growing the value, we are only safe if the 
+      // Otherwise we are still growing the value, we are only safe if the
       // result will match the sign/zeroextendness of the result.
       return ResultCast == FirstCast;
     }
@@ -3402,7 +3402,7 @@
     // If this is an A->B->A cast, and we are dealing with integral types, try
     // to convert this into a logical 'and' instruction.
     //
-    if (A->getType()->isInteger() && 
+    if (A->getType()->isInteger() &&
         CI.getType()->isInteger() && CSrc->getType()->isInteger() &&
         CSrc->getType()->isUnsigned() &&   // B->A cast must zero extend
         CSrc->getType()->getPrimitiveSize() < CI.getType()->getPrimitiveSize()&&
@@ -3422,7 +3422,7 @@
       return And;
     }
   }
-  
+
   // If this is a cast to bool, turn it into the appropriate setne instruction.
   if (CI.getType() == Type::BoolTy)
     return BinaryOperator::createSetNE(CI.getOperand(0),
@@ -3460,7 +3460,7 @@
 
           // If the allocation is for an even multiple of the cast type size
           if (CastElTySize && (AllocElTySize % CastElTySize == 0)) {
-            Value *Amt = ConstantUInt::get(Type::UIntTy, 
+            Value *Amt = ConstantUInt::get(Type::UIntTy,
                                          AllocElTySize/CastElTySize);
             std::string Name = AI->getName(); AI->setName("");
             AllocationInst *New;
@@ -3527,7 +3527,7 @@
         break;
       }
     }
-  
+
   return 0;
 }
 
@@ -3553,7 +3553,7 @@
   case Instruction::Sub:   // Can only fold on the amount subtracted.
   case Instruction::Shl:   // Can only fold on the shift amount.
   case Instruction::Shr:
-    return 1;           
+    return 1;
   default:
     return 0;              // Cannot fold
   }
@@ -3592,7 +3592,7 @@
     } else {
       return 0;  // unknown unary op.
     }
-    
+
     // Fold this by inserting a select from the input values.
     SelectInst *NewSI = new SelectInst(SI.getCondition(), TI->getOperand(0),
                                        FI->getOperand(0), SI.getName()+".v");
@@ -3732,9 +3732,9 @@
               cast<Constant>(IC->getOperand(1))->isNullValue())
             if (Instruction *ICA = dyn_cast<Instruction>(IC->getOperand(0)))
               if (ICA->getOpcode() == Instruction::And &&
-                  isa<ConstantInt>(ICA->getOperand(1)) && 
-                  (ICA->getOperand(1) == TrueValC || 
-                   ICA->getOperand(1) == FalseValC) && 
+                  isa<ConstantInt>(ICA->getOperand(1)) &&
+                  (ICA->getOperand(1) == TrueValC ||
+                   ICA->getOperand(1) == FalseValC) &&
                   isOneBitSet(cast<ConstantInt>(ICA->getOperand(1)))) {
                 // Okay, now we know that everything is set up, we just don't
                 // know whether we have a setne or seteq and whether the true or
@@ -3770,7 +3770,7 @@
       // NOTE: if we wanted to, this is where to detect MIN/MAX/ABS/etc.
     }
   }
-  
+
   if (Instruction *TI = dyn_cast<Instruction>(TrueVal))
     if (Instruction *FI = dyn_cast<Instruction>(FalseVal))
       if (TI->hasOneUse() && FI->hasOneUse()) {
@@ -3821,14 +3821,14 @@
                 std::swap(NewTrueOp, NewFalseOp);
               Instruction *NewSel =
                 new SelectInst(CondVal, NewTrueOp,NewFalseOp,SI.getName()+".p");
-                               
+
               NewSel = InsertNewInstBefore(NewSel, SI);
               return BinaryOperator::createAdd(SubOp->getOperand(0), NewSel);
             }
           }
         }
       }
-  
+
   // See if we can fold the select into one of our operands.
   if (SI.getType()->isInteger()) {
     // See the comment above GetSelectFoldableOperands for a description of the
@@ -3906,7 +3906,7 @@
       if (NumBytes->isNullValue()) return EraseInstFromFunction(CI);
 
       // FIXME: Increase alignment here.
-      
+
       if (ConstantInt *CI = dyn_cast<ConstantInt>(NumBytes))
         if (CI->getRawValue() == 1) {
           // Replace the instruction with just byte operations.  We would
@@ -3998,7 +3998,7 @@
         }
       }
   }
-  
+
   return Changed ? CS.getInstruction() : 0;
 }
 
@@ -4043,12 +4043,12 @@
 
   unsigned NumActualArgs = unsigned(CS.arg_end()-CS.arg_begin());
   unsigned NumCommonArgs = std::min(FT->getNumParams(), NumActualArgs);
-                                    
+
   CallSite::arg_iterator AI = CS.arg_begin();
   for (unsigned i = 0, e = NumCommonArgs; i != e; ++i, ++AI) {
     const Type *ParamTy = FT->getParamType(i);
     bool isConvertible = (*AI)->getType()->isLosslesslyConvertibleTo(ParamTy);
-    if (Callee->isExternal() && !isConvertible) return false;    
+    if (Callee->isExternal() && !isConvertible) return false;
   }
 
   if (FT->getNumParams() < NumActualArgs && !FT->isVarArg() &&
@@ -4200,7 +4200,7 @@
     InsertNewInstBefore(NewPN, PN);
     PhiVal = NewPN;
   }
-  
+
   // Insert and return the new operation.
   if (isa<CastInst>(FirstInst))
     return new CastInst(PhiVal, PN.getType());
@@ -4223,7 +4223,7 @@
 
   if (PHINode *PU = dyn_cast<PHINode>(PN->use_back()))
     return DeadPHICycle(PU, PotentiallyDeadPHIs);
-  
+
   return false;
 }
 
@@ -4295,7 +4295,7 @@
       if (DeadPHICycle(PU, PotentiallyDeadPHIs))
         return ReplaceInstUsesWith(PN, UndefValue::get(PN.getType()));
     }
-  
+
   return 0;
 }
 
@@ -4353,7 +4353,7 @@
             // We can always eliminate a cast from int to [u]long.  We can
             // eliminate a cast from uint to [u]long iff the target is a 32-bit
             // pointer target.
-            if (SrcTy->isSigned() || 
+            if (SrcTy->isSigned() ||
                 SrcTy->getPrimitiveSize() >= TD->getPointerSize()) {
               MadeChange = true;
               GEP.setOperand(i, Src);
@@ -4412,7 +4412,7 @@
     for (gep_type_iterator I = gep_type_begin(*cast<User>(PtrOp)),
            E = gep_type_end(*cast<User>(PtrOp)); I != E; ++I)
       EndsWithSequential = !isa<StructType>(*I);
-  
+
     // Can we combine the two pointer arithmetics offsets?
     if (EndsWithSequential) {
       // Replace: gep (gep %P, long B), long A, ...
@@ -4466,9 +4466,9 @@
         Indices.push_back(Sum);
         Indices.insert(Indices.end(), GEP.op_begin()+2, GEP.op_end());
       }
-    } else if (isa<Constant>(*GEP.idx_begin()) && 
+    } else if (isa<Constant>(*GEP.idx_begin()) &&
                cast<Constant>(*GEP.idx_begin())->isNullValue() &&
-               SrcGEPOperands.size() != 1) { 
+               SrcGEPOperands.size() != 1) {
       // Otherwise we can do the fold if the first index of the GEP is a zero
       Indices.insert(Indices.end(), SrcGEPOperands.begin()+1,
                      SrcGEPOperands.end());
@@ -4526,7 +4526,7 @@
         const Type *SrcElTy = cast<PointerType>(X->getType())->getElementType();
         const Type *ResElTy =cast<PointerType>(CE->getType())->getElementType();
         if (isa<ArrayType>(SrcElTy) &&
-            TD->getTypeSize(cast<ArrayType>(SrcElTy)->getElementType()) == 
+            TD->getTypeSize(cast<ArrayType>(SrcElTy)->getElementType()) ==
             TD->getTypeSize(ResElTy)) {
           Value *V = InsertNewInstBefore(
                  new GetElementPtrInst(X, Constant::getNullValue(Type::IntTy),
@@ -4556,7 +4556,7 @@
       }
 
       InsertNewInstBefore(New, AI);
-      
+
       // Scan to the end of the allocation instructions, to skip over a block of
       // allocas if possible...
       //
@@ -4579,7 +4579,7 @@
   // If alloca'ing a zero byte object, replace the alloca with a null pointer.
   // Note that we only do this for alloca's, because malloc should allocate and
   // return a unique pointer, even for a zero byte allocation.
-  if (isa<AllocaInst>(AI) && AI.getAllocatedType()->isSized() && 
+  if (isa<AllocaInst>(AI) && AI.getAllocatedType()->isSized() &&
       TD->getTypeSize(AI.getAllocatedType()) == 0)
     return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
 
@@ -4682,9 +4682,9 @@
           // Do not allow turning this into a load of an integer, which is then
           // casted to a pointer, this pessimizes pointer analysis a lot.
           (isa<PointerType>(SrcPTy) == isa<PointerType>(LI.getType())) &&
-          IC.getTargetData().getTypeSize(SrcPTy) == 
+          IC.getTargetData().getTypeSize(SrcPTy) ==
                IC.getTargetData().getTypeSize(DestPTy)) {
-          
+
         // Okay, we are casting from one integer or pointer type to another of
         // the same size.  Instead of casting the pointer before the load, cast
         // the result of the loaded value.
@@ -4721,7 +4721,7 @@
       if (LI->getOperand(0) == V) return true;
     } else if (StoreInst *SI = dyn_cast<StoreInst>(BBI))
       if (SI->getOperand(1) == V) return true;
-    
+
   }
   return false;
 }
@@ -4743,7 +4743,7 @@
     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Op))
       if (GV->isConstant() && !GV->isExternal())
         return ReplaceInstUsesWith(LI, GV->getInitializer());
-    
+
     // Instcombine load (constantexpr_GEP global, 0, ...) into the value loaded.
     if (ConstantExpr *CE = dyn_cast<ConstantExpr>(Op))
       if (CE->getOpcode() == Instruction::GetElementPtr) {
@@ -4867,7 +4867,7 @@
           }
 
       if ((SrcPTy->isInteger() || isa<PointerType>(SrcPTy)) &&
-          IC.getTargetData().getTypeSize(SrcPTy) == 
+          IC.getTargetData().getTypeSize(SrcPTy) ==
                IC.getTargetData().getTypeSize(DestPTy)) {
 
         // Okay, we are casting from one integer or pointer type to another of
@@ -4967,7 +4967,7 @@
       WorkList.push_back(cast<Instruction>(NewSCC));
       return &BI;
     }
-  
+
   return 0;
 }
 
@@ -5004,7 +5004,7 @@
 
   // Cannot move control-flow-involving instructions.
   if (isa<PHINode>(I) || isa<InvokeInst>(I) || isa<CallInst>(I)) return false;
-  
+
   // Do not sink alloca instructions out of the entry block.
   if (isa<AllocaInst>(I) && I->getParent() == &DestBlock->getParent()->front())
     return false;
@@ -5024,7 +5024,7 @@
   while (isa<PHINode>(InsertPos)) ++InsertPos;
 
   BasicBlock *SrcBlock = I->getParent();
-  DestBlock->getInstList().splice(InsertPos, SrcBlock->getInstList(), I);  
+  DestBlock->getInstList().splice(InsertPos, SrcBlock->getInstList(), I);
   ++NumSunkInst;
   return true;
 }
@@ -5165,7 +5165,7 @@
           for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
             if (Instruction *OpI = dyn_cast<Instruction>(I->getOperand(i)))
               WorkList.push_back(OpI);
-          
+
           // Instructions may end up in the worklist more than once.  Erase all
           // occurrances of this instruction.
           removeFromWorkList(I);


Index: llvm/lib/Transforms/Scalar/LICM.cpp
diff -u llvm/lib/Transforms/Scalar/LICM.cpp:1.72 llvm/lib/Transforms/Scalar/LICM.cpp:1.73
--- llvm/lib/Transforms/Scalar/LICM.cpp:1.72	Thu Mar 24 18:22:36 2005
+++ llvm/lib/Transforms/Scalar/LICM.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===-- LICM.cpp - Loop Invariant Code Motion Pass ------------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass performs loop invariant code motion, attempting to remove as much
@@ -89,7 +89,7 @@
     Loop *CurLoop;           // The current loop we are working on...
     AliasSetTracker *CurAST; // AliasSet information for the current loop...
 
-    /// visitLoop - Hoist expressions out of the specified loop...    
+    /// visitLoop - Hoist expressions out of the specified loop...
     ///
     void visitLoop(Loop *L, AliasSetTracker &AST);
 
@@ -131,21 +131,21 @@
       BasicBlock *LoopHeader = CurLoop->getHeader();
       if (BlockInLoop == LoopHeader)
         return true;
-      
+
       DominatorTree::Node *BlockInLoopNode = DT->getNode(BlockInLoop);
       DominatorTree::Node *IDom            = DT->getNode(ExitBlock);
-    
+
       // Because the exit block is not in the loop, we know we have to get _at
       // least_ its immediate dominator.
       do {
         // Get next Immediate Dominator.
         IDom = IDom->getIDom();
-        
+
         // If we have got to the header of the loop, then the instructions block
         // did not dominate the exit node, so we can't hoist it.
         if (IDom->getBlock() == LoopHeader)
           return false;
-        
+
       } while (IDom != BlockInLoopNode);
 
       return true;
@@ -170,7 +170,7 @@
 
     /// pointerInvalidatedByLoop - Return true if the body of this loop may
     /// store into the memory location pointed to by V.
-    /// 
+    ///
     bool pointerInvalidatedByLoop(Value *V, unsigned Size) {
       // Check to see if any of the basic blocks in CurLoop invalidate *V.
       return CurAST->getAliasSetForPointer(V, Size).isMod();
@@ -222,7 +222,7 @@
 }
 
 
-/// visitLoop - Hoist expressions out of the specified loop...    
+/// visitLoop - Hoist expressions out of the specified loop...
 ///
 void LICM::visitLoop(Loop *L, AliasSetTracker &AST) {
   // Recurse through all subloops before we process this loop...
@@ -296,7 +296,7 @@
 
   for (BasicBlock::iterator II = BB->end(); II != BB->begin(); ) {
     Instruction &I = *--II;
-    
+
     // Check to see if we can sink this instruction to the exit blocks
     // of the loop.  We can do this if the all users of the instruction are
     // outside of the loop.  In this case, it doesn't even matter if the
@@ -327,12 +327,12 @@
   if (!inSubLoop(BB))
     for (BasicBlock::iterator II = BB->begin(), E = BB->end(); II != E; ) {
       Instruction &I = *II++;
-      
+
       // Try hoisting the instruction out to the preheader.  We can only do this
       // if all of the operands of the instruction are loop invariant and if it
       // is safe to hoist the instruction.
       //
-      if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) && 
+      if (isLoopInvariantInst(I) && canSinkOrHoistInst(I) &&
           isSafeToExecuteUnconditionally(I))
           hoist(I);
       }
@@ -380,11 +380,11 @@
 
     // FIXME: This should use mod/ref information to see if we can hoist or sink
     // the call.
-    
+
     return false;
   }
 
-  return isa<BinaryOperator>(I) || isa<ShiftInst>(I) || isa<CastInst>(I) || 
+  return isa<BinaryOperator>(I) || isa<ShiftInst>(I) || isa<CastInst>(I) ||
          isa<SelectInst>(I) ||
          isa<GetElementPtrInst>(I) || isa<VANextInst>(I) || isa<VAArgInst>(I);
 }
@@ -452,7 +452,7 @@
       // Move the instruction to the start of the exit block, after any PHI
       // nodes in it.
       I.getParent()->getInstList().remove(&I);
-      
+
       BasicBlock::iterator InsertPt = ExitBlocks[0]->begin();
       while (isa<PHINode>(InsertPt)) ++InsertPt;
       ExitBlocks[0]->getInstList().insert(InsertPt, &I);
@@ -472,7 +472,7 @@
     if (I.getType() != Type::VoidTy)
       AI = new AllocaInst(I.getType(), 0, I.getName(),
                           I.getParent()->getParent()->front().begin());
-    
+
     // Secondly, insert load instructions for each use of the instruction
     // outside of the loop.
     while (!I.use_empty()) {
@@ -519,7 +519,7 @@
           // Insert the code after the last PHI node...
           BasicBlock::iterator InsertPt = ExitBlock->begin();
           while (isa<PHINode>(InsertPt)) ++InsertPt;
-          
+
           // If this is the first exit block processed, just move the original
           // instruction, otherwise clone the original instruction and insert
           // the copy.
@@ -535,7 +535,7 @@
               New->setName(I.getName()+".le");
             ExitBlock->getInstList().insert(InsertPt, New);
           }
-          
+
           // Now that we have inserted the instruction, store it into the alloca
           if (AI) new StoreInst(New, AI, InsertPt);
         }
@@ -547,7 +547,7 @@
       CurAST->deleteValue(&I);
       I.getParent()->getInstList().erase(&I);
     }
-      
+
     // Finally, promote the fine value to SSA form.
     if (AI) {
       std::vector<AllocaInst*> Allocas;
@@ -561,7 +561,7 @@
 /// that is safe to hoist, this instruction is called to do the dirty work.
 ///
 void LICM::hoist(Instruction &I) {
-  DEBUG(std::cerr << "LICM hoisting to " << Preheader->getName() 
+  DEBUG(std::cerr << "LICM hoisting to " << Preheader->getName()
                   << ": " << I);
 
   // Remove the instruction from its current basic block... but don't delete the
@@ -570,7 +570,7 @@
 
   // Insert the new node in Preheader, before the terminator.
   Preheader->getInstList().insert(Preheader->getTerminator(), &I);
-  
+
   if (isa<LoadInst>(I)) ++NumMovedLoads;
   else if (isa<CallInst>(I)) ++NumMovedCalls;
   ++NumHoisted;
@@ -584,7 +584,7 @@
 bool LICM::isSafeToExecuteUnconditionally(Instruction &Inst) {
   // If it is not a trapping instruction, it is always safe to hoist.
   if (!Inst.isTrapping()) return true;
-  
+
   // Otherwise we have to check to make sure that the instruction dominates all
   // of the exit blocks.  If it doesn't, then there is a path out of the loop
   // which does not execute this instruction, so we can't hoist it.
@@ -610,7 +610,7 @@
   for (unsigned i = 0, e = ExitBlocks.size(); i != e; ++i)
     if (!isExitBlockDominatedByBlockInLoop(ExitBlocks[i], Inst.getParent()))
       return false;
-  
+
   return true;
 }
 
@@ -672,7 +672,7 @@
     // Store into the temporary alloca.
     new StoreInst(LI, PromotedValues[i].first, LoopPredInst);
   }
-  
+
   // Scan the basic blocks in the loop, replacing uses of our pointers with
   // uses of the allocas in question.
   //
@@ -777,10 +777,10 @@
 
         // Update the AST and alias analysis.
         CurAST->copyValue(V, AI);
-        
+
         for (AliasSet::iterator I = AS.begin(), E = AS.end(); I != E; ++I)
           ValueToAllocaMap.insert(std::make_pair(I->first, AI));
-        
+
         DEBUG(std::cerr << "LICM: Promoting value: " << *V << "\n");
       }
     }


Index: llvm/lib/Transforms/Scalar/LoopSimplify.cpp
diff -u llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.55 llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.56
--- llvm/lib/Transforms/Scalar/LoopSimplify.cpp:1.55	Fri Mar 25 00:37:22 2005
+++ llvm/lib/Transforms/Scalar/LoopSimplify.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LoopSimplify.cpp - Loop Canonicalization Pass ----------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass performs several transformations to transform natural loops into a
@@ -60,7 +60,7 @@
     AliasAnalysis *AA;
 
     virtual bool runOnFunction(Function &F);
-    
+
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       // We need loop information to identify the loops...
       AU.addRequired<LoopInfo>();
@@ -204,13 +204,13 @@
 BasicBlock *LoopSimplify::SplitBlockPredecessors(BasicBlock *BB,
                                                  const char *Suffix,
                                        const std::vector<BasicBlock*> &Preds) {
-  
+
   // Create new basic block, insert right before the original block...
   BasicBlock *NewBB = new BasicBlock(BB->getName()+Suffix, BB->getParent(), BB);
 
   // The preheader first gets an unconditional branch to the loop header...
   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
   // possible cases here.  If the loop is dead, we just insert dummy entries
@@ -232,13 +232,13 @@
           InVal = 0;
           break;
         }
-      
+
       // If the values coming into the block are not the same, we need a PHI.
       if (InVal == 0) {
         // Create the new PHI node, insert it into NewBB at the end of the block
         PHINode *NewPHI = new PHINode(PN->getType(), PN->getName()+".ph", BI);
         if (AA) AA->copyValue(PN, NewPHI);
-        
+
         // Move all of the edges from blocks outside the loop to the new PHI
         for (unsigned i = 0, e = Preds.size(); i != e; ++i) {
           Value *V = PN->removeIncomingValue(Preds[i], false);
@@ -266,7 +266,7 @@
         }
       }
     }
-    
+
     // Now that the PHI nodes are updated, actually move the edges from
     // Preds to point to NewBB instead of BB.
     //
@@ -276,14 +276,14 @@
         if (TI->getSuccessor(s) == BB)
           TI->setSuccessor(s, NewBB);
     }
-    
+
   } else {                       // Otherwise the loop is dead...
     for (BasicBlock::iterator I = BB->begin(); isa<PHINode>(I); ++I) {
       PHINode *PN = cast<PHINode>(I);
       // Insert dummy values as the incoming value...
       PN->addIncoming(Constant::getNullValue(PN->getType()), NewBB);
     }
-  }  
+  }
   return NewBB;
 }
 
@@ -300,15 +300,15 @@
        PI != PE; ++PI)
       if (!L->contains(*PI))           // Coming in from outside the loop?
         OutsideBlocks.push_back(*PI);  // Keep track of it...
-  
+
   // Split out the loop pre-header
   BasicBlock *NewBB =
     SplitBlockPredecessors(Header, ".preheader", OutsideBlocks);
-  
+
   //===--------------------------------------------------------------------===//
   //  Update analysis results now that we have performed the transformation
   //
-  
+
   // We know that we have loop information to update... update it now.
   if (Loop *Parent = L->getParentLoop())
     Parent->addBasicBlockToLoop(NewBB, getAnalysis<LoopInfo>());
@@ -330,7 +330,7 @@
 
   DominatorSet &DS = getAnalysis<DominatorSet>();  // Update dominator info
   DominatorTree &DT = getAnalysis<DominatorTree>();
-    
+
 
   // Update the dominator tree information.
   // The immediate dominator of the preheader is the immediate dominator of
@@ -353,16 +353,16 @@
            E = df_end(PHDomTreeNode); DFI != E; ++DFI)
       DS.addDominator((*DFI)->getBlock(), NewBB);
   }
-  
+
   // Update immediate dominator information if we have it...
   if (ImmediateDominators *ID = getAnalysisToUpdate<ImmediateDominators>()) {
     // Whatever i-dominated the header node now immediately dominates NewBB
     ID->addNewBlock(NewBB, ID->get(Header));
-    
+
     // The preheader now is the immediate dominator for the header node...
     ID->setImmediateDominator(Header, NewBB);
   }
-  
+
   // Update dominance frontier information...
   if (DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>()) {
     // The DF(NewBB) is just (DF(Header)-Header), because NewBB dominates
@@ -405,7 +405,7 @@
 /// outside of the loop.
 BasicBlock *LoopSimplify::RewriteLoopExitBlock(Loop *L, BasicBlock *Exit) {
   DominatorSet &DS = getAnalysis<DominatorSet>();
-  
+
   std::vector<BasicBlock*> LoopBlocks;
   for (pred_iterator I = pred_begin(Exit), E = pred_end(Exit); I != E; ++I)
     if (L->contains(*I))
@@ -579,7 +579,7 @@
   // Move the new backedge block to right after the last backedge block.
   Function::iterator InsertPos = BackedgeBlocks.back(); ++InsertPos;
   F->getBasicBlockList().splice(InsertPos, F->getBasicBlockList(), BEBlock);
-  
+
   // Now that the block has been inserted into the function, create PHI nodes in
   // the backedge block which correspond to any PHI nodes in the header block.
   for (BasicBlock::iterator I = Header->begin(); isa<PHINode>(I); ++I) {
@@ -609,7 +609,7 @@
         }
       }
     }
-      
+
     // Delete all of the incoming values from the old PN except the preheader's
     assert(PreheaderIdx != ~0U && "PHI has no preheader entry??");
     if (PreheaderIdx != 0) {
@@ -825,7 +825,7 @@
       for (DominatorSet::DomSetType::const_iterator PDI = PredDoms.begin(),
              PDE = PredDoms.end(); PDI != PDE; ++PDI) {
         BasicBlock *PredDom = *PDI;
-        
+
         // If the NewBBSucc node is in DF(PredDom), then PredDom didn't
         // dominate NewBBSucc but did dominate a predecessor of it.  Now we
         // change this entry to include NewBB in the DF instead of NewBBSucc.
@@ -846,7 +846,7 @@
                 break;
               }
           }
-            
+
           if (ShouldRemove)
             DF->removeFromFrontier(DFI, NewBBSucc);
           DF->addToFrontier(DFI, NewBB);


Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.12 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.13
--- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.12	Sun Mar  6 16:52:29 2005
+++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LoopStrengthReduce.cpp - Strength Reduce GEPs in Loops -------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by Nate Begeman and is distributed under the
 // University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass performs a strength reduction on array references inside loops that
@@ -85,7 +85,7 @@
                            std::set<Instruction*> &DeadInsts);
     void DeleteTriviallyDeadInstructions(std::set<Instruction*> &Insts);
   };
-  RegisterOpt<LoopStrengthReduce> X("loop-reduce", 
+  RegisterOpt<LoopStrengthReduce> X("loop-reduce",
                                     "Strength Reduce GEP Uses of Ind. Vars");
 }
 
@@ -170,7 +170,7 @@
     Cache = Cache->get(operand);
   }
   assert(indvar > 0 && "Indvar used by GEP not found in operand list");
-  
+
   // Ensure the pointer base is loop invariant.  While strength reduction
   // makes sense even if the pointer changed on every iteration, there is no
   // realistic way of handling it unless GEPs were completely decomposed into
@@ -185,9 +185,9 @@
   if (sz && (sz & (sz-1)) == 0)   // Power of two?
     if (sz <= (1ULL << (MaxTargetAMSize-1)))
       return;
-  
+
   // If all operands of the GEP we are going to insert into the preheader
-  // are constants, generate a GEP ConstantExpr instead. 
+  // are constants, generate a GEP ConstantExpr instead.
   //
   // If there is only one operand after the initial non-constant one, we know
   // that it was the induction variable, and has been replaced by a constant
@@ -202,7 +202,7 @@
       PreGEP = GEPI->getOperand(0);
     } else {
       PreGEP = new GetElementPtrInst(GEPI->getOperand(0),
-                                    pre_op_vector, GEPI->getName()+".pre", 
+                                    pre_op_vector, GEPI->getName()+".pre",
                                     Preheader->getTerminator());
     }
 
@@ -210,15 +210,15 @@
     // choose between the initial GEP we created and inserted into the
     // preheader, and the incremented GEP that we will create below and insert
     // into the loop body.
-    NewPHI = new PHINode(PreGEP->getType(), 
+    NewPHI = new PHINode(PreGEP->getType(),
                                   GEPI->getName()+".str", InsertBefore);
     NewPHI->addIncoming(PreGEP, Preheader);
-    
+
     // Now, create the GEP instruction to increment by one the value selected
     // by the PHI instruction we just created above, and add it as the second
     // incoming Value/BasicBlock pair to the PHINode.  It is inserted before
     // the increment of the canonical induction variable.
-    Instruction *IncrInst = 
+    Instruction *IncrInst =
       const_cast<Instruction*>(L->getCanonicalInductionVariableIncrement());
     GetElementPtrInst *StrGEP = new GetElementPtrInst(NewPHI, inc_op_vector,
                                                       GEPI->getName()+".inc",
@@ -233,7 +233,7 @@
     // about to create.
     NewPHI = Cache->CachedPHINode;
   }
-  
+
   if (GEPI->getNumOperands() - 1 == indvar) {
     // If there were no operands following the induction variable, replace all
     // uses of the old GEP instruction with the new PHI.
@@ -252,7 +252,7 @@
                                                       GEPI);
     GEPI->replaceAllUsesWith(newGEP);
   }
-  
+
   // The old GEP is now dead.
   DeadInsts.insert(GEPI);
   ++NumReduced;
@@ -273,7 +273,7 @@
   // pass creates code like this, which we can't currently detect:
   //  %tmp.1 = sub uint 2000, %indvar
   //  %tmp.8 = getelementptr int* %y, uint %tmp.1
-  
+
   // Strength reduce all GEPs in the Loop.  Insert secondary PHI nodes for the
   // strength reduced pointers we'll be creating after the canonical induction
   // variable's PHI.


Index: llvm/lib/Transforms/Scalar/LoopUnroll.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.16 llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.17
--- llvm/lib/Transforms/Scalar/LoopUnroll.cpp:1.16	Sun Mar  6 14:57:32 2005
+++ llvm/lib/Transforms/Scalar/LoopUnroll.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===-- LoopUnroll.cpp - Loop unroller pass -------------------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass implements a simple loop unroller.  It works best when loops have
@@ -88,7 +88,7 @@
       } else if (I->hasOneUse() && I->use_back() == Term) {
         // Ignore instructions only used by the loop terminator.
       } else if (DbgInfoIntrinsic *DbgI = dyn_cast<DbgInfoIntrinsic>(I)) {
-	// Ignore debug instructions 
+	// Ignore debug instructions
       } else {
         ++Size;
       }
@@ -102,10 +102,10 @@
   return Size;
 }
 
-// RemapInstruction - Convert the instruction operands from referencing the 
+// RemapInstruction - Convert the instruction operands from referencing the
 // current values into those specified by ValueMap.
 //
-static inline void RemapInstruction(Instruction *I, 
+static inline void RemapInstruction(Instruction *I,
                                     std::map<const Value *, Value*> &ValueMap) {
   for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
     Value *Op = I->getOperand(op);
@@ -150,7 +150,7 @@
     return Changed;
   }
   DEBUG(std::cerr << "UNROLLING!\n");
- 
+
   unsigned TripCount = (unsigned)TripCountFull;
 
   BasicBlock *LoopExit = BI->getSuccessor(L->contains(BI->getSuccessor(0)));
@@ -235,7 +235,7 @@
     PN->replaceAllUsesWith(PN->getIncomingValueForBlock(Preheader));
     BB->getInstList().erase(PN);
   }
- 
+
   // Finally, add an unconditional branch to the block to continue into the exit
   // block.
   new BranchInst(LoopExit, BB);
@@ -245,7 +245,7 @@
   // go.
   for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ) {
     Instruction *Inst = I++;
-    
+
     if (isInstructionTriviallyDead(Inst))
       BB->getInstList().erase(Inst);
     else if (Constant *C = ConstantFoldInstruction(Inst)) {


Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.4 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.5
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.4	Wed Jan  5 23:47:18 2005
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===-- LoopUnswitch.cpp - Hoist loop-invariant conditionals in loop ------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass transforms loops that contain branches on loop-invariant conditions
@@ -116,15 +116,15 @@
         } else {
           // FIXME: check for profitability.
           //std::cerr << "BEFORE:\n"; LI->dump();
-          
+
           VersionLoop(BI->getCondition(), L);
-          
+
           //std::cerr << "AFTER:\n"; LI->dump();
           return true;
         }
       }
   }
-  
+
   return Changed;
 }
 
@@ -152,10 +152,10 @@
 }
 
 
-// RemapInstruction - Convert the instruction operands from referencing the 
+// RemapInstruction - Convert the instruction operands from referencing the
 // current values into those specified by ValueMap.
 //
-static inline void RemapInstruction(Instruction *I, 
+static inline void RemapInstruction(Instruction *I,
                                     std::map<const Value *, Value*> &ValueMap) {
   for (unsigned op = 0, E = I->getNumOperands(); op != E; ++op) {
     Value *Op = I->getOperand(op);
@@ -185,7 +185,7 @@
   // Add all of the subloops to the new loop.
   for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
     CloneLoop(*I, New, VM, LI);
-  
+
   return New;
 }
 
@@ -210,7 +210,7 @@
         !NL->contains(cast<Instruction>(*UI)->getParent()))
       goto UsedOutsideOfLoop;
   return 0;
-  
+
 UsedOutsideOfLoop:
   // Okay, this instruction is used outside of the current loop.  Insert a PHI
   // nodes for the instruction merging the values together.


Index: llvm/lib/Transforms/Scalar/LowerAllocations.cpp
diff -u llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.52 llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.53
--- llvm/lib/Transforms/Scalar/LowerAllocations.cpp:1.52	Wed Mar  2 19:03:43 2005
+++ llvm/lib/Transforms/Scalar/LowerAllocations.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LowerAllocations.cpp - Reduce malloc & free insts to calls ---------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // The LowerAllocations transformation is a target-dependent tranformation
@@ -49,7 +49,7 @@
     virtual bool doInitialization(Function &F) {
       return BasicBlockPass::doInitialization(F);
     }
-    
+
     /// runOnBasicBlock - This method does the actual work of converting
     /// instructions over, assuming that the pass has already been initialized.
     ///
@@ -104,7 +104,7 @@
   for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) {
     if (MallocInst *MI = dyn_cast<MallocInst>(I)) {
       const Type *AllocTy = MI->getType()->getElementType();
-      
+
       // malloc(type) becomes sbyte *malloc(size)
       Value *MallocArg;
       if (LowerMallocArgToInteger)
@@ -133,7 +133,7 @@
 
       const FunctionType *MallocFTy = MallocFunc->getFunctionType();
       std::vector<Value*> MallocArgs;
-      
+
       if (MallocFTy->getNumParams() > 0 || MallocFTy->isVarArg()) {
         if (MallocFTy->isVarArg()) {
           if (MallocArg->getType() != IntPtrTy)
@@ -150,14 +150,14 @@
 
       // Create the call to Malloc...
       CallInst *MCall = new CallInst(MallocFunc, MallocArgs, "", I);
-      
+
       // Create a cast instruction to convert to the right type...
       Value *MCast;
       if (MCall->getType() != Type::VoidTy)
         MCast = new CastInst(MCall, MI->getType(), "", I);
       else
         MCast = Constant::getNullValue(MI->getType());
-      
+
       // Replace all uses of the old malloc inst with the cast inst
       MI->replaceAllUsesWith(MCast);
       I = --BBIL.erase(I);         // remove and delete the malloc instr...
@@ -166,7 +166,7 @@
     } else if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
       const FunctionType *FreeFTy = FreeFunc->getFunctionType();
       std::vector<Value*> FreeArgs;
-      
+
       if (FreeFTy->getNumParams() > 0 || FreeFTy->isVarArg()) {
         Value *MCast = FI->getOperand(0);
         if (FreeFTy->getNumParams() > 0 &&
@@ -178,10 +178,10 @@
       // If malloc is prototyped to take extra arguments, pass nulls.
       for (unsigned i = 1; i < FreeFTy->getNumParams(); ++i)
        FreeArgs.push_back(Constant::getNullValue(FreeFTy->getParamType(i)));
-      
+
       // Insert a call to the free function...
       new CallInst(FreeFunc, FreeArgs, "", I);
-      
+
       // Delete the old free instruction
       I = --BBIL.erase(I);
       Changed = true;


Index: llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp
diff -u llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp:1.3 llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp:1.4
--- llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp:1.3	Thu Jul 29 12:05:13 2004
+++ llvm/lib/Transforms/Scalar/LowerConstantExprs.cpp	Thu Apr 21 18:45:12 2005
@@ -1,14 +1,14 @@
 //===-- lib/Transforms/Scalar/LowerConstantExprs.cpp ------------*- C++ -*-===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was written by Vladimir Prus and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file defines the LowerConstantExpression pass, which converts all
-// constant expressions into instructions. This is primarily usefull for 
+// constant expressions into instructions. This is primarily usefull for
 // code generators which don't yet want or don't have a need to handle
 // constant expressions themself.
 //
@@ -29,18 +29,18 @@
 
     class ConstantExpressionsLower : public FunctionPass {
     private: // FunctionPass overrides
-        
+
         bool runOnFunction(Function& f);
 
     private: // internal methods
 
         /// For all operands of 'insn' which are constant expressions, generates
-        /// an appropriate instruction and replaces the use of constant 
+        /// an appropriate instruction and replaces the use of constant
         /// expression with the use of the generated instruction.
         bool runOnInstruction(Instruction& insn);
 
         /// Given an constant expression 'c' which occures in 'instruction',
-        /// at position 'pos', 
+        /// at position 'pos',
         /// generates instruction to compute 'c' and replaces the use of 'c'
         /// with the use of that instruction. This handles only top-level
         /// expression in 'c', any subexpressions are not handled.
@@ -48,7 +48,7 @@
     };
 
     RegisterOpt<ConstantExpressionsLower> X(
-        "lowerconstantexprs", "Lower constant expressions");    
+        "lowerconstantexprs", "Lower constant expressions");
 }
 
 bool ConstantExpressionsLower::runOnFunction(Function& f)
@@ -66,14 +66,14 @@
     bool modified = false;
     for (unsigned pos = 0; pos < instruction.getNumOperands(); ++pos)
     {
-        if (ConstantExpr* ce 
+        if (ConstantExpr* ce
             = dyn_cast<ConstantExpr>(instruction.getOperand(pos))) {
 
             // Decide where to insert the new instruction
             Instruction* where = &instruction;
 
-            // For PHI nodes we can't insert new instruction before phi, 
-            // since phi should always come at the beginning of the 
+            // For PHI nodes we can't insert new instruction before phi,
+            // since phi should always come at the beginning of the
             // basic block.
             // So, we need to insert it in the predecessor, right before
             // the terminating instruction.
@@ -92,12 +92,12 @@
             // Note: we can't call replaceAllUsesWith, since
             // that might replace uses in another functions,
             // where the instruction(s) we've generated are not
-            // available. 
-                    
-            // Moreover, we can't replace all the users in the same 
-            // function, because we can't be sure the definition 
+            // available.
+
+            // Moreover, we can't replace all the users in the same
+            // function, because we can't be sure the definition
             // made in this block will be available in other
-            // places where the constant is used.                                       
+            // places where the constant is used.
             instruction.setOperand(pos, n);
 
             // The new instruction might have constant expressions in
@@ -105,11 +105,11 @@
             runOnInstruction(*n);
             modified = true;
         }
-    }            
+    }
     return modified;
 }
 
-Instruction* 
+Instruction*
 ConstantExpressionsLower::convert(const ConstantExpr& c, Instruction* where)
 {
     Instruction* result = 0;
@@ -118,13 +118,13 @@
         c.getOpcode() < Instruction::BinaryOpsEnd)
     {
         result = BinaryOperator::create(
-            static_cast<Instruction::BinaryOps>(c.getOpcode()), 
+            static_cast<Instruction::BinaryOps>(c.getOpcode()),
             c.getOperand(0), c.getOperand(1), "", where);
     }
     else
     {
         switch(c.getOpcode()) {
-        case Instruction::GetElementPtr: 
+        case Instruction::GetElementPtr:
         {
             vector<Value*> idx;
             for (unsigned i = 1; i < c.getNumOperands(); ++i)
@@ -135,7 +135,7 @@
         }
 
         case Instruction::Cast:
-            result = new CastInst(c.getOperand(0), c.getType(), "", 
+            result = new CastInst(c.getOperand(0), c.getType(), "",
                                   where);
             break;
 
@@ -143,15 +143,15 @@
         case Instruction::Shl:
         case Instruction::Shr:
             result = new ShiftInst(
-                static_cast<Instruction::OtherOps>(c.getOpcode()), 
+                static_cast<Instruction::OtherOps>(c.getOpcode()),
                 c.getOperand(0), c.getOperand(1), "", where);
             break;
-                    
+
         case Instruction::Select:
             result = new SelectInst(c.getOperand(0), c.getOperand(1),
                                     c.getOperand(2), "", where);
             break;
-                 
+
         default:
             std::cerr << "Offending expr: " << c << "\n";
             assert(0 && "Constant expression not yet handled!\n");


Index: llvm/lib/Transforms/Scalar/LowerGC.cpp
diff -u llvm/lib/Transforms/Scalar/LowerGC.cpp:1.7 llvm/lib/Transforms/Scalar/LowerGC.cpp:1.8
--- llvm/lib/Transforms/Scalar/LowerGC.cpp:1.7	Tue Oct 26 22:55:24 2004
+++ llvm/lib/Transforms/Scalar/LowerGC.cpp	Thu Apr 21 18:45:12 2005
@@ -47,7 +47,7 @@
     /// had zero roots.
     const Type *MainRootRecordType;
   public:
-    LowerGC() : GCRootInt(0), GCReadInt(0), GCWriteInt(0), 
+    LowerGC() : GCRootInt(0), GCReadInt(0), GCWriteInt(0),
                 GCRead(0), GCWrite(0), RootChain(0), MainRootRecordType(0) {}
     virtual bool doInitialization(Module &M);
     virtual bool runOnFunction(Function &F);
@@ -125,7 +125,7 @@
     if (RootChain == 0) {
       // If the root chain does not exist, insert a new one with linkonce
       // linkage!
-      RootChain = new GlobalVariable(PRLTy, false, 
+      RootChain = new GlobalVariable(PRLTy, false,
                                      GlobalValue::LinkOnceLinkage,
                                      Constant::getNullValue(PRLTy),
                                      "llvm_gc_root_chain", &M);
@@ -141,7 +141,7 @@
 /// not have the specified type, insert a cast.
 static void Coerce(Instruction *I, unsigned OpNum, Type *Ty) {
   if (I->getOperand(OpNum)->getType() != Ty) {
-    if (Constant *C = dyn_cast<Constant>(I->getOperand(OpNum))) 
+    if (Constant *C = dyn_cast<Constant>(I->getOperand(OpNum)))
       I->setOperand(OpNum, ConstantExpr::getCast(C, Ty));
     else {
       CastInst *CI = new CastInst(I->getOperand(OpNum), Ty, "", I);
@@ -152,7 +152,7 @@
 
 /// runOnFunction - If the program is using GC intrinsics, replace any
 /// read/write intrinsics with the appropriate read/write barrier calls, then
-/// inline them.  Finally, build the data structures for 
+/// inline them.  Finally, build the data structures for
 bool LowerGC::runOnFunction(Function &F) {
   // Quick exit for programs that are not using GC mechanisms.
   if (!GCRootInt && !GCReadInt && !GCWriteInt) return false;
@@ -192,7 +192,7 @@
                 CI->setOperand(0, GCRead);
               } else {
                 // Create a whole new call to replace the old one.
-                CallInst *NC = new CallInst(GCRead, CI->getOperand(1), 
+                CallInst *NC = new CallInst(GCRead, CI->getOperand(1),
                                             CI->getOperand(2),
                                             CI->getName(), CI);
                 Value *NV = new CastInst(NC, CI->getType(), "", CI);
@@ -208,7 +208,7 @@
             MadeChange = true;
           }
       }
-  
+
   // If there are no GC roots in this function, then there is no need to create
   // a GC list record for it.
   if (GCRoots.empty()) return MadeChange;
@@ -263,7 +263,7 @@
     Par[3] = Zero;
     Value *RootPtrPtr = new GetElementPtrInst(AI, Par, "RootEntPtr", IP);
     new StoreInst(Null, RootPtrPtr, IP);
-    
+
     // Each occurrance of the llvm.gcroot intrinsic now turns into an
     // initialization of the slot with the address and a zeroing out of the
     // address specified.
@@ -301,7 +301,7 @@
     UnwindInst *UI = new UnwindInst(Cleanup);
     PrevPtr = new LoadInst(PrevPtrPtr, "prevptr", UI);
     new StoreInst(PrevPtr, RootChain, UI);
-  
+
     // Loop over all of the function calls, turning them into invokes.
     while (!NormalCalls.empty()) {
       CallInst *CI = NormalCalls.back();
@@ -314,7 +314,7 @@
       // Remove the unconditional branch inserted at the end of the CBB.
       CBB->getInstList().pop_back();
       NewBB->getInstList().remove(CI);
-      
+
       // Create a new invoke instruction.
       Value *II = new InvokeInst(CI->getCalledValue(), NewBB, Cleanup,
                                  std::vector<Value*>(CI->op_begin()+1,


Index: llvm/lib/Transforms/Scalar/LowerInvoke.cpp
diff -u llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.20 llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.21
--- llvm/lib/Transforms/Scalar/LowerInvoke.cpp:1.20	Sat Nov 13 13:07:32 2004
+++ llvm/lib/Transforms/Scalar/LowerInvoke.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LowerInvoke.cpp - Eliminate Invoke & Unwind instructions -----------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This transformation is designed for use by code generators which do not yet
@@ -153,7 +153,7 @@
     Constant *Msg =
       ConstantArray::get("ERROR: Exception thrown, but not caught!\n");
     AbortMessageLength = Msg->getNumOperands()-1;  // don't include \0
-    
+
     GlobalVariable *MsgGV = new GlobalVariable(Msg->getType(), true,
                                                GlobalValue::InternalLinkage,
                                                Msg, "abortmsg", &M);
@@ -192,7 +192,7 @@
     unsigned NumArgs = FT->getNumParams();
     for (unsigned i = 0; i != 3; ++i)
       if (i < NumArgs && FT->getParamType(i) != Args[i]->getType())
-        Args[i] = ConstantExpr::getCast(cast<Constant>(Args[i]), 
+        Args[i] = ConstantExpr::getCast(cast<Constant>(Args[i]),
                                         FT->getParamType(i));
 
     new CallInst(WriteFn, Args, "", IB);
@@ -209,7 +209,7 @@
                                     std::vector<Value*>(II->op_begin()+3,
                                                         II->op_end()), Name,II);
       II->replaceAllUsesWith(NewCall);
-      
+
       // Insert an unconditional branch to the normal destination.
       new BranchInst(II->getNormalDest(), II);
 
@@ -269,7 +269,7 @@
       Value *NextFieldPtr = new GetElementPtrInst(JmpBuf, Idx, "NextField", II);
       new StoreInst(OldEntry, NextFieldPtr, II);
       new StoreInst(JmpBuf, JBListHead, II);
-      
+
       // Call setjmp, passing in the address of the jmpbuffer.
       Idx[1] = ConstantUInt::get(Type::UIntTy, 1);
       Value *JmpBufPtr = new GetElementPtrInst(JmpBuf, Idx, "TheJmpBuf", II);
@@ -283,7 +283,7 @@
       // destination.
       SplitCriticalEdge(II, 0, this);
       Instruction *InsertLoc = II->getNormalDest()->begin();
-      
+
       // Insert a normal call instruction on the normal execution path.
       std::string Name = II->getName(); II->setName("");
       Value *NewCall = new CallInst(II->getCalledValue(),
@@ -291,7 +291,7 @@
                                                         II->op_end()), Name,
                                     InsertLoc);
       II->replaceAllUsesWith(NewCall);
-      
+
       // If we got this far, then no exception was thrown and we can pop our
       // jmpbuf entry off.
       new StoreInst(OldEntry, JBListHead, InsertLoc);
@@ -301,8 +301,8 @@
 
       // Remove the InvokeInst now.
       BB->getInstList().erase(II);
-      ++NumLowered; Changed = true;      
-      
+      ++NumLowered; Changed = true;
+
     } else if (UnwindInst *UI = dyn_cast<UnwindInst>(BB->getTerminator())) {
       if (UnwindBlock == 0) {
         // Create two new blocks, the unwind block and the terminate block.  Add
@@ -330,7 +330,7 @@
 
       // Remove the UnwindInst now.
       BB->getInstList().erase(UI);
-      ++NumLowered; Changed = true;      
+      ++NumLowered; Changed = true;
     }
 
   // If an unwind instruction was inserted, we need to set up the Unwind and
@@ -370,7 +370,7 @@
 
     // Now we set up the terminate block.
     RI = TermBlock->getTerminator();
-    
+
     // Insert a new call to write(2, AbortMessage, AbortMessageLength);
     writeAbortMessage(RI);
 


Index: llvm/lib/Transforms/Scalar/LowerPacked.cpp
diff -u llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.4 llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.5
--- llvm/lib/Transforms/Scalar/LowerPacked.cpp:1.4	Fri Nov 19 10:49:34 2004
+++ llvm/lib/Transforms/Scalar/LowerPacked.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LowerPacked.cpp -  Implementation of LowerPacked Transform ---------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by Brad Jones and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements lowering Packed datatypes into more primitive
@@ -38,7 +38,7 @@
 ///
 class LowerPacked : public FunctionPass, public InstVisitor<LowerPacked> {
 public:
-   /// @brief Lowers packed operations to scalar operations. 
+   /// @brief Lowers packed operations to scalar operations.
    /// @param F The fuction to process
    virtual bool runOnFunction(Function &F);
 
@@ -60,13 +60,13 @@
 
    /// This function asserts if the instruction is a PackedType but
    /// is handled by another function.
-   /// 
+   ///
    /// @brief Asserts if PackedType instruction is not handled elsewhere.
    /// @param I the unhandled instruction
    void visitInstruction(Instruction &I)
    {
       if(isa<PackedType>(I.getType())) {
-         std::cerr << "Unhandled Instruction with Packed ReturnType: " << 
+         std::cerr << "Unhandled Instruction with Packed ReturnType: " <<
                       I << '\n';
       }
    }
@@ -82,7 +82,7 @@
    void setValues(Value* val,const std::vector<Value*>& values);
 
    // Data Members
-   /// @brief whether we changed the function or not   
+   /// @brief whether we changed the function or not
    bool Changed;
 
    /// @brief a map from old packed values to new smaller packed values
@@ -91,27 +91,27 @@
    /// Instructions in the source program to get rid of
    /// after we do a pass (the old packed instructions)
    std::vector<Instruction*> instrsToRemove;
-}; 
+};
 
-RegisterOpt<LowerPacked> 
-X("lower-packed", 
+RegisterOpt<LowerPacked>
+X("lower-packed",
   "lowers packed operations to operations on smaller packed datatypes");
 
-} // end namespace   
+} // end namespace
 
 FunctionPass *llvm::createLowerPackedPass() { return new LowerPacked(); }
 
 
 // This function sets lowered values for a corresponding
 // packed value.  Note, in the case of a forward reference
-// getValues(Value*) will have already been called for 
-// the packed parameter.  This function will then replace 
-// all references in the in the function of the "dummy" 
-// value the previous getValues(Value*) call 
+// getValues(Value*) will have already been called for
+// the packed parameter.  This function will then replace
+// all references in the in the function of the "dummy"
+// value the previous getValues(Value*) call
 // returned with actual references.
 void LowerPacked::setValues(Value* value,const std::vector<Value*>& values)
 {
-   std::map<Value*,std::vector<Value*> >::iterator it = 
+   std::map<Value*,std::vector<Value*> >::iterator it =
          packedToScalarMap.lower_bound(value);
    if (it == packedToScalarMap.end() || it->first != value) {
        // there was not a forward reference to this element
@@ -119,7 +119,7 @@
    }
    else {
       // replace forward declarations with actual definitions
-      assert(it->second.size() == values.size() && 
+      assert(it->second.size() == values.size() &&
              "Error forward refences and actual definition differ in size");
       for (unsigned i = 0, e = values.size(); i != e; ++i) {
            // replace and get rid of old forward references
@@ -133,8 +133,8 @@
 // This function will examine the packed value parameter
 // and if it is a packed constant or a forward reference
 // properly create the lowered values needed.  Otherwise
-// it will simply retreive values from a  
-// setValues(Value*,const std::vector<Value*>&) 
+// it will simply retreive values from a
+// setValues(Value*,const std::vector<Value*>&)
 // call.  Failing both of these cases, it will abort
 // the program.
 std::vector<Value*>& LowerPacked::getValues(Value* value)
@@ -144,7 +144,7 @@
 
    // reject further processing if this one has
    // already been handled
-   std::map<Value*,std::vector<Value*> >::iterator it = 
+   std::map<Value*,std::vector<Value*> >::iterator it =
       packedToScalarMap.lower_bound(value);
    if (it != packedToScalarMap.end() && it->first == value) {
        return it->second;
@@ -162,11 +162,11 @@
    }
    else if (ConstantAggregateZero* CAZ =
             dyn_cast<ConstantAggregateZero>(value)) {
-       // zero constant 
+       // zero constant
        const PackedType* PKT = cast<PackedType>(CAZ->getType());
        std::vector<Value*> results;
        results.reserve(PKT->getNumElements());
-   
+
        Constant* C = Constant::getNullValue(PKT->getElementType());
        for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) {
             results.push_back(C);
@@ -179,7 +179,7 @@
        const PackedType* PKT = cast<PackedType>(value->getType());
        std::vector<Value*> results;
        results.reserve(PKT->getNumElements());
-   
+
       for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) {
            results.push_back(new Argument(PKT->getElementType()));
       }
@@ -221,19 +221,19 @@
             Idx[1] = ConstantUInt::get(Type::UIntTy,i);
 
             // Get the pointer
-            Value* val = new GetElementPtrInst(array, 
+            Value* val = new GetElementPtrInst(array,
                                                Idx,
-                                               LI.getName() + 
+                                               LI.getName() +
                                                ".ge." + utostr(i),
                                                &LI);
 
             // generate the new load and save the result in packedToScalar map
-            values.push_back(new LoadInst(val, 
+            values.push_back(new LoadInst(val,
                              LI.getName()+"."+utostr(i),
                              LI.isVolatile(),
                              &LI));
        }
-               
+
        setValues(&LI,values);
        Changed = true;
        instrsToRemove.push_back(&LI);
@@ -251,13 +251,13 @@
               "The two packed operand to scalar maps must be equal in size.");
 
        result.reserve(op0Vals.size());
-   
+
        // generate the new binary op and save the result
        for (unsigned i = 0; i != op0Vals.size(); ++i) {
-            result.push_back(BinaryOperator::create(BO.getOpcode(), 
-                                                    op0Vals[i], 
+            result.push_back(BinaryOperator::create(BO.getOpcode(),
+                                                    op0Vals[i],
                                                     op1Vals[i],
-                                                    BO.getName() + 
+                                                    BO.getName() +
                                                     "." + utostr(i),
                                                     &BO));
        }
@@ -270,12 +270,12 @@
 
 void LowerPacked::visitStoreInst(StoreInst& SI)
 {
-   if (const PackedType* PKT = 
+   if (const PackedType* PKT =
        dyn_cast<PackedType>(SI.getOperand(0)->getType())) {
        // We will need this for getelementptr
        std::vector<Value*> Idx(2);
        Idx[0] = ConstantUInt::get(Type::UIntTy,0);
-         
+
        ArrayType* AT = ArrayType::get(PKT->getContainedType(0),
                                       PKT->getNumElements());
        PointerType* APT = PointerType::get(AT);
@@ -286,21 +286,21 @@
                                    "store.ge.a.",
                                    &SI);
        std::vector<Value*>& values = getValues(SI.getOperand(0));
-      
+
        assert((values.size() == PKT->getNumElements()) &&
               "Scalar must have the same number of elements as Packed Type");
 
        for (unsigned i = 0, e = PKT->getNumElements(); i != e; ++i) {
             // Generate the indices for getelementptr
             Idx[1] = ConstantUInt::get(Type::UIntTy,i);
-            Value* val = new GetElementPtrInst(array, 
+            Value* val = new GetElementPtrInst(array,
                                                Idx,
                                                "store.ge." +
                                                utostr(i) + ".",
                                                &SI);
             new StoreInst(values[i], val, SI.isVolatile(),&SI);
        }
-                 
+
        Changed = true;
        instrsToRemove.push_back(&SI);
    }
@@ -319,12 +319,12 @@
 
       for (unsigned i = 0; i != op0Vals.size(); ++i) {
            result.push_back(new SelectInst(SELI.getCondition(),
-                                           op0Vals[i], 
+                                           op0Vals[i],
                                            op1Vals[i],
                                            SELI.getName()+ "." + utostr(i),
                                            &SELI));
       }
-   
+
       setValues(&SELI,result);
       Changed = true;
       instrsToRemove.push_back(&SELI);
@@ -334,24 +334,24 @@
 bool LowerPacked::runOnFunction(Function& F)
 {
    // initialize
-   Changed = false; 
-  
+   Changed = false;
+
    // Does three passes:
-   // Pass 1) Converts Packed Operations to 
+   // Pass 1) Converts Packed Operations to
    //         new Packed Operations on smaller
    //         datatypes
    visit(F);
-  
+
    // Pass 2) Drop all references
    std::for_each(instrsToRemove.begin(),
                  instrsToRemove.end(),
                  std::mem_fun(&Instruction::dropAllReferences));
 
    // Pass 3) Delete the Instructions to remove aka packed instructions
-   for (std::vector<Instruction*>::iterator i = instrsToRemove.begin(), 
-                                            e = instrsToRemove.end(); 
+   for (std::vector<Instruction*>::iterator i = instrsToRemove.begin(),
+                                            e = instrsToRemove.end();
         i != e; ++i) {
-        (*i)->getParent()->getInstList().erase(*i);   
+        (*i)->getParent()->getInstList().erase(*i);
    }
 
    // clean-up


Index: llvm/lib/Transforms/Scalar/LowerSelect.cpp
diff -u llvm/lib/Transforms/Scalar/LowerSelect.cpp:1.2 llvm/lib/Transforms/Scalar/LowerSelect.cpp:1.3
--- llvm/lib/Transforms/Scalar/LowerSelect.cpp:1.2	Wed Sep  1 17:55:36 2004
+++ llvm/lib/Transforms/Scalar/LowerSelect.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LowerSelect.cpp - Transform select insts to branches ---------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass lowers select instructions into conditional branches for targets
@@ -86,7 +86,7 @@
           // Use the PHI instead of the select.
           SI->replaceAllUsesWith(PN);
           NewCont->getInstList().erase(SI);
-        
+
           Changed = true;
           break; // This block is done with.
         }


Index: llvm/lib/Transforms/Scalar/LowerSwitch.cpp
diff -u llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.16 llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.17
--- llvm/lib/Transforms/Scalar/LowerSwitch.cpp:1.16	Wed Sep 15 12:06:41 2004
+++ llvm/lib/Transforms/Scalar/LowerSwitch.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- LowerSwitch.cpp - Eliminate Switch instructions --------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // The LowerSwitch transformation rewrites switch statements with a sequence of


Index: llvm/lib/Transforms/Scalar/Mem2Reg.cpp
diff -u llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.13 llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.14
--- llvm/lib/Transforms/Scalar/Mem2Reg.cpp:1.13	Sun Mar 27 20:01:12 2005
+++ llvm/lib/Transforms/Scalar/Mem2Reg.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- Mem2Reg.cpp - The -mem2reg pass, a wrapper around the Utils lib ----===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass is a simple pass wrapper around the PromoteMemToReg function call
@@ -53,7 +53,7 @@
 
   DominatorTree     &DT = getAnalysis<DominatorTree>();
   DominanceFrontier &DF = getAnalysis<DominanceFrontier>();
-  
+
   while (1) {
     Allocas.clear();
 


Index: llvm/lib/Transforms/Scalar/PRE.cpp
diff -u llvm/lib/Transforms/Scalar/PRE.cpp:1.14 llvm/lib/Transforms/Scalar/PRE.cpp:1.15
--- llvm/lib/Transforms/Scalar/PRE.cpp:1.14	Sat Jan  8 11:21:40 2005
+++ llvm/lib/Transforms/Scalar/PRE.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- PRE.cpp - Partial Redundancy Elimination ---------------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements the well-known Partial Redundancy Elimination
@@ -80,7 +80,7 @@
     AvailableBlocksTy AvailableBlocks;
 
     bool ProcessBlock(BasicBlock *BB);
-    
+
     // Anticipatibility calculation...
     void MarkPostDominatingBlocksAnticipatible(PostDominatorTree::Node *N,
                                                std::vector<char> &AntBlocks,
@@ -262,7 +262,7 @@
   // active definition...
   if (ExistingAvailableVal == 0) {
     ExistingAvailableVal = NewOcc;
-    
+
     for (DominatorTree::Node::iterator I = N->begin(), E = N->end(); I != E;++I)
       ReplaceDominatedAvailableOccurrencesWith(NewOcc, *I);
   } else {
@@ -283,7 +283,7 @@
     for (df_iterator<DominatorTree::Node*> DI = df_begin(N), E = df_end(N);
          DI != E; ++DI)
       AvailableBlocks[(*DI)->getBlock()] = NewOcc;
-  }  
+  }
 }
 
 
@@ -400,7 +400,7 @@
           if (AnticipatibleBlocks[i])
             std::cerr << BlockMapping[i]->getName() <<" ";
         std::cerr << "\n";);
-  
+
 
 
   // AvailabilityFrontier - Calculates the availability frontier for the current
@@ -463,7 +463,7 @@
                   AnyNotAvailable = true;
                   break;
                 }
-            
+
               // If any predecessor blocks are not available, add the node to
               // the current expression dominance frontier.
               if (AnyNotAvailable) {
@@ -597,12 +597,12 @@
           ++NumRedundant;
           DEBUG(std::cerr << "  PHI replaces available value: %"
                 << OldVal->getName() << "\n");
-          
+
           // Loop over all of the blocks dominated by this PHI node, and change
           // the AvailableBlocks entries to be the PHI node instead of the old
           // instruction.
           MarkOccurrenceAvailableInAllDominatedBlocks(PN, AFBlock);
-          
+
           AFBlock->getInstList().erase(OldVal);  // Delete old instruction!
 
           // The resultant PHI node is a new definition of the value!
@@ -613,7 +613,7 @@
           // region (occurs when hoisting loop invariants, f.e.).  In this case,
           // the PHI node should actually just be removed.
           assert(PN->use_empty() && "No uses should exist for dead PHI node!");
-          PN->getParent()->getInstList().erase(PN);            
+          PN->getParent()->getInstList().erase(PN);
         }
       } else {
         // The resultant PHI node is a new definition of the value!


Index: llvm/lib/Transforms/Scalar/Reassociate.cpp
diff -u llvm/lib/Transforms/Scalar/Reassociate.cpp:1.35 llvm/lib/Transforms/Scalar/Reassociate.cpp:1.36
--- llvm/lib/Transforms/Scalar/Reassociate.cpp:1.35	Mon Mar 14 22:54:21 2005
+++ llvm/lib/Transforms/Scalar/Reassociate.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- Reassociate.cpp - Reassociate binary expressions -------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass reassociates commutative expressions in an order that is designed
@@ -115,7 +115,7 @@
   Value *RHS = I->getOperand(1);
   unsigned LHSRank = getRank(LHS);
   unsigned RHSRank = getRank(RHS);
-  
+
   bool Changed = false;
 
   // Make sure the LHS of the operand always has the greater rank...
@@ -130,7 +130,7 @@
     DEBUG(std::cerr << "Transposed: " << *I
           /* << " Result BB: " << I->getParent()*/);
   }
-  
+
   // If the LHS is the same operator as the current one is, and if we are the
   // only expression using it...
   //
@@ -233,7 +233,7 @@
 
       BI = New;
       New->setOperand(1, NegateValue(New->getOperand(1), BI));
-      
+
       Changed = true;
       DEBUG(std::cerr << "Negated: " << *New /*<< " Result BB: " << BB*/);
     }


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.122 llvm/lib/Transforms/Scalar/SCCP.cpp:1.123
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.122	Tue Apr 19 14:16:19 2005
+++ llvm/lib/Transforms/Scalar/SCCP.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- SCCP.cpp - Sparse Conditional Constant Propagation -----------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements sparse conditional constant propagation and merging:
@@ -45,7 +45,7 @@
 namespace {
 
 class LatticeVal {
-  enum { 
+  enum {
     undefined,           // This instruction has no known value
     constant,            // This instruction has a constant value
     overdefined          // This instruction has an unknown value
@@ -198,7 +198,7 @@
 
 private:
   // markConstant - Make a value be marked as "constant".  If the value
-  // is not already a constant, add it to the instruction work list so that 
+  // is not already a constant, add it to the instruction work list so that
   // the users of the instruction are updated later.
   //
   inline void markConstant(LatticeVal &IV, Value *V, Constant *C) {
@@ -212,9 +212,9 @@
   }
 
   // markOverdefined - Make a value be marked as "overdefined". If the
-  // value is not already overdefined, add it to the overdefined instruction 
+  // value is not already overdefined, add it to the overdefined instruction
   // work list so that the users of the instruction are updated later.
-  
+
   inline void markOverdefined(LatticeVal &IV, Value *V) {
     if (IV.markOverdefined()) {
       DEBUG(std::cerr << "markOverdefined: ";
@@ -262,9 +262,9 @@
     return ValueState[V];
   }
 
-  // markEdgeExecutable - Mark a basic block as executable, adding it to the BB 
+  // markEdgeExecutable - Mark a basic block as executable, adding it to the BB
   // work list if it is not already executable...
-  // 
+  //
   void markEdgeExecutable(BasicBlock *Source, BasicBlock *Dest) {
     if (!KnownFeasibleEdges.insert(Edge(Source, Dest)).second)
       return;  // This edge is already known to be executable!
@@ -308,7 +308,7 @@
 private:
   friend class InstVisitor<SCCPSolver>;
 
-  // visit implementations - Something changed in this instruction... Either an 
+  // visit implementations - Something changed in this instruction... Either an
   // operand made a transition, or the instruction is newly executable.  Change
   // the value type of I to reflect these changes if appropriate.
   //
@@ -406,7 +406,7 @@
 
   // Make sure the source basic block is executable!!
   if (!BBExecutable.count(From)) return false;
-  
+
   // Check to make sure this edge itself is actually feasible now...
   TerminatorInst *TI = From->getTerminator();
   if (BranchInst *BI = dyn_cast<BranchInst>(TI)) {
@@ -422,7 +422,7 @@
         if (!isa<ConstantBool>(BCValue.getConstant())) return true;
 
         // Constant condition variables mean the branch can only go a single way
-        return BI->getSuccessor(BCValue.getConstant() == 
+        return BI->getSuccessor(BCValue.getConstant() ==
                                        ConstantBool::False) == To;
       }
       return false;
@@ -511,7 +511,7 @@
   for (unsigned i = 0, e = PN.getNumIncomingValues(); i != e; ++i) {
     LatticeVal &IV = getValueState(PN.getIncomingValue(i));
     if (IV.isUndefined()) continue;  // Doesn't influence PHI node.
-    
+
     if (isEdgeFeasible(PN.getIncomingBlock(i), PN.getParent())) {
       if (IV.isOverdefined()) {   // PHI node becomes overdefined!
         markOverdefined(PNIV, &PN);
@@ -524,7 +524,7 @@
         // There is already a reachable operand.  If we conflict with it,
         // then the PHI node becomes overdefined.  If we agree with it, we
         // can continue on.
-        
+
         // Check to see if there are two different constants merging...
         if (IV.getConstant() != OperandVal) {
           // Yes there is.  This means the PHI node is not constant.
@@ -753,7 +753,7 @@
   Constant *Ptr = Operands[0];
   Operands.erase(Operands.begin());  // Erase the pointer from idx list...
 
-  markConstant(IV, &I, ConstantExpr::getGetElementPtr(Ptr, Operands));  
+  markConstant(IV, &I, ConstantExpr::getGetElementPtr(Ptr, Operands));
 }
 
 /// GetGEPGlobalInitializer - Given a constant and a getelementptr constantexpr,
@@ -813,7 +813,7 @@
       markConstant(IV, &I, Constant::getNullValue(I.getType()));
       return;
     }
-      
+
     // Transform load (constant global) into the value loaded.
     if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
       if (GV->isConstant()) {
@@ -837,7 +837,7 @@
       if (CE->getOpcode() == Instruction::GetElementPtr)
 	if (GlobalVariable *GV = dyn_cast<GlobalVariable>(CE->getOperand(0)))
 	  if (GV->isConstant() && !GV->isExternal())
-	    if (Constant *V = 
+	    if (Constant *V =
 		GetGEPGlobalInitializer(GV->getInitializer(), CE)) {
 	      markConstant(IV, &I, V);
 	      return;
@@ -857,7 +857,7 @@
   hash_map<Function*, LatticeVal>::iterator TFRVI =TrackedFunctionRetVals.end();
   if (F && F->hasInternalLinkage())
     TFRVI = TrackedFunctionRetVals.find(F);
-  
+
   if (TFRVI != TrackedFunctionRetVals.end()) {
     // If this is the first call to the function hit, mark its entry block
     // executable.
@@ -883,7 +883,7 @@
     mergeInValue(IV, I, TFRVI->second);
     return;
   }
-  
+
   if (F == 0 || !F->isExternal() || !canConstantFoldCallTo(F)) {
     markOverdefined(IV, I);
     return;
@@ -914,7 +914,7 @@
 
 void SCCPSolver::Solve() {
   // Process the work lists until they are empty!
-  while (!BBWorkList.empty() || !InstWorkList.empty() || 
+  while (!BBWorkList.empty() || !InstWorkList.empty() ||
 	 !OverdefinedInstWorkList.empty()) {
     // Process the instruction work list...
     while (!OverdefinedInstWorkList.empty()) {
@@ -922,7 +922,7 @@
       OverdefinedInstWorkList.pop_back();
 
       DEBUG(std::cerr << "\nPopped off OI-WL: " << *I);
-      
+
       // "I" got into the work list because it either made the transition from
       // bottom to constant
       //
@@ -940,7 +940,7 @@
       InstWorkList.pop_back();
 
       DEBUG(std::cerr << "\nPopped off I-WL: " << *I);
-      
+
       // "I" got into the work list because it either made the transition from
       // bottom to constant
       //
@@ -953,14 +953,14 @@
              UI != E; ++UI)
           OperandChangedState(*UI);
     }
-    
+
     // Process the basic block work list...
     while (!BBWorkList.empty()) {
       BasicBlock *BB = BBWorkList.back();
       BBWorkList.pop_back();
-      
+
       DEBUG(std::cerr << "\nPopped off BBWL: " << *BB);
-      
+
       // Notify all instructions in this basic block that they are newly
       // executable.
       visit(BB);
@@ -1016,7 +1016,7 @@
     // algorithm, and return true if the function was modified.
     //
     bool runOnFunction(Function &F);
-    
+
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.setPreservesCFG();
     }
@@ -1095,13 +1095,13 @@
             Constant *Const = IV.isConstant()
               ? IV.getConstant() : UndefValue::get(Inst->getType());
             DEBUG(std::cerr << "  Constant: " << *Const << " = " << *Inst);
-            
+
             // Replaces all of the uses of a variable with uses of the constant.
             Inst->replaceAllUsesWith(Const);
-            
+
             // Delete the instruction.
             BB->getInstList().erase(Inst);
-            
+
             // Hey, we just changed something!
             MadeChanges = true;
             ++NumInstRemoved;
@@ -1217,7 +1217,7 @@
           Constant *CST = IV.isConstant() ?
             IV.getConstant() : UndefValue::get(AI->getType());
           DEBUG(std::cerr << "***  Arg " << *AI << " = " << *CST <<"\n");
-          
+
           // Replaces all of the uses of a variable with uses of the
           // constant.
           AI->replaceAllUsesWith(CST);
@@ -1247,7 +1247,7 @@
           MadeChanges = true;
           ++IPNumInstRemoved;
         }
-        
+
         for (unsigned i = 0, e = TI->getNumSuccessors(); i != e; ++i) {
           BasicBlock *Succ = TI->getSuccessor(i);
           if (Succ->begin() != Succ->end() && isa<PHINode>(Succ->begin()))
@@ -1272,11 +1272,11 @@
               Constant *Const = IV.isConstant()
                 ? IV.getConstant() : UndefValue::get(Inst->getType());
               DEBUG(std::cerr << "  Constant: " << *Const << " = " << *Inst);
-              
+
               // Replaces all of the uses of a variable with uses of the
               // constant.
               Inst->replaceAllUsesWith(Const);
-              
+
               // Delete the instruction.
               if (!isa<TerminatorInst>(Inst) && !isa<CallInst>(Inst))
                 BB->getInstList().erase(Inst);
@@ -1300,7 +1300,7 @@
         bool Folded = ConstantFoldTerminator(I->getParent());
         assert(Folded && "Didn't fold away reference to block!");
       }
-        
+
       // Finally, delete the basic block.
       F->getBasicBlockList().erase(DeadBB);
     }
@@ -1338,6 +1338,6 @@
     M.getGlobalList().erase(GV);
     ++IPNumGlobalConst;
   }
-  
+
   return MadeChanges;
 }


Index: llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp
diff -u llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.30 llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.31
--- llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp:1.30	Sat Jan  8 13:34:41 2005
+++ llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- ScalarReplAggregates.cpp - Scalar Replacement of Aggregates --------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This transformation implements the well known scalar replacement of
@@ -91,7 +91,7 @@
   BasicBlock &BB = F.getEntryBlock();  // Get the entry node for the function
 
   bool Changed = false;
-  
+
   while (1) {
     Allocas.clear();
 
@@ -154,7 +154,7 @@
 
     DEBUG(std::cerr << "Found inst to xform: " << *AI);
     Changed = true;
-    
+
     std::vector<AllocaInst*> ElementAllocas;
     if (const StructType *ST = dyn_cast<StructType>(AI->getAllocatedType())) {
       ElementAllocas.reserve(ST->getNumContainedTypes());
@@ -175,7 +175,7 @@
         WorkList.push_back(NA);  // Add to worklist for recursive processing
       }
     }
-    
+
     // Now that we have created the alloca instructions that we want to use,
     // expand the getelementptr instructions to use them.
     //
@@ -183,12 +183,12 @@
       Instruction *User = cast<Instruction>(AI->use_back());
       GetElementPtrInst *GEPI = cast<GetElementPtrInst>(User);
       // We now know that the GEP is of the form: GEP <ptr>, 0, <cst>
-      unsigned Idx = 
+      unsigned Idx =
          (unsigned)cast<ConstantInt>(GEPI->getOperand(2))->getRawValue();
-      
+
       assert(Idx < ElementAllocas.size() && "Index out of range?");
       AllocaInst *AllocaToUse = ElementAllocas[Idx];
-      
+
       Value *RepValue;
       if (GEPI->getNumOperands() == 3) {
         // Do not insert a new getelementptr instruction with zero indices, only
@@ -206,7 +206,7 @@
         GEPI->setName("");
         RepValue = new GetElementPtrInst(AllocaToUse, NewArgs, OldName, GEPI);
       }
-      
+
       // Move all of the users over to the new GEP.
       GEPI->replaceAllUsesWith(RepValue);
       // Delete the old GEP
@@ -259,7 +259,7 @@
        I != E; ++I)
     if (cast<Instruction>(*I)->getOpcode() != Instruction::Load)
       return false;
-  return true; 
+  return true;
 }
 
 /// isSafeUseOfAllocation - Check to see if this user is an allowed use for an
@@ -289,7 +289,7 @@
       //
       if (cast<ConstantInt>(GEPI->getOperand(2))->getRawValue() >= NumElements)
         return 0;
-      
+
     } else {
       // If this is an array index and the index is not constant, we cannot
       // promote... that is unless the array has exactly one or two elements in
@@ -342,7 +342,7 @@
 
     if (const ArrayType *AT = dyn_cast<ArrayType>(*I)) {
       uint64_t NumElements = AT->getNumElements();
-      
+
       if (!isa<ConstantInt>(I.getOperand())) {
         if (NumElements == 1) {
           GEPI->setOperand(2, Constant::getNullValue(Type::IntTy));


Index: llvm/lib/Transforms/Scalar/SimplifyCFG.cpp
diff -u llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.13 llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.14
--- llvm/lib/Transforms/Scalar/SimplifyCFG.cpp:1.13	Tue Oct 19 01:33:16 2004
+++ llvm/lib/Transforms/Scalar/SimplifyCFG.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- SimplifyCFG.cpp - CFG Simplification Pass --------------------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file implements dead code elimination and basic block merging.
@@ -100,7 +100,7 @@
             (*SI)->removePredecessor(BB);
         BB->dropAllReferences();
       }
-    
+
     for (Function::iterator I = ++F.begin(); I != F.end();)
       if (!Reachable.count(I))
         I = F.getBasicBlockList().erase(I);


Index: llvm/lib/Transforms/Scalar/TailDuplication.cpp
diff -u llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.27 llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.28
--- llvm/lib/Transforms/Scalar/TailDuplication.cpp:1.27	Mon Nov 22 11:23:57 2004
+++ llvm/lib/Transforms/Scalar/TailDuplication.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- TailDuplication.cpp - Simplify CFG through tail duplication --------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This pass performs a limited form of tail duplication, intended to simplify
@@ -127,7 +127,7 @@
       if (TooMany-- == 0) return false;
   }
 
-  return true;  
+  return true;
 }
 
 /// FindObviousSharedDomOf - We know there is a branch from SrcBlock to
@@ -141,7 +141,7 @@
   if (PI == PE || ++PI != PE) return 0;
 
   BasicBlock *SrcPred = *pred_begin(SrcBlock);
-  
+
   // Look at the predecessors of DstBlock.  One of them will be SrcBlock.  If
   // there is only one other pred, get it, otherwise we can't handle it.
   PI = pred_begin(DstBlock); PE = pred_end(DstBlock);
@@ -199,7 +199,7 @@
     while (isa<PHINode>(BBI)) ++BBI;
     while (!isa<TerminatorInst>(BBI)) {
       Instruction *I = BBI++;
-      
+
       bool CanHoist = !I->isTrapping() && !I->mayWriteToMemory();
       if (CanHoist) {
         for (unsigned op = 0, e = I->getNumOperands(); op != e; ++op)
@@ -303,7 +303,7 @@
       // Ok, we have a PHI node.  Figure out what the incoming value was for the
       // DestBlock.
       Value *IV = PN->getIncomingValueForBlock(DestBlock);
-      
+
       // Remap the value if necessary...
       if (Value *MappedIV = ValueMapping[IV])
         IV = MappedIV;


Index: llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
diff -u llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.15 llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.16
--- llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp:1.15	Mon Mar 14 22:54:21 2005
+++ llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp	Thu Apr 21 18:45:12 2005
@@ -1,10 +1,10 @@
 //===- TailRecursionElimination.cpp - Eliminate Tail Calls ----------------===//
-// 
+//
 //                     The LLVM Compiler Infrastructure
 //
 // This file was developed by the LLVM research group and is distributed under
 // the University of Illinois Open Source License. See LICENSE.TXT for details.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // This file transforms calls of the current function (self recursion) followed
@@ -89,7 +89,7 @@
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
     if (ReturnInst *Ret = dyn_cast<ReturnInst>(BB->getTerminator()))
       MadeChange |= ProcessReturningBlock(Ret, OldEntry, ArgumentPHIs);
-  
+
   // If we eliminated any tail recursions, it's possible that we inserted some
   // silly PHI nodes which just merge an initial value (the incoming operand)
   // with themselves.  Check to see if we did and clean up our mess if so.  This
@@ -163,7 +163,7 @@
     Function *F = CI->getParent()->getParent();
     for (Function::arg_iterator AI = F->arg_begin(); &*AI != Arg; ++AI)
       ++ArgNo;
-    
+
     // If we are passing this argument into call as the corresponding
     // argument operand, then the argument is dynamically constant.
     // Otherwise, we cannot transform this function safely.
@@ -292,7 +292,7 @@
     std::string OldName = OldEntry->getName(); OldEntry->setName("tailrecurse");
     BasicBlock *NewEntry = new BasicBlock(OldName, F, OldEntry);
     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.
     // For now, we initialize each PHI to only have the real arguments
@@ -305,13 +305,13 @@
       ArgumentPHIs.push_back(PN);
     }
   }
-  
+
   // Ok, now that we know we have a pseudo-entry block WITH all of the
   // required PHI nodes, add entries into the PHI node for the actual
   // parameters passed into the tail-recursive call.
   for (unsigned i = 0, e = CI->getNumOperands()-1; i != e; ++i)
     ArgumentPHIs[i]->addIncoming(CI->getOperand(i+1), BB);
-  
+
   // If we are introducing an accumulator variable to eliminate the recursion,
   // do so now.  Note that we _know_ that no subsequent tail recursion
   // eliminations will happen on this function because of the way the






More information about the llvm-commits mailing list