[PATCH] D61321: [globalisel] Allow SrcOp to convert an APInt and render it as an immediate operand (MO.isImm() == true)

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 18 08:54:06 PDT 2019


arsenm added a comment.

In D61321#1547076 <https://reviews.llvm.org/D61321#1547076>, @dsanders wrote:

> >> In D61321#1546826 <https://reviews.llvm.org/D61321#1546826>, @arsenm wrote:
> >> 
> >>> We could try to be heroic and use something stronger than unsigned for registers
> >> 
> >> 
> >> Are you talking about using stronger types for registers just in the Builder interface? What would the usage look like? My big concern (besides the massive change this would take) is how verbose it would be to use the APIs.
> > 
> > I mean everywhere, but that's a huge project. I imagine a struct Register { unsigned X; isVirtual(); isPhysical() }
>
> FWIW, that would be my preferred solution if it weren't for the sheer amount of time required to achieve it. It's always felt wrong that we use `unsigned` to represent registers.


I tried prototyping it, and it seems to not be entirely infeasible: D63496 <https://reviews.llvm.org/D63496>

I think managing the migration inside GlobalISel should be manageable enough to avoid having an unsigned overload of SrcOp


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61321





More information about the llvm-commits mailing list