[PATCH] D143373: [InstCombine] fold icmp of the sum of ext bool based on limited range

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 13:08:42 PST 2023


goldstein.w.n added a comment.

Can you add alive2 links?



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5846
+    switch (CmpC->getSExtValue()) {
+    case -1:
+      if (Pred == ICmpInst::ICMP_EQ)
----------------
Think  it would be clearer to have the comments for each transform at their respective case statement.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:5849
+        return BinaryOperator::CreateAnd(Builder.CreateNot(X), Y);
+      if (Pred == ICmpInst::ICMP_NE || Pred == ICmpInst::ICMP_SGT)
+        return BinaryOperator::CreateOr(X, Builder.CreateNot(Y));
----------------
spatel wrote:
> Include "ULT" here?
> Include "ULT" here?

All corresponding unsigned predicts no?


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

https://reviews.llvm.org/D143373



More information about the llvm-commits mailing list