[PATCH] D134950: [CodeGen] Allow targets to define vreg flags

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 10:37:10 PDT 2022


arsenm added a comment.

In D134950#3837377 <https://reviews.llvm.org/D134950#3837377>, @qcolombet wrote:

> Hi,
>
> Given this is completely target specific, have you considered implementing that in your target specific `MachineFunctionInfo` pass?
> Also, could your use case be supported by the existing target flags that can be attached to `MachineOperand`s?

MachineFunctionInfo isn't really a pass, it's a dumping ground for side data. The primary use of this is when new spill instructions are introduced, so there's no existing MachineOperand to attach this to. Plus a pass to re-add these implies the MIR was in an incorrect state and needed a fixup, which rarely works out well.

> If we were to go down adding target flags for virtual registers, there are a few things that we would need to consider like what do we do with the flags when we merge live-ranges (e.g., in the coalescer), could a flag become invalid (e.g., when we do some peephole), etc.

Really what we want is for optimizations to not touch these at all. Coalescing shouldn't merge ranges with different flags.

> I feel this patch is creating the llvm equivalent of metadata with all the problems we have with them and I would rather we avoid that.

The alternative is to make everything more aware of the cross lane nature of VGPRs, and I don't really know what that would look like


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134950



More information about the llvm-commits mailing list