[PATCH] D103326: [GlobalISel] Add combine for PTR_ADD with regbanks

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 17 14:29:02 PDT 2021


aemerson added a comment.

In D103326#2824216 <https://reviews.llvm.org/D103326#2824216>, @foad wrote:

> +more GlobalISel reviewers.
>
> What do you all think about this? It seems to be the first generic combine designed specifically to run post-regbankselect. Should we be going in this direction? Or modifying existing combines so they can work both pre- and post-regbankselect?
>
> Assuming we do want this combine, is there a neater way of writing the "ugly manual regbank preservation" that Matt highlighted?

Modifying existing combines to work post-RBS, or adding RBS preserving variants, doesn't seem ideal to me but I don't have a better suggestion. It would be best if we could finish the tablegen combiner implementation one day and be able to specify this stuff declaratively if possible.

As for this solution, we use `isLegalOrBeforeLegalizer()` hooks in other combines, maybe we could add something similar for `isBeforeRegBankSelect()` and add the regbank checks guarded by that condition in the original combine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103326



More information about the llvm-commits mailing list