summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-01-08 22:10:48 +0000
committerHal Finkel <hfinkel@anl.gov>2015-01-08 22:10:48 +0000
commit0709f5160f8b2bf0ab03ad8844ac1a9278b70312 (patch)
tree80def0789a30fe5341f9bfcd7a2909b2ed7956bf
parentb40fd1b24e276b52c1f54466a32dbf577af0558d (diff)
downloadbcm5719-llvm-0709f5160f8b2bf0ab03ad8844ac1a9278b70312.tar.gz
bcm5719-llvm-0709f5160f8b2bf0ab03ad8844ac1a9278b70312.zip
[MachineLICM] A command-line option to hoist even cheap instructions
Add a command-line option to enable hoisting even cheap instructions (in low-register-pressure situations). This is turned off by default, but has proved useful for testing purposes. llvm-svn: 225470
-rw-r--r--llvm/lib/CodeGen/MachineLICM.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 2ab04674415..cb14a5cab4b 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -49,6 +49,11 @@ AvoidSpeculation("avoid-speculation",
cl::desc("MachineLICM should avoid speculation"),
cl::init(true), cl::Hidden);
+static cl::opt<bool>
+HoistCheapInsts("hoist-cheap-insts",
+ cl::desc("MachineLICM should hoist even cheap instructions"),
+ cl::init(false), cl::Hidden);
+
STATISTIC(NumHoisted,
"Number of machine instructions hoisted out of loops");
STATISTIC(NumLowRP,
@@ -1075,7 +1080,7 @@ bool MachineLICM::CanCauseHighRegPressure(DenseMap<unsigned, int> &Cost,
// Don't hoist cheap instructions if they would increase register pressure,
// even if we're under the limit.
- if (CheapInstr)
+ if (CheapInstr && !HoistCheapInsts)
return true;
for (unsigned i = BackTrace.size(); i != 0; --i) {
OpenPOWER on IntegriCloud