diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-04-29 23:29:43 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-04-29 23:29:43 +0000 |
commit | 5ed22ac54c2530a1d0d140d259f881f3b2040e56 (patch) | |
tree | 740060aedf3541a695c8ee54326cd88874936263 /lib/Target/X86/X86ISelDAGToDAG.cpp | |
parent | f0d2d9593dbeca56c962391c18ddb059e2ee9bef (diff) | |
download | external_llvm-5ed22ac54c2530a1d0d140d259f881f3b2040e56.zip external_llvm-5ed22ac54c2530a1d0d140d259f881f3b2040e56.tar.gz external_llvm-5ed22ac54c2530a1d0d140d259f881f3b2040e56.tar.bz2 |
Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86ISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/X86/X86ISelDAGToDAG.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 7da43e9..ceac594 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -134,7 +134,7 @@ namespace { bool OptForSize; public: - explicit X86DAGToDAGISel(X86TargetMachine &tm, unsigned OptLevel) + explicit X86DAGToDAGISel(X86TargetMachine &tm, CodeGenOpt::Level OptLevel) : SelectionDAGISel(tm, OptLevel), TM(tm), X86Lowering(*TM.getTargetLowering()), Subtarget(&TM.getSubtarget<X86Subtarget>()), @@ -306,7 +306,7 @@ static inline bool isNonImmUse(SDNode *Root, SDNode *Def, SDNode *ImmedUse) { bool X86DAGToDAGISel::IsLegalAndProfitableToFold(SDNode *N, SDNode *U, SDNode *Root) const { - if (OptLevel == 0) return false; + if (OptLevel == CodeGenOpt::None) return false; if (U == Root) switch (U->getOpcode()) { @@ -714,7 +714,7 @@ void X86DAGToDAGISel::InstructionSelect() { OptForSize = F->hasFnAttr(Attribute::OptimizeForSize); DEBUG(BB->dump()); - if (OptLevel != 0) + if (OptLevel != CodeGenOpt::None) PreprocessForRMW(); // FIXME: This should only happen when not compiled with -O0. @@ -1744,6 +1744,7 @@ SelectInlineAsmMemoryOperand(const SDValue &Op, char ConstraintCode, /// createX86ISelDag - This pass converts a legalized DAG into a /// X86-specific DAG, ready for instruction scheduling. /// -FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM, unsigned OptLevel) { +FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM, + llvm::CodeGenOpt::Level OptLevel) { return new X86DAGToDAGISel(TM, OptLevel); } |