[llvm] Fix an assert failure with a funclet in a swifttailcc function. (PR #78806)

Hiroshi Yamauchi via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 22 09:47:02 PST 2024


================
@@ -0,0 +1,125 @@
+; RUN: llc < %s -o - | FileCheck %s
+
+; Check that no assert failure occurs when there's a funclet in a swifttailcc function.
+; CHECK-LABEL: foo:
+
+target datalayout = "e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-unknown-windows-msvc19.38.33134"
+
+declare ptr @F2()
+
+declare void @F3(ptr)
+
+declare i32 @__CxxFrameHandler3(...)
+
+define swifttailcc void @foo(ptr swiftasync %0, ptr %v3, ptr %v4) personality ptr @__CxxFrameHandler3 !dbg !88 {
+v21:
+  call void @F3(ptr %0)
+  %v28 = invoke ptr @F2(ptr %v3, ptr %v4)
+          to label %v29 unwind label %v39
+
+v29:                                              ; preds = %v21
+  ret void
+
+v39:                                              ; preds = %v21
+  %v40 = cleanuppad within none []
+  %v43 = load i1, ptr null, align 1
+  cleanupret from %v40 unwind to caller
+}
+
+; This test is sensitive to the debug info
+
+!llvm.dbg.cu = !{!0, !11}
+!llvm.module.flags = !{!87}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_Swift, file: !1, producer: "Swift version 5.11-dev", isOptimized: true, flags: "-private-discriminator _0FA2C3DB08FF346F3CA00B2EC660E1DF -enable-experimental-cxx-interop", runtimeVersion: 5, emissionKind: FullDebug, globals: !2, imports: !10, sysroot: "S:\\Windows.sdk", sdk: "Windows.sdk")
----------------
hjyamauchi wrote:

The debug info is relevant here because the failing pass is `Live DEBUG_VALUE analysis` or `livedebugvalues`. It doesn't crash without it.

https://github.com/llvm/llvm-project/pull/78806


More information about the llvm-commits mailing list