<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Kevin,<div class=""><br class=""></div><div class="">That sounds like a bug :).</div><div class=""><br class=""></div><div class="">When is the implicit-def added?</div><div class=""><br class=""></div><div class="">What I am thinking is if it gets added after we computed the live intervals, then we may miss it is there.</div><div class=""><br class=""></div><div class="">Could you file a public report?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">-Quentin<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 6, 2019, at 3:13 PM, Kevin Choi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" class="">
<div text="#000000" bgcolor="#FFFFFF" class=""><p class="">Hi LLVM,</p><p class="">I ran into a case where RegAlloc would insert a spill across
instruction that had same register for output operand and
implicit-def. The effect this had was that spill code would
immediately overwrite the output result. Is this the expected
result of setting up MyInst this way? In other words, does
RegAlloc know to not insert spill in case it sees that output reg
is same as one of implicit-def?</p><p class="">If this is intended (always spilling live regs across
implicit-def inst?), I am puzzled on how to use MyInst that has
variable output reg with static implicit-defs. Any tips would be
greatly appreciated.</p><p class="">Reduced Example:<br class="">
</p><p class=""><u class=""><b class="">Before RegAlloc:</b></u><br class="">
%1:reg = COPY ...;<br class="">
%2:reg = MyInst %1:reg, ..., implicit-def dead $p1, ...;<br class="">
%3:reg = Use %2:reg</p>
<u class=""><b class="">RegAlloc:</b></u><br class="">
>> %2:reg = MyInst %1:reg, ..., implicit-def dead $p1, ...;<br class="">
Regs: $p1=%1<br class="">
Killing last use: %1:reg<br class="">
Assigning %2 to $p1<br class="">
Spilling %2 in $p1 to stack slot #2 <-- suspicious if this is
inserting spill, unaware of output reg being same<br class="">
<< $p1 =MyInst killed $p1, ..., implicit-def dead $p1, ...;
<p class=""><b class=""><u class="">After RegAlloc:</u></b><br class="">
$p1 = COPY ...;<br class="">
Store $p1 %stack.2;<br class="">
$p1 =MyInst killed $p1, ..., implicit-def dead $p1, ...;<br class="">
$p1 = Load %stack.2;<br class="">
$p2 = Use $p1, ...;</p><p class=""><br class="">
</p><p class="">Best Regards,</p><p class="">Kevin<br class="">
</p>
</div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></body></html>