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

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 12:31:59 PDT 2018


qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.

> This loop (per what determineCalleeSaves does) will only add any of the registers that getCalleeSavedRegs() returns

You're right I thought it was doing it for all the registers. Sorry for bringing confusion here.

> So I am still not sure what to think: Should SystemZ start to add all the aliases into CSR_SystemZ (which seems like unnecessary extra work), or else IPRA would have to do it per my previous question.

After actually checking the users (my recollections are not as good as I would like :P), no, we should definitely not start to put the aliases in that list.

> IPRA needs the set of fully saved/restored registers while building the regmask of clobbered registers for the whole function. I thought this is the only user of determineCalleeSaves that needs this, and that's why I suggested that this would be done inside the IPRA pass.

I agree.

Going back to the previous questions now.

>   I have added the subregs already, but it seems we should also check which super-regs end up as fully included, right?

So yes, but I don't think we have an easy wait to do that automatically. Now, I understand we would need that to make the checks accurate in the verifier, but I am afraid that if that is the only user we should have a mechanism to opt-in the targets that supply the proper implementation.

Anyhow, the patch itself, sounds legit again :).


https://reviews.llvm.org/D46315





More information about the llvm-commits mailing list