X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FTransforms%2FScalar.h;h=6f9e1245e51a287180420cede0c79411dd90efec;hb=1684d47d8f73250616bfbed63607121fb82555bb;hp=6893badfc2395b0050d9d8d886ae4a44fa73f513;hpb=60df9077ebe2a38723beadedd88e349f9aa214cb;p=oota-llvm.git diff --git a/include/llvm/Transforms/Scalar.h b/include/llvm/Transforms/Scalar.h index 6893badfc23..6f9e1245e51 100644 --- a/include/llvm/Transforms/Scalar.h +++ b/include/llvm/Transforms/Scalar.h @@ -15,6 +15,8 @@ #ifndef LLVM_TRANSFORMS_SCALAR_H #define LLVM_TRANSFORMS_SCALAR_H +#include "llvm/ADT/StringRef.h" + namespace llvm { class FunctionPass; @@ -23,6 +25,7 @@ class GetElementPtrInst; class PassInfo; class TerminatorInst; class TargetLowering; +class TargetMachine; //===----------------------------------------------------------------------===// // @@ -68,12 +71,22 @@ FunctionPass *createDeadStoreEliminationPass(); // FunctionPass *createAggressiveDCEPass(); +//===----------------------------------------------------------------------===// +// +// SROA - Replace aggregates or pieces of aggregates with scalar SSA values. +// +FunctionPass *createSROAPass(bool RequiresDomTree = true); + //===----------------------------------------------------------------------===// // // ScalarReplAggregates - Break up alloca's of aggregates into multiple allocas // if possible. // -FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1); +FunctionPass *createScalarReplAggregatesPass(signed Threshold = -1, + bool UseDomTree = true, + signed StructMemberThreshold = -1, + signed ArrayElementThreshold = -1, + signed ScalarLoadThreshold = -1); //===----------------------------------------------------------------------===// // @@ -105,11 +118,11 @@ Pass *createLICMPass(); //===----------------------------------------------------------------------===// // // LoopStrengthReduce - This pass is strength reduces GEP instructions that use -// a loop's canonical induction variable as one of their indices. It takes an -// optional parameter used to consult the target machine whether certain -// transformations are profitable. +// a loop's canonical induction variable as one of their indices. // -Pass *createLoopStrengthReducePass(const TargetLowering *TLI = 0); +Pass *createLoopStrengthReducePass(); + +Pass *createGlobalMergePass(const TargetMachine *TM = 0); //===----------------------------------------------------------------------===// // @@ -117,11 +130,24 @@ Pass *createLoopStrengthReducePass(const TargetLowering *TLI = 0); // Pass *createLoopUnswitchPass(bool OptimizeForSize = false); +//===----------------------------------------------------------------------===// +// +// LoopInstSimplify - This pass simplifies instructions in a loop's body. +// +Pass *createLoopInstSimplifyPass(); + //===----------------------------------------------------------------------===// // // LoopUnroll - This pass is a simple loop unrolling pass. // -Pass *createLoopUnrollPass(); +Pass *createLoopUnrollPass(int Threshold = -1, int Count = -1, + int AllowPartial = -1, int Runtime = -1); + +//===----------------------------------------------------------------------===// +// +// LoopReroll - This pass is a simple loop rerolling pass. +// +Pass *createLoopRerollPass(); //===----------------------------------------------------------------------===// // @@ -131,11 +157,10 @@ Pass *createLoopRotatePass(); //===----------------------------------------------------------------------===// // -// LoopIndexSplit - This pass divides loop's iteration range by spliting loop -// such that each individual loop is executed efficiently. +// LoopIdiom - This pass recognizes and replaces idioms in loops. // -Pass *createLoopIndexSplitPass(); - +Pass *createLoopIdiomPass(); + //===----------------------------------------------------------------------===// // // PromoteMemoryToRegister - This pass is used to promote memory references to @@ -149,7 +174,6 @@ Pass *createLoopIndexSplitPass(); // ret i32 %Y // FunctionPass *createPromoteMemoryToRegisterPass(); -extern const PassInfo *const PromoteMemoryToRegisterID; //===----------------------------------------------------------------------===// // @@ -158,7 +182,7 @@ extern const PassInfo *const PromoteMemoryToRegisterID; // hacking easier. // FunctionPass *createDemoteRegisterToMemoryPass(); -extern const PassInfo *const DemoteRegisterToMemoryID; +extern char &DemoteRegisterToMemoryID; //===----------------------------------------------------------------------===// // @@ -169,13 +193,6 @@ extern const PassInfo *const DemoteRegisterToMemoryID; // FunctionPass *createReassociatePass(); -//===----------------------------------------------------------------------===// -// -// TailDuplication - Eliminate unconditional branches through controlled code -// duplication, creating simpler CFG structures. -// -FunctionPass *createTailDuplicationPass(); - //===----------------------------------------------------------------------===// // // JumpThreading - Thread control through mult-pred/multi-succ blocks where some @@ -190,6 +207,19 @@ FunctionPass *createJumpThreadingPass(); // FunctionPass *createCFGSimplificationPass(); +//===----------------------------------------------------------------------===// +// +// FlattenCFG - flatten CFG, reduce number of conditional branches by using +// parallel-and and parallel-or mode, etc... +// +FunctionPass *createFlattenCFGPass(); + +//===----------------------------------------------------------------------===// +// +// CFG Structurization - Remove irreducible control flow +// +Pass *createStructurizeCFGPass(); + //===----------------------------------------------------------------------===// // // BreakCriticalEdges - Break all of the critical edges in the CFG by inserting @@ -202,7 +232,7 @@ FunctionPass *createCFGSimplificationPass(); // (set, immediate dominators, tree, and frontier) information. // FunctionPass *createBreakCriticalEdgesPass(); -extern const PassInfo *const BreakCriticalEdgesID; +extern char &BreakCriticalEdgesID; //===----------------------------------------------------------------------===// // @@ -213,7 +243,7 @@ extern const PassInfo *const BreakCriticalEdgesID; // AU.addRequiredID(LoopSimplifyID); // Pass *createLoopSimplifyPass(); -extern const PassInfo *const LoopSimplifyID; +extern char &LoopSimplifyID; //===----------------------------------------------------------------------===// // @@ -228,7 +258,7 @@ FunctionPass *createTailCallEliminationPass(); // chained binary branch instructions. // FunctionPass *createLowerSwitchPass(); -extern const PassInfo *const LowerSwitchID; +extern char &LowerSwitchID; //===----------------------------------------------------------------------===// // @@ -240,15 +270,9 @@ extern const PassInfo *const LowerSwitchID; // purpose "my LLVM-to-LLVM pass doesn't support the invoke instruction yet" // lowering pass. // -FunctionPass *createLowerInvokePass(const TargetLowering *TLI = 0); -extern const PassInfo *const LowerInvokePassID; - -//===----------------------------------------------------------------------===// -// -// BlockPlacement - This pass reorders basic blocks in order to increase the -// number of fall-through conditional branches. -// -FunctionPass *createBlockPlacementPass(); +FunctionPass *createLowerInvokePass(const TargetMachine *TM = 0, + bool useExpensiveEHSupport = false); +extern char &LowerInvokePassID; //===----------------------------------------------------------------------===// // @@ -256,8 +280,15 @@ FunctionPass *createBlockPlacementPass(); // optimizations. // Pass *createLCSSAPass(); -extern const PassInfo *const LCSSAID; +extern char &LCSSAID; +//===----------------------------------------------------------------------===// +// +// EarlyCSE - This pass performs a simple and fast CSE pass over the dominator +// tree. +// +FunctionPass *createEarlyCSEPass(); + //===----------------------------------------------------------------------===// // // GVN - This pass performs global value numbering and redundant load @@ -279,62 +310,71 @@ FunctionPass *createMemCpyOptPass(); // Pass *createLoopDeletionPass(); -//===----------------------------------------------------------------------===// -// -/// createSimplifyLibCallsPass - This pass optimizes specific calls to -/// specific well-known (library) functions. -FunctionPass *createSimplifyLibCallsPass(); - -//===----------------------------------------------------------------------===// -// -/// createSimplifyHalfPowrLibCallsPass - This is an experimental pass that -/// optimizes specific half_pow functions. -FunctionPass *createSimplifyHalfPowrLibCallsPass(); - //===----------------------------------------------------------------------===// // // CodeGenPrepare - This pass prepares a function for instruction selection. // -FunctionPass *createCodeGenPreparePass(const TargetLowering *TLI = 0); +FunctionPass *createCodeGenPreparePass(const TargetMachine *TM = 0); //===----------------------------------------------------------------------===// // // InstructionNamer - Give any unnamed non-void instructions "tmp" names. // FunctionPass *createInstructionNamerPass(); -extern const PassInfo *const InstructionNamerID; +extern char &InstructionNamerID; //===----------------------------------------------------------------------===// // -// SSI - This pass converts instructions to Static Single Information form -// on demand. +// Sink - Code Sinking // -FunctionPass *createSSIPass(); +FunctionPass *createSinkingPass(); //===----------------------------------------------------------------------===// // -// SSI - This pass converts every non-void instuction to Static Single -// Information form. +// LowerAtomic - Lower atomic intrinsics to non-atomic form // -FunctionPass *createSSIEverythingPass(); +Pass *createLowerAtomicPass(); //===----------------------------------------------------------------------===// // -// GEPSplitter - Split complex GEPs into simple ones +// ValuePropagation - Propagate CFG-derived value information // -FunctionPass *createGEPSplitterPass(); +Pass *createCorrelatedValuePropagationPass(); //===----------------------------------------------------------------------===// // -// SCCVN - Aggressively eliminate redundant scalar values +// InstructionSimplifier - Remove redundant instructions. +// +FunctionPass *createInstructionSimplifierPass(); +extern char &InstructionSimplifierID; + + +//===----------------------------------------------------------------------===// +// +// LowerExpectIntrinsics - Removes llvm.expect intrinsics and creates +// "block_weights" metadata. +FunctionPass *createLowerExpectIntrinsicPass(); + + +//===----------------------------------------------------------------------===// +// +// PartiallyInlineLibCalls - Tries to inline the fast path of library +// calls such as sqrt. +// +FunctionPass *createPartiallyInlineLibCallsPass(); + +//===----------------------------------------------------------------------===// // -FunctionPass *createSCCVNPass(); +// SampleProfilePass - Loads sample profile data from disk and generates +// IR metadata to reflect the profile. +FunctionPass *createSampleProfileLoaderPass(); +FunctionPass *createSampleProfileLoaderPass(StringRef Name); //===----------------------------------------------------------------------===// // -// ABCD - Elimination of Array Bounds Checks on Demand +// ScalarizerPass - Converts vector operations into scalar operations // -FunctionPass *createABCDPass(); +FunctionPass *createScalarizerPass(); } // End llvm namespace