[llvm] r225470 - [MachineLICM] A command-line option to hoist even cheap instructions

Hal Finkel hfinkel at anl.gov
Thu Jan 8 14:10:48 PST 2015


Author: hfinkel
Date: Thu Jan  8 16:10:48 2015
New Revision: 225470

URL: http://llvm.org/viewvc/llvm-project?rev=225470&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/CodeGen/MachineLICM.cpp

Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=225470&r1=225469&r2=225470&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Thu Jan  8 16:10:48 2015
@@ -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::CanCauseHighRegPressur
 
     // 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) {





More information about the llvm-commits mailing list