commit | 4a863d9fa1a6e5ff16d16fb7a1f95916f6de26b9 | [log] [tgz] |
---|---|---|
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | Fri Sep 29 02:51:58 2023 +0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Sep 28 11:56:04 2023 -0700 |
tree | c3566eebc56b0ad18149dafe0008d709a13db7ba | |
parent | 32f75350d348d8839e7612649610b78e4288bf94 [diff] |
[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. GitOrigin-RevId: a7f962c00745c8e28991379985fcd6b51ac0d671