Unverified Commit 4028dd2e authored by Graham Hunter's avatar Graham Hunter Committed by GitHub
Browse files

[InstSimplify] Fold converted urem to 0 if there's no overlapping bits (#71528)

When folding urem instructions we can end up not recognizing that
the output will always be 0 due to Value*s being different, despite
generating the same data (in this case, 2 different calls to vscale).

This patch recognizes the (x << N) & (add (x << M), -1) pattern that
instcombine replaces urem with after the two vscale calls have been
reduced to one via CSE, then replaces with 0 when x is a power of 2
and N >= M.
parent 32c3decb
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