[all-commits] [llvm/llvm-project] 9868f9: WebAssembly: Stop changing MCAsmInfo's ExceptionsT...
Matt Arsenault via All-commits
all-commits at lists.llvm.org
Mon Jun 30 05:14:33 PDT 2025
Branch: refs/heads/users/arsenm/webassembly/stop-overwriting-mcasminfo-exceptions-type
Home: https://github.com/llvm/llvm-project
Commit: 9868f97f4e1f71dfbb2c12b3f6a9a0f04f5bd42c
https://github.com/llvm/llvm-project/commit/9868f97f4e1f71dfbb2c12b3f6a9a0f04f5bd42c
Author: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: 2025-06-30 (Mon, 30 Jun 2025)
Changed paths:
M clang/test/CodeGen/WebAssembly/wasm-exception-model-flag-parse-ir-input.ll
M clang/test/CodeGenCXX/builtins-eh-wasm.cpp
M clang/test/CodeGenCXX/wasm-eh.cpp
M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCAsmInfo.cpp
M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.cpp
M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
M llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.h
M llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyMCInstLower.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
M llvm/test/CodeGen/WebAssembly/cfg-stackify-eh-legacy.mir
M llvm/test/CodeGen/WebAssembly/exception-legacy.mir
M llvm/test/CodeGen/WebAssembly/function-info.mir
Log Message:
-----------
WebAssembly: Stop changing MCAsmInfo's ExceptionsType based on flags
Currently wasm adds an extra level of options that work backwards
from the standard options, and overwrites them. The ExceptionModel
field in TM->Options is the standard user configuration option for the
exception model to use. MCAsmInfo's ExceptionsType is a constant for the
default to use for the triple if not explicitly set in the TargetOptions
ExceptionModel. This was adding 2 custom flags, changing the MCAsmInfo
default, and overwriting the ExceptionModel from the custom flags.
These comments about compiling bitcode with clang are describing a toolchain
bug or user error. TargetOptions is bad, and we should move to eliminating it.
It is module state not captured in the IR. Ideally the exception model should either
come implied from the triple, or a module flag and not depend on this side state.
Currently it is the responsibility of the toolchain and/or user to ensure the same
command line flags are used at each phase of the compilation. It is not the backend's
responsibilty to try to second guess these options.
-wasm-enable-eh and -wasm-enable-sjlj should also be removed in favor of the standard
exception control. I'm a bit confused by how all of these fields are supposed to interact,
but there are a few uses in the backend that are directly looking at these flags instead
of the already parsed ExceptionModel which need to be cleaned up.
Additionally, this was enforcing some rules about the combinations of flags at a random
point in the IR pass pipeline configuration. This is a module property that should
be handled at TargetMachine construction time at the latest. This required adding flags
to a few mir and clang tests which never got this far to avoid hitting the errors.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list