aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-19 17:53:34 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-19 18:00:08 +0800
commitff1029193a6c505e31b0b5df360c9af73b921b42 (patch)
treee41a5f955c1860acc9ddd7a2fd06c79796e122be
parente8555cfd193c8de5a3de29275148731b29f6e176 (diff)
downloadrcc-project-ff1029193a6c505e31b0b5df360c9af73b921b42.tar.gz
rcc-project-ff1029193a6c505e31b0b5df360c9af73b921b42.tar.xz
[CodeGen] Match LLVM block placement contract
-rw-r--r--backend/lib/CodeGen/MachineBlockPlacement.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/backend/lib/CodeGen/MachineBlockPlacement.cpp b/backend/lib/CodeGen/MachineBlockPlacement.cpp
index 8e2242c..0dbcd37 100644
--- a/backend/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/backend/lib/CodeGen/MachineBlockPlacement.cpp
@@ -32,7 +32,7 @@ enum class PlacementClass : std::uint8_t {
static const MachinePassContract Contract = [] {
MachinePassContract Value{
.Name = "machine-block-placement",
- .Requires = {MachineFunctionProperty::Selected, MachineFunctionProperty::NoPHIs},
+ .Requires = {},
.Sets = {},
.Clears = {},
.RequiredAnalyses =
@@ -42,7 +42,7 @@ enum class PlacementClass : std::uint8_t {
MachineFunctionAnalysisManager::id<MachineBlockFrequencyAnalysis>(),
MachineFunctionAnalysisManager::id<MachineLoopAnalysis>(),
},
- .VerificationStage = PipelineStage::Selected,
+ .VerificationStage = std::nullopt,
};
Value.ThreadSafety = PassThreadSafety::ThreadSafe;
Value.DeclaredChanges = {MachinePassChange::BlockLayout};
@@ -99,10 +99,6 @@ const MachinePassContract &MachineBlockPlacementPass::contract() const noexcept
Expected<MachinePassResult>
MachineBlockPlacementPass::run(MachineFunction &Function, const TargetDescription &Target,
MachineFunctionAnalysisManager &Analyses) {
- if (!Function.properties().containsAll(contract().Requires)) {
- return makeUnexpected(ErrorCode::VerificationError,
- "machine block placement requires selected PHI-free MachineIR");
- }
auto Trial = cloneMachineFunction(
Function, Target,
MachineFunctionCloneOptions{.NewStableID = Function.stableID(), .NewName = std::nullopt});