Commit 61d2f3a7 authored by Nikita Popov's avatar Nikita Popov
Browse files

[InstCombine] Canonicalize icmp eq pow2 more thoroughly

We currently already canonicalize icmp eq (%x & Pow2), Pow2 to
icmp ne (%x & Pow2), 0. This patch generalizes the fold based on
known bits.

In particular, this allows us to handle comparisons against
!range !{i64 0, i64 2} loads, which addresses an optimization
regression in Rust caused by 8df376db.

Differential Revision: https://reviews.llvm.org/D146149
parent ddbcd985
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment