<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Aug 31, 2012, at 7:08 AM, Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi again,<br><br><blockquote type="cite">You can't add a dependency on a value that isn't there, so you need to know that %s1 is live before you can add the <imp-use> operand.<br><br>The transformation is safe if you can establish that the original instruction is already reading or writing the other lane.<br></blockquote><br>Just one more quick question that you'll probably know the answer to<br>immediately: from these I inferred that there's no easy way to check<br>whether %s1 *is* live at that point; I've certainly not seen one in my<br>travels, but haven't looked recently. Is that correct?<br></blockquote><div><br></div><div>No easy way, that's right. You would need to scan the instruction stream for evidence. See for example isSafeToClobberEFLAGS() in X86InstrInfo.cpp. As a bonus, you get top deal with sub- and super-registers as well.</div><div><br></div><div><blockquote type="cite"><span style="font-family: monospace; ">I've not been able to come up with an entirely satisfactory solution</span><br style="font-family: monospace; "><span style="font-family: monospace; ">to this. If I understand correctly, the above instruction wouldn't be</span><br style="font-family: monospace; "><span style="font-family: monospace; ">eligible because D0 is not an implicit-use.</span></blockquote><br></div><div>It think that is a bug in ExpandPostRAPseudos.cpp. The original COPY looked like this:</div><div><br></div><div><div>        %S2<def> = COPY %S0<kill>, %D1<imp-use,kill>, %D1<imp-def></div><div><br></div><div>Then it was expanded to:</div><div><br></div><div><div>        %S2<def> = VMOVS %S0<kill>, pred:14, pred:%noreg, %D1<imp-def></div></div><div><br></div><div>But either way, the fact the the destination D-register is fully defined by the original instruction should be enough. You can check MI->definedRegister().</div><div><br></div><div>/jakob</div><div><br></div></div></div></body></html>