[llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Cloning.h

Chris Lattner lattner at cs.uiuc.edu
Fri May 26 18:22:03 PDT 2006



Changes in directory llvm/include/llvm/Transforms/Utils:

Cloning.h updated: 1.19 -> 1.20
---
Log message:

Implement a new method: CloneAndPruneFunctionInto, as documented.


---
Diffs of the changes:  (+13 -0)

 Cloning.h |   13 +++++++++++++
 1 files changed, 13 insertions(+)


Index: llvm/include/llvm/Transforms/Utils/Cloning.h
diff -u llvm/include/llvm/Transforms/Utils/Cloning.h:1.19 llvm/include/llvm/Transforms/Utils/Cloning.h:1.20
--- llvm/include/llvm/Transforms/Utils/Cloning.h:1.19	Wed May 17 13:05:35 2006
+++ llvm/include/llvm/Transforms/Utils/Cloning.h	Fri May 26 20:21:50 2006
@@ -130,6 +130,19 @@
                        const char *NameSuffix = "", 
                        ClonedCodeInfo *CodeInfo = 0);
 
+/// CloneAndPruneFunctionInto - This works exactly like CloneFunctionInto,
+/// except that it does some simple constant prop and DCE on the fly.  The
+/// effect of this is to copy significantly less code in cases where (for
+/// example) a function call with constant arguments is inlined, and those
+/// constant arguments cause a significant amount of code in the callee to be
+/// dead.  Since this doesn't produce an exactly copy of the input, it can't be
+/// used for things like CloneFunction or CloneModule.
+void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
+                               std::map<const Value*, Value*> &ValueMap,
+                               std::vector<ReturnInst*> &Returns,
+                               const char *NameSuffix = "", 
+                               ClonedCodeInfo *CodeInfo = 0);
+
 
 /// CloneTraceInto - Clone T into NewFunc. Original<->clone mapping is
 /// saved in ValueMap.






More information about the llvm-commits mailing list