llvm-project/llvm
Heejin Ahn 44a5a4b107 [WebAssembly] Fix bugs in BLOCK/TRY placement
Summary:
Before we placed all TRY/END_TRY markers before placing BLOCK/END_BLOCK
markers. This couldn't handle this case:
```
bb0:
  br bb2
bb1:          // nearest common dominator of bb3 and bb4
  br_if ... bb3
  br bb4
bb2:
  ...
bb3:
  call @foo   // unwinds to ehpad
bb4:
  call @bar   // unwinds to ehpad
ehpad:
  catch
  ...
```

When we placed TRY markers, we placed it in bb1 because it is the
nearest common dominator of bb3 and bb4. But because bb0 jumps to bb2,
when we placed block markers, we ended up with interleaved scopes like
```
block
try
end_block
catch
end_try
```
which was not correct.

This patch fixes the bug by placing BLOCK and TRY markers in one pass
while iterating BBs in a function. This also adds some more routines to
`placeTryMarkers`, because we now have to assume that there can be
previously placed BLOCK and END_BLOCK.

Reviewers: dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59739

llvm-svn: 357007
2019-03-26 17:15:55 +00:00
..
benchmarks
bindings [bindings/go] Fix building on 32-bit systems (ARM etc.) 2019-02-16 22:33:10 +00:00
cmake Moved everything SMT-related to LLVM and updated the cmake scripts. 2019-03-25 17:47:45 +00:00
docs Test commit: fix typo 2019-03-26 15:26:15 +00:00
examples [Kaleidoscope] Fix symbol resolver to search in reverse order. 2019-02-21 16:53:04 +00:00
include [MCA] Correctly update the UsedResourceGroups mask in the InstrBuilder. 2019-03-26 15:38:37 +00:00
lib [WebAssembly] Fix bugs in BLOCK/TRY placement 2019-03-26 17:15:55 +00:00
projects
resources
runtimes [runtime] Use --strip-all rather than --strip-sections 2019-03-10 04:26:54 +00:00
test [WebAssembly] Fix bugs in BLOCK/TRY placement 2019-03-26 17:15:55 +00:00
tools [llvm-exegesis] Allow the target to disable the selection of some registers. 2019-03-26 15:44:57 +00:00
unittests [llvm-exegesis] Allow the target to disable the selection of some registers. 2019-03-26 15:44:57 +00:00
utils merge-request.sh: Update 8.0 metabug for 8.0.1 2019-03-25 17:01:29 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore [clangd] Store index in '.clangd/index' instead of '.clangd-index' 2019-02-20 19:08:06 +00:00
CMakeLists.txt Moved everything SMT-related to LLVM and updated the cmake scripts. 2019-03-25 17:47:45 +00:00
CODE_OWNERS.TXT
CREDITS.TXT [NFC] Add to contributor list. 2019-02-26 05:46:45 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt Testing commit access 2019-02-19 20:38:51 +00:00
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.