From: Hal Finkel Date: Thu, 8 Jan 2015 22:10:48 +0000 (+0000) Subject: [MachineLICM] A command-line option to hoist even cheap instructions X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=9d1500e68f00e76492b9d7ac6fda5803abf96857;p=oota-llvm.git [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225470 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp index 2ab04674415..cb14a5cab4b 100644 --- a/lib/CodeGen/MachineLICM.cpp +++ b/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 +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 &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) {