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

Duncan Sands baldrick at free.fr
Fri Feb 15 06:07:55 PST 2013


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.



More information about the llvm-commits mailing list