https://github.com/arsenm created 
https://github.com/llvm/llvm-project/pull/224313

The -wasm-enable-eh backend flag was redundant with -exception-model=wasm:
every caller paired the two, and the model already carries the intent.

Co-authored-by: Claude (Claude-Opus-4.8) <[email protected]>

>From 8947724cfba05e97261ba5a97f172166f3302fed Mon Sep 17 00:00:00 2001
From: Matt Arsenault <[email protected]>
Date: Thu, 17 Sep 2026 15:30:45 +0200
Subject: [PATCH] WebAssembly: Remove -wasm-enable-eh cl::opt in favor of
 -exception-model=wasm

The -wasm-enable-eh backend flag was redundant with -exception-model=wasm:
every caller paired the two, and the model already carries the intent.

Co-authored-by: Claude (Claude-Opus-4.8) <[email protected]>
---
 clang/lib/Driver/ToolChains/WebAssembly.cpp   |  6 +----
 .../WebAssembly/exception-model-flag.c        | 16 ------------
 ...asm-exception-model-flag-parse-ir-input.ll |  2 +-
 clang/test/CodeGen/exception-model-flag.c     |  8 ++++++
 clang/test/CodeGenCXX/builtins-eh-wasm.cpp    |  2 +-
 clang/test/CodeGenCXX/wasm-eh.cpp             | 12 ++++-----
 clang/test/CodeGenObjC/wasm32-eh-arc.m        |  2 +-
 clang/test/CodeGenObjC/wasm32-eh.m            |  2 +-
 clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm  |  2 +-
 clang/test/Driver/wasm-toolchain.c            |  4 +--
 .../WebAssemblyCodeGenPassBuilder.cpp         |  5 ++--
 .../WebAssembly/WebAssemblyTargetMachine.cpp  | 26 ++++---------------
 .../WebAssembly/WebAssemblyTargetMachine.h    |  1 -
 .../WebAssembly/cfg-stackify-eh-legacy.ll     | 10 +++----
 .../WebAssembly/cfg-stackify-eh-legacy.mir    |  2 +-
 .../CodeGen/WebAssembly/cfg-stackify-eh.ll    | 10 +++----
 llvm/test/CodeGen/WebAssembly/eh-lsda.ll      | 12 ++++-----
 .../CodeGen/WebAssembly/eh-option-errors.ll   |  8 +-----
 .../CodeGen/WebAssembly/exception-legacy.ll   |  6 ++---
 .../CodeGen/WebAssembly/exception-legacy.mir  |  2 +-
 llvm/test/CodeGen/WebAssembly/exception.ll    | 10 +++----
 .../WebAssembly/lower-wasm-ehsjlj-phi.ll      |  2 +-
 .../CodeGen/WebAssembly/lower-wasm-ehsjlj.ll  |  4 +--
 .../test/CodeGen/WebAssembly/null-streamer.ll |  4 +--
 .../WebAssembly/wasm-eh-em-sjlj-error.ll      |  2 +-
 .../wasm-eh-invalid-personality.ll            |  2 +-
 .../CodeGen/WebAssembly/wasm-eh-prepare.ll    |  2 +-
 .../wasm-eh-sjlj-setjmp-within-catch.ll       |  2 +-
 28 files changed, 65 insertions(+), 101 deletions(-)
 delete mode 100644 clang/test/CodeGen/WebAssembly/exception-model-flag.c

diff --git a/clang/lib/Driver/ToolChains/WebAssembly.cpp 
b/clang/lib/Driver/ToolChains/WebAssembly.cpp
index b28154772f9f9..4487798b85fcc 100644
--- a/clang/lib/Driver/ToolChains/WebAssembly.cpp
+++ b/clang/lib/Driver/ToolChains/WebAssembly.cpp
@@ -456,9 +456,6 @@ void WebAssembly::addClangTargetOptions(const ArgList 
&DriverArgs,
   if (DriverArgs.getLastArg(options::OPT_fwasm_exceptions)) {
     BanIncompatibleOptionsForWasmEHSjLj("-fwasm-exceptions");
     EnableFeaturesForWasmEHSjLj();
-    // Backend needs -wasm-enable-eh to enable Wasm EH
-    CC1Args.push_back("-mllvm");
-    CC1Args.push_back("-wasm-enable-eh");
   }
 
   for (const Arg *A : DriverArgs.filtered(options::OPT_mllvm)) {
@@ -483,8 +480,7 @@ void WebAssembly::addClangTargetOptions(const ArgList 
&DriverArgs,
       }
     }
 
-    for (const auto *Option :
-         {"-wasm-enable-eh", "-wasm-enable-sjlj", "-wasm-use-legacy-eh"}) {
+    for (const auto *Option : {"-wasm-enable-sjlj", "-wasm-use-legacy-eh"}) {
       if (Opt.starts_with(Option)) {
         BanIncompatibleOptionsForWasmEHSjLj(Option);
         EnableFeaturesForWasmEHSjLj();
diff --git a/clang/test/CodeGen/WebAssembly/exception-model-flag.c 
b/clang/test/CodeGen/WebAssembly/exception-model-flag.c
deleted file mode 100644
index 35b56db409b0b..0000000000000
--- a/clang/test/CodeGen/WebAssembly/exception-model-flag.c
+++ /dev/null
@@ -1,16 +0,0 @@
-// REQUIRES: webassembly-registered-target
-
-// Verify clang records the "exception-model" module flag for the WebAssembly
-// exception models. The target-independent models are covered in
-// exception-model-flag.c.
-
-// Wasm EH (needs the backend enable flag) records the "wasm" model.
-// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions 
-exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm %s -o - | FileCheck %s 
--check-prefix=WASM
-
-// Emscripten EH records the "emscripten" model.
-// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fexceptions 
-exception-model=emscripten -emit-llvm %s -o - | FileCheck %s 
--check-prefix=EMSCRIPTEN
-
-void f(void) {}
-
-// WASM: !{i32 1, !"exception-model", !"wasm"}
-// EMSCRIPTEN: !{i32 1, !"exception-model", !"emscripten"}
diff --git 
a/clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll 
b/clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll
index 8263c98670aab..1410de231660a 100644
--- a/clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll
+++ b/clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll
@@ -2,7 +2,7 @@
 
 ; Check all the options parse
 ; RUN: %clang_cc1 -triple wasm32 -o - -emit-llvm -exception-model=none %s | 
FileCheck %s
-; RUN: %clang_cc1 -triple wasm32 -o - -emit-llvm -exception-model=wasm -mllvm 
-wasm-enable-eh %s | FileCheck %s
+; RUN: %clang_cc1 -triple wasm32 -o - -emit-llvm -exception-model=wasm %s | 
FileCheck %s
 
 ; RUN: not %clang_cc1 -triple wasm32 -o - -emit-llvm -exception-model=invalid 
%s 2>&1 | FileCheck -check-prefix=ERR %s
 ; RUN: not %clang_cc1 -triple wasm32 -o - -emit-llvm -exception-model=dwarf %s 
2>&1 | FileCheck -check-prefix=ERR-BE %s
diff --git a/clang/test/CodeGen/exception-model-flag.c 
b/clang/test/CodeGen/exception-model-flag.c
index f9713d88df592..797a9965ab5f4 100644
--- a/clang/test/CodeGen/exception-model-flag.c
+++ b/clang/test/CodeGen/exception-model-flag.c
@@ -13,6 +13,12 @@
 // SEH maps to the "wineh" spelling regardless of the requesting triple.
 // RUN: %clang_cc1 -triple i686-unknown-windows-gnu -fexceptions 
-exception-model=seh -emit-llvm %s -o - | FileCheck %s --check-prefix=WINEH
 
+// Wasm EH records the "wasm" model.
+// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions 
-exception-model=wasm -emit-llvm %s -o - | FileCheck %s --check-prefix=WASM
+
+// Emscripten EH records the "emscripten" model.
+// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fexceptions 
-exception-model=emscripten -emit-llvm %s -o - | FileCheck %s 
--check-prefix=EMSCRIPTEN
+
 // A requested model that matches the target default is still recorded, so that
 // the flag's absence always means "unspecified".
 // RUN: %clang_cc1 -triple i686-unknown-linux-gnu -fexceptions 
-exception-model=dwarf -emit-llvm %s -o - | FileCheck %s --check-prefix=DWARF
@@ -30,6 +36,8 @@ void f(void) {}
 
 // SJLJ: !{i32 1, !"exception-model", !"sjlj"}
 // WINEH: !{i32 1, !"exception-model", !"wineh"}
+// WASM: !{i32 1, !"exception-model", !"wasm"}
+// EMSCRIPTEN: !{i32 1, !"exception-model", !"emscripten"}
 // DWARF: !{i32 1, !"exception-model", !"dwarf"}
 // NONE: !{i32 1, !"exception-model", !"none"}
 // UNSPEC-NOT: "exception-model"
diff --git a/clang/test/CodeGenCXX/builtins-eh-wasm.cpp 
b/clang/test/CodeGenCXX/builtins-eh-wasm.cpp
index b3a6ffc92e11b..dfb0116e19428 100644
--- a/clang/test/CodeGenCXX/builtins-eh-wasm.cpp
+++ b/clang/test/CodeGenCXX/builtins-eh-wasm.cpp
@@ -1,5 +1,5 @@
 // REQUIRES: webassembly-registered-target
-// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions 
-fcxx-exceptions -target-feature +reference-types -target-feature 
+exception-handling -target-feature +multivalue -mllvm -wasm-enable-eh 
-exception-model=wasm -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple wasm32-unknown-unknown -fexceptions 
-fcxx-exceptions -target-feature +reference-types -target-feature 
+exception-handling -target-feature +multivalue -exception-model=wasm 
-emit-llvm -o - %s | FileCheck %s
 
 // Check if __builtin_wasm_throw and __builtin_wasm_rethrow are correctly
 // invoked when placed in try-catch.
diff --git a/clang/test/CodeGenCXX/wasm-eh.cpp 
b/clang/test/CodeGenCXX/wasm-eh.cpp
index 0b87107e476c7..a6dd939be733e 100644
--- a/clang/test/CodeGenCXX/wasm-eh.cpp
+++ b/clang/test/CodeGenCXX/wasm-eh.cpp
@@ -3,8 +3,8 @@
 // RUN: %clang -E -dM %s -target wasm32-unknown-unknown -fwasm-exceptions | 
FileCheck %s -check-prefix PREPROCESSOR
 // PREPROCESSOR: #define __WASM_EXCEPTIONS__ 1
 
-// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -mllvm -wasm-enable-eh -exception-model=wasm 
-target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
-// RUN: %clang_cc1 %s -triple wasm64-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -mllvm -wasm-enable-eh -exception-model=wasm 
-target-feature +exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -exception-model=wasm -target-feature 
+exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
+// RUN: %clang_cc1 %s -triple wasm64-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -exception-model=wasm -target-feature 
+exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
 
 // Test code generation for Wasm EH using WebAssembly EH proposal.
 // 
(https://github.com/WebAssembly/exception-handling/blob/main/proposals/exception-handling/Exceptions.md)
@@ -421,9 +421,9 @@ int tls_wrapper_within_funclet() {
 // CHECK-NEXT:  call void @_ZSt9terminatev()
 
 
-// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -mllvm -wasm-enable-eh -exception-model=wasm 
-target-feature +exception-handling -emit-llvm -o - -std=c++11 2>&1 | FileCheck 
%s --check-prefix=WARNING-DEFAULT
-// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -mllvm -wasm-enable-eh -exception-model=wasm 
-target-feature +exception-handling -Wwasm-exception-spec -emit-llvm -o - 
-std=c++11 2>&1 | FileCheck %s --check-prefix=WARNING-ON
-// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -mllvm -wasm-enable-eh -exception-model=wasm 
-target-feature +exception-handling -Wno-wasm-exception-spec -emit-llvm -o - 
-std=c++11 2>&1 | FileCheck %s --check-prefix=WARNING-OFF
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -exception-model=wasm -target-feature 
+exception-handling -emit-llvm -o - -std=c++11 2>&1 | FileCheck %s 
--check-prefix=WARNING-DEFAULT
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -exception-model=wasm -target-feature 
+exception-handling -Wwasm-exception-spec -emit-llvm -o - -std=c++11 2>&1 | 
FileCheck %s --check-prefix=WARNING-ON
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -exception-model=wasm -target-feature 
+exception-handling -Wno-wasm-exception-spec -emit-llvm -o - -std=c++11 2>&1 | 
FileCheck %s --check-prefix=WARNING-OFF
 // RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fexceptions 
-fcxx-exceptions -emit-llvm -o - -std=c++11 2>&1 | FileCheck %s 
--check-prefix=EM-EH-WARNING
 
 // Wasm EH ignores dynamic exception specifications with types at the moment.
@@ -448,7 +448,7 @@ void exception_spec_throw_empty() throw() {
 // Here we only check if the command enables wasm exception handling in the
 // backend so that exception handling instructions can be generated in .s file.
 
-// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -mllvm -wasm-enable-eh -exception-model=wasm 
-target-feature +exception-handling -S -o - -std=c++11 | FileCheck %s 
--check-prefix=ASSEMBLY
+// RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -exception-model=wasm -target-feature 
+exception-handling -S -o - -std=c++11 | FileCheck %s --check-prefix=ASSEMBLY
 
 // ASSEMBLY: try
 // ASSEMBLY: catch
diff --git a/clang/test/CodeGenObjC/wasm32-eh-arc.m 
b/clang/test/CodeGenObjC/wasm32-eh-arc.m
index 3d78d633953c6..021084906eccb 100644
--- a/clang/test/CodeGenObjC/wasm32-eh-arc.m
+++ b/clang/test/CodeGenObjC/wasm32-eh-arc.m
@@ -1,5 +1,5 @@
 // REQUIRES: webassembly-registered-target
-// RUN: %clang_cc1 -triple wasm32-unknown-emscripten 
-fobjc-runtime=gnustep-2.2 -fobjc-arc -fexceptions -fobjc-exceptions 
-exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm -o - %s | FileCheck 
--enable-var-scope %s
+// RUN: %clang_cc1 -triple wasm32-unknown-emscripten 
-fobjc-runtime=gnustep-2.2 -fobjc-arc -fexceptions -fobjc-exceptions 
-exception-model=wasm -emit-llvm -o - %s | FileCheck --enable-var-scope %s
 __attribute__((objc_root_class)) @interface Object @end
 extern void mayThrowObjC();
 
diff --git a/clang/test/CodeGenObjC/wasm32-eh.m 
b/clang/test/CodeGenObjC/wasm32-eh.m
index 09062bdea1894..d25f17319b76e 100644
--- a/clang/test/CodeGenObjC/wasm32-eh.m
+++ b/clang/test/CodeGenObjC/wasm32-eh.m
@@ -1,5 +1,5 @@
 // REQUIRES: webassembly-registered-target
-// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fobjc-exceptions 
-fexceptions -exception-model=wasm -mllvm -wasm-enable-eh -emit-llvm 
-fobjc-runtime=gnustep-2.2 -o - %s | FileCheck --enable-var-scope %s
+// RUN: %clang_cc1 -triple wasm32-unknown-emscripten -fobjc-exceptions 
-fexceptions -exception-model=wasm -emit-llvm -fobjc-runtime=gnustep-2.2 -o - 
%s | FileCheck --enable-var-scope %s
 
 __attribute__((objc_root_class)) @interface Object
 @end
diff --git a/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm 
b/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
index 3af09f7055b98..cfc87f4fe5b54 100644
--- a/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
+++ b/clang/test/CodeGenObjCXX/wasm32-eh-objcxx.mm
@@ -1,5 +1,5 @@
 // REQUIRES: webassembly-registered-target
-// RUN: %clang_cc1 -target-feature +exception-handling -triple 
wasm32-unknown-emscripten -fobjc-runtime=gnustep-2.2 -fexceptions 
-fobjc-exceptions -fcxx-exceptions -exception-model=wasm -mllvm -wasm-enable-eh 
-emit-llvm -o - %s | FileCheck --enable-var-scope %s
+// RUN: %clang_cc1 -target-feature +exception-handling -triple 
wasm32-unknown-emscripten -fobjc-runtime=gnustep-2.2 -fexceptions 
-fobjc-exceptions -fcxx-exceptions -exception-model=wasm -emit-llvm -o - %s | 
FileCheck --enable-var-scope %s
 
 struct ThrowingDestructor {
   ~ThrowingDestructor() noexcept(false);
diff --git a/clang/test/Driver/wasm-toolchain.c 
b/clang/test/Driver/wasm-toolchain.c
index 7a36440494f42..e5fadaba174da 100644
--- a/clang/test/Driver/wasm-toolchain.c
+++ b/clang/test/Driver/wasm-toolchain.c
@@ -155,11 +155,11 @@
 // WASM_EXCEPTIONS_FEMSCRIPTEN_EH: invalid argument '-fwasm-exceptions' not 
allowed with '-femscripten-exceptions'
 
 // '-fwasm-exceptions' sets +exception-handling, -multivalue, -reference-types,
-// "-exception-model=wasm", and '-mllvm -wasm-enable-eh'
+// and "-exception-model=wasm"
 // RUN: %clang -### --target=wasm32-unknown-unknown \
 // RUN:    --sysroot=/foo %s -fwasm-exceptions 2>&1 \
 // RUN:  | FileCheck -check-prefix=WASM_EXCEPTIONS %s
-// WASM_EXCEPTIONS: "-cc1" {{.*}} "-target-feature" "+exception-handling" 
"-target-feature" "+multivalue" "-target-feature" "+reference-types" 
"-exception-model=wasm" "-mllvm" "-wasm-enable-eh"
+// WASM_EXCEPTIONS: "-cc1" {{.*}} "-target-feature" "+exception-handling" 
"-target-feature" "+multivalue" "-target-feature" "+reference-types" 
"-exception-model=wasm"
 
 // '-fwasm-exceptions' not allowed with '-mllvm -enable-emscripten-sjlj'
 // RUN: not %clang -### --target=wasm32-unknown-unknown \
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp 
b/llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
index c53072764bc82..960f01f1e73a0 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyCodeGenPassBuilder.cpp
@@ -41,13 +41,11 @@ using namespace llvm;
 
 namespace WebAssembly {
 extern cl::opt<bool> WasmDisableExplicitLocals;
-extern cl::opt<bool> WasmEnableEH;
 extern cl::opt<bool> WasmEnableEmSjLj;
 extern cl::opt<bool> WasmEnableSjLj;
 } // namespace WebAssembly
 
 using llvm::WebAssembly::WasmDisableExplicitLocals;
-using llvm::WebAssembly::WasmEnableEH;
 using llvm::WebAssembly::WasmEnableEmSjLj;
 using llvm::WebAssembly::WasmEnableSjLj;
 
@@ -126,7 +124,8 @@ void 
WebAssemblyCodeGenPassBuilder::addIRPasses(PassManagerWrapper &PMW) {
   // passes and Emscripten SjLj handling expects all invokes to be lowered
   // before.
   bool EnableEmEH = TM.Options.ExceptionModel == ExceptionHandling::Emscripten;
-  if (!EnableEmEH && !WasmEnableEH) {
+  bool EnableWasmEH = TM.Options.ExceptionModel == ExceptionHandling::Wasm;
+  if (!EnableEmEH && !EnableWasmEH) {
     addFunctionPass(LowerInvokePass(), PMW);
     // The lower invoke pass may create unreachable code. Remove it in order 
not
     // to process dead blocks in setjmp/longjmp handling.
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp 
b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
index 3b054f80027c5..6c15b2e3b5864 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
@@ -57,10 +57,6 @@ cl::opt<bool> WebAssembly::WasmEnableEmSjLj(
     "enable-emscripten-sjlj",
     cl::desc("WebAssembly Emscripten-style setjmp/longjmp handling"),
     cl::init(false));
-// Exception handling using wasm EH instructions
-cl::opt<bool>
-    WebAssembly::WasmEnableEH("wasm-enable-eh",
-                              cl::desc("WebAssembly exception handling"));
 // setjmp/longjmp handling using wasm EH instructions
 cl::opt<bool> WebAssembly::WasmEnableSjLj(
     "wasm-enable-sjlj", cl::desc("WebAssembly setjmp/longjmp handling"));
@@ -129,7 +125,6 @@ static Reloc::Model 
getEffectiveRelocModel(std::optional<Reloc::Model> RM) {
 }
 
 using WebAssembly::WasmDisableExplicitLocals;
-using WebAssembly::WasmEnableEH;
 using WebAssembly::WasmEnableEmSjLj;
 using WebAssembly::WasmEnableSjLj;
 
@@ -137,10 +132,6 @@ static void basicCheckForEHAndSjLj(TargetMachine *TM) {
 
   bool EnableEmEH = TM->Options.ExceptionModel == 
ExceptionHandling::Emscripten;
 
-  // You can't enable two modes of EH at the same time
-  if (EnableEmEH && WasmEnableEH)
-    report_fatal_error(
-        "-exception-model=emscripten not allowed with -wasm-enable-eh");
   // You can't enable two modes of SjLj at the same time
   if (WasmEnableEmSjLj && WasmEnableSjLj)
     report_fatal_error(
@@ -151,9 +142,9 @@ static void basicCheckForEHAndSjLj(TargetMachine *TM) {
         "-exception-model=emscripten not allowed with -wasm-enable-sjlj");
 
   if (TM->Options.ExceptionModel == ExceptionHandling::Default) {
-    // FIXME: These flags should be removed in favor of directly using the
-    // generically configured ExceptionsType
-    if (WebAssembly::WasmEnableEH || WebAssembly::WasmEnableSjLj)
+    // FIXME: This flag should be removed in favor of directly using the
+    // generically configured ExceptionsType.
+    if (WebAssembly::WasmEnableSjLj)
       TM->Options.ExceptionModel = ExceptionHandling::Wasm;
   }
 
@@ -164,17 +155,9 @@ static void basicCheckForEHAndSjLj(TargetMachine *TM) {
       TM->Options.ExceptionModel != ExceptionHandling::Emscripten)
     report_fatal_error(
         "-exception-model should be either 'none', 'wasm', or 'emscripten'");
-  if (WasmEnableEH && TM->Options.ExceptionModel != ExceptionHandling::Wasm)
-    report_fatal_error(
-        "-wasm-enable-eh only allowed with -exception-model=wasm");
   if (WasmEnableSjLj && TM->Options.ExceptionModel != ExceptionHandling::Wasm)
     report_fatal_error(
         "-wasm-enable-sjlj only allowed with -exception-model=wasm");
-  if ((!WasmEnableEH && !WasmEnableSjLj) &&
-      TM->Options.ExceptionModel == ExceptionHandling::Wasm)
-    report_fatal_error(
-        "-exception-model=wasm only allowed with at least one of "
-        "-wasm-enable-eh or -wasm-enable-sjlj");
 
   // Currently it is allowed to mix Wasm EH with Emscripten SjLj as an interim
   // measure, but some code will error out at compile time in this combination.
@@ -334,7 +317,8 @@ void WebAssemblyPassConfig::addIRPasses() {
   // passes and Emscripten SjLj handling expects all invokes to be lowered
   // before.
   bool EnableEmEH = TM->Options.ExceptionModel == 
ExceptionHandling::Emscripten;
-  if (!EnableEmEH && !WasmEnableEH) {
+  bool EnableWasmEH = TM->Options.ExceptionModel == ExceptionHandling::Wasm;
+  if (!EnableEmEH && !EnableWasmEH) {
     addPass(createLowerInvokePass());
     // The lower invoke pass may create unreachable code. Remove it in order 
not
     // to process dead blocks in setjmp/longjmp handling.
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h 
b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
index cff4d345b8516..a7ff3f4afa9b7 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
@@ -25,7 +25,6 @@ namespace WebAssembly {
 // Exception handling / setjmp-longjmp handling command-line options
 extern cl::opt<bool> WasmDisableExplicitLocals;
 extern cl::opt<bool> WasmEnableEmSjLj; // asm.js-style SjLJ
-extern cl::opt<bool> WasmEnableEH;     // EH using Wasm EH instructions
 extern cl::opt<bool> WasmEnableSjLj;   // SjLj using Wasm EH instructions
 extern cl::opt<bool> WasmUseLegacyEH;  // Legacy Wasm EH
 } // namespace WebAssembly
diff --git a/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.ll 
b/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.ll
index b3bf255b2391e..7b7827a71d47d 100644
--- a/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.ll
+++ b/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.ll
@@ -1,9 +1,9 @@
 ; REQUIRES: asserts
-; 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
-; 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
-; 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
-; 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
-; 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
+; 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-use-legacy-eh -exception-model=wasm 
-mattr=+exception-handling,bulk-memory | FileCheck %s
+; 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-use-legacy-eh -exception-model=wasm -mattr=+exception-handling,bulk-memory
+; RUN: llc < %s -O0 -disable-wasm-fallthrough-return-opt 
-wasm-disable-explicit-locals -wasm-keep-registers -verify-machineinstrs 
-wasm-use-legacy-eh -exception-model=wasm 
-mattr=+exception-handling,-bulk-memory,-bulk-memory-opt | FileCheck %s 
--check-prefix=NOOPT
+; 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-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
+; 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-use-legacy-eh -exception-model=wasm 
-mattr=+exception-handling,-bulk-memory,-bulk-memory-opt 
-wasm-disable-ehpad-sort | FileCheck %s --check-prefix=NOSORT-LOCALS
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir 
b/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir
index ecf55e7bde413..18ee0bdf69b9a 100644
--- a/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir
+++ b/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=wasm32-unknown-unknown -wasm-use-legacy-eh -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling -run-pass wasm-cfg-stackify %s 
-o - | FileCheck %s
+# 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
 
 --- |
   target triple = "wasm32-unknown-unknown"
diff --git a/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll 
b/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
index 6400b833da982..c3c4cfd9cc61d 100644
--- a/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
+++ b/llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
@@ -1,9 +1,9 @@
 ; REQUIRES: asserts
-; 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
-; 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
-; 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
-; 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
-; 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
+; 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-use-legacy-eh=false -exception-model=wasm 
-mattr=+exception-handling,bulk-memory | FileCheck %s
+; 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-use-legacy-eh=false -exception-model=wasm 
-mattr=+exception-handling,bulk-memory
+; RUN: llc < %s -O0 -disable-wasm-fallthrough-return-opt -verify-machineinstrs 
-wasm-use-legacy-eh=false -exception-model=wasm 
-mattr=+exception-handling,-bulk-memory,-bulk-memory-opt | FileCheck %s 
--check-prefix=NOOPT
+; 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-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
+; 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-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
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/eh-lsda.ll 
b/llvm/test/CodeGen/WebAssembly/eh-lsda.ll
index 1f8fe2cdd8944..517de9c307b49 100644
--- a/llvm/test/CodeGen/WebAssembly/eh-lsda.ll
+++ b/llvm/test/CodeGen/WebAssembly/eh-lsda.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s --mtriple=wasm32-unknown-unknown -wasm-disable-explicit-locals 
-wasm-keep-registers -wasm-enable-eh -exception-model=wasm 
-mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32
-; RUN: llc < %s --mtriple=wasm64-unknown-unknown -wasm-disable-explicit-locals 
-wasm-keep-registers -wasm-enable-eh -exception-model=wasm 
-mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64
-; RUN: llc < %s --mtriple=wasm32-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling | FileCheck %s 
-check-prefixes=CHECK,NOPIC -DPTR=32
-; RUN: llc < %s --mtriple=wasm64-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling | FileCheck %s 
-check-prefixes=CHECK,NOPIC -DPTR=64
-; RUN: llc < %s --mtriple=wasm32-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling -relocation-model=pic | 
FileCheck %s -check-prefixes=CHECK,PIC -DPTR=32
-; RUN: llc < %s --mtriple=wasm64-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling -relocation-model=pic | 
FileCheck %s -check-prefixes=CHECK,PIC -DPTR=64
+; RUN: llc < %s --mtriple=wasm32-unknown-unknown -wasm-disable-explicit-locals 
-wasm-keep-registers -exception-model=wasm -mattr=+exception-handling | 
FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32
+; RUN: llc < %s --mtriple=wasm64-unknown-unknown -wasm-disable-explicit-locals 
-wasm-keep-registers -exception-model=wasm -mattr=+exception-handling | 
FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64
+; RUN: llc < %s --mtriple=wasm32-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -exception-model=wasm 
-mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32
+; RUN: llc < %s --mtriple=wasm64-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -exception-model=wasm 
-mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64
+; RUN: llc < %s --mtriple=wasm32-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -exception-model=wasm 
-mattr=+exception-handling -relocation-model=pic | FileCheck %s 
-check-prefixes=CHECK,PIC -DPTR=32
+; RUN: llc < %s --mtriple=wasm64-unknown-emscripten 
-wasm-disable-explicit-locals -wasm-keep-registers -exception-model=wasm 
-mattr=+exception-handling -relocation-model=pic | FileCheck %s 
-check-prefixes=CHECK,PIC -DPTR=64
 
 @_ZTIi = external constant ptr
 @_ZTIf = external constant ptr
diff --git a/llvm/test/CodeGen/WebAssembly/eh-option-errors.ll 
b/llvm/test/CodeGen/WebAssembly/eh-option-errors.ll
index 010c06a2283d5..b78b2d32918f7 100644
--- a/llvm/test/CodeGen/WebAssembly/eh-option-errors.ll
+++ b/llvm/test/CodeGen/WebAssembly/eh-option-errors.ll
@@ -1,16 +1,10 @@
 target triple = "wasm32-unknown-unknown"
 
-; RUN: not --crash llc < %s -exception-model=emscripten -wasm-enable-eh 2>&1 | 
FileCheck %s --check-prefix=EM_EH_W_WASM_EH
-; EM_EH_W_WASM_EH: LLVM ERROR: -exception-model=emscripten not allowed with 
-wasm-enable-eh
-
 ; RUN: not --crash llc < %s -enable-emscripten-sjlj -wasm-enable-sjlj 2>&1 | 
FileCheck %s --check-prefix=EM_SJLJ_W_WASM_SJLJ
 ; EM_SJLJ_W_WASM_SJLJ: LLVM ERROR: -enable-emscripten-sjlj not allowed with 
-wasm-enable-sjlj
 
 ; RUN: not --crash llc < %s -exception-model=emscripten -wasm-enable-sjlj 2>&1 
| FileCheck %s --check-prefix=EM_EH_W_WASM_SJLJ
 ; EM_EH_W_WASM_SJLJ: LLVM ERROR: -exception-model=emscripten not allowed with 
-wasm-enable-sjlj
 
-; RUN: not --crash llc < %s -wasm-enable-eh -exception-model=dwarf 2>&1 | 
FileCheck %s --check-prefix=EH_MODEL_DWARF
+; RUN: not --crash llc < %s -exception-model=dwarf 2>&1 | FileCheck %s 
--check-prefix=EH_MODEL_DWARF
 ; EH_MODEL_DWARF: LLVM ERROR: -exception-model should be either 'none', 
'wasm', or 'emscripten'
-
-; RUN: not --crash llc < %s -exception-model=wasm 2>&1 | FileCheck %s 
--check-prefix=MODEL_WASM_WO_WASM_EH_SJLJ
-; MODEL_WASM_WO_WASM_EH_SJLJ: LLVM ERROR: -exception-model=wasm only allowed 
with at least one of -wasm-enable-eh or -wasm-enable-sjlj
diff --git a/llvm/test/CodeGen/WebAssembly/exception-legacy.ll 
b/llvm/test/CodeGen/WebAssembly/exception-legacy.ll
index 2c5d918295249..0fa360116baed 100644
--- a/llvm/test/CodeGen/WebAssembly/exception-legacy.ll
+++ b/llvm/test/CodeGen/WebAssembly/exception-legacy.ll
@@ -1,6 +1,6 @@
-; 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
-; 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
-; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-keep-registers 
-wasm-enable-eh -wasm-use-legacy-eh -exception-model=wasm 
-mattr=+exception-handling
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt 
-wasm-disable-explicit-locals -wasm-keep-registers -wasm-use-legacy-eh 
-exception-model=wasm -mattr=+exception-handling -verify-machineinstrs | 
FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt 
-wasm-disable-explicit-locals -wasm-keep-registers -wasm-use-legacy-eh 
-exception-model=wasm -mattr=+exception-handling -verify-machineinstrs -O0
+; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-keep-registers 
-wasm-use-legacy-eh -exception-model=wasm -mattr=+exception-handling
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/exception-legacy.mir 
b/llvm/test/CodeGen/WebAssembly/exception-legacy.mir
index 02731b62f18ac..339a49c15ef6e 100644
--- a/llvm/test/CodeGen/WebAssembly/exception-legacy.mir
+++ b/llvm/test/CodeGen/WebAssembly/exception-legacy.mir
@@ -1,4 +1,4 @@
-# RUN: llc -mtriple=wasm32-unknown-unknown -wasm-use-legacy-eh -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling -run-pass wasm-late-eh-prepare 
-run-pass wasm-cfg-stackify %s -o - | FileCheck %s
+# 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
 
 --- |
   target triple = "wasm32-unknown-unknown"
diff --git a/llvm/test/CodeGen/WebAssembly/exception.ll 
b/llvm/test/CodeGen/WebAssembly/exception.ll
index 808b1926e0be5..e2f44b4e8c263 100644
--- a/llvm/test/CodeGen/WebAssembly/exception.ll
+++ b/llvm/test/CodeGen/WebAssembly/exception.ll
@@ -1,8 +1,8 @@
-; 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
-; RUN: llc < %s -asm-verbose=false -wasm-enable-eh -wasm-use-legacy-eh=false 
-exception-model=wasm -mattr=+exception-handling -verify-machineinstrs -O0
-; RUN: llc < %s -wasm-enable-eh -wasm-use-legacy-eh=false 
-exception-model=wasm -mattr=+exception-handling
-; RUN: llc < %s -wasm-enable-eh -wasm-use-legacy-eh=false 
-exception-model=wasm -mattr=+exception-handling -filetype=obj
-; RUN: llc < %s -mtriple=wasm64-unknown-unknown -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 --check-prefix=WASM64
+; RUN: llc < %s -asm-verbose=false -wasm-use-legacy-eh=false 
-exception-model=wasm -mattr=+exception-handling -verify-machineinstrs | 
FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s
+; RUN: llc < %s -asm-verbose=false -wasm-use-legacy-eh=false 
-exception-model=wasm -mattr=+exception-handling -verify-machineinstrs -O0
+; RUN: llc < %s -wasm-use-legacy-eh=false -exception-model=wasm 
-mattr=+exception-handling
+; RUN: llc < %s -wasm-use-legacy-eh=false -exception-model=wasm 
-mattr=+exception-handling -filetype=obj
+; RUN: llc < %s -mtriple=wasm64-unknown-unknown -wasm-use-legacy-eh=false 
-exception-model=wasm -mattr=+exception-handling -verify-machineinstrs | 
FileCheck --implicit-check-not=ehgcr -allow-deprecated-dag-overlap %s 
--check-prefix=WASM64
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj-phi.ll 
b/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj-phi.ll
index fbe203697e96e..1011bdf61f5c3 100644
--- a/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj-phi.ll
+++ b/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj-phi.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -wasm-lower-em-ehsjlj -wasm-enable-eh -wasm-enable-sjlj 
-mattr=+exception-handling -S | FileCheck %s
+; RUN: opt < %s -wasm-lower-em-ehsjlj -wasm-enable-sjlj 
-mattr=+exception-handling -S | FileCheck %s
 
 target triple = "wasm32-unknown-emscripten"
 
diff --git a/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll 
b/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll
index 9670af3cdd8d3..11c7407df7aff 100644
--- a/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll
+++ b/llvm/test/CodeGen/WebAssembly/lower-wasm-ehsjlj.ll
@@ -1,5 +1,5 @@
-; RUN: opt < %s -wasm-lower-em-ehsjlj -wasm-enable-eh -wasm-enable-sjlj 
-mattr=+exception-handling -S | FileCheck %s
-; RUN: llc < %s -wasm-enable-eh -wasm-enable-sjlj -exception-model=wasm 
-mattr=+exception-handling -verify-machineinstrs
+; RUN: opt < %s -wasm-lower-em-ehsjlj -wasm-enable-sjlj 
-mattr=+exception-handling -S | FileCheck %s
+; RUN: llc < %s -wasm-enable-sjlj -exception-model=wasm 
-mattr=+exception-handling -verify-machineinstrs
 
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
diff --git a/llvm/test/CodeGen/WebAssembly/null-streamer.ll 
b/llvm/test/CodeGen/WebAssembly/null-streamer.ll
index e8396e3ad456a..bc87319515253 100644
--- a/llvm/test/CodeGen/WebAssembly/null-streamer.ll
+++ b/llvm/test/CodeGen/WebAssembly/null-streamer.ll
@@ -1,5 +1,5 @@
-; RUN: llc < %s -O0 -filetype=null -wasm-enable-eh -exception-model=wasm 
-mattr=+exception-handling
-; RUN: llc < %s -O0 -filetype=asm -asm-verbose=false -wasm-enable-eh 
-exception-model=wasm -mattr=+exception-handling | FileCheck %s
+; RUN: llc < %s -O0 -filetype=null -exception-model=wasm 
-mattr=+exception-handling
+; RUN: llc < %s -O0 -filetype=asm -asm-verbose=false -exception-model=wasm 
-mattr=+exception-handling | FileCheck %s
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/wasm-eh-em-sjlj-error.ll 
b/llvm/test/CodeGen/WebAssembly/wasm-eh-em-sjlj-error.ll
index 9ac92f5f0667d..1ed00e73172a9 100644
--- a/llvm/test/CodeGen/WebAssembly/wasm-eh-em-sjlj-error.ll
+++ b/llvm/test/CodeGen/WebAssembly/wasm-eh-em-sjlj-error.ll
@@ -1,4 +1,4 @@
-; RUN: not --crash llc < %s -wasm-enable-eh -enable-emscripten-sjlj 
-exception-model=wasm 2>&1 | FileCheck %s
+; RUN: not --crash llc < %s -enable-emscripten-sjlj -exception-model=wasm 2>&1 
| FileCheck %s
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/wasm-eh-invalid-personality.ll 
b/llvm/test/CodeGen/WebAssembly/wasm-eh-invalid-personality.ll
index 36340c1444525..da2d5e044aa60 100644
--- a/llvm/test/CodeGen/WebAssembly/wasm-eh-invalid-personality.ll
+++ b/llvm/test/CodeGen/WebAssembly/wasm-eh-invalid-personality.ll
@@ -1,4 +1,4 @@
-; RUN: not --crash llc < %s -wasm-enable-eh -exception-model=wasm 
-mattr=+exception-handling 2>&1 | FileCheck %s
+; RUN: not --crash llc < %s -exception-model=wasm -mattr=+exception-handling 
2>&1 | FileCheck %s
 
 target triple = "wasm32-unknown-unknown"
 
diff --git a/llvm/test/CodeGen/WebAssembly/wasm-eh-prepare.ll 
b/llvm/test/CodeGen/WebAssembly/wasm-eh-prepare.ll
index f299b354b18f2..8e9ab3ac6cab0 100644
--- a/llvm/test/CodeGen/WebAssembly/wasm-eh-prepare.ll
+++ b/llvm/test/CodeGen/WebAssembly/wasm-eh-prepare.ll
@@ -2,7 +2,7 @@
 ; RUN: opt < %s -win-eh-prepare -demote-catchswitch-only -wasm-eh-prepare -S 
--mattr=+atomics,+bulk-memory | FileCheck %s
 ; RUN: opt < %s 
-passes='win-eh-prepare<demote-catchswitch-only>,wasm-eh-prepare' -S | 
FileCheck %s
 ; RUN: opt < %s 
-passes='win-eh-prepare<demote-catchswitch-only>,wasm-eh-prepare' -S 
--mattr=+atomics,+bulk-memory | FileCheck %s
-; RUN: llc < %s -wasm-enable-eh -exception-model=wasm 
-mattr=+exception-handling -stop-after=wasm-eh-prepare | FileCheck %s
+; RUN: llc < %s -exception-model=wasm -mattr=+exception-handling 
-stop-after=wasm-eh-prepare | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"
diff --git a/llvm/test/CodeGen/WebAssembly/wasm-eh-sjlj-setjmp-within-catch.ll 
b/llvm/test/CodeGen/WebAssembly/wasm-eh-sjlj-setjmp-within-catch.ll
index e5f373c686d62..5e3940b54ea2a 100644
--- a/llvm/test/CodeGen/WebAssembly/wasm-eh-sjlj-setjmp-within-catch.ll
+++ b/llvm/test/CodeGen/WebAssembly/wasm-eh-sjlj-setjmp-within-catch.ll
@@ -1,4 +1,4 @@
-; RUN: not --crash opt < %s -wasm-lower-em-ehsjlj -wasm-enable-eh 
-wasm-enable-sjlj -mattr=+exception-handling -S 2>&1 | FileCheck %s
+; RUN: not --crash opt < %s -wasm-lower-em-ehsjlj -wasm-enable-sjlj 
-mattr=+exception-handling -S 2>&1 | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
 target triple = "wasm32-unknown-unknown"

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to