[PATCH] D139075: [Instcombine] Code refactors for foldSelectOpOp; NFC

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 10:29:48 PST 2022


RKSimon added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:374
+      if (match(TII, m_MaxOrMin(m_Value(), m_Value())) &&
+          match(FII, m_MaxOrMin(m_Value(), m_Value()))) {
+        Value *MatchOp = getCommonOp(TI, FI, true);
----------------
Do you need to match both - given you've tested the intrinsic ID above and don't get the operands anymore - maybe drop the FII match (or but it inside an assertion).


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:376
+        Value *MatchOp = getCommonOp(TI, FI, true);
+        if (MatchOp) {
+          Value *NewSel =
----------------
if (Value *MatchOp = getCommonOp(TI, FI, true)) {


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

https://reviews.llvm.org/D139075



More information about the llvm-commits mailing list