[llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Local.h
Chris Lattner
lattner at cs.uiuc.edu
Fri May 26 18:17:52 PDT 2006
Changes in directory llvm/include/llvm/Transforms/Utils:
Local.h updated: 1.22 -> 1.23
---
Log message:
Add an interface to constant fold and instruction given it's opcode, type
and operands.
---
Diffs of the changes: (+9 -0)
Local.h | 9 +++++++++
1 files changed, 9 insertions(+)
Index: llvm/include/llvm/Transforms/Utils/Local.h
diff -u llvm/include/llvm/Transforms/Utils/Local.h:1.22 llvm/include/llvm/Transforms/Utils/Local.h:1.23
--- llvm/include/llvm/Transforms/Utils/Local.h:1.22 Thu Oct 27 11:00:10 2005
+++ llvm/include/llvm/Transforms/Utils/Local.h Fri May 26 20:17:40 2006
@@ -48,6 +48,15 @@
///
Constant *ConstantFoldInstruction(Instruction *I);
+/// ConstantFoldInstOperands - Attempt to constant fold an instruction with the
+/// specified opcode and operands. If successful, the constant result is
+/// returned, if not, null is returned. Note that this function can fail when
+/// attempting to fold instructions like loads and stores, which have no
+/// constant expression form.
+///
+Constant *ConstantFoldInstOperands(unsigned Opc, const Type *DestTy,
+ const std::vector<Constant*> &Ops);
+
/// ConstantFoldLoadThroughGEPConstantExpr - Given a constant and a
/// getelementptr constantexpr, return the constant value being addressed by the
More information about the llvm-commits
mailing list