Commit 526102b3 authored by Nikita Popov's avatar Nikita Popov Committed by Tobias Hieta
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

(cherry picked from commit 61d2f3a7)
parent 7049d589
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