[PATCH] Move transforms from InstCombine to InstSimplify

David Majnemer david.majnemer at gmail.com
Wed Jul 10 15:26:06 PDT 2013


InstCombine was pattern matching for (icmp (shl 1, X), Cst) to try to
transform these icmps to true/false if we could prove that Cst must be
in/out of range.

However, there are two problems:
1. This sort of thing belongs in InstSimplify
2. This can be generalized further

Attached is a patch that moves over these transforms to InstructionSimplify
and handles arbitrary constants on the left hand side of the shift and
constrains the possible range further by analyzing the nsw/nuw flags on the
shift.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130710/713022e9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shfcmp.diff
Type: application/octet-stream
Size: 4826 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130710/713022e9/attachment.obj>


More information about the llvm-commits mailing list