diff options
Diffstat (limited to 'bolt/lib/Rewrite/BinaryPassManager.cpp')
-rw-r--r-- | bolt/lib/Rewrite/BinaryPassManager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bolt/lib/Rewrite/BinaryPassManager.cpp b/bolt/lib/Rewrite/BinaryPassManager.cpp index 199ed5f..929b734 100644 --- a/bolt/lib/Rewrite/BinaryPassManager.cpp +++ b/bolt/lib/Rewrite/BinaryPassManager.cpp @@ -11,6 +11,7 @@ #include "bolt/Passes/Aligner.h" #include "bolt/Passes/AllocCombiner.h" #include "bolt/Passes/AsmDump.h" +#include "bolt/Passes/CMOVConversion.h" #include "bolt/Passes/FrameOptimizer.h" #include "bolt/Passes/IdenticalCodeFolding.h" #include "bolt/Passes/IndirectCallPromotion.h" @@ -247,6 +248,11 @@ ThreeWayBranchFlag("three-way-branch", cl::desc("reorder three way branches"), cl::ZeroOrMore, cl::ReallyHidden, cl::cat(BoltOptCategory)); +static cl::opt<bool> CMOVConversionFlag("cmov-conversion", + cl::desc("fold jcc+mov into cmov"), + cl::ZeroOrMore, cl::ReallyHidden, + cl::cat(BoltOptCategory)); + } // namespace opts namespace llvm { @@ -393,6 +399,9 @@ void BinaryFunctionPassManager::runAllPasses(BinaryContext &BC) { Manager.registerPass(std::make_unique<TailDuplication>(), opts::TailDuplicationFlag); + Manager.registerPass(std::make_unique<CMOVConversion>(), + opts::CMOVConversionFlag); + // This pass syncs local branches with CFG. If any of the following // passes breaks the sync - they either need to re-run the pass or // fix branches consistency internally. |