llvm-project/llvm/test/MC/WebAssembly
Heejin Ahn d6f487863d [WebAssembly] Exception handling: Switch to the new proposal
Summary:
This switches the EH implementation to the new proposal:
https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md
(The previous proposal was
 https://github.com/WebAssembly/exception-handling/blob/master/proposals/old/Exceptions.md)

- Instruction changes
  - Now we have one single `catch` instruction that returns a except_ref
    value
  - `throw` now can take variable number of operations
  - `rethrow` does not have 'depth' argument anymore
  - `br_on_exn` queries an except_ref to see if it matches the tag and
    branches to the given label if true.
  - `extract_exception` is a pseudo instruction that simulates popping
    values from wasm stack. This is to make `br_on_exn`, a very special
    instruction, work: `br_on_exn` puts values onto the stack only if it
    is taken, and the # of values can vay depending on the tag.

- Now there's only one `catch` per `try`, this patch removes all special
  handling for terminate pad with a call to `__clang_call_terminate`.
  Before it was the only case there are two catch clauses (a normal
  `catch` and `catch_all` per `try`).

- Make `rethrow` act as a terminator like `throw`. This splits BB after
  `rethrow` in WasmEHPrepare, and deletes an unnecessary `unreachable`
  after `rethrow` in LateEHPrepare.

- Now we stop at all catchpads (because we add wasm `catch` instruction
  that catches all exceptions), this creates new
  `findWasmUnwindDestinations` function in SelectionDAGBuilder.

- Now we use `br_on_exn` instrution to figure out if an except_ref
  matches the current tag or not, LateEHPrepare generates this sequence
  for catch pads:
```
  catch
  block i32
  br_on_exn $__cpp_exception
  end_block
  extract_exception
```

- Branch analysis for `br_on_exn` in WebAssemblyInstrInfo

- Other various misc. changes to switch to the new proposal.

Reviewers: dschuff

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

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

llvm-svn: 352598
2019-01-30 03:21:57 +00:00
..
annotations.s [WebAssembly] Exception handling: Switch to the new proposal 2019-01-30 03:21:57 +00:00
array-fill.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
assembler-binary.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
basic-assembly-errors.s [WebAssembly] Make assembler check for proper nesting of control flow. 2018-12-26 22:46:18 +00:00
basic-assembly.s [WebAssembly] Exception handling: Switch to the new proposal 2019-01-30 03:21:57 +00:00
blockaddress.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
bss.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
comdat.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
compile-twice.ll [WebAssembly] MC: Add compile-twice test and fix corresponding bug 2018-05-30 02:57:20 +00:00
custom-code-section.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
custom-sections.ll [WebAssembly] Parse llvm.ident into producers section 2019-01-17 02:29:55 +00:00
debug-info.ll [WebAssembly] Add languages from debug info to producers section 2019-01-18 02:47:48 +00:00
dwarfdump.ll Fix for llvm-dwarfdump changes for subroutine types 2018-12-12 21:15:48 +00:00
event-section.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
explicit-sections.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
external-data.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
external-func-address.ll [WebAssembly] Refactor WasmSignature and use it for MCSymbolWasm 2018-10-03 22:22:48 +00:00
file-headers.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
func-address.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
function-sections.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
global-ctor-dtor.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
libcall.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
lit.local.cfg
objdump.s [WebAssembly] Fixed objdump not parsing function headers. 2019-01-17 18:14:09 +00:00
offset.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
reloc-code.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
reloc-data.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
sections.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
simd-encodings.s [WebAssembly] Add unimplemented-simd128 subtarget feature 2019-01-10 22:32:11 +00:00
stack-ptr.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
types.ll [WebAssembly] Add unimplemented-simd128 subtarget feature 2019-01-10 22:32:11 +00:00
unnamed-data.ll [WebAssembly] Store section alignment as a power of 2 2019-01-16 01:34:48 +00:00
visibility.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
weak-alias.ll [WebAssembly] Fixed objdump not parsing function headers. 2019-01-17 18:14:09 +00:00
weak.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00