[PATCH] D87050: GlobalISel: Add combines for G_TRUNC

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 13:44:24 PDT 2020


paquette added a comment.

@arsenm

> For AMDGPU this would need a regbank legality check for post-regbankselect combines but I'm not sure what to do about that

Maybe it would make sense for now to add something like

  SelectionStage getSelectionStage(MachineFunction &MF);
  ...
  if (getSelectionStage(MF) < SelectionStage::Legalized)
     return false;
  ...
  if (getSelectionStage(MF) != SelectionStage::RegBankSelected)
     return false;
  ...

So we can at least bail out when something could be unsafe for some target?

Ultimately, it would be nicest to declare which stages each combine is valid/invalid at in the tablegen somehow, but I guess something like this could be useful temporarily? :/


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

https://reviews.llvm.org/D87050



More information about the llvm-commits mailing list