[PATCH] D154565: [InstCombine] Fold icmps comparing uadd_sat with a constant

Dhruv Chawla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 22:55:00 PDT 2023


0xdc03 added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:3644
+  else
+    LHSPred = SaturatingValueCheck ? ICmpInst::ICMP_ULT : ICmpInst::ICMP_UGE;
+
----------------
This expression can be simplified to:
```
LHSPred = (IntrinsicIsUAddSat XNOR SaturatingValueCheck) ? ICmpInst::ICMP_UGE : ICmpInst::ICMP_ULT;
```
i.e. `(IntrinsicIsUAddSat == SaturatingValueCheck)`, however I feel that just looks ugly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154565/new/

https://reviews.llvm.org/D154565



More information about the llvm-commits mailing list