mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156258 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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) ||
|
||||
|
Reference in New Issue
Block a user