<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sat, Jul 15, 2017 at 11:03 AM Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Jul 12, 2017 at 3:24 PM Daniel Neilson via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dneilson<br>
Date: Wed Jul 12 12:24:07 2017<br>
New Revision: 307831<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=307831&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=307831&view=rev</a><br>
Log:<br>
Fix to web assembly lib call list<br></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>This patch regressed a basic regression test for the WebAssembly backend. Please always run 'check-llvm' before committing and have the experimental backend you are changing enabled.</div><div><br></div><div>I'm reverting this and the subsequent patches to get the regression test suite back to green.</div></div></div></blockquote><div><br></div><div>Never mind, I can't. Everything else breaks.</div><div><br></div><div>I'm disabling the tests instead I guess. Again, please check these things before committing in the future, and please get a build bot included in the main upstream bots with the backend enabled. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Summary:<br>
 Revision 307796 caused an internal build break in WebAssembly bots in the form of a<br>
crash.  ex:<br>
Here's the crash dump from one of the failing tests:<br>
<br>
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/llc < /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll<br>
--<br>
Exit Code: 2<br>
<br>
Command Output (stderr):<br>
--<br>
Stack dump:<br>
0.      Program arguments: build/default/./bin/llc -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals<br>
1.      Running pass 'Function Pass Manager' on module '<stdin>'.<br>
2.      Running pass 'WebAssembly Assembly Printer' on function '@call_memcpy'<br>
FileCheck error: '-' is empty.<br>
FileCheck command line:  build/default/./bin/FileCheck src/test/CodeGen/WebAssembly/global.ll<br>
<br>
The problem is in lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp. There’s an array declared:<br>
545 static const char *<br>
Fix to web assembly lib call list<br>
<br>
Summary:<br>
 Revision 307796 caused an internal build break in WebAssembly bots in the form of a<br>
crash.  ex:<br>
Here's the crash dump from one of the failing tests:<br>
<br>
/usr/local/google/home/blaikie/dev/llvm/build/default/./bin/llc < /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | /usr/local/google/home/blaikie/dev/llvm/build/default/./bin/FileCheck /usr/local/google/home/blaikie/dev/llvm/src/test/CodeGen/WebAssembly/global.ll<br>
--<br>
Exit Code: 2<br>
<br>
Command Output (stderr):<br>
--<br>
Stack dump:<br>
0.      Program arguments: build/default/./bin/llc -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals<br>
1.      Running pass 'Function Pass Manager' on module '<stdin>'.<br>
2.      Running pass 'WebAssembly Assembly Printer' on function '@call_memcpy'<br>
FileCheck error: '-' is empty.<br>
FileCheck command line:  build/default/./bin/FileCheck src/test/CodeGen/WebAssembly/global.ll<br>
<br>
The problem is in lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp. There’s an array declared:<br>
static const char *<br>
RuntimeLibcallNames[RTLIB::UNKNOWN_LIBCALL] = {<br>
<br>
 That is defining a runtime lib call name for each entry in the enum RTLIB:Libcall from include/llvm/CodeGen/RuntimeLibcalls.h.<br>
<br>
Revision 307796 added entries to the enum, but didn’t add entries to the RuntimeLibcallNames array, which caused a crash when attempting<br>
to access past the end of the array.<br>
<br>
This patch fixes the issue by adding the element atomic memmove to the WebAssembly arrays.<br>
<br>
Reviewed by: reames<br>
<br>
Modified:<br>
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp<br>
<br>
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp?rev=307831&r1=307830&r2=307831&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp?rev=307831&r1=307830&r2=307831&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp (original)<br>
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyRuntimeLibcallSignatures.cpp Wed Jul 12 12:24:07 2017<br>
@@ -400,6 +400,12 @@ RuntimeLibcallSignatures[RTLIB::UNKNOWN_<br>
 /* MEMCPY_ELEMENT_ATOMIC_8 */ iPTR_func_iPTR_iPTR_iPTR,<br>
 /* MEMCPY_ELEMENT_ATOMIC_16 */ iPTR_func_iPTR_iPTR_iPTR,<br>
<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1 */ unsupported,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2 */ unsupported,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4 */ unsupported,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8 */ unsupported,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16 */ unsupported,<br>
+<br>
 // EXCEPTION HANDLING<br>
 /* UNWIND_RESUME */ unsupported,<br>
<br>
@@ -844,6 +850,11 @@ RuntimeLibcallNames[RTLIB::UNKNOWN_LIBCA<br>
 /* MEMCPY_ELEMENT_ATOMIC_4 */ "MEMCPY_ELEMENT_ATOMIC_4",<br>
 /* MEMCPY_ELEMENT_ATOMIC_8 */ "MEMCPY_ELEMENT_ATOMIC_8",<br>
 /* MEMCPY_ELEMENT_ATOMIC_16 */ "MEMCPY_ELEMENT_ATOMIC_16",<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_1 */ nullptr,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_2 */ nullptr,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_4 */ nullptr,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_8 */ nullptr,<br>
+/* MEMMOVE_ELEMENT_UNORDERED_ATOMIC_16 */ nullptr,<br>
 /* UNWIND_RESUME */ "_Unwind_Resume",<br>
 /* SYNC_VAL_COMPARE_AND_SWAP_1 */ "__sync_val_compare_and_swap_1",<br>
 /* SYNC_VAL_COMPARE_AND_SWAP_2 */ "__sync_val_compare_and_swap_2",<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></blockquote></div></div>