[llvm] [RISCV][WIP] Let RA do the CSR saves. (PR #90819)

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 6 14:16:35 PST 2024


================
@@ -262,6 +267,7 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
   // called functions.  Because of this, calculateCalleeSavedRegisters()
   // must be called before this function in order to set the AdjustsStack
   // and MaxCallFrameSize variables.
+  RDA->reset();
----------------
michaelmaitland wrote:

Why is a call to `reset()` needed? Can it be dirty into this function or after the `getAnalysis<ReachingDefAnalysis>()` above? If it is needed, could we have done this instead in case the function had the Naked attribute:

```
  if (!F.hasFnAttribute(Attribute::Naked)) {
    RDA->reset();
    insertPrologEpilogCode(MF);
}
```

https://github.com/llvm/llvm-project/pull/90819


More information about the llvm-commits mailing list