[llvm] [BOLT] BB can be cold, warm and hot. (PR #121475)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 2 04:53:58 PST 2025
https://github.com/liusy58 created https://github.com/llvm/llvm-project/pull/121475
CDSplit enables BB to be cold, warm or hot. So this assert should be removed.
>From ad3a483661f6c552b90470571db9a6ed4bd4f984 Mon Sep 17 00:00:00 2001
From: liusy58 <liusy58 at linux.alibaba.com>
Date: Thu, 2 Jan 2025 20:53:27 +0800
Subject: [PATCH] [BOLT] BB can be cold, warm and hot.
CDSplit enables BB to be cold, warm or hot. So this assert should be removed.
---
bolt/include/bolt/Core/BinaryBasicBlock.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/bolt/include/bolt/Core/BinaryBasicBlock.h b/bolt/include/bolt/Core/BinaryBasicBlock.h
index 25cccc4edecf68..5818ed240f88c5 100644
--- a/bolt/include/bolt/Core/BinaryBasicBlock.h
+++ b/bolt/include/bolt/Core/BinaryBasicBlock.h
@@ -672,11 +672,11 @@ class BinaryBasicBlock {
bool isSplit() const { return Fragment != FragmentNum::main(); }
- bool isCold() const {
- assert(Fragment.get() < 2 &&
- "Function is split into more than two (hot/cold)-fragments");
- return isSplit();
- }
+ bool isCold() const { return Fragment == FragmentNum::cold(); }
+
+ bool isWarm() const { return Fragment == FragmentNum::warm(); }
+
+ bool isHot() const { return Fragment == FragmentNum::main(); }
void setIsCold(const bool Flag) {
Fragment = Flag ? FragmentNum::cold() : FragmentNum::main();
More information about the llvm-commits
mailing list