diff --git a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h --- a/llvm/include/llvm/Transforms/InstCombine/InstCombine.h +++ b/llvm/include/llvm/Transforms/InstCombine/InstCombine.h @@ -52,21 +52,6 @@ void getAnalysisUsage(AnalysisUsage &AU) const override; bool runOnFunction(Function &F) override; }; - -//===----------------------------------------------------------------------===// -// -// InstructionCombining - Combine instructions to form fewer, simple -// instructions. This pass does not modify the CFG, and has a tendency to make -// instructions dead, so a subsequent DCE pass is useful. -// -// This pass combines things like: -// %Y = add int 1, %X -// %Z = add int 1, %Y -// into: -// %Z = add int 2, %X -// -FunctionPass *createInstructionCombiningPass(); -FunctionPass *createInstructionCombiningPass(unsigned MaxIterations); } #endif diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h --- a/llvm/include/llvm/Transforms/Scalar.h +++ b/llvm/include/llvm/Transforms/Scalar.h @@ -530,6 +530,22 @@ // transformations. // Pass *createWarnMissedTransformationsPass(); + +//===----------------------------------------------------------------------===// +// +// InstructionCombining - Combine instructions to form fewer, simple +// instructions. This pass does not modify the CFG, and has a tendency to make +// instructions dead, so a subsequent DCE pass is useful. +// +// This pass combines things like: +// %Y = add int 1, %X +// %Z = add int 1, %Y +// into: +// %Z = add int 2, %X +// +FunctionPass *createInstructionCombiningPass(); +FunctionPass *createInstructionCombiningPass(unsigned MaxIterations); + } // End llvm namespace #endif diff --git a/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp b/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp --- a/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp @@ -312,7 +312,7 @@ bool NoOpt = (getOptLevel() == CodeGenOpt::None); if (!NoOpt) { - addPass(createConstantPropagationPass()); + addPass(createInstructionCombiningPass()); addPass(createDeadCodeEliminationPass()); } diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -101,6 +101,7 @@ #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/InstCombine/InstCombine.h" #include "llvm/Transforms/InstCombine/InstCombineWorklist.h" +#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/Local.h" #include #include