[WebAssembly] Always print loop end labels
authorDan Gohman <dan433584@gmail.com>
Mon, 23 Nov 2015 19:12:37 +0000 (19:12 +0000)
committerDan Gohman <dan433584@gmail.com>
Mon, 23 Nov 2015 19:12:37 +0000 (19:12 +0000)
commit5aafb6def54fc6f4de28e1bccc42a036ca8e33bf
tree557a9419951a360ad1e42389d962c32ad58ba78f
parent236067a61b9e1391425ada920b21a416609eede6
[WebAssembly] Always print loop end labels

WebAssembly is currently using labels to end scopes, so for example a
loop scope looks like this:

BB0_0:
  loop BB0_1
  ...
BB0_1:

with BB0_0 being the label of the first block not in the loop. This
requires that the label be printed even when it's only reachable via
fallthrough. To arrange this, insert a no-op LOOP_END instruction in
such cases at the end of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253901 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
lib/Target/WebAssembly/WebAssemblyInstrControl.td
test/CodeGen/WebAssembly/cfg-stackify.ll