[llvm] [DAG] Fold (umin (sub a b) a) -> (usubo a b); (select usubo.1 a usubo.0) (PR #161651)
Chaitanya Koparkar via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 10 07:04:47 PST 2025
ckoparkar wrote:
To fix the test failure I need to update the patterns in `CodeGen/AMDGPU/llvm.set.rounding.ll` since the fold also applies to it. The DAG for `set_rounding`:
```
Legalized selection DAG: %bb.0 's_set_rounding:'
SelectionDAG has 17 nodes:
t0: ch,glue = EntryToken
t2: i32,ch = CopyFromReg t0, Register:i32 %0
t8: i32 = sub t2, Constant:i32<4>
t9: i32 = umin t2, t8
t11: i32 = shl t9, Constant:i32<2>
t12: i64 = srl Constant:i64<-5242644231586798321>, t11
t13: i32 = truncate t12
t15: i32 = llvm.amdgcn.readfirstlane TargetConstant:i32<3375>, t13
t18: ch = llvm.amdgcn.s.setreg t0, TargetConstant:i32<3416>, TargetConstant:i32<6145>, t15
t5: ch = RET_GLUE t18
```
https://github.com/llvm/llvm-project/pull/161651
More information about the llvm-commits
mailing list