[llvm] Adding Matching and Inference Functionality to Propeller-PR4: Implement matching and inference and create clusters (PR #165868)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 4 09:56:06 PST 2025
================
@@ -0,0 +1,187 @@
+//===- llvm/CodeGen/BasicBlockMatchingAndInference.cpp ----------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Infer weights for all basic blocks using matching and inference.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/CodeGen/BasicBlockMatchingAndInference.h"
+#include "llvm/CodeGen/BasicBlockSectionsProfileReader.h"
+#include "llvm/CodeGen/MachineBlockHashInfo.h"
+#include "llvm/CodeGen/Passes.h"
+#include "llvm/InitializePasses.h"
+#include <llvm/Support/CommandLine.h>
+
+using namespace llvm;
+
+static cl::opt<float>
+ PropellerInferThreshold("propeller-infer-threshold",
----------------
wdx727 wrote:
We currently plan to reserve this file exclusively for Propeller. A better approach would be to integrate the implementations here with those in BOLT into the LLVM infrastructure, enabling reuse by both Propeller and BOLT. For now, we aim to first add matching and inference support to Propeller, with the code integration work scheduled for a separate PR in the future.
https://github.com/llvm/llvm-project/pull/165868
More information about the llvm-commits
mailing list