[all-commits] [llvm/llvm-project] 835da1: [AArch64] Correctly recognize -reserve-regs-for-re...

weiguozhi via All-commits all-commits at lists.llvm.org
Tue Nov 22 09:21:13 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 835da13ae0b816d4a2071fedece41f141871ba2f
      https://github.com/llvm/llvm-project/commit/835da13ae0b816d4a2071fedece41f141871ba2f
  Author: Guozhi Wei <carrot at google.com>
  Date:   2022-11-22 (Tue, 22 Nov 2022)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64Subtarget.cpp
    A llvm/test/CodeGen/AArch64/reserveXreg.ll

  Log Message:
  -----------
  [AArch64] Correctly recognize -reserve-regs-for-regalloc=X30,X29

In AArch64 backend X30 is named as LR, X29 is named as FP. So the code in AArch64Subtarget::AArch64Subtarget can't recognize these 2 registers.

  for (unsigned i = 0; i < 31; ++i) {
    if (ReservedRegNames.count(TRI->getName(AArch64::X0 + i)))
      ReserveXRegisterForRA.set(i);
  }

This patch add code to explicitly handle these 2 registers.

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




More information about the All-commits mailing list