diff options
author | Chris Lattner <sabre@nondot.org> | 2001-06-30 04:36:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-06-30 04:36:40 +0000 |
commit | 7e02b7e600ce8b719b34e2df7a7e44310229564d (patch) | |
tree | a7ef2a6f567cfce44379e051a855afc596ed1979 /lib/Transforms/Scalar/ConstantProp.cpp | |
parent | 28bf86ac001846b167ff3befacdca2f96b25f24a (diff) |
Optimizations got their own header files
Optimizations now live in the 'opt' namespace
include/llvm/Opt was renamed include/llvm/Optimizations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/ConstantProp.cpp')
-rw-r--r-- | lib/Transforms/Scalar/ConstantProp.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/Transforms/Scalar/ConstantProp.cpp b/lib/Transforms/Scalar/ConstantProp.cpp index 51800f5a6b..7a0254bca7 100644 --- a/lib/Transforms/Scalar/ConstantProp.cpp +++ b/lib/Transforms/Scalar/ConstantProp.cpp @@ -21,6 +21,8 @@ // //===----------------------------------------------------------------------===// +#include "llvm/Optimizations/ConstantProp.h" +#include "llvm/Optimizations/ConstantHandling.h" #include "llvm/Module.h" #include "llvm/Method.h" #include "llvm/BasicBlock.h" @@ -28,18 +30,16 @@ #include "llvm/iOther.h" #include "llvm/ConstPoolVals.h" #include "llvm/ConstantPool.h" -#include "llvm/Opt/AllOpts.h" -#include "llvm/Opt/ConstantHandling.h" // Merge identical constant values in the constant pool. // // TODO: We can do better than this simplistic N^2 algorithm... // -bool DoConstantPoolMerging(Method *M) { +bool opt::DoConstantPoolMerging(Method *M) { return DoConstantPoolMerging(M->getConstantPool()); } -bool DoConstantPoolMerging(ConstantPool &CP) { +bool opt::DoConstantPoolMerging(ConstantPool &CP) { bool Modified = false; for (ConstantPool::plane_iterator PI = CP.begin(); PI != CP.end(); ++PI) { for (ConstantPool::PlaneType::iterator I = (*PI)->begin(); @@ -73,7 +73,7 @@ inline static bool ConstantFoldUnaryInst(Method *M, Method::inst_iterator &DI, UnaryOperator *Op, ConstPoolVal *D) { ConstPoolVal *ReplaceWith = - ConstantFoldUnaryInstruction(Op->getInstType(), D); + opt::ConstantFoldUnaryInstruction(Op->getInstType(), D); if (!ReplaceWith) return false; // Nothing new to change... @@ -100,7 +100,7 @@ ConstantFoldBinaryInst(Method *M, Method::inst_iterator &DI, BinaryOperator *Op, ConstPoolVal *D1, ConstPoolVal *D2) { ConstPoolVal *ReplaceWith = - ConstantFoldBinaryInstruction(Op->getInstType(), D1, D2); + opt::ConstantFoldBinaryInstruction(Op->getInstType(), D1, D2); if (!ReplaceWith) return false; // Nothing new to change... // Add the new value to the constant pool... @@ -124,7 +124,7 @@ ConstantFoldBinaryInst(Method *M, Method::inst_iterator &DI, // constant value, convert it into an unconditional branch to the constant // destination. // -bool ConstantFoldTerminator(TerminatorInst *T) { +bool opt::ConstantFoldTerminator(TerminatorInst *T) { // Branch - See if we are conditional jumping on constant if (T->getInstType() == Instruction::Br) { BranchInst *BI = (BranchInst*)T; @@ -186,7 +186,7 @@ ConstantFoldInstruction(Method *M, Method::inst_iterator &II) { ConstPoolVal *D = Inst->getOperand(0)->castConstant(); if (D) return ConstantFoldUnaryInst(M, II, (UnaryOperator*)Inst, D); } else if (Inst->isTerminator()) { - return ConstantFoldTerminator((TerminatorInst*)Inst); + return opt::ConstantFoldTerminator((TerminatorInst*)Inst); } else if (Inst->isPHINode()) { PHINode *PN = (PHINode*)Inst; // If it's a PHI node and only has one operand @@ -238,7 +238,7 @@ static bool DoConstPropPass(Method *M) { // returns true on failure, false on success... // -bool DoConstantPropogation(Method *M) { +bool opt::DoConstantPropogation(Method *M) { bool Modified = false; // Fold constants until we make no progress... |