X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FTransforms%2FUtils%2FCloning.h;h=5b15b5b8719998880e211247144e5357eab23d3c;hb=8f2718fbef6177966ff807af0732eb2431bd9a5f;hp=53e47a3c195231dc91e0b639d0a77b7e3913f3b7;hpb=4bc2a0b420c728e77a852bad9721e4edfd4b3f79;p=oota-llvm.git diff --git a/include/llvm/Transforms/Utils/Cloning.h b/include/llvm/Transforms/Utils/Cloning.h index 53e47a3c195..5b15b5b8719 100644 --- a/include/llvm/Transforms/Utils/Cloning.h +++ b/include/llvm/Transforms/Utils/Cloning.h @@ -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. // //===----------------------------------------------------------------------===// // @@ -18,15 +18,12 @@ #ifndef LLVM_TRANSFORMS_UTILS_CLONING_H #define LLVM_TRANSFORMS_UTILS_CLONING_H -#include #include "llvm/ADT/DenseMap.h" namespace llvm { class Module; class Function; -class Loop; -class LoopInfo; class Pass; class LPPassManager; class BasicBlock; @@ -38,6 +35,11 @@ class CallSite; class Trace; class CallGraph; class TargetData; +class Loop; +class LoopInfo; +class LLVMContext; +class AllocaInst; +template class SmallVectorImpl; /// CloneModule - Return an exact copy of the specified module /// @@ -103,9 +105,9 @@ BasicBlock *CloneBasicBlock(const BasicBlock *BB, ClonedCodeInfo *CodeInfo = 0); -/// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate ValueMap -/// using old blocks to new blocks mapping. -Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI, +/// CloneLoop - Clone Loop. Clone dominator info for loop insiders. Populate +/// ValueMap using old blocks to new blocks mapping. +Loop *CloneLoop(Loop *L, LPPassManager *LPM, LoopInfo *LI, DenseMap &ValueMap, Pass *P); /// CloneFunction - Return a copy of the specified function, but without @@ -136,7 +138,7 @@ inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 0){ /// void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, DenseMap &ValueMap, - std::vector &Returns, + SmallVectorImpl &Returns, const char *NameSuffix = "", ClonedCodeInfo *CodeInfo = 0); @@ -149,25 +151,11 @@ void CloneFunctionInto(Function *NewFunc, const Function *OldFunc, /// used for things like CloneFunction or CloneModule. void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc, DenseMap &ValueMap, - std::vector &Returns, + SmallVectorImpl &Returns, const char *NameSuffix = "", ClonedCodeInfo *CodeInfo = 0, const TargetData *TD = 0); - -/// CloneTraceInto - Clone T into NewFunc. Original<->clone mapping is -/// saved in ValueMap. -/// -void CloneTraceInto(Function *NewFunc, Trace &T, - DenseMap &ValueMap, - const char *NameSuffix); - -/// CloneTrace - Returns a copy of the specified trace. -/// It takes a vector of basic blocks clones the basic blocks, removes internal -/// phi nodes, adds it to the same function as the original (although there is -/// no jump to it) and returns the new vector of basic blocks. -std::vector CloneTrace(const std::vector &origTrace); - /// InlineFunction - This function inlines the called function into the basic /// block of the caller. This returns false if it is not possible to inline /// this call. The program is still in a well defined state if this occurs @@ -181,9 +169,15 @@ std::vector CloneTrace(const std::vector &origTrace); /// If a non-null callgraph pointer is provided, these functions update the /// CallGraph to represent the program after inlining. /// -bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0); -bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD =0); -bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0); +/// If StaticAllocas is non-null, InlineFunction populates it with all of the +/// static allocas that it inlines into the caller. +/// +bool InlineFunction(CallInst *C, CallGraph *CG = 0, const TargetData *TD = 0, + SmallVectorImpl *StaticAllocas = 0); +bool InlineFunction(InvokeInst *II, CallGraph *CG = 0, const TargetData *TD = 0, + SmallVectorImpl *StaticAllocas = 0); +bool InlineFunction(CallSite CS, CallGraph *CG = 0, const TargetData *TD = 0, + SmallVectorImpl *StaticAllocas = 0); } // End llvm namespace