[PATCH] D46315: [RegUsageInfoCollector] Fix handling of callee saved registers with CSR optimization.

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 01:02:47 PDT 2018


jonpa added a comment.

While looking at this and the related machine verifier patch, I am now again somewhat unsure if this is doing the right thing for any given target.

The target returns a list of registers from determineCalleeSaves that does not include any aliases. It seems that we must therefore build this set so that it includes any fully saved/restored register. I have added the subregs already, but it seems we should also check which super-regs end up as fully included, right? Should we make a new function that does this work, since we need this also in the MachineVerifier, like determineCalleeSavesWithAliases? Maybe this could be a static method in RegUsageInfoCollector?



================
Comment at: lib/CodeGen/RegUsageInfoCollector.cpp:149
+          << " function optimized for not having CSR.\n");
   }
 
----------------
qcolombet wrote:
> This logging is not very useful now. I would get rid of it.
Do you want to remove this entire clause of just the dbgs() output?

I might object a little to removing this, since I have made SystemZ tests that checks for this, for instance to check that the return register is saved even on such a function:

```
; DBG: fun3 function optimized for not having CSR
; CHECK-LABEL: fun3
​; CHECK: stmg    %r14, %r15, 112(%r15)
​; CHECK: lr      %r14
​; CHECK: a       %r14
​; CHECK: lmg     %r14, %r15, 112(%r15)
​; CHECK: br      %r14

```
It also seems useful to IPRA to have the statistic around...



https://reviews.llvm.org/D46315





More information about the llvm-commits mailing list