From 3d38c17b59b7e43e3aa702cdc9b96a8153c5ca82 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 6 May 2012 14:25:16 +0000 Subject: Switch the select to branch transformation on by default. The primitive conservative heuristic seems to give a slight overall improvement while not regressing stuff. Make it available to wider testing. If you notice any speed regressions (or significant code size regressions) let me know! llvm-svn: 156258 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp index 291274d715e..24d64b50c2a 100644 --- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -71,8 +71,9 @@ static cl::opt DisableDeleteDeadBlocks( "disable-cgp-delete-dead-blocks", cl::Hidden, cl::init(false), cl::desc("Disable deleting dead blocks in CodeGenPrepare")); -static cl::opt EnableSelectToBranch("enable-cgp-select2branch", cl::Hidden, - cl::desc("Enable select to branch conversion.")); +static cl::opt DisableSelectToBranch( + "disable-cgp-select2branch", cl::Hidden, cl::init(false), + cl::desc("Disable select to branch conversion.")); namespace { class CodeGenPrepare : public FunctionPass { @@ -1132,7 +1133,7 @@ static bool isFormingBranchFromSelectProfitable(SelectInst *SI) { bool CodeGenPrepare::OptimizeSelectInst(SelectInst *SI) { // If we have a SelectInst that will likely profit from branch prediction, // turn it into a branch. - if (!EnableSelectToBranch || OptSize || !TLI->isPredictableSelectExpensive()) + if (DisableSelectToBranch || OptSize || !TLI->isPredictableSelectExpensive()) return false; if (!SI->getCondition()->getType()->isIntegerTy(1) || -- cgit v1.2.3