Whitespace cleanups.
[oota-llvm.git] / include / llvm / Transforms / Scalar.h
index 01063f9136de52d1cbd3570fa8bf0d4adfc301b1..9a165c91c99b4757871917dcf2d789e0b35df9d2 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     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 is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -76,7 +76,7 @@ FunctionPass *createAggressiveDCEPass();
 // ScalarReplAggregates - Break up alloca's of aggregates into multiple allocas
 // if possible.
 //
-FunctionPass *createScalarReplAggregatesPass();
+FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1);
 
 //===----------------------------------------------------------------------===//
 //
@@ -92,7 +92,7 @@ FunctionPass *createGCSEPass();
 // InductionVariableSimplify - Transform induction variables in a program to all
 // use a single canonical induction variable per loop.
 //
-FunctionPass *createIndVarSimplifyPass();
+LoopPass *createIndVarSimplifyPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -112,7 +112,7 @@ FunctionPass *createInstructionCombiningPass();
 //
 // LICM - This pass is a loop invariant code motion and memory promotion pass.
 //
-FunctionPass *createLICMPass();
+LoopPass *createLICMPass();
 
 //===----------------------------------------------------------------------===//
 //
@@ -121,13 +121,13 @@ FunctionPass *createLICMPass();
 // optional parameter used to consult the target machine whether certain
 // transformations are profitable.
 //
-LoopPass *createLoopStrengthReducePass(const TargetLowering *TLI = NULL);
+LoopPass *createLoopStrengthReducePass(const TargetLowering *TLI = 0);
 
 //===----------------------------------------------------------------------===//
 //
 // LoopUnswitch - This pass is a simple loop unswitching pass.
 //
-LoopPass *createLoopUnswitchPass();
+LoopPass *createLoopUnswitchPass(bool OptimizeForSize = false);
 
 //===----------------------------------------------------------------------===//
 //
@@ -135,6 +135,20 @@ LoopPass *createLoopUnswitchPass();
 //
 LoopPass *createLoopUnrollPass();
 
+//===----------------------------------------------------------------------===//
+//
+// LoopRotate - This pass is a simple loop rotating pass.
+//
+LoopPass *createLoopRotatePass();
+
+//===----------------------------------------------------------------------===//
+//
+// LoopIndexSplit - This pass divides loop's iteration range by spliting loop
+// such that each individual loop is executed efficiently.
+//
+LoopPass *createLoopIndexSplitPass();
+
+
 //===----------------------------------------------------------------------===//
 //
 // PromoteMemoryToRegister - This pass is used to promote memory references to
@@ -148,7 +162,7 @@ LoopPass *createLoopUnrollPass();
 //   ret int %Y
 //
 FunctionPass *createPromoteMemoryToRegisterPass();
-extern const PassInfo *PromoteMemoryToRegisterID;
+extern const PassInfo *const PromoteMemoryToRegisterID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -157,7 +171,7 @@ extern const PassInfo *PromoteMemoryToRegisterID;
 // hacking easier.
 //
 FunctionPass *createDemoteRegisterToMemoryPass();
-extern const PassInfo *DemoteRegisterToMemoryID;
+extern const PassInfo *const DemoteRegisterToMemoryID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -168,17 +182,6 @@ extern const PassInfo *DemoteRegisterToMemoryID;
 //
 FunctionPass *createReassociatePass();
 
-//===----------------------------------------------------------------------===//
-//
-// CorrelatedExpressionElimination - This pass eliminates correlated
-// conditions, such as these:
-//  if (X == 0)
-//    if (X > 2) ;   // Known false
-//    else
-//      Y = X * Z;   // = 0
-//
-FunctionPass *createCorrelatedExpressionEliminationPass();
-
 //===----------------------------------------------------------------------===//
 //
 // CondPropagationPass - This pass propagates information about conditional
@@ -194,6 +197,13 @@ FunctionPass *createCondPropagationPass();
 //
 FunctionPass *createTailDuplicationPass();
 
+//===----------------------------------------------------------------------===//
+//
+// JumpThreading - Thread control through mult-pred/multi-succ blocks where some
+// preds always go to some succ.
+//
+FunctionPass *createJumpThreadingPass();
+  
 //===----------------------------------------------------------------------===//
 //
 // CFGSimplification - Merge basic blocks, eliminate unreachable blocks,
@@ -213,7 +223,7 @@ FunctionPass *createCFGSimplificationPass();
 // (set, immediate dominators, tree, and frontier) information.
 //
 FunctionPass *createBreakCriticalEdgesPass();
-extern const PassInfo *BreakCriticalEdgesID;
+extern const PassInfo *const BreakCriticalEdgesID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -224,16 +234,7 @@ extern const PassInfo *BreakCriticalEdgesID;
 //   AU.addRequiredID(LoopSimplifyID);
 //
 FunctionPass *createLoopSimplifyPass();
-extern const PassInfo *LoopSimplifyID;
-
-//===----------------------------------------------------------------------===//
-//
-// LowerSelect - This pass converts SelectInst instructions into conditional
-// branch and PHI instructions. If the OnlyFP flag is set to true, then only
-// floating point select instructions are lowered.
-//
-FunctionPass *createLowerSelectPass(bool OnlyFP = false);
-extern const PassInfo *LowerSelectID;
+extern const PassInfo *const LoopSimplifyID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -243,7 +244,7 @@ extern const PassInfo *LowerSelectID;
 //   AU.addRequiredID(LowerAllocationsID);
 //
 Pass *createLowerAllocationsPass(bool LowerMallocArgToInteger = false);
-extern const PassInfo *LowerAllocationsID;
+extern const PassInfo *const LowerAllocationsID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -258,14 +259,7 @@ FunctionPass *createTailCallEliminationPass();
 // chained binary branch instructions.
 //
 FunctionPass *createLowerSwitchPass();
-extern const PassInfo *LowerSwitchID;
-
-//===----------------------------------------------------------------------===//
-//
-// LowerPacked - This pass converts VectorType operations into low-level scalar
-// operations.
-//
-FunctionPass *createLowerPackedPass();
+extern const PassInfo *const LowerSwitchID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -278,14 +272,7 @@ FunctionPass *createLowerPackedPass();
 // lowering pass.
 //
 FunctionPass *createLowerInvokePass(const TargetLowering *TLI = NULL);
-extern const PassInfo *LowerInvokePassID;
-
-//===----------------------------------------------------------------------===//
-//
-// LowerGCPass - This function returns an instance of the "lowergc" pass, which
-// lowers garbage collection intrinsics to normal LLVM code.
-//
-FunctionPass *createLowerGCPass();
+extern const PassInfo *const LowerInvokePassID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -299,8 +286,8 @@ FunctionPass *createBlockPlacementPass();
 // LCSSA - This pass inserts phi nodes at loop boundaries to simplify other loop
 // optimizations.
 //
-FunctionPass *createLCSSAPass();
-extern const PassInfo *LCSSAID;
+LoopPass *createLCSSAPass();
+extern const PassInfo *const LCSSAID;
 
 //===----------------------------------------------------------------------===//
 //
@@ -309,6 +296,46 @@ extern const PassInfo *LCSSAID;
 //
 FunctionPass *createPredicateSimplifierPass();
 
+//===----------------------------------------------------------------------===//
+//
+// GVN-PRE - This pass performs global value numbering and partial redundancy
+// elimination.
+//
+FunctionPass *createGVNPREPass();
+
+//===----------------------------------------------------------------------===//
+//
+// GVN - This pass performs global value numbering and redundant load 
+// elimination cotemporaneously.
+//
+FunctionPass *createGVNPass();
+
+//===----------------------------------------------------------------------===//
+//
+// MemCpyOpt - This pass performs optimizations related to eliminating memcpy
+// calls and/or combining multiple stores into memset's.
+//
+FunctionPass *createMemCpyOptPass();
+
+//===----------------------------------------------------------------------===//
+//
+// LoopDeletion - This pass performs DCE of non-infinite loops that it
+// can prove are dead.
+//
+LoopPass *createLoopDeletionPass();
+  
+//===----------------------------------------------------------------------===//
+//
+/// createSimplifyLibCallsPass - This pass optimizes specific calls to
+/// specific well-known (library) functions.
+FunctionPass *createSimplifyLibCallsPass();
+
+//===----------------------------------------------------------------------===//
+//
+// CodeGenPrepare - This pass prepares a function for instruction selection.
+//
+FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0);
+
 } // End llvm namespace
 
 #endif