[llvm] [BOLT][AArch64] Refuse to run Stoke analysis on AArch64 (PR #195878)
via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 09:23:07 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
Author: Amina Chabane (Amichaxx)
<details>
<summary>Changes</summary>
`--stoke` and `--stoke-out` yields an UNIMPLEMENTED crash on AArch64. It is a fundamentally X86 pass.
- Add a non-X86 guard
- Add the error message to unsupported-passes.test.
---
Full diff: https://github.com/llvm/llvm-project/pull/195878.diff
2 Files Affected:
- (modified) bolt/lib/Passes/StokeInfo.cpp (+5)
- (modified) bolt/test/AArch64/unsupported-passes.test (+2)
``````````diff
diff --git a/bolt/lib/Passes/StokeInfo.cpp b/bolt/lib/Passes/StokeInfo.cpp
index 9da460a2877c9..a4fcf42d1da75 100644
--- a/bolt/lib/Passes/StokeInfo.cpp
+++ b/bolt/lib/Passes/StokeInfo.cpp
@@ -146,6 +146,11 @@ bool StokeInfo::checkFunction(BinaryFunction &BF, DataflowInfoManager &DInfo,
}
Error StokeInfo::runOnFunctions(BinaryContext &BC) {
+ if (!BC.isX86()) {
+ BC.errs() << "BOLT-ERROR: " << getName() << " is supported only on X86\n";
+ exit(1);
+ }
+
BC.outs() << "STOKE-INFO: begin of stoke pass\n";
std::ofstream Outfile;
diff --git a/bolt/test/AArch64/unsupported-passes.test b/bolt/test/AArch64/unsupported-passes.test
index ef3e434c4ba06..13a84d56b36b0 100644
--- a/bolt/test/AArch64/unsupported-passes.test
+++ b/bolt/test/AArch64/unsupported-passes.test
@@ -16,8 +16,10 @@ CHECK-INDIRECT-CALL-PROMOTION: BOLT-ERROR: indirect-call-promotion is supported
// Passes specific to X86 arch
RUN: not llvm-bolt %t -o %t.bolt --cmov-conversion 2>&1 | FileCheck %s --check-prefix=CHECK-CMOV-CONV
RUN: not llvm-bolt %t -o %t.bolt --reg-reassign 2>&1 | FileCheck %s --check-prefix=CHECK-REG-REASSIGN
+RUN: not llvm-bolt %t -o %t.bolt --stoke --stoke-out=%t.stoke.csv 2>&1 | FileCheck %s --check-prefix=CHECK-STOKE
CHECK-CMOV-CONV: BOLT-ERROR: CMOV conversion is supported only on X86
CHECK-REG-REASSIGN: BOLT-ERROR: reg-reassign is supported only on X86
+CHECK-STOKE: BOLT-ERROR: stoke-get-stat is supported only on X86
RUN: not llvm-bolt %t -o %t.bolt split-functions --split-strategy=cdsplit 2>&1 | FileCheck %s --check-prefix=CHECK-CDSPLIT
CHECK-CDSPLIT: BOLT-ERROR: CDSplit is not supported with LongJmp. Try with '--compact-code-model'
``````````
</details>
https://github.com/llvm/llvm-project/pull/195878
More information about the llvm-commits
mailing list