[llvm-commits] CVS: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp ConstantMerge.cpp DeadArgumentElimination.cpp DeadTypeElimination.cpp ExtractFunction.cpp FunctionResolution.cpp GlobalDCE.cpp GlobalOpt.cpp IPConstantPropagation.cpp InlineSimple.cpp Inliner.cpp Inliner.h Internalize.cpp LoopExtractor.cpp LowerSetJmp.cpp PruneEH.cpp RaiseAllocations.cpp StripSymbols.cpp

Misha Brukman brukman at cs.uiuc.edu
Thu Apr 21 16:39:48 PDT 2005



Changes in directory llvm/lib/Transforms/IPO:

ArgumentPromotion.cpp updated: 1.17 -> 1.18
ConstantMerge.cpp updated: 1.29 -> 1.30
DeadArgumentElimination.cpp updated: 1.20 -> 1.21
DeadTypeElimination.cpp updated: 1.54 -> 1.55
ExtractFunction.cpp updated: 1.12 -> 1.13
FunctionResolution.cpp updated: 1.56 -> 1.57
GlobalDCE.cpp updated: 1.36 -> 1.37
GlobalOpt.cpp updated: 1.38 -> 1.39
IPConstantPropagation.cpp updated: 1.17 -> 1.18
InlineSimple.cpp updated: 1.69 -> 1.70
Inliner.cpp updated: 1.23 -> 1.24
Inliner.h updated: 1.7 -> 1.8
Internalize.cpp updated: 1.24 -> 1.25
LoopExtractor.cpp updated: 1.17 -> 1.18
LowerSetJmp.cpp updated: 1.23 -> 1.24
PruneEH.cpp updated: 1.17 -> 1.18
RaiseAllocations.cpp updated: 1.28 -> 1.29
StripSymbols.cpp updated: 1.3 -> 1.4
---
Log message:

Remove trailing whitespace


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

 ArgumentPromotion.cpp       |   16 +++++++--------
 ConstantMerge.cpp           |   16 +++++++--------
 DeadArgumentElimination.cpp |   22 ++++++++++-----------
 DeadTypeElimination.cpp     |    4 +--
 ExtractFunction.cpp         |   30 ++++++++++++++--------------
 FunctionResolution.cpp      |   20 +++++++++----------
 GlobalDCE.cpp               |   10 ++++-----
 GlobalOpt.cpp               |   46 ++++++++++++++++++++++----------------------
 IPConstantPropagation.cpp   |   10 ++++-----
 InlineSimple.cpp            |    6 ++---
 Inliner.cpp                 |   20 +++++++++----------
 Inliner.h                   |    4 +--
 Internalize.cpp             |   10 ++++-----
 LoopExtractor.cpp           |   22 ++++++++++-----------
 LowerSetJmp.cpp             |   10 ++++-----
 PruneEH.cpp                 |   16 +++++++--------
 RaiseAllocations.cpp        |   18 ++++++++---------
 StripSymbols.cpp            |   10 ++++-----
 18 files changed, 145 insertions(+), 145 deletions(-)


Index: llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
diff -u llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.17 llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.18
--- llvm/lib/Transforms/IPO/ArgumentPromotion.cpp:1.17	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/ArgumentPromotion.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===-- ArgumentPromotion.cpp - Promote by-reference arguments ------------===//
-// 
+//
 //                     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 promotes "by reference" arguments to be "by value" arguments.  In
@@ -67,7 +67,7 @@
     virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);
   private:
     bool PromoteArguments(CallGraphNode *CGN);
-    bool isSafeToPromoteArgument(Argument *Arg) const;  
+    bool isSafeToPromoteArgument(Argument *Arg) const;
     Function *DoPromotion(Function *F, std::vector<Argument*> &ArgsToPromote);
   };
 
@@ -89,7 +89,7 @@
       LocalChange |= PromoteArguments(SCC[i]);
     Changed |= LocalChange;               // Remember that we changed something.
   } while (LocalChange);
-  
+
   return Changed;
 }
 
@@ -306,7 +306,7 @@
       unsigned idx = 0;
       for (; idx < LHS.size() && idx < RHS.size(); ++idx) {
         if (LHS[idx] != RHS[idx]) {
-          return cast<ConstantInt>(LHS[idx])->getRawValue() < 
+          return cast<ConstantInt>(LHS[idx])->getRawValue() <
                  cast<ConstantInt>(RHS[idx])->getRawValue();
         }
       }
@@ -325,7 +325,7 @@
 Function *ArgPromotion::DoPromotion(Function *F,
                                     std::vector<Argument*> &Args2Prom) {
   std::set<Argument*> ArgsToPromote(Args2Prom.begin(), Args2Prom.end());
-  
+
   // Start by computing a new prototype for the function, which is the same as
   // the old function, but has modified arguments.
   const FunctionType *FTy = F->getFunctionType();
@@ -391,7 +391,7 @@
     Params.push_back(Type::IntTy);
   }
   FunctionType *NFTy = FunctionType::get(RetTy, Params, FTy->isVarArg());
-  
+
    // Create the new function body and insert it into the module...
   Function *NF = new Function(NFTy, F->getLinkage(), F->getName());
   F->getParent()->getFunctionList().insert(F, NF);
@@ -456,7 +456,7 @@
       Call->setName("");
       New->setName(Name);
     }
-    
+
     // Finally, remove the old call from the program, reducing the use-count of
     // F.
     Call->getParent()->getInstList().erase(Call);


Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp
diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.29 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.30
--- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.29	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/ConstantMerge.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- ConstantMerge.cpp - Merge duplicate global constants ---------------===//
-// 
+//
 //                     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 defines the interface to a pass that merges duplicate global
@@ -60,10 +60,10 @@
       // Only process constants with initializers
       if (GV->isConstant() && GV->hasInitializer()) {
         Constant *Init = GV->getInitializer();
-        
+
         // Check to see if the initializer is already known...
         std::map<Constant*, GlobalVariable*>::iterator I = CMap.find(Init);
-        
+
         if (I == CMap.end()) {    // Nope, add it to the map
           CMap.insert(I, std::make_pair(Init, GV));
         } else if (GV->hasInternalLinkage()) {    // Yup, this is a duplicate!
@@ -75,22 +75,22 @@
           I->second = GV;
         }
       }
-    
+
     if (Replacements.empty())
       return MadeChange;
     CMap.clear();
-    
+
     // Now that we have figured out which replacements must be made, do them all
     // now.  This avoid invalidating the pointers in CMap, which are unneeded
     // now.
     for (unsigned i = 0, e = Replacements.size(); i != e; ++i) {
       // Eliminate any uses of the dead global...
       Replacements[i].first->replaceAllUsesWith(Replacements[i].second);
-      
+
       // Delete the global value from the module...
       M.getGlobalList().erase(Replacements[i].first);
     }
-    
+
     NumMerged += Replacements.size();
     Replacements.clear();
   }


Index: llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
diff -u llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.20 llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.21
--- llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp:1.20	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===-- DeadArgumentElimination.cpp - Eliminate dead arguments ------------===//
-// 
+//
 //                     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 deletes dead arguments from internal functions.  Dead argument
@@ -88,7 +88,7 @@
     void MarkArgumentLive(Argument *Arg);
     void MarkRetValLive(Function *F);
     void MarkReturnInstArgumentLive(ReturnInst *RI);
-  
+
     void RemoveDeadArgumentsFromFunction(Function *F);
   };
   RegisterOpt<DAE> X("deadargelim", "Dead Argument Elimination");
@@ -168,7 +168,7 @@
   if (!F.hasInternalLinkage() &&
       (!ShouldHackArguments() || F.getIntrinsicID()))
     FunctionIntrinsicallyLive = true;
-  else 
+  else
     for (Value::use_iterator I = F.use_begin(), E = F.use_end(); I != E; ++I) {
       // If this use is anything other than a call site, the function is alive.
       CallSite CS = CallSite::get(*I);
@@ -197,7 +197,7 @@
             RetValLiveness = Live;
             break;
           }
-      
+
       // If the function is PASSED IN as an argument, its address has been taken
       for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
            AI != E; ++AI)
@@ -300,11 +300,11 @@
 void DAE::MarkArgumentLive(Argument *Arg) {
   std::set<Argument*>::iterator It = MaybeLiveArguments.lower_bound(Arg);
   if (It == MaybeLiveArguments.end() || *It != Arg) return;
- 
+
   DEBUG(std::cerr << "  MaybeLive argument now live: " << Arg->getName()<<"\n");
   MaybeLiveArguments.erase(It);
   LiveArguments.insert(Arg);
-  
+
   // Loop over all of the call sites of the function, making any arguments
   // passed in to provide a value for this argument live as necessary.
   //
@@ -440,7 +440,7 @@
         New->setName(Name);
       }
     }
-    
+
     // Finally, remove the old call from the program, reducing the use-count of
     // F.
     Call->getParent()->getInstList().erase(Call);
@@ -499,7 +499,7 @@
   while (!InstructionsToInspect.empty()) {
     Instruction *I = InstructionsToInspect.back();
     InstructionsToInspect.pop_back();
-    
+
     if (ReturnInst *RI = dyn_cast<ReturnInst>(I)) {
       // For return instructions, we just have to check to see if the return
       // value for the current function is known now to be alive.  If so, any
@@ -513,7 +513,7 @@
       assert(CS.getInstruction() && "Unknown instruction for the I2I list!");
 
       Function *Callee = CS.getCalledFunction();
-      
+
       // If we found a call or invoke instruction on this list, that means that
       // an argument of the function is a call instruction.  If the argument is
       // live, then the return value of the called instruction is now live.
@@ -556,7 +556,7 @@
   if (MaybeLiveArguments.empty() && DeadArguments.empty() &&
       MaybeLiveRetVal.empty() && DeadRetVal.empty())
     return false;
-  
+
   // Otherwise, compact into one set, and start eliminating the arguments from
   // the functions.
   DeadArguments.insert(MaybeLiveArguments.begin(), MaybeLiveArguments.end());


Index: llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
diff -u llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.54 llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.55
--- llvm/lib/Transforms/IPO/DeadTypeElimination.cpp:1.54	Sat Mar  5 23:42:36 2005
+++ llvm/lib/Transforms/IPO/DeadTypeElimination.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- DeadTypeElimination.cpp - Eliminate unused types for symbol table --===//
-// 
+//
 //                     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 used to cleanup the output of GCC.  It eliminate names for types


Index: llvm/lib/Transforms/IPO/ExtractFunction.cpp
diff -u llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.12 llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.13
--- llvm/lib/Transforms/IPO/ExtractFunction.cpp:1.12	Mon Mar 14 23:19:49 2005
+++ llvm/lib/Transforms/IPO/ExtractFunction.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===-- ExtractFunction.cpp - Function extraction 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 extracts
@@ -25,7 +25,7 @@
     /// specified function. Otherwise, it deletes as much of the module as
     /// possible, except for the function specified.
     ///
-    FunctionExtractorPass(Function *F = 0, bool deleteFn = true) 
+    FunctionExtractorPass(Function *F = 0, bool deleteFn = true)
       : Named(F), deleteFunc(deleteFn) {}
 
     bool runOnModule(Module &M) {
@@ -36,7 +36,7 @@
 
       if (deleteFunc)
         return deleteFunction();
-      else 
+      else
         return isolateFunction(M);
     }
 
@@ -57,31 +57,31 @@
           I->setInitializer(0);  // Make all variables external
           I->setLinkage(GlobalValue::ExternalLinkage);
         }
-      
+
       // All of the functions may be used by global variables or the named
       // function.  Loop through them and create a new, external functions that
       // can be "used", instead of ones with bodies.
       std::vector<Function*> NewFunctions;
-      
+
       Function *Last = --M.end();  // Figure out where the last real fn is.
-      
+
       for (Module::iterator I = M.begin(); ; ++I) {
         if (&*I != Named) {
           Function *New = new Function(I->getFunctionType(),
                                        GlobalValue::ExternalLinkage,
                                        I->getName());
           I->setName("");  // Remove Old name
-          
+
           // If it's not the named function, delete the body of the function
           I->dropAllReferences();
-          
+
           M.getFunctionList().push_back(New);
           NewFunctions.push_back(New);
         }
-        
+
         if (&*I == Last) break;  // Stop after processing the last function
       }
-      
+
       // Now that we have replacements all set up, loop through the module,
       // deleting the old functions, replacing them with the newly created
       // functions.
@@ -92,19 +92,19 @@
           if (&*I != Named) {
             // Make everything that uses the old function use the new dummy fn
             I->replaceAllUsesWith(NewFunctions[FuncNum++]);
-            
+
             Function *Old = I;
             ++I;  // Move the iterator to the new function
-            
+
             // Delete the old function!
             M.getFunctionList().erase(Old);
-            
+
           } else {
             ++I;  // Skip the function we are extracting
           }
         } while (&*I != NewFunctions[0]);
       }
-      
+
       return true;
     }
   };


Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp
diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.56 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.57
--- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.56	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/FunctionResolution.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- FunctionResolution.cpp - Resolve declarations to implementations ---===//
-// 
+//
 //                     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.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // Loop over the functions that are in the module and look for functions that
@@ -57,7 +57,7 @@
       Function *Old = cast<Function>(Globals[i]);
       const FunctionType *OldMT = Old->getFunctionType();
       const FunctionType *ConcreteMT = Concrete->getFunctionType();
-      
+
       if (OldMT->getNumParams() > ConcreteMT->getNumParams() &&
           !ConcreteMT->isVarArg())
         if (!Old->use_empty()) {
@@ -69,7 +69,7 @@
           WriteAsOperand(std::cerr, Concrete);
           std::cerr << "\n";
         }
-      
+
       // Check to make sure that if there are specified types, that they
       // match...
       //
@@ -79,7 +79,7 @@
       if (!Old->use_empty() && !Concrete->use_empty())
         for (unsigned i = 0; i < NumArguments; ++i)
           if (OldMT->getParamType(i) != ConcreteMT->getParamType(i))
-            if (OldMT->getParamType(i)->getTypeID() != 
+            if (OldMT->getParamType(i)->getTypeID() !=
                 ConcreteMT->getParamType(i)->getTypeID()) {
               std::cerr << "WARNING: Function [" << Old->getName()
                         << "]: Parameter types conflict for: '";
@@ -89,7 +89,7 @@
               std::cerr << "'\n";
               return Changed;
             }
-      
+
       // Attempt to convert all of the uses of the old function to the concrete
       // form of the function.  If there is a use of the fn that we don't
       // understand here we punt to avoid making a bad transformation.
@@ -174,11 +174,11 @@
       if (!F->isExternal()) {
         if (Concrete && !Concrete->isExternal())
           return false;   // Found two different functions types.  Can't choose!
-        
+
         Concrete = Globals[i];
       } else if (Concrete) {
         if (Concrete->isExternal()) // If we have multiple external symbols...
-          if (F->getFunctionType()->getNumParams() > 
+          if (F->getFunctionType()->getNumParams() >
               cast<Function>(Concrete)->getFunctionType()->getNumParams())
             Concrete = F;  // We are more concrete than "Concrete"!
 
@@ -213,7 +213,7 @@
       else if (!Globals[i]->hasInternalLinkage())
         NumInstancesWithExternalLinkage++;
     }
-    
+
     if (!HasExternal && NumInstancesWithExternalLinkage <= 1)
       return false;  // Nothing to do?  Must have multiple internal definitions.
 
@@ -231,7 +231,7 @@
               OtherF->getFunctionType()->isVarArg() &&
               OtherF->getFunctionType()->getNumParams() == 0)
             DontPrintWarning = true;
-      
+
       // Otherwise, if the non-concrete global is a global array variable with a
       // size of 0, and the concrete global is an array with a real size, don't
       // warn.  This occurs due to declaring 'extern int A[];'.


Index: llvm/lib/Transforms/IPO/GlobalDCE.cpp
diff -u llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.36 llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.37
--- llvm/lib/Transforms/IPO/GlobalDCE.cpp:1.36	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/GlobalDCE.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===-- GlobalDCE.cpp - DCE unreachable internal functions ----------------===//
-// 
+//
 //                     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 transform is designed to eliminate unreachable internal globals from the
@@ -111,7 +111,7 @@
     NumVariables += DeadGlobalVars.size();
     Changed = true;
   }
-    
+
   // Make sure that all memory is released
   AliveGlobals.clear();
   return Changed;
@@ -148,7 +148,7 @@
           if (GlobalValue *GV = dyn_cast<GlobalValue>(*U))
             GlobalIsNeeded(GV);
           else if (Constant *C = dyn_cast<Constant>(*U))
-            MarkUsedGlobalsAsNeeded(C);      
+            MarkUsedGlobalsAsNeeded(C);
   }
 }
 
@@ -174,7 +174,7 @@
   GV.removeDeadConstantUsers();
   return GV.use_empty();
 }
- 
+
 // SafeToDestroyConstant - It is safe to destroy a constant iff it is only used
 // by constants itself.  Note that constants cannot be cyclic, so this test is
 // pretty easy to implement recursively.


Index: llvm/lib/Transforms/IPO/GlobalOpt.cpp
diff -u llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.38 llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.39
--- llvm/lib/Transforms/IPO/GlobalOpt.cpp:1.38	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/GlobalOpt.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- GlobalOpt.cpp - Optimize Global Variables --------------------------===//
-// 
+//
 //                     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 simple global variables that never have their address
@@ -47,7 +47,7 @@
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequired<TargetData>();
     }
-    
+
     bool runOnModule(Module &M);
 
   private:
@@ -201,7 +201,7 @@
         // If the first two indices are constants, this can be SRA'd.
         if (isa<GlobalVariable>(I->getOperand(0))) {
           if (I->getNumOperands() < 3 || !isa<Constant>(I->getOperand(1)) ||
-              !cast<Constant>(I->getOperand(1))->isNullValue() || 
+              !cast<Constant>(I->getOperand(1))->isNullValue() ||
               !isa<ConstantInt>(I->getOperand(2)))
             GS.isNotSuitableForSRA = true;
         } else if (ConstantExpr *CE = dyn_cast<ConstantExpr>(I->getOperand(0))){
@@ -304,7 +304,7 @@
   bool Changed = false;
   for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E;) {
     User *U = *UI++;
-    
+
     if (LoadInst *LI = dyn_cast<LoadInst>(U)) {
       if (Init) {
         // Replace the load with the initializer.
@@ -367,7 +367,7 @@
   assert(GV->hasInternalLinkage() && !GV->isConstant());
   Constant *Init = GV->getInitializer();
   const Type *Ty = Init->getType();
-  
+
   std::vector<GlobalVariable*> NewGlobals;
   Module::GlobalListType &Globals = GV->getParent()->getGlobalList();
 
@@ -422,7 +422,7 @@
     assert(((isa<ConstantExpr>(GEP) &&
              cast<ConstantExpr>(GEP)->getOpcode()==Instruction::GetElementPtr)||
             isa<GetElementPtrInst>(GEP)) && "NonGEP CE's are not SRAable!");
-             
+
     // Ignore the 1th operand, which has to be zero or else the program is quite
     // broken (undefined).  Get the 2nd operand, which is the structure or array
     // index.
@@ -499,7 +499,7 @@
       if (!AllUsesOfValueWillTrapIfNull(CI)) return false;
     } else if (GetElementPtrInst *GEPI = dyn_cast<GetElementPtrInst>(*UI)) {
       if (!AllUsesOfValueWillTrapIfNull(GEPI)) return false;
-    } else if (isa<SetCondInst>(*UI) && 
+    } else if (isa<SetCondInst>(*UI) &&
                isa<ConstantPointerNull>(UI->getOperand(1))) {
       // Ignore setcc X, null
     } else {
@@ -681,7 +681,7 @@
     MI->eraseFromParent();
     MI = NewMI;
   }
-  
+
   // Create the new global variable.  The contents of the malloc'd memory is
   // undefined, so initialize with an undef value.
   Constant *Init = UndefValue::get(MI->getAllocatedType());
@@ -689,7 +689,7 @@
                                              GlobalValue::InternalLinkage, Init,
                                              GV->getName()+".body");
   GV->getParent()->getGlobalList().insert(GV, NewGV);
-  
+
   // Anything that used the malloc now uses the global directly.
   MI->replaceAllUsesWith(NewGV);
 
@@ -699,8 +699,8 @@
 
   // If there is a comparison against null, we will insert a global bool to
   // keep track of whether the global was initialized yet or not.
-  GlobalVariable *InitBool = 
-    new GlobalVariable(Type::BoolTy, false, GlobalValue::InternalLinkage, 
+  GlobalVariable *InitBool =
+    new GlobalVariable(Type::BoolTy, false, GlobalValue::InternalLinkage,
                        ConstantBool::False, GV->getName()+".init");
   bool InitBoolUsed = false;
 
@@ -817,7 +817,7 @@
     if (Constant *SOVC = dyn_cast<Constant>(StoredOnceVal)) {
       if (GV->getInitializer()->getType() != SOVC->getType())
         SOVC = ConstantExpr::getCast(SOVC, GV->getInitializer()->getType());
-      
+
       // Optimize away any trapping uses of the loaded value.
       if (OptimizeAwayTrappingUsesOfLoads(GV, SOVC))
         return true;
@@ -846,7 +846,7 @@
 }
 
 /// ShrinkGlobalToBoolean - At this point, we have learned that the only two
-/// values ever stored into GV are its initializer and OtherVal.  
+/// values ever stored into GV are its initializer and OtherVal.
 static void ShrinkGlobalToBoolean(GlobalVariable *GV, Constant *OtherVal) {
   // Create the new global, initializing it to false.
   GlobalVariable *NewGV = new GlobalVariable(Type::BoolTy, false,
@@ -895,13 +895,13 @@
     } else if (!UI->use_empty()) {
       // Change the load into a load of bool then a select.
       LoadInst *LI = cast<LoadInst>(UI);
-      
+
       std::string Name = LI->getName(); LI->setName("");
       LoadInst *NLI = new LoadInst(NewGV, Name+".b", LI);
       Value *NSI;
       if (IsOneZero)
         NSI = new CastInst(NLI, LI->getType(), Name, LI);
-      else 
+      else
         NSI = new SelectInst(NLI, OtherVal, InitVal, Name, LI);
       LI->replaceAllUsesWith(NSI);
     }
@@ -947,7 +947,7 @@
       AllocaInst* Alloca = new AllocaInst(ElemTy, NULL, GV->getName(), FirstI);
       if (!isa<UndefValue>(GV->getInitializer()))
         new StoreInst(GV->getInitializer(), Alloca, FirstI);
-   
+
       GV->replaceAllUsesWith(Alloca);
       GV->eraseFromParent();
       ++NumLocalized;
@@ -969,14 +969,14 @@
         Changed = true;
       }
       return Changed;
-          
+
     } else if (GS.StoredType <= GlobalStatus::isInitializerStored) {
       DEBUG(std::cerr << "MARKING CONSTANT: " << *GV);
       GV->setConstant(true);
-          
+
       // Clean up any obviously simplifiable users now.
       CleanupConstantGlobalUsers(GV, GV->getInitializer());
-          
+
       // If the global is dead now, just nuke it.
       if (GV->use_empty()) {
         DEBUG(std::cerr << "   *** Marking constant allowed us to simplify "
@@ -984,7 +984,7 @@
         GV->eraseFromParent();
         ++NumDeleted;
       }
-          
+
       ++NumMarked;
       return true;
     } else if (!GS.isNotSuitableForSRA &&
@@ -1002,10 +1002,10 @@
         if (isa<UndefValue>(GV->getInitializer())) {
           // Change the initial value here.
           GV->setInitializer(SOVConstant);
-          
+
           // Clean up any obviously simplifiable users now.
           CleanupConstantGlobalUsers(GV, GV->getInitializer());
-          
+
           if (GV->use_empty()) {
             DEBUG(std::cerr << "   *** Substituting initializer allowed us to "
                   "simplify all users and delete global!\n");


Index: llvm/lib/Transforms/IPO/IPConstantPropagation.cpp
diff -u llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.17 llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.18
--- llvm/lib/Transforms/IPO/IPConstantPropagation.cpp:1.17	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/IPConstantPropagation.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===-- IPConstantPropagation.cpp - Propagate constants through 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 pass implements an _extremely_ simple interprocedural constant
@@ -81,10 +81,10 @@
       return false;  // Used by a non-instruction, do not transform
     else {
       CallSite CS = CallSite::get(cast<Instruction>(*I));
-      if (CS.getInstruction() == 0 || 
+      if (CS.getInstruction() == 0 ||
           CS.getCalledFunction() != &F)
         return false;  // Not a direct call site?
-      
+
       // Check out all of the potentially constant arguments
       CallSite::arg_iterator AI = CS.arg_begin();
       Function::arg_iterator Arg = F.arg_begin();
@@ -163,7 +163,7 @@
       ReplacedAllUsers = false;
     else {
       CallSite CS = CallSite::get(cast<Instruction>(*I));
-      if (CS.getInstruction() == 0 || 
+      if (CS.getInstruction() == 0 ||
           CS.getCalledFunction() != &F) {
         ReplacedAllUsers = false;
       } else {


Index: llvm/lib/Transforms/IPO/InlineSimple.cpp
diff -u llvm/lib/Transforms/IPO/InlineSimple.cpp:1.69 llvm/lib/Transforms/IPO/InlineSimple.cpp:1.70
--- llvm/lib/Transforms/IPO/InlineSimple.cpp:1.69	Mon Mar 14 22:54:20 2005
+++ llvm/lib/Transforms/IPO/InlineSimple.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- InlineSimple.cpp - Code to perform simple function inlining --------===//
-// 
+//
 //                     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 bottom-up inlining of functions into callees.
@@ -101,7 +101,7 @@
       if (AllOperandsConstant) {
         // We will get to remove this instruction...
         Reduction += 7;
-        
+
         // And any other instructions that use it which become constants
         // themselves.
         Reduction += CountCodeReductionForConstant(&Inst);


Index: llvm/lib/Transforms/IPO/Inliner.cpp
diff -u llvm/lib/Transforms/IPO/Inliner.cpp:1.23 llvm/lib/Transforms/IPO/Inliner.cpp:1.24
--- llvm/lib/Transforms/IPO/Inliner.cpp:1.23	Sat Sep 18 16:37:03 2004
+++ llvm/lib/Transforms/IPO/Inliner.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- Inliner.cpp - Code common to all inliners --------------------------===//
-// 
+//
 //                     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 mechanics required to implement inlining without
@@ -53,18 +53,18 @@
   for (CallGraphNode::iterator I = CalleeNode->begin(),
          E = CalleeNode->end(); I != E; ++I)
     CallerNode->addCalledFunction(*I);
-  
+
   // If we inlined the last possible call site to the function, delete the
   // function body now.
   if (Callee->use_empty() && Callee->hasInternalLinkage() &&
       !SCCFunctions.count(Callee)) {
     DEBUG(std::cerr << "    -> Deleting dead function: "
                     << Callee->getName() << "\n");
-    
+
     // Remove any call graph edges from the callee to its callees.
     while (CalleeNode->begin() != CalleeNode->end())
       CalleeNode->removeCallEdgeTo(*(CalleeNode->end()-1));
-     
+
     // Removing the node for callee from the call graph and delete it.
     delete CG.removeFunctionFromModule(CalleeNode);
     ++NumDeleted;
@@ -99,7 +99,7 @@
         }
 
   DEBUG(std::cerr << ": " << CallSites.size() << " call sites.\n");
-  
+
   // Now that we have all of the call sites, move the ones to functions in the
   // current SCC to the end of the list.
   unsigned FirstCallInSCC = CallSites.size();
@@ -107,7 +107,7 @@
     if (Function *F = CallSites[i].getCalledFunction())
       if (SCCFunctions.count(F))
         std::swap(CallSites[i--], CallSites[--FirstCallInSCC]);
-  
+
   // Now that we have all of the call sites, loop over them and inline them if
   // it looks profitable to do so.
   bool Changed = false;
@@ -137,7 +137,7 @@
         } else {
           DEBUG(std::cerr << "    Inlining: cost=" << InlineCost
                 << ", Call: " << *CS.getInstruction());
-          
+
           Function *Caller = CS.getInstruction()->getParent()->getParent();
 
           // Attempt to inline the function...
@@ -178,12 +178,12 @@
         // Remove any call graph edges from the function to its callees.
         while (CGN->begin() != CGN->end())
           CGN->removeCallEdgeTo(*(CGN->end()-1));
-        
+
         // Remove any edges from the external node to the function's call graph
         // node.  These edges might have been made irrelegant due to
         // optimization of the program.
         CG.getExternalCallingNode()->removeAnyCallEdgeTo(CGN);
-        
+
         // Removing the node for callee from the call graph and delete it.
         FunctionsToRemove.insert(CGN);
       }


Index: llvm/lib/Transforms/IPO/Inliner.h
diff -u llvm/lib/Transforms/IPO/Inliner.h:1.7 llvm/lib/Transforms/IPO/Inliner.h:1.8
--- llvm/lib/Transforms/IPO/Inliner.h:1.7	Sun May 23 16:21:35 2004
+++ llvm/lib/Transforms/IPO/Inliner.h	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- InlineCommon.h - Code common to all inliners -------------*- C++ -*-===//
-// 
+//
 //                     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 defines a simple policy-based bottom-up inliner.  This file


Index: llvm/lib/Transforms/IPO/Internalize.cpp
diff -u llvm/lib/Transforms/IPO/Internalize.cpp:1.24 llvm/lib/Transforms/IPO/Internalize.cpp:1.25
--- llvm/lib/Transforms/IPO/Internalize.cpp:1.24	Mon Mar 14 22:54:21 2005
+++ llvm/lib/Transforms/IPO/Internalize.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===-- Internalize.cpp - Mark functions internal -------------------------===//
-// 
+//
 //                     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 loops over all of the functions in the input module, looking for a
@@ -38,7 +38,7 @@
   APIList("internalize-public-api-list", cl::value_desc("list"),
           cl::desc("A list of symbol names to preserve"),
           cl::CommaSeparated);
- 
+
   class InternalizePass : public ModulePass {
     std::set<std::string> ExternalNames;
   public:
@@ -80,7 +80,7 @@
       }
 
       bool Changed = false;
-      
+
       // Found a main function, mark all functions not named main as internal.
       for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
         if (!I->isExternal() &&         // Function must be defined here
@@ -109,7 +109,7 @@
           ++NumGlobals;
           DEBUG(std::cerr << "Internalizing gvar " << I->getName() << "\n");
         }
-      
+
       return Changed;
     }
   };


Index: llvm/lib/Transforms/IPO/LoopExtractor.cpp
diff -u llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.17 llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.18
--- llvm/lib/Transforms/IPO/LoopExtractor.cpp:1.17	Sun Jan  9 22:23:32 2005
+++ llvm/lib/Transforms/IPO/LoopExtractor.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- LoopExtractor.cpp - Extract each loop into a new function ----------===//
-// 
+//
 //                     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.
-// 
+//
 //===----------------------------------------------------------------------===//
 //
 // A pass wrapper around the ExtractLoop() scalar transformation to extract each
@@ -27,7 +27,7 @@
 
 namespace {
   Statistic<> NumExtracted("loop-extract", "Number of loops extracted");
-  
+
   // FIXME: This is not a function pass, but the PassManager doesn't allow
   // Module passes to require FunctionPasses, so we can't get loop info if we're
   // not a function pass.
@@ -37,7 +37,7 @@
     LoopExtractor(unsigned numLoops = ~0) : NumLoops(numLoops) {}
 
     virtual bool runOnFunction(Function &F);
-    
+
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
       AU.addRequiredID(BreakCriticalEdgesID);
       AU.addRequiredID(LoopSimplifyID);
@@ -46,7 +46,7 @@
     }
   };
 
-  RegisterOpt<LoopExtractor> 
+  RegisterOpt<LoopExtractor>
   X("loop-extract", "Extract loops into new functions");
 
   /// SingleLoopExtractor - For bugpoint.
@@ -54,9 +54,9 @@
     SingleLoopExtractor() : LoopExtractor(1) {}
   };
 
-  RegisterOpt<SingleLoopExtractor> 
+  RegisterOpt<SingleLoopExtractor>
   Y("loop-extract-single", "Extract at most one loop into a new function");
-} // End anonymous namespace 
+} // End anonymous namespace
 
 // createLoopExtractorPass - This pass extracts all natural loops from the
 // program into a function if it can.
@@ -87,11 +87,11 @@
     // than a minimal wrapper around the loop, extract the loop.
     Loop *TLL = *LI.begin();
     bool ShouldExtractLoop = false;
-    
+
     // Extract the loop if the entry block doesn't branch to the loop header.
     TerminatorInst *EntryTI = F.getEntryBlock().getTerminator();
     if (!isa<BranchInst>(EntryTI) ||
-        !cast<BranchInst>(EntryTI)->isUnconditional() || 
+        !cast<BranchInst>(EntryTI)->isUnconditional() ||
         EntryTI->getSuccessor(0) != TLL->getHeader())
       ShouldExtractLoop = true;
     else {
@@ -105,7 +105,7 @@
           break;
         }
     }
-    
+
     if (ShouldExtractLoop) {
       if (NumLoops == 0) return Changed;
       --NumLoops;
@@ -184,6 +184,6 @@
 
   for (unsigned i = 0, e = BlocksToExtract.size(); i != e; ++i)
     ExtractBasicBlock(BlocksToExtract[i]);
-  
+
   return !BlocksToExtract.empty();
 }


Index: llvm/lib/Transforms/IPO/LowerSetJmp.cpp
diff -u llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.23 llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.24
--- llvm/lib/Transforms/IPO/LowerSetJmp.cpp:1.23	Thu Apr 21 11:46:46 2005
+++ llvm/lib/Transforms/IPO/LowerSetJmp.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- LowerSetJmp.cpp - Code pertaining to lowering set/long jumps -------===//
-// 
+//
 //                     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 lowering of setjmp and longjmp to use the
@@ -204,7 +204,7 @@
 
   // void __llvm_sjljeh_init_setjmpmap(void**)
   InitSJMap = M.getOrInsertFunction("__llvm_sjljeh_init_setjmpmap",
-                                    Type::VoidTy, SBPPTy, 0); 
+                                    Type::VoidTy, SBPPTy, 0);
   // void __llvm_sjljeh_destroy_setjmpmap(void**)
   DestroySJMap = M.getOrInsertFunction("__llvm_sjljeh_destroy_setjmpmap",
                                        Type::VoidTy, SBPPTy, 0);
@@ -386,7 +386,7 @@
   // instructions after the call.
   for (BasicBlock::iterator I = ++BasicBlock::iterator(Inst), E = ABlock->end();
        I != E; ++I)
-    InstrsAfterCall.insert(I);    
+    InstrsAfterCall.insert(I);
 
   for (BasicBlock::iterator II = ABlock->begin();
        II != BasicBlock::iterator(Inst); ++II)
@@ -460,7 +460,7 @@
   std::vector<Value*> Params(CI.op_begin() + 1, CI.op_end());
   InvokeInst* II = new
     InvokeInst(CI.getCalledValue(), NewBB, PrelimBBMap[Func],
-               Params, CI.getName(), Term); 
+               Params, CI.getName(), Term);
 
   // Replace the old call inst with the invoke inst and remove the call.
   CI.replaceAllUsesWith(II);


Index: llvm/lib/Transforms/IPO/PruneEH.cpp
diff -u llvm/lib/Transforms/IPO/PruneEH.cpp:1.17 llvm/lib/Transforms/IPO/PruneEH.cpp:1.18
--- llvm/lib/Transforms/IPO/PruneEH.cpp:1.17	Mon Oct 18 10:43:46 2004
+++ llvm/lib/Transforms/IPO/PruneEH.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- PruneEH.cpp - Pass which deletes unused exception handlers ---------===//
-// 
+//
 //                     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 simple interprocedural pass which walks the
@@ -77,7 +77,7 @@
                 SCCMightThrow = true;
                 break;
               }
-                
+
             } else {
               // Indirect call, it might throw.
               SCCMightThrow = true;
@@ -109,24 +109,24 @@
                                          std::vector<Value*>(II->op_begin()+3,
                                                              II->op_end()),
                                          Name, II);
-              
+
               // Anything that used the value produced by the invoke instruction
               // now uses the value produced by the call instruction.
               II->replaceAllUsesWith(Call);
               II->getUnwindDest()->removePredecessor(II->getParent());
-          
+
               // Insert a branch to the normal destination right before the
               // invoke.
               new BranchInst(II->getNormalDest(), II);
-              
+
               // Finally, delete the invoke instruction!
               I->getInstList().pop_back();
-              
+
               ++NumRemoved;
               MadeChange = true;
             }
   }
 
-  return MadeChange; 
+  return MadeChange;
 }
 


Index: llvm/lib/Transforms/IPO/RaiseAllocations.cpp
diff -u llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.28 llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.29
--- llvm/lib/Transforms/IPO/RaiseAllocations.cpp:1.28	Sun Feb 27 00:16:55 2005
+++ llvm/lib/Transforms/IPO/RaiseAllocations.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- RaiseAllocations.cpp - Convert %malloc & %free calls to insts ------===//
-// 
+//
 //                     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 defines the RaiseAllocations pass which convert malloc and free
@@ -33,17 +33,17 @@
     Function *FreeFunc;     // Initialized by doPassInitializationVirt
   public:
     RaiseAllocations() : MallocFunc(0), FreeFunc(0) {}
-    
+
     // doPassInitialization - For the raise allocations pass, this finds a
     // declaration for malloc and free if they exist.
     //
     void doInitialization(Module &M);
-    
+
     // run - This method does the actual work of converting instructions over.
     //
     bool runOnModule(Module &M);
   };
-  
+
   RegisterOpt<RaiseAllocations>
   X("raiseallocs", "Raise allocations from calls to instructions");
 }  // end anonymous namespace
@@ -134,14 +134,14 @@
             (CS.getCalledFunction() == MallocFunc ||
              std::find(EqPointers.begin(), EqPointers.end(),
                        CS.getCalledValue()) != EqPointers.end())) {
-            
+
           Value *Source = *CS.arg_begin();
-          
+
           // If no prototype was provided for malloc, we may need to cast the
           // source size.
           if (Source->getType() != Type::UIntTy)
             Source = new CastInst(Source, Type::UIntTy, "MallocAmtCast", I);
-          
+
           std::string Name(I->getName()); I->setName("");
           MallocInst *MI = new MallocInst(Type::SByteTy, Source, Name, I);
           I->replaceAllUsesWith(MI);
@@ -183,7 +183,7 @@
             (CS.getCalledFunction() == FreeFunc ||
              std::find(EqPointers.begin(), EqPointers.end(),
                        CS.getCalledValue()) != EqPointers.end())) {
-          
+
           // If no prototype was provided for free, we may need to cast the
           // source pointer.  This should be really uncommon, but it's necessary
           // just in case we are dealing with weird code like this:


Index: llvm/lib/Transforms/IPO/StripSymbols.cpp
diff -u llvm/lib/Transforms/IPO/StripSymbols.cpp:1.3 llvm/lib/Transforms/IPO/StripSymbols.cpp:1.4
--- llvm/lib/Transforms/IPO/StripSymbols.cpp:1.3	Mon Mar 14 22:54:21 2005
+++ llvm/lib/Transforms/IPO/StripSymbols.cpp	Thu Apr 21 18:39:37 2005
@@ -1,10 +1,10 @@
 //===- StripSymbols.cpp - Strip symbols and debug info from a module ------===//
-// 
+//
 //                     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 stripping symbols out of symbol tables.
@@ -17,7 +17,7 @@
 //
 // Notice that:
 //   * This pass makes code much less readable, so it should only be used in
-//     situations where the 'strip' utility would be used (such as reducing 
+//     situations where the 'strip' utility would be used (such as reducing
 //     code size, and making it harder to reverse engineer code).
 //
 //===----------------------------------------------------------------------===//
@@ -63,7 +63,7 @@
   }
   else if (!isa<Function>(C))
     C->destroyConstant();
-  
+
   // If the constant referenced anything, see if we can delete it as well.
   while (!Operands.empty()) {
     RemoveDeadConstant(Operands.back());
@@ -144,5 +144,5 @@
       RemoveDeadConstant(GV);
   }
 
-  return true; 
+  return true;
 }






More information about the llvm-commits mailing list