[PATCH] D159510: [InstCombine] Optimize 'xor-and-select' sequence to 'or' for bool

Qi Hu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 12:17:35 PDT 2023


Qi-Hu added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:3184
+  }
+
   return nullptr;
----------------
goldstein.w.n wrote:
> goldstein.w.n wrote:
> > 1) You can also do `and` case: https://alive2.llvm.org/ce/z/adHMjn (if the ~ op is the trueval).
> > 2) This probably belongs in `foldSelectOfBools`.
> Actually should be able to handle all 4 of these cases:
> https://alive2.llvm.org/ce/z/BgAFyN
Thank you for the suggestions! Actually I submitted this patch as a pull request: [[ https://github.com/llvm/llvm-project/pull/66394 | 66394 ]] (which was closed due to another PR implementing the same feature). I should've closed this revision.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159510



More information about the llvm-commits mailing list