[all-commits] [llvm/llvm-project] 0f6b03: CodeGen: Suppress per-invoke EH labels via an MCAs...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Wed Sep 23 23:37:02 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f6b03f1ecb134c58aaa6a79b9320b3c30f15ef8
      https://github.com/llvm/llvm-project/commit/0f6b03f1ecb134c58aaa6a79b9320b3c30f15ef8
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2026-09-24 (Thu, 24 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 (#225903)

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