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

Arnaud A. de Grandmaison arnaud.adegm at gmail.com
Fri Feb 15 06:36:54 PST 2013


Done with r175270.

Cheers,
--
Arnaud

On 02/15/2013 03:07 PM, Duncan Sands wrote:
> Hi Arnaud,
>
>        return new ICmpInst(TrueIfSigned ? ICmpInst::ICMP_NE :
> ICmpInst::ICMP_EQ,
>                            And, Constant::getNullValue(And->getType()));
>      }
> +
> +    // Transform (icmp pred iM (shl iM %v, N), CI)
> +    // -> (icmp pred i(M-N) (trunc %v iM to i(N-N)), (trunc (CI>>N))
> +    // Transform the shl to a trunc if (trunc (CI>>N) has no loss.
>
> unbalanced parenthesis in "(trunc (CI>>N)".  Otherwise, LGTM.
>
> Ciao, Duncan.


-- 
Arnaud A. de Grandmaison




More information about the llvm-commits mailing list