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

Chris Lattner sabre at nondot.org
Tue Jan 30 15:13:06 PST 2007



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

Local.h updated: 1.24 -> 1.25
---
Log message:

Change constant folding APIs to take an optional TargetData, and change
ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array
of operands + size, instead of an std::vector.


---
Diffs of the changes:  (+6 -3)

 Local.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Transforms/Utils/Local.h
diff -u llvm/include/llvm/Transforms/Utils/Local.h:1.24 llvm/include/llvm/Transforms/Utils/Local.h:1.25
--- llvm/include/llvm/Transforms/Utils/Local.h:1.24	Sat Dec 23 00:05:40 2006
+++ llvm/include/llvm/Transforms/Utils/Local.h	Tue Jan 30 17:12:47 2007
@@ -24,6 +24,7 @@
 class PHINode;
 class AllocaInst;
 class ConstantExpr;
+class TargetData;
 
 //===----------------------------------------------------------------------===//
 //  Local constant propagation...
@@ -32,7 +33,7 @@
 /// doConstantPropagation - Constant prop a specific instruction.  Returns true
 /// and potentially moves the iterator if constant propagation was performed.
 ///
-bool doConstantPropagation(BasicBlock::iterator &I);
+bool doConstantPropagation(BasicBlock::iterator &I, const TargetData *TD = 0);
 
 /// ConstantFoldTerminator - If a terminator instruction is predicated on a
 /// constant value, convert it into an unconditional branch to the constant
@@ -46,7 +47,7 @@
 /// is returned.  Note that this function can only fail when attempting to fold
 /// instructions like loads and stores, which have no constant expression form.
 ///
-Constant *ConstantFoldInstruction(Instruction *I);
+Constant *ConstantFoldInstruction(Instruction *I, const TargetData *TD = 0);
 
 /// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
 /// specified operands.  If successful, the constant result is returned, if not,
@@ -56,7 +57,9 @@
 ///
 Constant *ConstantFoldInstOperands(
   const Instruction *I, ///< The model instruction
-  const std::vector<Constant*> &Ops ///< The constant operands to use.
+  Constant** Ops,       ///< The array of constant operands to use.
+  unsigned NumOps,      ///< The number of operands provided.
+  const TargetData *TD = 0 ///< Optional target information.
 );
 
 






More information about the llvm-commits mailing list