[PATCH] D101807: [InstCombine] Fold select x_inv, true, (select y, x, false)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 09:47:20 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2776
     }
+    // select c, true, (select a, b, false)  -> select c, true, a
+    //   if c = false implies that b = true
----------------
Shouldn't we also handle `select (select a, b, false), true, c -> select a, true, c` here? It seems odd to handle 3 out of 4 patterns.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101807



More information about the llvm-commits mailing list