[llvm] [SCCP] Simplify [us]cmp(X, Y) into X - Y (PR #144717)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 19 03:15:00 PDT 2025


dtcxzyw wrote:

> In practice, is this useful for anything other than the "extended bool" case? I'm wondering if it would be better to handle this as a KnownBits transform.

See the first case in the diff:
```
%45 = select i1 %44, i32 -1, i32 1
%47 = phi i32 [ %45, %bb1 ], [ 0, %bb2 ]
%.0.i.i.i.i.i.i.i.i = call noundef i32 @llvm.scmp.i32.i32(i32 %47, i32 0)
```



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


More information about the llvm-commits mailing list