[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:34 PST 2024


================
@@ -114,8 +114,11 @@ class ReachingDefAnalysis : public MachineFunctionPass {
 private:
   MachineFunction *MF = nullptr;
   const TargetRegisterInfo *TRI = nullptr;
+  const TargetInstrInfo *TII = nullptr;
   LoopTraversal::TraversalOrder TraversedMBBOrder;
   unsigned NumRegUnits = 0;
+  unsigned NumStackObjects = 0;
----------------
michaelmaitland wrote:

I think `NumStackObjects` and `ObjectIndexBegin` are available in `enterBasicBlock` through `MBB->getParent()->getFrameInfo().getNumObjects()` and `MBB->getParent()->getFrameInfo().getObjectIndexBegin()`.

We could probably avoid storing them as member variables in ReachingDefAnalysis to keep the object smaller.

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


More information about the llvm-commits mailing list