[PATCH] D54882: [AMDGPU] Add sdwa support for ADD|SUB U64 decomposed Pseudos

Ron Lieberman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 07:33:56 PST 2018


ronlieb added a comment.

In D54882#1309642 <https://reviews.llvm.org/D54882#1309642>, @rampitec wrote:

> In D54882#1309639 <https://reviews.llvm.org/D54882#1309639>, @ronlieb wrote:
>
> > In D54882#1309605 <https://reviews.llvm.org/D54882#1309605>, @rampitec wrote:
> >
> > > In D54882#1309588 <https://reviews.llvm.org/D54882#1309588>, @rampitec wrote:
> > >
> > > > In D54882#1309583 <https://reviews.llvm.org/D54882#1309583>, @ronlieb wrote:
> > > >
> > > > > In D54882#1308240 <https://reviews.llvm.org/D54882#1308240>, @rampitec wrote:
> > > > >
> > > > > > Essentially this is a limited version of shrinking. So I have several questions:
> > > > > >
> > > > > > 1. Why not to run shrink pass before sdwa instead?
> > > > >
> > > > >
> > > > > I tried adding Shrink pass before PeepholeSDWA and observed 88 lit test failures.
> > > > >  i tried moving Shrink pass before Peephole SDWA and observed 25 lit test failures
> > > >
> > > >
> > > > Which may be a good thing if these failures are progressions (as I suspect) and not regressions. Are they progressions?
> > > >  That is the point of other comments too, this patch is limited to handle just two instructions while there is a clear possibility to do it for almost any VOP3.
> > >
> > >
> > > I would also assume many of these failures are just commute which is attempted by shrink pass. That is normal and would only need to change the tests.
> >
> >
> > i tried an experiment of simply invoking the Shrink pass a 2nd time.
> >
> >   addPass(createSIShrinkInstructionsPass());
> >   addPass(createSIShrinkInstructionsPass());
> >
> > which resulted in 74 failures, and they do seem to be commute changes primarily (did not look at them all)
> >  So then, i added a 3rd invocation and zero failures (i'm still laughing at this one).
>
>
> So it must be commute. I guess you just need to add a new shrink pass before sdwa. Does it help to deal with these two instructions, e.g. does it help you lit test?
>
> If yes there are two options, either:
>
> 1. Revert the commute in shrink pass if it did not help.
> 2. Just update tests.


Adding the shrink pass just before Peephole SDWA does not help the lit test,  it made no difference.
I think at this point i should proceed with adding the MIR test to verify when we cannot fold.


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

https://reviews.llvm.org/D54882





More information about the llvm-commits mailing list