[llvm] [InstCombine] Fold usub_sat((sub nuw C1, A), C2) to usub_sat(C1 - C2, A) or 0 (PR #82280)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 04:56:10 PDT 2024


================
@@ -2139,6 +2139,21 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
       }
     }
 
+    // usub_sat((sub nuw C1, A), C2) -> usub_sat(usub_sat(C1- C2), A)
----------------
nikic wrote:

```suggestion
    // usub_sat((sub nuw C1, A), C2) -> usub_sat(usub_sat(C1, C2), A)
```

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


More information about the llvm-commits mailing list