[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
Sun May 13 23:15:37 PDT 2018


jonpa added a comment.

>>   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 :).

I think also RegUsageInfoCollector would benefit from this - let's say that the MF uses %r10Q. SystemZ will never save %r10Q, but %r10D and %r11D, so I think we must simply do a second iteration over the registers and check for any reg that is not marked as saved if all its subregs are saved. Why is that not easy? Are there other cases (targets) where the subreg structure modeling would make this wrong?


https://reviews.llvm.org/D46315





More information about the llvm-commits mailing list