[llvm-branch-commits] [llvm] [BOLT] Lookup top-level inline tree node in YAMLProfileWriter (PR #165491)
Amir Ayupov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Dec 22 14:22:46 PST 2025
https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/165491
>From d14bd8935edffb2ee667b4c6b86f2071c719ae75 Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Wed, 12 Nov 2025 14:28:59 -0800
Subject: [PATCH 1/2] Drop MC changes
Created using spr 1.3.4
---
llvm/lib/MC/MCPseudoProbe.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/llvm/lib/MC/MCPseudoProbe.cpp b/llvm/lib/MC/MCPseudoProbe.cpp
index 0b73f5af6ed21..b493337b39317 100644
--- a/llvm/lib/MC/MCPseudoProbe.cpp
+++ b/llvm/lib/MC/MCPseudoProbe.cpp
@@ -277,8 +277,8 @@ static StringRef getProbeFNameForGUID(const GUIDProbeFunctionMap &GUID2FuncMAP,
}
void MCPseudoProbeFuncDesc::print(raw_ostream &OS) {
- OS << "GUID: " << Twine::utohexstr(FuncGUID) << " Name: " << FuncName << "\n";
- OS << "Hash: " << Twine::utohexstr(FuncHash) << "\n";
+ OS << "GUID: " << FuncGUID << " Name: " << FuncName << "\n";
+ OS << "Hash: " << FuncHash << "\n";
}
void MCDecodedPseudoProbe::getInlineContext(
@@ -681,7 +681,7 @@ void MCPseudoProbeDecoder::printProbesForAllAddresses(raw_ostream &OS) {
uint64_t Address = Probe.getAddress();
if (Address != PrevAddress) {
PrevAddress = Address;
- OS << "Address:\t" << Twine::utohexstr(Address) << '\n';
+ OS << "Address:\t" << Address << '\n';
}
OS << " [Probe]:\t";
Probe.print(OS, GUID2FuncDescMap, true);
>From 3a57d51f2c38d4b5d1ff49242197883b4cc3efbc Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Wed, 12 Nov 2025 14:29:24 -0800
Subject: [PATCH 2/2] test format
Created using spr 1.3.4
---
bolt/test/X86/Inputs/test_coro.cpp | 93 +++++++++++++++---------------
1 file changed, 46 insertions(+), 47 deletions(-)
diff --git a/bolt/test/X86/Inputs/test_coro.cpp b/bolt/test/X86/Inputs/test_coro.cpp
index eba66277101ca..9d44bd4646934 100644
--- a/bolt/test/X86/Inputs/test_coro.cpp
+++ b/bolt/test/X86/Inputs/test_coro.cpp
@@ -1,72 +1,71 @@
-#include <iostream>
#include <coroutine>
-#include <thread>
-#include <queue>
#include <functional>
+#include <iostream>
+#include <queue>
+#include <thread>
std::queue<std::function<bool()>> task_queue;
struct co_sleep {
- co_sleep(int n) : delay{n} {}
+ co_sleep(int n) : delay{n} {}
- constexpr bool await_ready() const noexcept { return false; }
+ constexpr bool await_ready() const noexcept { return false; }
- void await_suspend(std::coroutine_handle<> h) const noexcept {
- auto start = std::chrono::steady_clock::now();
- task_queue.push([start, h, d = delay] {
- if (decltype(start)::clock::now() - start > d) {
- h.resume();
- return true;
- } else {
- return false;
- }
- });
- }
+ void await_suspend(std::coroutine_handle<> h) const noexcept {
+ auto start = std::chrono::steady_clock::now();
+ task_queue.push([start, h, d = delay] {
+ if (decltype(start)::clock::now() - start > d) {
+ h.resume();
+ return true;
+ } else {
+ return false;
+ }
+ });
+ }
- void await_resume() const noexcept {}
+ void await_resume() const noexcept {}
- std::chrono::milliseconds delay;
+ std::chrono::milliseconds delay;
};
-
struct Task {
- struct promise_type {
- promise_type() = default;
- Task get_return_object() { return {}; }
- std::suspend_never initial_suspend() { return {}; }
- std::suspend_always final_suspend() noexcept { return {}; }
- void unhandled_exception() {}
- };
+ struct promise_type {
+ promise_type() = default;
+ Task get_return_object() { return {}; }
+ std::suspend_never initial_suspend() { return {}; }
+ std::suspend_always final_suspend() noexcept { return {}; }
+ void unhandled_exception() {}
+ };
};
Task foo1() noexcept {
- std::cout << "1. hello from foo1" << std::endl;
- for (int i = 0; i < 10; ++i) {
- co_await co_sleep{10};
- std::cout << "2. hello from foo1" << std::endl;
- }
+ std::cout << "1. hello from foo1" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ co_await co_sleep{10};
+ std::cout << "2. hello from foo1" << std::endl;
+ }
}
Task foo2() noexcept {
- std::cout << "1. hello from foo2" << std::endl;
- for (int i = 0; i < 10; ++i) {
- co_await co_sleep{10};
- std::cout << "2. hello from foo2" << std::endl;
- }
+ std::cout << "1. hello from foo2" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ co_await co_sleep{10};
+ std::cout << "2. hello from foo2" << std::endl;
+ }
}
-//call foo
+// call foo
int main() {
- foo1();
- foo2();
-
- while (!task_queue.empty()) {
- auto task = task_queue.front();
- if (!task()) {
- task_queue.push(task);
- }
- task_queue.pop();
+ foo1();
+ foo2();
- std::this_thread::sleep_for(std::chrono::milliseconds(10));
+ while (!task_queue.empty()) {
+ auto task = task_queue.front();
+ if (!task()) {
+ task_queue.push(task);
}
+ task_queue.pop();
+
+ std::this_thread::sleep_for(std::chrono::milliseconds(10));
+ }
}
More information about the llvm-branch-commits
mailing list