From 872ec72de447b2803894e17253399a54a4c10e1f Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Fri, 18 Feb 2022 14:10:25 +0000 Subject: Update compiler/ implications to use (D)CHECK_IMPLIES Follow-up to aosp/1988868 in which we added the (D)CHECK_IMPLIES macro. This CL uses it on compiler/ occurrences found by a regex. Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: If63aed969bfb8b31d6fbbcb3bca2b04314c894b7 --- compiler/optimizing/register_allocation_resolver.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'compiler/optimizing/register_allocation_resolver.cc') diff --git a/compiler/optimizing/register_allocation_resolver.cc b/compiler/optimizing/register_allocation_resolver.cc index 670db42f6f..875c633889 100644 --- a/compiler/optimizing/register_allocation_resolver.cc +++ b/compiler/optimizing/register_allocation_resolver.cc @@ -75,7 +75,7 @@ void RegisterAllocationResolver::Resolve(ArrayRef safepoint } } else if (instruction->IsCurrentMethod()) { // The current method is always at offset 0. - DCHECK(!current->HasSpillSlot() || (current->GetSpillSlot() == 0)); + DCHECK_IMPLIES(current->HasSpillSlot(), (current->GetSpillSlot() == 0)); } else if (instruction->IsPhi() && instruction->AsPhi()->IsCatchPhi()) { DCHECK(current->HasSpillSlot()); size_t slot = current->GetSpillSlot() @@ -306,9 +306,9 @@ void RegisterAllocationResolver::ConnectSiblings(LiveInterval* interval) { size_t num_of_slots = interval->NumberOfSpillSlotsNeeded(); loc = Location::StackSlotByNumOfSlots(num_of_slots, interval->GetParent()->GetSpillSlot()); - CHECK(!loc.IsSIMDStackSlot() || - (codegen_->GetSIMDRegisterWidth() / kVRegSize == num_of_slots)) << - "Unexpected number of spill slots"; + CHECK_IMPLIES(loc.IsSIMDStackSlot(), + (codegen_->GetSIMDRegisterWidth() / kVRegSize == num_of_slots)) + << "Unexpected number of spill slots"; InsertMoveAfter(interval->GetDefinedBy(), interval->ToLocation(), loc); } UsePositionList::const_iterator use_it = current->GetUses().begin(); @@ -468,9 +468,9 @@ void RegisterAllocationResolver::ConnectSplitSiblings(LiveInterval* interval, DCHECK(defined_by->IsCurrentMethod()); size_t num_of_slots = parent->NumberOfSpillSlotsNeeded(); location_source = Location::StackSlotByNumOfSlots(num_of_slots, parent->GetSpillSlot()); - CHECK(!location_source.IsSIMDStackSlot() || - (codegen_->GetSIMDRegisterWidth() == num_of_slots * kVRegSize)) << - "Unexpected number of spill slots"; + CHECK_IMPLIES(location_source.IsSIMDStackSlot(), + (codegen_->GetSIMDRegisterWidth() == num_of_slots * kVRegSize)) + << "Unexpected number of spill slots"; } } else { DCHECK(source != nullptr); -- cgit v1.2.3-59-g8ed1b