<div dir="ltr">Currently I'm focusing on correctness rather than performance, and this change should help debugging, so I'd think we want to keep it as is regardless of performance implications. I'd rather not run microbenchmarks and optimize at this moment. Maybe we should add a TODO to revisit it later?</div>

<div class="gmail_extra"><br><br><div class="gmail_quote">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><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 class="HOEnZb"><font color="#888888"><br>


<br><div>-- Sean Silva </div></font></span></div></div><div class="HOEnZb"><div class="h5"><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></blockquote></div><br></div>