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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 00:01:46 PDT 2021


aqjune marked 2 inline comments as done.
aqjune added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:2732
+        replaceOperand(SI, AIdx, A);
+        replaceOperand(SI, 3 - AIdx, B);
+        return &SI;
----------------
nikic wrote:
> 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.
Hope this new code addresses the concern.


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