[PATCH] D34962: [TargetLowering] Add hook for adding target MMO flags when doing ISel.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 19:58:05 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D34962#799842, @gberry wrote:

> In https://reviews.llvm.org/D34962#798587, @hfinkel wrote:
>
> > Given that I understand the use case here to be the desire to translate metadata on loads into something at the MI level:
> >
> > Did you consider just adding the metadata operands as MI-level metadata operands to the load? I believe that MI-level metadata operands are only currently used for DBG_VALUEs, but I can imagine using them for more-general information passing. I question came up just the other day (again) about preserving the !unpredictable metadata on branches for MI-level transformations, and so I'm wondering whether it is worth exploring a solution that can handle more than memory accesses.
> >
> > Alternatively, MMOs currently hold a bunch of pointers to various kinds of Metadata. Should we extend this in some way? One option, for example, would be to allow targets to subclass MachinePointerInfo (and, so, we'd always construct and free these via some target callback), thus allowing the target to add whatever it wants.
> >
> > All that having been said, AArch64 already uses target MMO flags (for suppressLdStPair), and I'm completely in favor of adding some way to get these in and out of MIR. It would be nice to also let the target callbacks provide names. The syntax could just be to use a quoted string, for example. I believe that's unambiguous.
>
>
> Since I only needed one bit on some loads, the target MMO flags seemed like a perfect fit.  I did consider adding target hooks for printing/parsing these flag values, but it didn't seem worth the effort, since I think it will make parsing these particularly complex (e.g. we would need custom token types per target etc.).  If we made them quoted strings, that might make it simple enough to be worth while.


I'd prefer that they be quoted strings; otherwise, I'm happy with the direction.


https://reviews.llvm.org/D34962





More information about the llvm-commits mailing list