[PATCH] Teach Instcombine to use the nsw attribute for signed comparisons to 0 of (shl %v, Cst) or (mul %v, Cst)

Arnaud de Grandmaison arnaud.adegm at gmail.com
Sun Mar 17 10:11:47 PDT 2013


The attached patch teaches InstCombine/visitICmpInstWithInstAndIntCst to 
optimize 'icmp pred (mul %v, Cst), 0' when the mul has the nsw attribute set.
 The comparison can the be performed on the mul RHS. 

The patch also handles the case of the mul in strength reduced form : shl

Cheers
--
Arnaud de Grandmaison
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-InstCombine-use-nsw-information-to-simplify-comparis.patch
Type: text/x-patch
Size: 5031 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130317/ba668ed2/attachment.bin>


More information about the llvm-commits mailing list