PATCH. Fix some ARM MLA instructions is not to be single used.

Yin Ma yinma at codeaurora.org
Mon Oct 14 11:20:32 PDT 2013


Hi Tim,

For us, the mul_su is defined very similar to fmul_su. Just  change fmul to
mul.
Like this

// An 'mul' node with a single use.
def mul_su : PatFrag<(ops node:$lhs, node:$rhs), (mul node:$lhs,
node:$rhs),[{
  return N->hasOneUse();
}]>;

I tested on the current line of qualcomm devices. But I didn't  test
non-qualcomm 
Designs. 

For the benefit, we did find the single usage produces faster code, at least
for 
Qualcomm devices.  Theoretically, it should be also faster to use single use
Mark.  For the equations  (a*b) - c  and (a*b) - d , there are 1 multiple
and two subtracts, without single usage mark, two mls will generates, which 
are two multiples and two subtracts. Since multiples are expensive options,
so two mls should be a slower format.

Thanks,

Yin 

-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com] 
Sent: Monday, October 07, 2013 12:38 PM
To: Yin Ma
Cc: llvm-commits
Subject: Re: PATCH. Fix some ARM MLA instructions is not to be single used.

Hi Yin,

> In ARM .td file, some MLA instructions has been marked to be single used.
> However, Some other MLA like instructions are not marked to be single 
> used. The patch will Mark the rest of MLA like instruction definitions to
be single used.

I can't find any record of "mul_su" already in the source, and in fact this
patch fails to compile for me because of that.

More generally, what can you tell us about why this is better? Take a look
at Evan's commit message where he introduced "fmul_su" (r120960).
There was quite a bit of extra infrastructure introduced there, as well as
simply a "single-use fmul" patten. Why isn't that needed to exploit this
change?

What example code does this make go faster for you? Have you tested it on
non-Qualcomm designs? What Qualcomm designs have you tested it on?

Finally, tests would be a good idea.

Cheers.

Tim.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tmla-single-use.ii
Type: application/octet-stream
Size: 689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131014/4ce372ea/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: single-use.ii
Type: application/octet-stream
Size: 1266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131014/4ce372ea/attachment-0001.obj>


More information about the llvm-commits mailing list