[llvm] r175270 - Teach InstCombine to work with smaller legal types in icmp (shl %v, C1), C2

Arnaud de Grandmaison arnaud.adegm at gmail.com
Sat Mar 9 11:05:48 PST 2013


Hi Benjamin and Duncan,

Attached is a patch proposal to fix my previous commit :

 - It now combines only if the icmp is the unique use of the shl.
 - It still does not check for legality of the type on the target, but it at 
least don't do the combining if the resulting type has an odd-width.

Let me know if this looks reasonable to you.

Cheers,
--
Arnaud

On Saturday 09 March 2013 11:08:07 Benjamin Kramer wrote:
> On 15.02.2013, at 15:35, Arnaud A. de Grandmaison <arnaud.adegm at gmail.com> 
wrote:
> > Author: aadg
> > Date: Fri Feb 15 08:35:47 2013
> > New Revision: 175270
> > 
> > URL: http://llvm.org/viewvc/llvm-project?rev=175270&view=rev
> > Log:
> > Teach InstCombine to work with smaller legal types in icmp (shl %v, C1),
> > C2
> 
> It says legal types, but the code never actually checks for legality.
> Combined with the not checking for multiple uses on the shift you're
> introducing potentially expensive operations here.
> 
> The attached test case (extracted from scimark) shows a case where your
> patch adds a trunc to i61.
> 
> - Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-a-performance-regression-when-combining-to-small.patch
Type: text/x-patch
Size: 3266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130309/52e1c11c/attachment.bin>


More information about the llvm-commits mailing list