[llvm] [InstCombine] Fold `(X & Mask) == 0 ? TC : FC -> TC binop (X & Mask)` (PR #100437)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 07:27:44 PDT 2024


nikic wrote:

> https://godbolt.org/z/xh1aToWvx

Ideally we would generate
```
define i64 @tgt (i32 %x) {
%mask = and i32 %x, 2
%19 = add i32 %mask, 4
%20 = zext i32 %19 to i64
ret i64 %20
}
```
in this case.

https://github.com/llvm/llvm-project/pull/100437


More information about the llvm-commits mailing list