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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 05:41:05 PDT 2023


nikic added inline comments.


================
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
----------------
chfast wrote:
> The new created select instructions do not copy metadata from the original ones. Is this worth doing so?
I don't think metadata can be safely preserved in this transform.


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