From 68f7caffe7a2e7d728d5447b28cf8c422be46748 Mon Sep 17 00:00:00 2001 From: Santiago Aboy Solanes Date: Mon, 11 Mar 2024 09:31:10 +0000 Subject: Make sure there are no lone UNREACHABLEs Either remove them, or add a LOG(FATAL) before them. Bug: 328756212 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Test: m test-art-host-gtest Change-Id: Ibf2bddb0a4add5a844a515a040b3751acc7faf84 --- compiler/optimizing/loop_optimization.cc | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'compiler/optimizing/loop_optimization.cc') diff --git a/compiler/optimizing/loop_optimization.cc b/compiler/optimizing/loop_optimization.cc index f6d69ca789..28712302c5 100644 --- a/compiler/optimizing/loop_optimization.cc +++ b/compiler/optimizing/loop_optimization.cc @@ -2455,13 +2455,9 @@ HInstruction* HLoopOptimization::GenerateVecOp(HInstruction* org, new (global_allocator_) HAbs(org_type, opa, dex_pc)); case HInstruction::kEqual: { // Special case. - if (vector_mode_ == kVector) { - vector = new (global_allocator_) HVecCondition( - global_allocator_, opa, opb, type, vector_length_, dex_pc); - } else { - DCHECK(vector_mode_ == kSequential); - UNREACHABLE(); - } + DCHECK_EQ(vector_mode_, kVector); + vector = new (global_allocator_) + HVecCondition(global_allocator_, opa, opb, type, vector_length_, dex_pc); } break; default: @@ -2772,19 +2768,14 @@ bool HLoopOptimization::VectorizeIfCondition(LoopNode* node, vector_map_->Get(opa_promoted), vector_map_->Get(opb_promoted), type); + DCHECK_EQ(vector_mode_, kVector); + HInstruction* vec_pred_not = new (global_allocator_) + HVecPredNot(global_allocator_, vec_cond, type, vector_length_, hif->GetDexPc()); - if (vector_mode_ == kVector) { - HInstruction* vec_pred_not = new (global_allocator_) HVecPredNot( - global_allocator_, vec_cond, type, vector_length_, hif->GetDexPc()); - - vector_map_->Put(hif, vec_pred_not); - BlockPredicateInfo* pred_info = predicate_info_map_->Get(hif->GetBlock()); - pred_info->SetControlFlowInfo(vec_cond->AsVecPredSetOperation(), - vec_pred_not->AsVecPredSetOperation()); - } else { - DCHECK(vector_mode_ == kSequential); - UNREACHABLE(); - } + vector_map_->Put(hif, vec_pred_not); + BlockPredicateInfo* pred_info = predicate_info_map_->Get(hif->GetBlock()); + pred_info->SetControlFlowInfo(vec_cond->AsVecPredSetOperation(), + vec_pred_not->AsVecPredSetOperation()); } return true; } @@ -3140,6 +3131,7 @@ void HLoopOptimization::InitPredicateInfoMap(LoopNode* node, return; } } + LOG(FATAL) << "Unreachable"; UNREACHABLE(); } -- cgit v1.2.3-59-g8ed1b