[llvm] [GlobalIsel] Combine G_ADD and G_SUB (PR #92879)

Thorsten Schütt via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 08:22:00 PDT 2024


tschuett wrote:

>From `visitADDLike`:
```
// fold ((0-A) + B) -> B-A
if (sd_match(N0, m_Neg(m_Value(A))))
    return DAG.getNode(ISD::SUB, DL, VT, N1, A);
```

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


More information about the llvm-commits mailing list