llvm-project/llvm/test/CodeGen/WebAssembly
Heejin Ahn 24faf859e5 Reland "[WebAssembly] LSDA info generation"
Summary:
This adds support for LSDA (exception table) generation for wasm EH.
Wasm EH mostly follows the structure of Itanium-style exception tables,
with one exception: a call site table entry in wasm EH corresponds to
not a call site but a landing pad.

In wasm EH, the VM is responsible for stack unwinding. After an
exception occurs and the stack is unwound, the control flow is
transferred to wasm 'catch' instruction by the VM, after which the
personality function is called from the compiler-generated code. (Refer
to WasmEHPrepare pass for more information on this part.)

This patch:
- Changes wasm.landingpad.index intrinsic to take a token argument, to
make this 1:1 match with a catchpad instruction
- Stores landingpad index info and catch type info MachineFunction in
before instruction selection
- Lowers wasm.lsda intrinsic to an MCSymbol pointing to the start of an
exception table
- Adds WasmException class with overridden methods for table generation
- Adds support for LSDA section in Wasm object writer

Reviewers: dschuff, sbc100, rnk

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

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

llvm-svn: 345345
2018-10-25 23:55:10 +00:00
..
add-prototypes.ll [WebAssembly] Add pass to infer prototypes for prototype-less functions 2018-07-11 04:29:36 +00:00
address-offsets.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
annotations.mir [WebAssembly] Support EH instructions in InstPrinter 2018-10-25 23:45:48 +00:00
atomic-mem-consistency.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
atomic-rmw.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
byval.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
call.ll [WebAssembly][NFC] Add missing tests for indirect calls 2018-09-20 22:08:27 +00:00
cfg-stackify-dbg-skip.ll [WebAssembly] Ignore DBG_VALUE in WebAssemblyCFGStackify pass when looking for block start 2018-10-04 23:31:00 +00:00
cfg-stackify-eh.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
cfg-stackify-eh.mir [WebAssembly] Fix immediate of rethrow when throwing to caller 2018-10-24 23:31:24 +00:00
cfg-stackify.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
cfi.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
comparisons-f32.ll [WebAssembly][NFC] Fix unconventional test names 2018-09-14 20:22:45 +00:00
comparisons-f64.ll [WebAssembly][NFC] Fix unconventional test names 2018-09-14 20:22:45 +00:00
comparisons-i32.ll [WebAssembly][NFC] Fix unconventional test names 2018-09-14 20:22:45 +00:00
comparisons-i64.ll [WebAssembly][NFC] Fix unconventional test names 2018-09-14 20:22:45 +00:00
conv-trap.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
conv.ll [WebAssembly] Saturating float to int intrinsics 2018-10-11 00:01:25 +00:00
copysign-casts.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
cpus.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
custom-sections.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
dbgvalue.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
dead-vreg.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
divrem-constant.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
eh-lsda.ll Reland "[WebAssembly] LSDA info generation" 2018-10-25 23:55:10 +00:00
exception.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
explicit-locals.mir [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
f16.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
f32.ll [WebAssembly] SIMD min and max 2018-10-13 07:26:10 +00:00
f64.ll [WebAssembly] SIMD min and max 2018-10-13 07:26:10 +00:00
fast-isel-br-i1.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
fast-isel-i24.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
fast-isel-i256.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
fast-isel-noreg.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
fast-isel.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
frem.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
func.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
function-bitcasts-varargs.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
function-bitcasts.ll [WebAssembly] Be a little more conservative in WebAssemblyFixFunctionBitcasts 2018-08-30 01:01:30 +00:00
global.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
globl.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
i32-load-store-alignment.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
i32.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
i64-load-store-alignment.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
i64.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
i128-returned.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
i128.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
ident.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
immediates.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
implicit-def.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
import-module.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
indirect-import.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
inline-asm-m.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
inline-asm-roundtrip.ll [WebAssembly] Added test for inline assembly roundtrip. 2018-10-23 00:12:49 +00:00
inline-asm.ll [WebAssembly] Make tied inline asm operands work again 2018-09-12 21:34:39 +00:00
irreducible-cfg.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
legalize.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
libcalls.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
lit.local.cfg
load-ext-atomic.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
load-ext.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
load-store-i1.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
load.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
lower-em-ehsjlj-options.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
lower-em-exceptions-whitelist.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
lower-em-exceptions.ll [WebAssembly] Stop generating helper functions in WebAssemblyLowerEmscriptenEHSjLj 2018-10-02 22:12:15 +00:00
lower-em-sjlj.ll [WebAssembly] Stop generating helper functions in WebAssemblyLowerEmscriptenEHSjLj 2018-10-02 22:12:15 +00:00
lower-global-dtors.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
main-declaration.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
main-no-args.ll [WebAssembly] Fix signature of `main` in FixFunctionBitcasts 2018-09-13 17:13:10 +00:00
main-with-args.ll [WebAssembly] Fix signature of `main` in FixFunctionBitcasts 2018-09-13 17:13:10 +00:00
mem-intrinsics.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
memory-addr32.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
muloti4.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
negative-base-reg.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
non-executable-stack.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
offset-atomics.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
offset-fastisel.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
offset-folding.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
offset.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
phi.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
reg-stackify.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
return-int32.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
return-void.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
returned.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
select.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
signext-arg.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
signext-inreg.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
signext-zeroext.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
simd-arith.ll [SelectionDAG] DAG combiner for fminnan and fmaxnan 2018-10-24 22:18:54 +00:00
simd-bitcasts.ll [WebAssembly][NFC] Rename simd-conversions test to simd-bitcasts 2018-09-21 18:46:39 +00:00
simd-comparisons.ll [WebAssembly] Implement vector sext_inreg and tests with comparisons 2018-10-20 01:35:23 +00:00
simd-conversions.ll [WebAssembly] Restore slashes in SIMD conversion names 2018-10-02 01:52:21 +00:00
simd-ext-load-trunc-store.ll [WebAssembly] Set LoadExt and TruncStore actions for SIMD types 2018-10-25 01:46:07 +00:00
simd-intrinsics.ll [WebAssembly] Use target-independent saturating add 2018-10-25 19:06:13 +00:00
simd-nested-shuffles.ll [WebAssembly] Retain shuffle types during custom lowering 2018-10-24 23:27:40 +00:00
simd-offset.ll [WebAssembly][NFC] Generalize operand numbers in SIMD tests 2018-09-15 01:12:48 +00:00
simd-sext-inreg.ll [WebAssembly] Implement vector sext_inreg and tests with comparisons 2018-10-20 01:35:23 +00:00
simd.ll [WebAssembly] Handle undefined lane indices in SIMD patterns 2018-10-19 19:08:06 +00:00
stack-alignment.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
stack-insts.ll [WebAssembly] Fix assembly printing of br_table 2018-10-23 00:28:14 +00:00
store-trunc-atomic.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
store-trunc.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
store.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
switch.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
tls.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
umulo-128-legalisation-lowering.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
umulo-i64.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
unreachable.ll [WebAsembly] Update default triple in test files to wasm32-unknown-unkown. 2018-05-10 17:49:11 +00:00
unsupported-function-bitcasts.ll [WebAssembly] Be a little more conservative in WebAssemblyFixFunctionBitcasts 2018-08-30 01:01:30 +00:00
unused-argument.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
userstack.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
varargs.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
vector-sdiv.ll [WebAssembly] Convert remaining tests from elf to wasm output format 2018-07-02 16:03:49 +00:00
vtable.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
wasmehprepare.ll Reland "[WebAssembly] LSDA info generation" 2018-10-25 23:55:10 +00:00