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

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 19:07:55 PST 2018


hfinkel added inline comments.


================
Comment at: lib/CodeGen/PrologEpilogInserter.cpp:464
+    if (CSI[i].isSpilledToReg()) {
+      for (MachineBasicBlock &MBB : MF) {
+        MCPhysReg DstReg = CSI[i].getDstReg();
----------------
thegameg wrote:
> I agree that in the general case all the basic blocks need to have this register as live in, but if the prologue/epilogue of the function is shrink-wrapped, only the blocks between the prologue and the epilogue need to have this as live-in.
> I think at this point in the function the `Visited` set contains all the blocks *outside* the prologue/epilogue region. Correct me if I'm wrong but I think you're missing a:
> 
> ```
> if (Visited.count(&MBB))
>   continue;
> ```
Please add a comment here explaining that the visited set contains the blocks outside the prologue/epilogue region. That's likely not obvious.


https://reviews.llvm.org/D39386





More information about the llvm-commits mailing list