[all-commits] [llvm/llvm-project] 2ec161: [AArch64] Peephole rule to remove redundant cmp af...

Pavel Iliin via All-commits all-commits at lists.llvm.org
Mon Apr 19 11:59:26 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2ec16103c68528669080040629961217662353cd
      https://github.com/llvm/llvm-project/commit/2ec16103c68528669080040629961217662353cd
  Author: Pavel Iliin <Pavel.Iliin at arm.com>
  Date:   2021-04-19 (Mon, 19 Apr 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/lib/Target/AArch64/AArch64InstrInfo.h
    M llvm/test/CodeGen/AArch64/csinc-cmp-removal.mir
    M llvm/test/CodeGen/AArch64/f16-instructions.ll

  Log Message:
  -----------
  [AArch64] Peephole rule to remove redundant cmp after cset.

Comparisons to zero or one after cset instructions can be safely
removed in examples like:

cset w9, eq          cset w9, eq
cmp  w9, #1   --->   <removed>
b.ne    .L1          b.ne    .L1

cset w9, eq          cset w9, eq
cmp  w9, #0   --->   <removed>
b.ne    .L1          b.eq    .L1

Peephole optimization to detect suitable cases and get rid of that
comparisons added.

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




More information about the All-commits mailing list