[PATCH] D101375: [InstCombine] Add a few more patterns for folding select of select

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 13:09:15 PDT 2021


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2732
+        replaceOperand(SI, AIdx, A);
+        replaceOperand(SI, 3 - AIdx, B);
+        return &SI;
----------------
This is pretty hard to understand, I think it will be more obvious if you match both patterns separately and use Builder.CreateSelect here instead of modifying all three operands in place.


================
Comment at: llvm/test/Transforms/InstCombine/select-safe-transforms.ll:187
   ret i1 %or
 }
----------------
Missing test for the second variant?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101375



More information about the llvm-commits mailing list