[llvm] RuntimeLibcalls: Make sure _Unwind_Resume entries are mutually exclusive (PR #164195)
    Matt Arsenault via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Oct 24 06:51:42 PDT 2025
    
    
  
https://github.com/arsenm updated https://github.com/llvm/llvm-project/pull/164195
>From 66d3765c8d44af42b19fd21a48cb484658b0162e Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Mon, 20 Oct 2025 01:13:16 +0900
Subject: [PATCH] RuntimeLibcalls: Make sure _Unwind_Resume entries are
 mutually exclusive
---
 llvm/include/llvm/IR/RuntimeLibcalls.td | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index ec16995a4f57c..9d394af83ee7f 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -59,6 +59,11 @@ def ExceptionModelIsNotNone : RuntimeLibcallPredicate<
   [{ExceptionModel != ExceptionHandling::None}]
 >;
 
+def ExceptionModelHasUnwindResume : RuntimeLibcallPredicate<
+  [{ExceptionModel != ExceptionHandling::None &&
+    ExceptionModel != ExceptionHandling::SjLj}]
+>;
+
 def ExceptionModelIsSjLj : RuntimeLibcallPredicate<
   [{ExceptionModel == ExceptionHandling::SjLj}]
 >;
@@ -1153,8 +1158,10 @@ def __ssp_canary_word : RuntimeLibcallImpl<STACK_CHECK_GUARD>;
 //===----------------------------------------------------------------------===//
 
 defvar ExceptionModelCalls = (add
-  LibcallImpls<(add DefaultExceptionHandlingLibcalls),
+  LibcallImpls<(add __cxa_end_cleanup),
                ExceptionModelIsNotNone>,
+  LibcallImpls<(add _Unwind_Resume),
+               ExceptionModelHasUnwindResume>,
   LibcallImpls<(add SjLjExceptionHandlingLibcalls),
                ExceptionModelIsSjLj>
 );
@@ -1396,8 +1403,10 @@ defset list<RuntimeLibcallImpl> WinArm64ECSjLjExceptionHandlingLibcalls = {
 }
 
 defvar ExceptionModelCallsArm64EC = (add
-  LibcallImpls<(add WinArm64ECDefaultExceptionHandlingLibcalls),
+  LibcallImpls<(add arm64ec___cxa_end_cleanup),
                ExceptionModelIsNotNone>,
+  LibcallImpls<(add arm64ec__Unwind_Resume),
+               ExceptionModelHasUnwindResume>,
   LibcallImpls<(add WinArm64ECSjLjExceptionHandlingLibcalls),
                ExceptionModelIsSjLj>
 );
    
    
More information about the llvm-commits
mailing list