Hello,<br><br>Based on TARGETRegisterInfo.td<br><br>def V0_q0 : TARGETReg<256, "v0">;<br>def V0_q1 : TARGETReg<257, "v0">;<br>def V0_q2 : TARGETReg<258, "v0">;<br>def V0_q3 : TARGETReg<259, "v0">;<br>
<br>def V0_l : TARGETRegWithSubregs<512, "v0", [V0_q0, V0_q1]>;<br>def V0_h : TARGETRegWithSubregs<513, "v0", [V0_q2, V0_q3]>;<br><br>def V0 : TARGETRegWithSubregs<640, "v0", [V0_l, V0_h]>;<br>
<br>TableGen infers the following which it writes in TARGETGenRegisterInfo.inc:<br><br> const unsigned V0_q0_Overlaps[] = { TARGET::V0_q0, TARGET::V0_l, TARGET::V0, 0 };<br><br>that means that when V0_q0 gets written, all the registers it overlaps (i.e. V0_q0, V0_l, V0) get dirty. All this is handled by RegisterInfoEmitter in TableGen.<br>
<br>Best regards,<br>Alex<br><br><br><div class="gmail_quote">On Wed, Sep 7, 2011 at 3:52 AM, zhangzuyu <span dir="ltr"><<a href="mailto:hitzzy@gmail.com">hitzzy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">On Tue, Sep 6, 2011 at 9:34 PM, Alexandru Dura <span dir="ltr"><<a href="mailto:alexdura@gmail.com" target="_blank">alexdura@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi everyone,<br><br>I found some peculiar behavior of TableGen when generating [TARGET]GenRegisterInfo.inc. Some register overlaps are generated twice in this file, leading to a compilation error. </blockquote><div><br></div>
</div><div>Hi,</div><div><br></div><div>What do you mean "overlapped register"?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">I think this is because in RegisterInfoEmitter.cpp, RegisterAliases are declared as "std::map<Record*, std::set<Record*>, LessRecord>"<br>
<br>and a requirement for std::map is that the comparison function ("LessRecord") should correspond to a strict weak ordering; in this case this points to : <br><br> "StringRef1.compare_numeric(StringRef2) < 0"<br>
<br>which does not behave like strict weak ordering predicate on the set of strings. I have attached an example built upon snippets from StringRef.cpp, compiled with gcc version 4.4.5 (Debian 4.4.5-8) (I also saw that there is a workaround for gcc 4.x ...). <br>
<br>Please tell me if I am doing something wrong or this is a real bug. <br><br>Thank you,<br>Alex<br><br>
<br></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><span style="font-family: arial,sans-serif; font-size: 11px; background-color: rgb(255, 255, 255);">Yours truly,</span><br>Zhang Zuyu(张祖羽)<br>
<br>-----------------------------------------------------------<br>
College of Computer Science and Technology, Harbin Engineering University</div>
<div><br></div><div style=""></div><br>
</font></blockquote></div><br><br clear="all"><br><br><br><br>