[all-commits] [llvm/llvm-project] 29763a: [AArch64] Peephole optimization to remove redundan...

Marina Taylor via All-commits all-commits at lists.llvm.org
Mon Aug 5 03:35:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29763aa47103ad039544fc93fe5693b1a7f27691
      https://github.com/llvm/llvm-project/commit/29763aa47103ad039544fc93fe5693b1a7f27691
  Author: Marina Taylor <marina_taylor at apple.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp
    M llvm/test/CodeGen/AArch64/peephole-csel.ll
    M llvm/test/CodeGen/AArch64/peephole-csel.mir

  Log Message:
  -----------
  [AArch64] Peephole optimization to remove redundant csel instructions (#101483)

Given a sequence such as

  %8:gpr64 = COPY $xzr
  %10:gpr64 = COPY $xzr
  %11:gpr64 = CSELXr %8:gpr64, %10:gpr64, 0, implicit $nzcv

`PeepholeOptimizer::foldRedundantCopy` led to the creation of select
instructions where both inputs were the same register:

  %11:gpr64 = CSELXr %8:gpr64, %8:gpr64, 0, implicit $nzcv

This change adds a later peephole optimization that replaces such
selects with unconditional moves.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list