@@ -1253,6 +1253,23 @@ void ScheduleDAGMILive::enterRegion(MachineBasicBlock *bb,
12531253 " ShouldTrackLaneMasks requires ShouldTrackPressure" );
12541254}
12551255
1256+ // EXPERIMENTAL: It seems that GenericScheduler currently often increases
1257+ // spilling heavily with huge regions (like >350 instructions). This option
1258+ // makes any sched region bigger than its value have pre-ra scheduling
1259+ // skipped.
1260+ cl::opt<unsigned > NoSchedAbove (" nosched-above" , cl::init(~0U ));
1261+ bool ScheduleDAGMILive::disableForRegion (MachineBasicBlock *bb,
1262+ MachineBasicBlock::iterator begin,
1263+ MachineBasicBlock::iterator end,
1264+ unsigned regioninstrs) const {
1265+ if (NumRegionInstrs > NoSchedAbove) {
1266+ LLVM_DEBUG (dbgs () << " Disabling pre-ra mischeduling of region with "
1267+ << NumRegionInstrs << " instructions\n " ;);
1268+ return true ;
1269+ }
1270+ return false ;
1271+ }
1272+
12561273// Setup the register pressure trackers for the top scheduled and bottom
12571274// scheduled regions.
12581275void ScheduleDAGMILive::initRegPressure () {
@@ -3335,13 +3352,6 @@ void GenericScheduler::dumpPolicy() const {
33353352#endif
33363353}
33373354
3338- bool GenericScheduler::disableForRegionPreRA (MachineBasicBlock::iterator Begin,
3339- MachineBasicBlock::iterator End,
3340- unsigned NumRegionInstrs) const {
3341- const MachineFunction &MF = *Begin->getMF ();
3342- return MF.getSubtarget ().disableForRegionPreRA (Begin, End, NumRegionInstrs);
3343- }
3344-
33453355// / Set IsAcyclicLatencyLimited if the acyclic path is longer than the cyclic
33463356// / critical path by more cycles than it takes to drain the instruction buffer.
33473357// / We estimate an upper bounds on in-flight instructions as:
0 commit comments