[llvm] [BOLT] BB can be cold, warm and hot. (PR #121475)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 2 04:54:35 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-bolt
Author: Nicholas (liusy58)
<details>
<summary>Changes</summary>
CDSplit enables BB to be cold, warm or hot. So this assert should be removed.
---
Full diff: https://github.com/llvm/llvm-project/pull/121475.diff
1 Files Affected:
- (modified) bolt/include/bolt/Core/BinaryBasicBlock.h (+5-5)
``````````diff
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();
``````````
</details>
https://github.com/llvm/llvm-project/pull/121475
More information about the llvm-commits
mailing list