[PATCH] D143758: [CodeGen] MRI call back in TargetMachine

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 04:41:43 PST 2023


arsenm added a comment.

In D143758#4154723 <https://reviews.llvm.org/D143758#4154723>, @qcolombet wrote:

> Hi @cdevadas,
>
> What do you want to achieve with this call back?
>
> It feels wrong to me that the `TargetMachine` would need to know about the `MRI`. IIRC, the `TargetMachine` holds information that applies to the whole target and doesn't do any specific based on each function. (At least it doesn't hold any state.)
>
> Cheers,
> -Quentin

The TargetMachine doesn't maintain state but manages the construction of MachineFunctionInfo and MIR parsing. This change is the consequence of your suggestion to use the callbacks for virtual registers (D134950 <https://reviews.llvm.org/D134950>)  instead of the directly tracking virtual register flags in MRI. If we have to handle this in a side table stored in MFI, the TargetMachine needs to register these callbacks at the same time MFI is constructed (which is here).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143758



More information about the llvm-commits mailing list