[PATCH] D59174: [DAGCombine][AArch64] Fold (x & ~y) | y patterns

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 9 02:29:37 PST 2019


nikic created this revision.
nikic added reviewers: spatel, RKSimon, eli.friedman.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.

This is an alternative to D59066 <https://reviews.llvm.org/D59066>. We introduce DAGCombine patterns for (x & ~y) | y to x | y. Additionally we check for x & ~1 in AArch64 AND lowering, as we are not guaranteed that this is folded away at that time.

Overall this allows us to lower (x & ~y) | (z & y) with z=-1 to x | y, recovering the uaddsat results from D59066 <https://reviews.llvm.org/D59066>.


Repository:
  rL LLVM

https://reviews.llvm.org/D59174

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/test/CodeGen/AArch64/sat-add.ll
  llvm/test/CodeGen/AArch64/uadd_sat_vec.ll
  llvm/test/CodeGen/AArch64/unfold-masked-merge-vector-variablemask-const.ll
  llvm/test/CodeGen/X86/unfold-masked-merge-vector-variablemask-const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59174.189984.patch
Type: text/x-patch
Size: 10402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190309/ea475297/attachment.bin>


More information about the llvm-commits mailing list