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

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 15 21:12:59 PDT 2016

mehdi_amini added inline comments.

Comment at: lib/CodeGen/RegUsageInfoCollector.cpp:119
@@ +118,3 @@
+  for (MachineBasicBlock &MBB : MF) {
+    for (MachineInstr &MI : MBB) {
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?


More information about the llvm-commits mailing list