[llvm] 210c0ba - X86: Simplify the EH_LABEL Expand condition (#213130)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 8 10:59:31 PDT 2026


Author: Matt Arsenault
Date: 2026-08-08T17:59:25Z
New Revision: 210c0ba72b0c10c04bcf553eb23cabce038cd253

URL: https://github.com/llvm/llvm-project/commit/210c0ba72b0c10c04bcf553eb23cabce038cd253
DIFF: https://github.com/llvm/llvm-project/commit/210c0ba72b0c10c04bcf553eb23cabce038cd253.diff

LOG: X86: Simplify the EH_LABEL Expand condition (#213130)

Re-express the opt-out handling of EH_LABEL. The special
case is 32-bit non-GNU Windows, and the net result is to skip
printing unused labels. Try to make this more comprehensible
to help figure out where this logic should really be.
I want to eliminate use of the TargetOptions::ExceptionModel,
which ideally wouldn't be needed in a TargetLowering
constructor.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 3b39e1bddb8ba..c74d342fed1cb 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -570,9 +570,9 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
   if (Subtarget.canUseCMPXCHG16B())
     setOperationAction(ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS, MVT::i128, Custom);
 
-  // FIXME - use subtarget debug flags
-  if (!Subtarget.isTargetDarwin() && !Subtarget.isTargetELF() &&
-      !Subtarget.isTargetCygMing() && !Subtarget.isTargetWin64() &&
+  // 32-bit Windows non-GNU EH (MSVC/Itanium SEH) does not use per-invoke EH
+  // labels, so expand them away. SjLj EH does use them.
+  if (Subtarget.isTargetWin32() && !Subtarget.isTargetCygMing() &&
       TM.Options.ExceptionModel != ExceptionHandling::SjLj) {
     setOperationAction(ISD::EH_LABEL, MVT::Other, Expand);
   }


        


More information about the llvm-commits mailing list