<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 19, 2013 at 3:48 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">MSVC uses int3 fill for alignment everywhere in .text.  I agree we should benchmark eventually, but there's nothing wrong with being consistent here for now.</div>
</blockquote><div><br></div><div>Wow, even for aligning loops? Seems like a pointless waste of decoding bandwidth vs. an appropriately sized nop.</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">
On Sat, Nov 16, 2013 at 11:31 PM, Sean Silva <span dir="ltr"><<a href="mailto:silvas@purdue.edu" target="_blank">silvas@purdue.edu</a>></span> wrote:<br></div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr">The CPU is probably still decoding these and it might hiccup. Could you try running some microbenchmarks to verify that this isn't a performance issue? (2 otherwise identical tight asm loops under `perf stat` is probably enough)<div>


It may not be a problem, but in case it is, you're going to have a *really* hard time tracking down this performance bug later; all you would basically have to go on from a bug report is "when I link my program with lld, it runs slower".<span><font color="#888888"><br>


<br><div>-- Sean Silva </div></font></span></div></div><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 15, 2013 at 5:11 PM, Rui Ueyama <span dir="ltr"><<a href="mailto:ruiu@google.com" target="_blank">ruiu@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ruiu<br>
Date: Fri Nov 15 16:11:43 2013<br>
New Revision: 194860<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=194860&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=194860&view=rev</a><br>
Log:<br>
[PECOFF] Use INT3 instead of NOP.<br>
<br>
This patch does not change the meaning of the program, but if something's wrong<br>
in the linker or the compiler and the control reaches to the gap of imported<br>
function table, it will stop immediately because of the presence of INT3. If<br>
NOP, it'd fall through to the next call instruction, which is usually a<br>
completely foreign function call.<br>
<br>
Modified:<br>
    lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=194860&r1=194859&r2=194860&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp?rev=194860&r1=194859&r2=194860&view=diff</a><br>



==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp (original)<br>
+++ lld/trunk/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp Fri Nov 15 16:11:43 2013<br>
@@ -152,7 +152,7 @@ namespace {<br>
<br>
 uint8_t FuncAtomContent[] = {<br>
   0xff, 0x25, 0x00, 0x00, 0x00, 0x00,  // jmp *0x0<br>
-  0x90, 0x90                           // nop; nop<br>
+  0xcc, 0xcc                           // int 3; int 3<br>
 };<br>
<br>
 /// The defined atom for jump table.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div></div></div><br></div>
</blockquote></div><br></div></div>