[PATCH] D119973: RegAllocGreedy: Fix last chance recolor assert in impossible case

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 25 17:49:34 PDT 2022


qcolombet added a comment.

> I now have another attempt which tracks a stack of successful recolorings that are rolled back on failure

I haven't looked at that code for quite some time so I could totally mistaken, but that's conceptually already what is supposed to happen.

The order in which we roll back a particular "level" shouldn't matter. The stacking happens already naturally with the recursive calls.
IIRC we record the coloring of each register involved in the recoloring for each level (as materialized by the local variable in the call frame) and if it fails we put them back into this level pre-recoloring state.

> The one that succeeded did further recoloring which is not rolled back on the failure of the second.

Hmm, that's weird, if one register fails within the same level, we should roll back the whole level to its previous state.


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

https://reviews.llvm.org/D119973



More information about the llvm-commits mailing list