[PATCH] D21395: Fix for Bug 28144 and print register preserved in comments in asm files

Vivek Pandya via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 21:22:17 PDT 2016

vivekvpandya added inline comments.

Comment at: lib/CodeGen/RegUsageInfoCollector.cpp:119
@@ +118,3 @@
+  for (MachineBasicBlock &MBB : MF) {
+    for (MachineInstr &MI : MBB) {
mehdi_amini wrote:
> vivekvpandya wrote:
> > mehdi_amini wrote:
> > > vivekvpandya wrote:
> > > > I have added this code after marking callee saved registers as preserved because if any callee inside the MF body is using the register , which has marked safe above then that will be correct register usage information.
> > > Can you take an example? I don't make sense of it.
> > @mehdi_amini This is not real example but this is what I have thought of when writing this code. Consider foo() sets R15 as per the calling convention as preserved register but one of its callee lat say bar() actually clobbers R15 then foo() will mark R15 as clobbered. I think you may have better reason.
> Isn't your example showing exactly why it is not the right ordering?
@mehdi_amini Do you mean that if foo()'s CC preserves R15 , it would be saved by foo() so no problem if foo's caller is using R15 ?


More information about the llvm-commits mailing list