Skip to content

Commit a8e1135

Browse files
authored
[WebAssembly] Add -wasm-use-legacy-eh option (#122158)
This replaces the existing `-wasm-enable-exnref` with `-wasm-use-legacy-eh` option, in an effort to make the new standardized exnref proposal the 'default' state and the legacy proposal needs to be separately enabled an option. But given that most users haven't switched to the new proposal and major web browsers haven't turned it on by default, this `-wasm-use-legacy-eh` is turned on by default, so nothing will change for now for the functionality perspective. This also removes the restriction that `-wasm-enable-exnref` be only used with `-wasm-enable-eh` because this option is enabled by default. This option does not have any effect when `-wasm-enable-eh` is not used.
1 parent a531800 commit a8e1135

14 files changed

+57
-53
lines changed

llvm/docs/ReleaseNotes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,16 @@ Changes to the WebAssembly Backend
250250
`-mmutable-globals`, `-mcall-indirect-overlong`, `-msign-ext`,
251251
`-mbulk-memory-opt`, `-mnontrapping-fptoint`, and `-mextended-const`.
252252

253+
* Support for the new standardized [Exception Handling] proposal is added.
254+
The [legacy Exception Handling] proposal is still supported, and turned on by
255+
the newly added `-wasm-use-legacy-eh` option. Given that major web browsers
256+
still default to the legacy EH proposal, this option is turned on by default
257+
for the moment.
258+
253259
[Bulk Memory Operations]: https://github.com/WebAssembly/bulk-memory-operations/blob/master/proposals/bulk-memory-operations/Overview.md
254260
[Non-trapping float-to-int Conversions]: https://github.com/WebAssembly/spec/blob/master/proposals/nontrapping-float-to-int-conversion/Overview.md
261+
[Exception Handling]: https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md
262+
[legacy Exception Handling]: https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/legacy/Exceptions.md
255263
[widely implemented in engines]: https://webassembly.org/features/
256264
[here]: https://github.com/WebAssembly/tool-conventions/blob/main/Lime.md#lime1
257265

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@ cl::opt<bool>
5454
// setjmp/longjmp handling using wasm EH instrutions
5555
cl::opt<bool> WebAssembly::WasmEnableSjLj(
5656
"wasm-enable-sjlj", cl::desc("WebAssembly setjmp/longjmp handling"));
57-
// Whether we use the new exnref Wasm EH proposal adopted on Oct 2023.
58-
// Should be used with -wasm-enable-eh.
59-
// Currently set to false by default, but will later change to true and then
60-
// later can be removed after the legacy WAsm EH instructions are removed.
61-
cl::opt<bool> WebAssembly::WasmEnableExnref(
62-
"wasm-enable-exnref", cl::desc("WebAssembly exception handling (exnref)"),
63-
cl::init(false));
57+
// If true, use the legacy Wasm EH proposal:
58+
// https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/legacy/Exceptions.md
59+
// And if false, use the standardized Wasm EH proposal:
60+
// https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md
61+
// Currently set to true by default because not all major web browsers turn on
62+
// the new standard proposal by default, but will later change to false.
63+
cl::opt<bool> WebAssembly::WasmUseLegacyEH(
64+
"wasm-use-legacy-eh", cl::desc("WebAssembly exception handling (legacy)"),
65+
cl::init(true));
6466

6567
static MCAsmInfo *createMCAsmInfo(const MCRegisterInfo & /*MRI*/,
6668
const Triple &TT,

llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extern cl::opt<bool> WasmEnableEmEH; // asm.js-style EH
4444
extern cl::opt<bool> WasmEnableEmSjLj; // asm.js-style SjLJ
4545
extern cl::opt<bool> WasmEnableEH; // EH using Wasm EH instructions
4646
extern cl::opt<bool> WasmEnableSjLj; // SjLj using Wasm EH instructions
47-
extern cl::opt<bool> WasmEnableExnref; // EH using new Wasm EH (exnref)
47+
extern cl::opt<bool> WasmUseLegacyEH; // Legacy Wasm EH
4848

4949
enum OperandType {
5050
/// Basic block label in a branch construct.

llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ bool WebAssemblyCFGStackify::fixCallUnwindMismatches(MachineFunction &MF) {
19421942

19431943
// When end_loop is before end_try_table within the same BB in unwind
19441944
// destinations, we should split the end_loop into another BB.
1945-
if (WebAssembly::WasmEnableExnref)
1945+
if (!WebAssembly::WasmUseLegacyEH)
19461946
for (auto &[UnwindDest, _] : UnwindDestToTryRanges)
19471947
splitEndLoopBB(UnwindDest);
19481948

@@ -1975,10 +1975,10 @@ bool WebAssemblyCFGStackify::fixCallUnwindMismatches(MachineFunction &MF) {
19751975
MBB->removeSuccessor(EHPad);
19761976
}
19771977

1978-
if (WebAssembly::WasmEnableExnref)
1979-
addNestedTryTable(RangeBegin, RangeEnd, UnwindDest);
1980-
else
1978+
if (WebAssembly::WasmUseLegacyEH)
19811979
addNestedTryDelegate(RangeBegin, RangeEnd, UnwindDest);
1980+
else
1981+
addNestedTryTable(RangeBegin, RangeEnd, UnwindDest);
19821982
}
19831983
}
19841984

@@ -2188,15 +2188,15 @@ bool WebAssemblyCFGStackify::fixCatchUnwindMismatches(MachineFunction &MF) {
21882188
for (auto &[EHPad, UnwindDest] : EHPadToUnwindDest) {
21892189
MachineInstr *Try = EHPadToTry[EHPad];
21902190
MachineInstr *EndTry = BeginToEnd[Try];
2191-
if (WebAssembly::WasmEnableExnref) {
2192-
addNestedTryTable(Try, EndTry, UnwindDest);
2193-
} else {
2191+
if (WebAssembly::WasmUseLegacyEH) {
21942192
addNestedTryDelegate(Try, EndTry, UnwindDest);
21952193
NewEndTryBBs.insert(EndTry->getParent());
2194+
} else {
2195+
addNestedTryTable(Try, EndTry, UnwindDest);
21962196
}
21972197
}
21982198

2199-
if (WebAssembly::WasmEnableExnref)
2199+
if (!WebAssembly::WasmUseLegacyEH)
22002200
return true;
22012201

22022202
// Adding a try-delegate wrapping an existing try-catch-end can make existing
@@ -2387,10 +2387,10 @@ void WebAssemblyCFGStackify::placeMarkers(MachineFunction &MF) {
23872387
// Place the TRY/TRY_TABLE for MBB if MBB is the EH pad of an exception.
23882388
if (MCAI->getExceptionHandlingType() == ExceptionHandling::Wasm &&
23892389
MF.getFunction().hasPersonalityFn()) {
2390-
if (WebAssembly::WasmEnableExnref)
2391-
placeTryTableMarker(MBB);
2392-
else
2390+
if (WebAssembly::WasmUseLegacyEH)
23932391
placeTryMarker(MBB);
2392+
else
2393+
placeTryTableMarker(MBB);
23942394
}
23952395
} else {
23962396
// Place the BLOCK for MBB if MBB is branched to from above.
@@ -2576,7 +2576,7 @@ bool WebAssemblyCFGStackify::runOnMachineFunction(MachineFunction &MF) {
25762576

25772577
// Remove unnecessary instructions possibly introduced by try/end_trys.
25782578
if (MCAI->getExceptionHandlingType() == ExceptionHandling::Wasm &&
2579-
MF.getFunction().hasPersonalityFn() && !WebAssembly::WasmEnableExnref)
2579+
MF.getFunction().hasPersonalityFn() && WebAssembly::WasmUseLegacyEH)
25802580
removeUnnecessaryInstrs(MF);
25812581

25822582
// Convert MBB operands in terminators to relative depth immediates.

llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ void WebAssemblyDAGToDAGISel::Select(SDNode *Node) {
210210
case Intrinsic::wasm_catch: {
211211
int Tag = Node->getConstantOperandVal(2);
212212
SDValue SymNode = getTagSymNode(Tag, CurDAG);
213-
unsigned CatchOpcode = WebAssembly::WasmEnableExnref
214-
? WebAssembly::CATCH
215-
: WebAssembly::CATCH_LEGACY;
213+
unsigned CatchOpcode = WebAssembly::WasmUseLegacyEH
214+
? WebAssembly::CATCH_LEGACY
215+
: WebAssembly::CATCH;
216216
MachineSDNode *Catch =
217217
CurDAG->getMachineNode(CatchOpcode, DL,
218218
{

llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ bool WebAssemblyLateEHPrepare::runOnMachineFunction(MachineFunction &MF) {
128128
Changed |= hoistCatches(MF);
129129
Changed |= addCatchAlls(MF);
130130
Changed |= replaceFuncletReturns(MF);
131-
if (WebAssembly::WasmEnableExnref)
131+
if (!WebAssembly::WasmUseLegacyEH)
132132
Changed |= addCatchRefsAndThrowRefs(MF);
133133
}
134134
Changed |= removeUnnecessaryUnreachables(MF);
@@ -217,9 +217,9 @@ bool WebAssemblyLateEHPrepare::addCatchAlls(MachineFunction &MF) {
217217
if (InsertPos == MBB.end() ||
218218
!WebAssembly::isCatch(InsertPos->getOpcode())) {
219219
Changed = true;
220-
unsigned CatchAllOpcode = WebAssembly::WasmEnableExnref
221-
? WebAssembly::CATCH_ALL
222-
: WebAssembly::CATCH_ALL_LEGACY;
220+
unsigned CatchAllOpcode = WebAssembly::WasmUseLegacyEH
221+
? WebAssembly::CATCH_ALL_LEGACY
222+
: WebAssembly::CATCH_ALL;
223223
BuildMI(MBB, InsertPos,
224224
InsertPos == MBB.end() ? DebugLoc() : InsertPos->getDebugLoc(),
225225
TII.get(CatchAllOpcode));

llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ FunctionPass *WebAssemblyPassConfig::createTargetRegisterAllocator(bool) {
400400
using WebAssembly::WasmEnableEH;
401401
using WebAssembly::WasmEnableEmEH;
402402
using WebAssembly::WasmEnableEmSjLj;
403-
using WebAssembly::WasmEnableExnref;
404403
using WebAssembly::WasmEnableSjLj;
404+
using WebAssembly::WasmUseLegacyEH;
405405

406406
static void basicCheckForEHAndSjLj(TargetMachine *TM) {
407407

@@ -417,9 +417,6 @@ static void basicCheckForEHAndSjLj(TargetMachine *TM) {
417417
if (WasmEnableEmEH && WasmEnableSjLj)
418418
report_fatal_error(
419419
"-enable-emscripten-cxx-exceptions not allowed with -wasm-enable-sjlj");
420-
if (WasmEnableExnref && !WasmEnableEH)
421-
report_fatal_error(
422-
"-wasm-enable-exnref should be used with -wasm-enable-eh");
423420

424421
// Here we make sure TargetOptions.ExceptionModel is the same as
425422
// MCAsmInfo.ExceptionsType. Normally these have to be the same, because clang

llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; REQUIRES: asserts
2-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling,bulk-memory | FileCheck %s
3-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling,bulk-memory
4-
; RUN: llc < %s -O0 -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt | FileCheck %s --check-prefix=NOOPT
5-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort -stats 2>&1 | FileCheck %s --check-prefix=NOSORT
6-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort | FileCheck %s --check-prefix=NOSORT-LOCALS
2+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling,bulk-memory | FileCheck %s
3+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling,bulk-memory
4+
; RUN: llc < %s -O0 -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt | FileCheck %s --check-prefix=NOOPT
5+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort -stats 2>&1 | FileCheck %s --check-prefix=NOSORT
6+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort | FileCheck %s --check-prefix=NOSORT-LOCALS
77

88
target triple = "wasm32-unknown-unknown"
99

llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RUN: llc -mtriple=wasm32-unknown-unknown -exception-model=wasm -mattr=+exception-handling -run-pass wasm-cfg-stackify %s -o - | FileCheck %s
1+
# RUN: llc -mtriple=wasm32-unknown-unknown -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling -run-pass wasm-cfg-stackify %s -o - | FileCheck %s
22

33
--- |
44
target triple = "wasm32-unknown-unknown"

llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
; REQUIRES: asserts
2-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-enable-exnref -exception-model=wasm -mattr=+exception-handling,bulk-memory | FileCheck %s
3-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-enable-exnref -exception-model=wasm -mattr=+exception-handling,bulk-memory
4-
; RUN: llc < %s -O0 -disable-wasm-fallthrough-return-opt -verify-machineinstrs -wasm-enable-eh -wasm-enable-exnref -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt | FileCheck %s --check-prefix=NOOPT
5-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-enable-exnref -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort -stats 2>&1 | FileCheck %s --check-prefix=NOSORT
6-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-enable-exnref -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort | FileCheck %s --check-prefix=NOSORT-LOCALS
2+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling,bulk-memory | FileCheck %s
3+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling,bulk-memory
4+
; RUN: llc < %s -O0 -disable-wasm-fallthrough-return-opt -verify-machineinstrs -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt | FileCheck %s --check-prefix=NOOPT
5+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort -stats 2>&1 | FileCheck %s --check-prefix=NOSORT
6+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling,-bulk-memory,-bulk-memory-opt -wasm-disable-ehpad-sort | FileCheck %s --check-prefix=NOSORT-LOCALS
77

88
target triple = "wasm32-unknown-unknown"
99

llvm/test/CodeGen/WebAssembly/eh-option-errors.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ target triple = "wasm32-unknown-unknown"
99
; RUN: not --crash llc < %s -enable-emscripten-cxx-exceptions -wasm-enable-sjlj 2>&1 | FileCheck %s --check-prefix=EM_EH_W_WASM_SJLJ
1010
; EM_EH_W_WASM_SJLJ: LLVM ERROR: -enable-emscripten-cxx-exceptions not allowed with -wasm-enable-sjlj
1111

12-
; RUN: not --crash llc < %s -wasm-enable-exnref 2>&1 | FileCheck %s --check-prefix=WASM_EXNREF_ONLY
13-
; WASM_EXNREF_ONLY: LLVM ERROR: -wasm-enable-exnref should be used with -wasm-enable-eh
14-
1512
; RUN: not --crash llc < %s -wasm-enable-eh -exception-model=dwarf 2>&1 | FileCheck %s --check-prefix=EH_MODEL_DWARF
1613
; EH_MODEL_DWARF: LLVM ERROR: -exception-model should be either 'none' or 'wasm'
1714

llvm/test/CodeGen/WebAssembly/exception-legacy.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs | FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s
2-
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs -O0
3-
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling
1+
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs | FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s
2+
; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs -O0
3+
; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-keep-registers -wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling
44

55
target triple = "wasm32-unknown-unknown"
66

llvm/test/CodeGen/WebAssembly/exception-legacy.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# RUN: llc -mtriple=wasm32-unknown-unknown -exception-model=wasm -mattr=+exception-handling -run-pass wasm-late-eh-prepare -run-pass wasm-cfg-stackify %s -o - | FileCheck %s
1+
# RUN: llc -mtriple=wasm32-unknown-unknown -wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling -run-pass wasm-late-eh-prepare -run-pass wasm-cfg-stackify %s -o - | FileCheck %s
22

33
--- |
44
target triple = "wasm32-unknown-unknown"

llvm/test/CodeGen/WebAssembly/exception.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
; RUN: llc < %s -asm-verbose=false -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -wasm-enable-exnref -verify-machineinstrs | FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s
2-
; RUN: llc < %s -asm-verbose=false -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -wasm-enable-exnref -verify-machineinstrs -O0
3-
; RUN: llc < %s -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -wasm-enable-exnref
4-
; RUN: llc < %s -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -wasm-enable-exnref -filetype=obj
1+
; RUN: llc < %s -asm-verbose=false -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs | FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s
2+
; RUN: llc < %s -asm-verbose=false -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling -verify-machineinstrs -O0
3+
; RUN: llc < %s -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling
4+
; RUN: llc < %s -wasm-enable-eh -wasm-use-legacy-eh=false -exception-model=wasm -mattr=+exception-handling -filetype=obj
55

66
target triple = "wasm32-unknown-unknown"
77

0 commit comments

Comments
 (0)