[PATCH] D123029: [AArch64] Optimize patterns where AND's on same operand with multiple masks can be combined.

Biplob Mishra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 4 06:30:23 PDT 2022


bipmis created this revision.
bipmis added reviewers: dmgreen, samtebbs, spatel.
bipmis added projects: LLVM, All.
Herald added a subscriber: ecnelises.
bipmis requested review of this revision.

The patch simplifies some of the patterns as below

or(or(and(a, mask1), and(b, mask)), and(a, mask2)) -> or(and(a, mask1|mask2), and(b, mask))

or(or(or(x, and(a,mask1)), and(b,mask)), and(a,mask2)) -> or(or(x, and(a,mask1|mask2)), and(b,mask))

The simplifications allows for generation of single instruction like rev16 on AArch64 when there is a code pattern which does a half word byte swaps on a 64 bit.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D123029

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/AArch64/arm64-rev.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123029.420153.patch
Type: text/x-patch
Size: 11500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220404/cb9f6868/attachment.bin>


More information about the llvm-commits mailing list