[PATCH] D139408: [InstCombine] Fold logic-and/logic-or by distributive laws

PaweĊ‚ Bylica via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 02:58:09 PDT 2023


chfast added inline comments.
Herald added a subscriber: StephenFan.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2804
+        if (A == C)
+          return SelectInst::Create(A, Builder.CreateSelect(B, One, D), Zero);
+        // (A ? B : 0) ? 1 : (C ? A : 0) --> A ? (B ? 1 : C) : 0
----------------
The new created select instructions do not copy metadata from the original ones. Is this worth doing so?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139408



More information about the llvm-commits mailing list