[PATCH] D39386: [Power9] Allow gpr callee saved spills in prologue to vector registers rather than stack

Zaara Syeda via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 31 08:30:59 PDT 2018


syzaara added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/MachineFrameInfo.h:37
+    int FrameIdx;
+    unsigned DstReg;
+  };
----------------
MatzeB wrote:
> If `DstReg` must be a physical register then you could use `MCPhysReg` instead of `unsigned`.
I'm preferring to keep it as unsigned so that it is consistent with unsigned Reg (the other register variable in the class).

If you'd like me to change it, I can go ahead with that. Would you also want me to change the function definitions for unsigned getDstReg() and void setDstReg(unsigned SpillReg). 

And what about the users of this function, like:

```
        unsigned SpilledReg = CSI[I].getDstReg();
        unsigned CFIRegister = MF.addFrameInst(MCCFIInstruction::createRegister(
            nullptr, MRI->getDwarfRegNum(Reg, true),
            MRI->getDwarfRegNum(SpilledReg, true)));
```

SpilledReg is passed to getDwarfRegNum as unsigned.



================
Comment at: llvm/include/llvm/CodeGen/MachineFrameInfo.h:54
+  /// register.
+  bool SpilledToReg;
 
----------------
MatzeB wrote:
> You could use `bool SpilledToReg = false;` here instead of setting it in the constructor.
Also preferring to keep this the same way so its consistent with the rest of the variables in the class being set in the constructor.


https://reviews.llvm.org/D39386





More information about the llvm-commits mailing list