[PATCH] D134360: [ARM] Enable and/cmp0 folding

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 06:51:25 PDT 2022


chill created this revision.
Herald added subscribers: dmgreen, hiraditya, kristof.beyls.
Herald added a project: All.
chill requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The `CodeGenPrepare` pass can sink bitwise `and` used by compare to
zero into the basic blocks where the users are. This operation is
guarded by lowering hook, which is disabled for ARM.  In the ARM
architecture versions from v7-M up these two operations can be folded
into `tst rN, #imm` instruction. Sinking of `and` can also enable
the cmov-to-bfi DAG combiner.

This patch fixes some benchmark regressions caused
by https://reviews.llvm.org/D129370 as well scoring slightly better overall.


https://reviews.llvm.org/D134360

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/test/CodeGen/ARM/and-cmp0-sink.ll
  llvm/test/CodeGen/Thumb2/mve-float16regloops.ll
  llvm/test/CodeGen/Thumb2/mve-float32regloops.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134360.461883.patch
Type: text/x-patch
Size: 10505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220921/9af27dff/attachment.bin>


More information about the llvm-commits mailing list