llvm-project/llvm/test/MC
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
..
AArch64 [MC] Teach the MachO object writer about N_FUNC_COLD 2019-01-25 18:30:22 +00:00
AMDGPU [AMDGPU][MC][GFX8+][DISASSEMBLER] Corrected 1/2pi value for 64-bit operands 2019-01-18 15:17:17 +00:00
ARM [ARM] Add command-line option for SB 2019-01-03 12:09:12 +00:00
AVR [AVR] Fix the inst-cbr test 2019-01-18 10:11:33 +00:00
AsmParser [DWARF] Emit reasonable debug info for empty .s files. 2019-01-29 20:53:51 +00:00
BPF bpf: New disassembler testcases for 32-bit subregister support 2018-02-23 23:49:35 +00:00
COFF [llvm-objdump] - Print LMAs when dumping section headers. 2019-01-28 14:11:35 +00:00
Disassembler [AMDGPU][MC][GFX8+][DISASSEMBLER] Corrected 1/2pi value for 64-bit operands 2019-01-18 15:17:17 +00:00
ELF Remove irrelevant references to legacy git repositories from 2019-01-15 16:18:52 +00:00
Hexagon [Hexagon] Add instruction definitions for Hexagon V66 2018-12-05 21:01:07 +00:00
Lanai
MSP430 [MSP430] Recognize '{' as a line separator 2019-01-15 20:10:46 +00:00
MachO [MC] Enable .file support on COFF and diagnose it on unsupported targets 2018-12-21 23:35:48 +00:00
Mips [llvm-objdump] - Implement -z/--disassemble-zeroes. 2019-01-10 14:55:26 +00:00
PowerPC [MC] Avoid inlining constant symbols with variants. 2018-09-17 20:34:26 +00:00
RISCV [RISCV] Add R_RISCV_RELAX relocation to all possible relax candidates. 2019-01-21 05:27:09 +00:00
Sparc [Sparc] Add membar assembler tags 2018-12-13 15:29:12 +00:00
SystemZ [SystemZ] Implement SystemZOperand::print() 2018-10-26 00:36:00 +00:00
WebAssembly [WebAssembly] Exception handling: Switch to the new proposal 2019-01-30 03:21:57 +00:00
X86 [X86][AVX512F_SCALAR]: Adding full coverage of MC encoding for the AVX512F_SCALAR isa sets. NFC 2019-01-22 20:48:24 +00:00