[PATCH] R600/SI: Allow commuting some 3 op instructions

Tom Stellard tom at stellard.net
Thu Nov 13 09:03:45 PST 2014


On Fri, Oct 31, 2014 at 11:50:17AM -0700, Matt Arsenault wrote:
> 
> > On Oct 21, 2014, at 9:26 AM, Matt Arsenault <arsenm2 at gmail.com> wrote:
> > 
> >> 
> >> On Oct 21, 2014, at 6:38 AM, Tom Stellard <tom at stellard.net> wrote:
> >> 
> >> On Sat, Oct 18, 2014 at 01:57:11AM +0000, Matt Arsenault wrote:
> >>> e.g. v_mad_f32 a, b, c -> v_mad_f32 b, a, c
> >>> 
> >>> This simplifies matching v_madmk_f32.
> >>> 
> >>> This looks somewhat surprising, but it appears to be
> >>> OK to do this. We can commute src0 and src1 in all
> >>> of these instructions, and that's all that appears
> >>> to matter.
> >>> 
> >> 
> >> Are there any advantages to being able to commute VOP3 instructions?
> >> 
> >> -Tom
> > 
> > Mostly just canonicalization to simplify other checks. For example, I have another patch that forms v_madmk_f32 which relies on this to avoid checking for an immediate in the 2nd operand
> 
> 
> ping

LGTM.



More information about the llvm-commits mailing list