[llvm] [llvm-mca][Darwin] Fix crash on .subsections_via_symbols in asm input (PR #182694)
dan rouhana via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 21 14:30:12 PST 2026
https://github.com/dr7ana updated https://github.com/llvm/llvm-project/pull/182694
>From 04ae31cef871ef1d56b55706608c172a93e4f0db Mon Sep 17 00:00:00 2001
From: dr7ana <danielrouhana at gmail.com>
Date: Sat, 21 Feb 2026 11:01:38 -0800
Subject: [PATCH 1/2] add no-op emitSubsectionsViaSymbols in MCStreamerWrapper
for Darwin asm parsing
---
llvm/tools/llvm-mca/CodeRegionGenerator.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/tools/llvm-mca/CodeRegionGenerator.h b/llvm/tools/llvm-mca/CodeRegionGenerator.h
index c30f67a53eac0..7083ba363081a 100644
--- a/llvm/tools/llvm-mca/CodeRegionGenerator.h
+++ b/llvm/tools/llvm-mca/CodeRegionGenerator.h
@@ -106,6 +106,7 @@ class MCStreamerWrapper : public MCStreamer {
void emitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
uint64_t Size = 0, Align ByteAlignment = Align(1),
SMLoc Loc = SMLoc()) override {}
+ void emitSubsectionsViaSymbols() override {}
void beginCOFFSymbolDef(const MCSymbol *Symbol) override {}
void emitCOFFSymbolStorageClass(int StorageClass) override {}
void emitCOFFSymbolType(int Type) override {}
>From 4afc0a804736e695d5dea61e716c5e16aec3b578 Mon Sep 17 00:00:00 2001
From: dr7ana <danielrouhana at gmail.com>
Date: Sat, 21 Feb 2026 12:35:51 -0800
Subject: [PATCH 2/2] add llvm-mca test case for minimal reproducible example
---
.../AArch64/Apple/darwin-subsections-via-symbols.s | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 llvm/test/tools/llvm-mca/AArch64/Apple/darwin-subsections-via-symbols.s
diff --git a/llvm/test/tools/llvm-mca/AArch64/Apple/darwin-subsections-via-symbols.s b/llvm/test/tools/llvm-mca/AArch64/Apple/darwin-subsections-via-symbols.s
new file mode 100644
index 0000000000000..bcc17a5247292
--- /dev/null
+++ b/llvm/test/tools/llvm-mca/AArch64/Apple/darwin-subsections-via-symbols.s
@@ -0,0 +1,7 @@
+# RUN: llvm-mca -mtriple=arm64-apple-macos -mcpu=apple-m4 -iterations=1 < %s
+
+.text
+.subsections_via_symbols
+.globl _foo
+_foo:
+ ret
More information about the llvm-commits
mailing list