[PATCH] D94383: [SystemZ] Don't crash with -misched-cutoff

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 10:47:18 PST 2021


jonpa added a comment.

In D94383#2489954 <https://reviews.llvm.org/D94383#2489954>, @uweigand wrote:

> Could you elaborate why initPolicy is the correct place to clear the Available list?  I'm wondering because the default implementation doesn't appear to do that either, it looks like common code only clears the list in the main "init" ...

My main concern was that it is cleared before each region, and it seems that either SystemZPostRASchedStrategy::initialize() and SystemZPostRASchedStrategy::initPolicy() could work.

For a region containing just a single instruction (scheduling boundary), only SystemZPostRASchedStrategy::initPolicy() is called, which is why that method is used to update the hazard recognizer with those instructions as well so that it is accurate when the next region begins with actual scheduling.

My idea - based on the assumption that this is a compile-time issue - was to clear Available and also skip updating the HazardRecognizer in cases where the scheduling had reached the limit. I thought that since pickNode() is called for the first instruction in the region, that the cutoff happens for each region, but that was wrong - as soon as the cutoff has been reached, all scheduling stops. I don't understand  really why the DAG is built and pickNode() is called for each region when no scheduling will occur...

I think we could probably only clear Available in either initPolicy() or initialize() - the cost of advancing the hazard recognizer should be much less than building the DAGs...?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D94383/new/

https://reviews.llvm.org/D94383



More information about the llvm-commits mailing list