<div dir="ltr"><div>Hi,</div><div><br></div><div>My understanding of a "dead" register is a def that is never used. However,</div><div>when I dump the MI after reg alloc on a simple program I see the following sequence:</div><div><br></div><div>ADJCALLSTACKDOWN64 0, 0, 0, <b>implicit-def dead %rsp</b>, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp</div><div>CALL64pcrel32 @foo, <regmask %bh %bl %bp %bpl %bx %ebp %ebx %rbp %rbx %r12 %r13 %r14 %r15 %r12b %r13b %r14b %r15b %r12d %r13d %r14d %r15d %r12w %r13w %r14w %r15w>, <b>implicit %rsp</b>, implicit %ssp, implicit-def %rsp, implicit-def %ssp</div><div>ADJCALLSTACKUP64 0, 0, implicit-def dead %rsp, implicit-def dead %eflags, implicit-def dead %ssp, implicit %rsp, implicit %ssp</div><div>RET 0</div><div><br></div><div><br></div><div>The ADJCALLSTACKDOWN64 has implicit-def dead %rsp. However the next instruction,</div><div>CALL64pcrel32 has an implicit use of %rsp. This would be a use of %rsp as definedĀ </div><div>in ADJCALLSTACKDOWN64 making that non-dead.</div><div><br></div><div>So I guess my understanding of dead is incorrect. Could you please explain what dead means?</div><div><br></div><div><br></div><div>For reference:</div><div>Source file(a.c):</div><div>void foo(void);</div><div>void boo(){ foo(); }</div><div><br></div><div>Commands:</div><div>clang -S -emit-llvm -Xclang -disable-O0-optnone a.c</div><div>llc -print-after="stack-slot-coloring" a.ll</div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font size="1"><span style="color:rgb(84,141,212);font-family:arial,helvetica,sans-serif">Regards</span><br></font></div><div><div dir="ltr"><font color="#000000" face="arial, helvetica, sans-serif" size="1"><font color="#548dd4">Bhatu</font></font></div></div></div></div></div></div></div></div></div></div>
</div>