[PATCH] D37389: [AMDGPU] Produce madak and madmk from the two-address pass

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 6 15:09:45 PDT 2017


arsenm added a comment.

In https://reviews.llvm.org/D37389#861163, @rampitec wrote:

> In https://reviews.llvm.org/D37389#859432, @rampitec wrote:
>
> > In https://reviews.llvm.org/D37389#859395, @arsenm wrote:
> >
> > > I don't think this is the right place for this. This is converting a two address instruction into another two address instruction. Why wasn't this matched to a v_madak originally?
> >
> >
> > It was selected as mac, and mac is preferable over mad or madmk.
>
>
> In fact I do not see how madak is different from mad in the respect of two/three address. It really worth nothing that one of the register operands can be also folded into the instruction as immediate. If we would produce mad here and fold immediate later the result would be same, just more work. The pass needs to simplify operands and we do it. For the selection part I also do not see how could it efficiently deal with register pressure issues, it is just too early.


OK, I was thinking of s_mulk_i32/s_addk_i32 which is an inplace update of the register.


https://reviews.llvm.org/D37389





More information about the llvm-commits mailing list