[PATCH] D156238: [InstCombine] Generalize foldICmpWithMinMax

Yingwei Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 19:44:24 PDT 2023


dtcxzyw marked an inline comment as done.
dtcxzyw added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5004
+    // min(X, Y) == Z X <= Y
+    // max(X, Y) == Z X >= Y
+    // min(X, Y) != Z X > Y
----------------
goldstein.w.n wrote:
> goldstein.w.n wrote:
> > Still missing fact for different transforms?
> > 
> Shouldn't there be a factor for `Y == Z`?
I am sure that the fact to check is `X == Z`. https://alive2.llvm.org/ce/z/73Ta9S

`CmpYZ` is optional. When `CmpXZ` is unavailable and `CmpYZ` has a value, `X` and `Y` will get swapped.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156238



More information about the llvm-commits mailing list