Issue |
152804
|
Summary |
Missed optimization: (x & -2^C) -1 & -2^C + 2^C -> x & -2^C
|
Labels |
new issue
|
Assignees |
|
Reporter |
zxt5
|
```
define i32 @src(i32 %0) {
%v0 = and i32 %0, -4
%v1 = add i32 %v0, -1
%v2 = and i32 %v1, -4
%v3 = add nuw i32 %v2, 4
ret i32 %v3
}
define i32 @tgt(i32 %0) {
%v0 = and i32 %0, -4
ret i32 %v0
}
```
alive2: https://alive2.llvm.org/ce/z/PVar64
godbolt: https://godbolt.org/z/h65Kneqzh
Found this pattern in: https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/opencv/optimized/t1.ll
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs