<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Jun 26, 2007, at 12:11 PM, Evan Cheng wrote:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">AH,inf = [30,42:0)[50,54:1)  0@? 1@?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">AL,inf = [30,31:0)[34,42:1)[50,54:2)  0@30 1@? 2@?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">AX,inf = [30,42:0)[50,54:1)  0@? 1@?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">EAX,inf = [30,31:0)[34,42:1)[50,54:2)  0@30 1@? 2@50</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">RAX,inf = [34,50:0)[50,54:1)  0@? 1@50</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">AL is marked dead. So it makes sense there is a gap between [30:31) and [34,42).  It looks like EAX implicit def should be marked dead as well. So I think there is a bug there somewhere.</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>BTW, I am making some fixes to LiveIntervals so this may look different after my check-in. If it's still buggy (I expect so), please file a bug.  This doesn't really affect codegen but it still should be examined.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Evan</DIV><DIV><BR><BLOCKQUOTE type="cite"><DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">At slot 42 all of the A registers EXCEPT RAX die (last use).<SPAN class="Apple-converted-space">  </SPAN>Again, what's<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the deal with RAX?<SPAN class="Apple-converted-space">  </SPAN>EAX is redefined just a few instructions later, which</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">should kill RAX.<SPAN class="Apple-converted-space">  </SPAN>The [34,50:0)[50,54:1)<SPAN class="Apple-converted-space">  </SPAN>interval for RAX is just weird.<SPAN class="Apple-converted-space">  </SPAN>Why</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">isn't it [34,54)?</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">48<SPAN class="Apple-tab-span" style="white-space:pre">     </SPAN>%EAX = MOV32rr %reg1027<kill>, %RAX<imp-use,kill>, %RAX<imp-def></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">MOV32rr<SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN>%mreg(17)<d><SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>%reg1027<SPAN class="Apple-tab-span" style="white-space:pre">    </SPAN>%mreg(74)<SPAN class="Apple-tab-span" style="white-space:pre">   </SPAN>%mreg(74)<d></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Def of sub-register use and define its super-register(s).  So RAX's live range isn't broken here.</DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Finally, according to the above live interval information, registers 1026 and</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">1027 have live ranges that overlap RAX.<SPAN class="Apple-converted-space">  </SPAN>That's just totally bogus as can</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">be seen simply by reading the machine instructions.<SPAN class="Apple-converted-space">  </SPAN>EAX and all other</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">A registers are last used at instruction 40 and EAX is not defined again</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">until instruction 48, which is the last use of register 1027.<SPAN class="Apple-converted-space">  </SPAN>The move to</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">register 1026 is entirely unnecessary -- why is it even there?</DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>Move to r1026 is marked dead. This is the artifact of translating CopyFromReg (of the call result) of EAX. It's harmless.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">EAX,inf = [30,31:0)[34,42:1)[50,54:2)  0@30 1@? 2@50</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">RAX,inf = [34,50:0)[50,54:1)  0@? 1@50</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">%reg1026,0 = [42,43:0)  0@42</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">%reg1027,0 = [46,50:0)  0@?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">40<SPAN class="Apple-tab-span" style="white-space:pre">       </SPAN>%reg1026<dead> = MOV32rr %EAX<kill></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">MOV32rr<SPAN class="Apple-tab-span" style="white-space:pre">  </SPAN>%reg1026<d><SPAN class="Apple-tab-span" style="white-space:pre">   </SPAN>%mreg(17)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">While EAX is marked kill here, RAX is still alive. Again, this is because def of EAX r/m/w RAX. It does not terminate RAX live range. The important thing here is reg1027 does not overlap EAX and the magic of coalescer join them together.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Evan</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><BR class="khtml-block-placeholder"></DIV><DIV><BR><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It's apparent that I don't understand the interaction between live intervals</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">and register aliases/sub registers, etc.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Help?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">                                                   </SPAN>-Dave</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">LLVM Developers mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A> <SPAN class="Apple-converted-space">        </SPAN><A href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</A></DIV> </BLOCKQUOTE></DIV><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>