diff options
author | Xinliang David Li <davidxl@google.com> | 2016-05-12 02:04:41 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-05-12 02:04:41 +0000 |
commit | f0ab6dfedc34dc5df4df4f78080547809cd28c7d (patch) | |
tree | 2e4e6b0394ca39d6676c3beed2f31509aa000426 /llvm/lib/CodeGen/MachineBlockPlacement.cpp | |
parent | a61cb48dd2c40cf4c9b53c8aa00c24543d23cd60 (diff) | |
download | bcm5719-llvm-f0ab6dfedc34dc5df4df4f78080547809cd28c7d.tar.gz bcm5719-llvm-f0ab6dfedc34dc5df4df4f78080547809cd28c7d.zip |
[Layout] Add a new option (NFC)
Currently cost based loop rotation algo can only be turned on with
two conditions: the function has real profile data, and -precise-rotation-cost
flag is turned on. This is not convenient for developers to experiment
when profile is not available. Add a new option to force the new
rotation algorithm -force-precise-rotation-cost
llvm-svn: 269266
Diffstat (limited to 'llvm/lib/CodeGen/MachineBlockPlacement.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBlockPlacement.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp index d849509ce12..ad73449f972 100644 --- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp +++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp @@ -99,6 +99,11 @@ static cl::opt<bool> cl::desc("Model the cost of loop rotation more " "precisely by using profile data."), cl::init(false), cl::Hidden); +static cl::opt<bool> + ForcePreciseRotationCost("force-precise-rotation-cost", + cl::desc("Model the cost of loop rotation more " + "precisely by using profile data."), + cl::init(false), cl::Hidden); static cl::opt<unsigned> MisfetchCost( "misfetch-cost", @@ -1126,7 +1131,8 @@ void MachineBlockPlacement::buildLoopChains(MachineFunction &F, // this loop by modeling costs more precisely which requires the profile data // for better layout. bool RotateLoopWithProfile = - PreciseRotationCost && F.getFunction()->getEntryCount(); + ForcePreciseRotationCost || + (PreciseRotationCost && F.getFunction()->getEntryCount()); // First check to see if there is an obviously preferable top block for the // loop. This will default to the header, but may end up as one of the |