Unverified Commit a7f962c0 authored by Yingwei Zheng's avatar Yingwei Zheng Committed by GitHub
Browse files

[InstCombine] Canonicalize `and(zext(A), B)` into `select A, B & 1, 0` (#66740)

This patch canonicalizes the pattern `and(zext(A), B)` into `select A, B
& 1, 0`. Thus, we can reuse transforms `select B == even, B & 1, 0 -> 0`
and `select B == odd, B & 1, 0 -> zext(B == odd)` in `InstCombine`.
It is an alternative to #66676. 
Alive2: https://alive2.llvm.org/ce/z/598phE
Fixes #66733.
Fixes #66606.
Fixes #28612.
parent 3231a365
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