[llvm] [BOLT] Add structure of CDSplit to SplitFunctions (PR #73430)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 16:20:44 PST 2023


================
@@ -136,6 +149,55 @@ struct SplitProfile2 final : public SplitStrategy {
   }
 };
 
+struct SplitCacheDirected final : public SplitStrategy {
+  BinaryContext &BC;
+  using BasicBlockOrder = BinaryFunction::BasicBlockOrderType;
+
+  explicit SplitCacheDirected(BinaryContext &BC) : BC(BC) {}
+
+  bool canSplit(const BinaryFunction &BF) override {
+    return BF.hasValidProfile() && hasFullProfile(BF) && !allBlocksCold(BF);
+  }
+
+  bool keepEmpty() override { return true; }
----------------
maksfb wrote:

Could you please add a comment on why we need `keepEmpty()` for this strategy?

https://github.com/llvm/llvm-project/pull/73430


More information about the llvm-commits mailing list