[all-commits] [llvm/llvm-project] 20da46: CodeGen: Suppress per-invoke EH labels via an MCAs...
Matt Arsenault via All-commits
all-commits at lists.llvm.org
Wed Sep 23 12:31:56 PDT 2026
Branch: refs/heads/users/arsenm/isel/eh-labels-only-when-recorded
Home: https://github.com/llvm/llvm-project
Commit: 20da46563110bfd10d3e4a659e68cd1aa8296fd8
https://github.com/llvm/llvm-project/commit/20da46563110bfd10d3e4a659e68cd1aa8296fd8
Author: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M llvm/include/llvm/MC/MCAsmInfo.h
M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
M llvm/lib/Target/X86/X86ISelLowering.cpp
A llvm/test/CodeGen/WebAssembly/eh-invoke-label-suppression.ll
A llvm/test/CodeGen/X86/eh-labels-unknown-personality.ll
Log Message:
-----------
CodeGen: Suppress per-invoke EH labels via an MCAsmInfo object predicate
This is to avoid depending on TargetOptions::ExceptionModel in the
X86ISelLowering constructor. This was used to legalize EH_LABEL to a nop.
Legality rules cannot depend on program state, and the exception model should
be read from the IR module flag. In this instance the exception model isn't
really the relevant property. The specific personality and the target
object's EH table format are. Introduce a new MCAsmInfo predicate which is a
known constant for the triple. Also just do this during the initial label
emission instead of leaving it to legalization. This cleans up some unused
labels for wasm. This is also a minor behavior change for unknown personalities;
the labels will now be conservatively emitted.
I don't know all that much about exceptions, there's a lot of AI reverse
engineering of intent here. Another bruteforce approach would be to just
relocate the current condition to the selector which has access to the
exception model, but the MCAsmInfo check will be reusable in other contexts.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
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