[all-commits] [llvm/llvm-project] 660211: [ARM] Enable and/cmp0 folding

Momchil Velikov via All-commits all-commits at lists.llvm.org
Mon Sep 26 03:48:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6602110152471e570d0aee69e66375e47b8459c6
      https://github.com/llvm/llvm-project/commit/6602110152471e570d0aee69e66375e47b8459c6
  Author: Momchil Velikov <momchil.velikov at arm.com>
  Date:   2022-09-26 (Mon, 26 Sep 2022)

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

  Log Message:
  -----------
  [ARM] Enable and/cmp0 folding

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.

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D134360




More information about the All-commits mailing list