summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-05-06 14:25:16 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-05-06 14:25:16 +0000
commit3d38c17b59b7e43e3aa702cdc9b96a8153c5ca82 (patch)
treee891b8d5aec03e2643eb77eb2194058124d6cd78 /llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
parentcfc46f82ffeaf9e2cf14e39f3c274c37d389b150 (diff)
downloadbcm5719-llvm-3d38c17b59b7e43e3aa702cdc9b96a8153c5ca82.tar.gz
bcm5719-llvm-3d38c17b59b7e43e3aa702cdc9b96a8153c5ca82.zip
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
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp7
1 files changed, 4 insertions, 3 deletions
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<bool> DisableDeleteDeadBlocks(
"disable-cgp-delete-dead-blocks", cl::Hidden, cl::init(false),
cl::desc("Disable deleting dead blocks in CodeGenPrepare"));
-static cl::opt<bool> EnableSelectToBranch("enable-cgp-select2branch", cl::Hidden,
- cl::desc("Enable select to branch conversion."));
+static cl::opt<bool> 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) ||
OpenPOWER on IntegriCloud