[all-commits] [llvm/llvm-project] b2542c: RegisterClassInfo: Fix CSR cache invalidation

Matthias Braun via All-commits all-commits at lists.llvm.org
Mon Aug 22 09:29:27 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b2542c40b924acba8bf9708e938c184b77918ae4
      https://github.com/llvm/llvm-project/commit/b2542c40b924acba8bf9708e938c184b77918ae4
  Author: Matthias Braun <matze at braunis.de>
  Date:   2022-08-22 (Mon, 22 Aug 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/RegisterClassInfo.h
    M llvm/lib/CodeGen/RegisterClassInfo.cpp
    M llvm/test/CodeGen/PowerPC/pcrel-call-linkage-leaf.ll
    M llvm/test/CodeGen/XCore/scavenging.ll

  Log Message:
  -----------
  RegisterClassInfo: Fix CSR cache invalidation

`RegisterClassInfo` caches information like allocation orders and reuses
it for multiple machine functions where possible. However the `MCPhysReg
*CalleeSavedRegs` field used to test whether the set of callee saved
registers changed did not work: After D28566
`MachineRegisterInfo::getCalleeSavedRegs()` can return dynamically
computed CSR sets that are only valid while the `MachineRegisterInfo`
object of the current function exists.

This changes the code to make a copy of the CSR list instead of keeping
a possibly invalid pointer around.

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




More information about the All-commits mailing list