aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/lib/CodeGen/MachineLiveness.cpp4
-rw-r--r--backend/unittests/CodeGen/MachineLivenessTest.cpp6
2 files changed, 8 insertions, 2 deletions
diff --git a/backend/lib/CodeGen/MachineLiveness.cpp b/backend/lib/CodeGen/MachineLiveness.cpp
index 327ae7d..9ed09cc 100644
--- a/backend/lib/CodeGen/MachineLiveness.cpp
+++ b/backend/lib/CodeGen/MachineLiveness.cpp
@@ -1789,9 +1789,9 @@ Expected<void> verifyTrackedMachineLiveness(const MachineFunction &Function,
auto Expected = liveInUnits(BlockPlan.RebuiltLiveIns, Target);
if (!Expected)
return std::unexpected(Expected.error());
- if (*Actual != *Expected) {
+ if (!isSubset(*Expected, *Actual)) {
return makeUnexpected(ErrorCode::VerificationError,
- "TracksLiveness block has stale physical live-ins");
+ "TracksLiveness block is missing required physical live-ins");
}
}
for (const OperandFlagPlan &OperandPlan : Plan->Operands) {
diff --git a/backend/unittests/CodeGen/MachineLivenessTest.cpp b/backend/unittests/CodeGen/MachineLivenessTest.cpp
index a375e25..3f7621d 100644
--- a/backend/unittests/CodeGen/MachineLivenessTest.cpp
+++ b/backend/unittests/CodeGen/MachineLivenessTest.cpp
@@ -656,6 +656,12 @@ void testLivenessRebuildAndVerifier(TestContext &Context, const rcc::TargetDescr
Context.expect(rcc::MachineVerifier::verify(Function, Target).has_value(),
"rebuilt tracked liveness must pass the MachineVerifier");
+ auto ConservativeLiveIn = Entry.addLiveIn(physical(rcc::test::TestRegister::F0));
+ Context.expect(ConservativeLiveIn.has_value() &&
+ rcc::MachineVerifier::verify(Function, Target).has_value(),
+ "MachineVerifier must accept conservative physical live-ins");
+ Entry.clearLiveIns();
+
rcc::MachineOperand *FirstUseOperand = (*FirstUse)->operandAt(0);
if (FirstUseOperand == nullptr) {
Context.expect(false, "first use operand must exist");