diff options
author | 2024-03-11 09:31:10 +0000 | |
---|---|---|
committer | 2024-03-14 08:47:37 +0000 | |
commit | 68f7caffe7a2e7d728d5447b28cf8c422be46748 (patch) | |
tree | 68e927688ed734bdf16161e52297008b61733c0c /compiler/optimizing | |
parent | 41f264abe76acb4f7cb545471cbbfbc30e3101ca (diff) |
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
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/code_generator_riscv64.cc | 1 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/code_generator_x86_64.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/inliner.cc | 1 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_x86.cc | 5 | ||||
-rw-r--r-- | compiler/optimizing/intrinsics_x86_64.cc | 8 | ||||
-rw-r--r-- | compiler/optimizing/loop_optimization.cc | 30 | ||||
-rw-r--r-- | compiler/optimizing/loop_optimization.h | 1 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 1 |
9 files changed, 21 insertions, 30 deletions
diff --git a/compiler/optimizing/code_generator_riscv64.cc b/compiler/optimizing/code_generator_riscv64.cc index abbd74ac65..451481bceb 100644 --- a/compiler/optimizing/code_generator_riscv64.cc +++ b/compiler/optimizing/code_generator_riscv64.cc @@ -122,7 +122,6 @@ Location Riscv64ReturnLocation(DataType::Type return_type) { case DataType::Type::kVoid: return Location::NoLocation(); } - UNREACHABLE(); } static RegisterSet OneRegInReferenceOutSaveEverythingCallerSaves() { diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 21d3492e8a..55fb4ee3d3 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -1506,8 +1506,6 @@ Location InvokeDexCallingConventionVisitorX86::GetReturnLocation(DataType::Type case DataType::Type::kFloat32: return Location::FpuRegisterLocation(XMM0); } - - UNREACHABLE(); } Location InvokeDexCallingConventionVisitorX86::GetMethodLocation() const { diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index af6c6255e5..f94514e08e 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -2950,8 +2950,6 @@ Location InvokeDexCallingConventionVisitorX86_64::GetReturnLocation(DataType::Ty case DataType::Type::kFloat32: return Location::FpuRegisterLocation(XMM0); } - - UNREACHABLE(); } Location InvokeDexCallingConventionVisitorX86_64::GetMethodLocation() const { diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc index 0fd3eeab2e..02cf8a4052 100644 --- a/compiler/optimizing/inliner.cc +++ b/compiler/optimizing/inliner.cc @@ -684,7 +684,6 @@ bool HInliner::TryInlineFromInlineCache(HInvoke* invoke_instruction) return false; } } - UNREACHABLE(); } HInliner::InlineCacheType HInliner::GetInlineCacheJIT( diff --git a/compiler/optimizing/intrinsics_x86.cc b/compiler/optimizing/intrinsics_x86.cc index b21f36cfcf..62efeb1d8c 100644 --- a/compiler/optimizing/intrinsics_x86.cc +++ b/compiler/optimizing/intrinsics_x86.cc @@ -3816,7 +3816,7 @@ static void GenerateVarHandleCommonChecks(HInvoke *invoke, break; } default: - // Unimplemented + LOG(FATAL) << "Unexpected coordinates count: " << expected_coordinates_count; UNREACHABLE(); } @@ -4350,6 +4350,7 @@ static void GenerateVarHandleGetAndSet(HInvoke* invoke, CodeGeneratorX86* codege break; } default: + LOG(FATAL) << "Unexpected type: " << value_type; UNREACHABLE(); } @@ -4688,6 +4689,7 @@ static void GenerateVarHandleGetAndAdd(HInvoke* invoke, CodeGeneratorX86* codege break; } default: + LOG(FATAL) << "Unexpected type: " << type; UNREACHABLE(); } @@ -4782,6 +4784,7 @@ static void GenerateBitwiseOp(HInvoke* invoke, __ andl(left, right); break; default: + LOG(FATAL) << "Unexpected intrinsic: " << invoke->GetIntrinsic(); UNREACHABLE(); } } diff --git a/compiler/optimizing/intrinsics_x86_64.cc b/compiler/optimizing/intrinsics_x86_64.cc index 1876a70541..598b95867e 100644 --- a/compiler/optimizing/intrinsics_x86_64.cc +++ b/compiler/optimizing/intrinsics_x86_64.cc @@ -4493,7 +4493,7 @@ static void GenerateVarHandleGetAndSet(HInvoke* invoke, __ xchgq(valreg, field_addr); break; default: - DCHECK(false) << "unexpected type in getAndSet intrinsic"; + LOG(FATAL) << "unexpected type in getAndSet intrinsic: " << type; UNREACHABLE(); } if (byte_swap) { @@ -4600,7 +4600,7 @@ static void GenerateVarHandleGetAndOp(HInvoke* invoke, } break; default: - DCHECK(false) << "unexpected operation"; + LOG(FATAL) << "unexpected operation"; UNREACHABLE(); } @@ -4628,7 +4628,7 @@ static void GenerateVarHandleGetAndOp(HInvoke* invoke, __ LockCmpxchgq(field_addr, temp); break; default: - DCHECK(false) << "unexpected type in getAndBitwiseOp intrinsic"; + LOG(FATAL) << "unexpected type in getAndBitwiseOp intrinsic"; UNREACHABLE(); } @@ -4800,7 +4800,7 @@ static void GenerateVarHandleGetAndAdd(HInvoke* invoke, __ LockXaddq(field_addr, valreg); break; default: - DCHECK(false) << "unexpected type in getAndAdd intrinsic"; + LOG(FATAL) << "unexpected type in getAndAdd intrinsic"; UNREACHABLE(); } } 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(); } diff --git a/compiler/optimizing/loop_optimization.h b/compiler/optimizing/loop_optimization.h index 86a9f0fcb8..2bf32ac095 100644 --- a/compiler/optimizing/loop_optimization.h +++ b/compiler/optimizing/loop_optimization.h @@ -108,6 +108,7 @@ class HLoopOptimization : public HOptimization { * Vectorization mode during synthesis * (sequential peeling/cleanup loop or vector loop). */ + // TODO(solanes): Change this into enum class enum VectorMode { kSequential, kVector diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 0e5de00f97..f532681527 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -897,6 +897,7 @@ CodeGenerator* OptimizingCompiler::TryCompile(ArenaAllocator* allocator, break; } case kAnalysisSuccess: + LOG(FATAL) << "Unreachable"; UNREACHABLE(); } pass_observer.SetGraphInBadState(); |