Skip to content
Commit ff39b7ea authored by Craig Topper's avatar Craig Topper
Browse files

[InstCombine] Optimize (icmp slt (1 << Y), 1) -> (icmp eq Y, BitWidth-1).

The code tried to do this for (icmp sle (1 << Y), 0), but that is
canonicalized to sgt before we get there.

Simplify the code by removing the unreachable SGE and SLE handling.

Also remove the (1 << Y) >=u 2147483648 and (1 << Y) <u 2147483648
handling since those are canonicalized to (1 << Y) <s 0 and
(1 << Y) >=s 0 before we get there.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D141753
parent a1580d7b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment