aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-30 23:12:47 +0000
committerChris Lattner <sabre@nondot.org>2007-01-30 23:12:47 +0000
commit73259caa44b03206d1e39e77a7aa375250b1a193 (patch)
tree09ed54e7fbb353c845d0cc197b7b4178396f379d /include/llvm/Transforms
parentf08c0eab150eec0f9393423fae4be1262feb7bf2 (diff)
downloadexternal_llvm-73259caa44b03206d1e39e77a7aa375250b1a193.zip
external_llvm-73259caa44b03206d1e39e77a7aa375250b1a193.tar.gz
external_llvm-73259caa44b03206d1e39e77a7aa375250b1a193.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33669 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Transforms')
-rw-r--r--include/llvm/Transforms/Utils/Local.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Transforms/Utils/Local.h b/include/llvm/Transforms/Utils/Local.h
index 4fc016d..3b14e41 100644
--- a/include/llvm/Transforms/Utils/Local.h
+++ b/include/llvm/Transforms/Utils/Local.h
@@ -24,6 +24,7 @@ class Pass;
class PHINode;
class AllocaInst;
class ConstantExpr;
+class TargetData;
//===----------------------------------------------------------------------===//
// Local constant propagation...
@@ -32,7 +33,7 @@ class ConstantExpr;
/// 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 @@ bool ConstantFoldTerminator(BasicBlock *BB);
/// 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 *ConstantFoldInstruction(Instruction *I);
///
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.
);