From ff0ac4772d489d8780bbb6bb271dc6d5333cca7c Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Thu, 2 Oct 2014 17:24:53 +0100 Subject: [PATCH] Remove all uses of MIR_INLINED. They are not needed since https://android-review.googlesource.com/103763 Change-Id: I1dffe5e219db615be9d9aaceb72ad9bd7c69b58e --- compiler/dex/local_value_numbering.cc | 12 +++++------- compiler/dex/mir_dataflow.cc | 2 +- compiler/dex/quick/dex_file_method_inliner.cc | 2 -- compiler/dex/quick/gen_invoke.cc | 10 ---------- compiler/dex/quick/mir_to_lir.cc | 26 ++++++++++---------------- compiler/dex/quick/x86/utility_x86.cc | 26 ++++++++++++-------------- 6 files changed, 28 insertions(+), 50 deletions(-) diff --git a/compiler/dex/local_value_numbering.cc b/compiler/dex/local_value_numbering.cc index eb0806b2a..e411164f3 100644 --- a/compiler/dex/local_value_numbering.cc +++ b/compiler/dex/local_value_numbering.cc @@ -1463,14 +1463,12 @@ uint16_t LocalValueNumbering::GetValueNumber(MIR* mir) { // Intentional fall-through. case Instruction::INVOKE_STATIC: case Instruction::INVOKE_STATIC_RANGE: - if ((mir->optimization_flags & MIR_INLINED) == 0) { - // Make ref args aliasing. - for (size_t i = 0u, count = mir->ssa_rep->num_uses; i != count; ++i) { - uint16_t reg = GetOperandValue(mir->ssa_rep->uses[i]); - non_aliasing_refs_.erase(reg); - } - HandleInvokeOrClInitOrAcquireOp(mir); + // Make ref args aliasing. + for (size_t i = 0u, count = mir->ssa_rep->num_uses; i != count; ++i) { + uint16_t reg = GetOperandValue(mir->ssa_rep->uses[i]); + non_aliasing_refs_.erase(reg); } + HandleInvokeOrClInitOrAcquireOp(mir); break; case Instruction::MOVE_RESULT: diff --git a/compiler/dex/mir_dataflow.cc b/compiler/dex/mir_dataflow.cc index 246ae44d1..51b670953 100644 --- a/compiler/dex/mir_dataflow.cc +++ b/compiler/dex/mir_dataflow.cc @@ -1163,7 +1163,7 @@ bool MIRGraph::DoSSAConversion(BasicBlock* bb) { if (!MIR::DecodedInstruction::IsPseudoMirOp(mir->dalvikInsn.opcode)) { int flags = mir->dalvikInsn.FlagsOf(); - if ((flags & Instruction::kInvoke) != 0 && (mir->optimization_flags & MIR_INLINED) == 0) { + if ((flags & Instruction::kInvoke) != 0) { attributes_ &= ~METHOD_IS_LEAF; } } diff --git a/compiler/dex/quick/dex_file_method_inliner.cc b/compiler/dex/quick/dex_file_method_inliner.cc index 2523380bc..0f1d765d8 100644 --- a/compiler/dex/quick/dex_file_method_inliner.cc +++ b/compiler/dex/quick/dex_file_method_inliner.cc @@ -566,7 +566,6 @@ bool DexFileMethodInliner::GenInline(MIRGraph* mir_graph, BasicBlock* bb, MIR* i break; } if (result) { - invoke->optimization_flags |= MIR_INLINED; // If the invoke has not been eliminated yet, check now whether we should do it. // This is done so that dataflow analysis does not get tripped up seeing nop invoke. if (static_cast(invoke->dalvikInsn.opcode) != kMirOpNop) { @@ -583,7 +582,6 @@ bool DexFileMethodInliner::GenInline(MIRGraph* mir_graph, BasicBlock* bb, MIR* i } } if (move_result != nullptr) { - move_result->optimization_flags |= MIR_INLINED; move_result->dalvikInsn.opcode = static_cast(kMirOpNop); } } diff --git a/compiler/dex/quick/gen_invoke.cc b/compiler/dex/quick/gen_invoke.cc index 67a75cbd6..c308932bc 100755 --- a/compiler/dex/quick/gen_invoke.cc +++ b/compiler/dex/quick/gen_invoke.cc @@ -1666,16 +1666,6 @@ bool Mir2Lir::GenInlinedUnsafePut(CallInfo* info, bool is_long, } void Mir2Lir::GenInvoke(CallInfo* info) { - if ((info->opt_flags & MIR_INLINED) != 0) { - // Already inlined but we may still need the null check. - if (info->type != kStatic && - ((cu_->disable_opt & (1 << kNullCheckElimination)) != 0 || - (info->opt_flags & MIR_IGNORE_NULL_CHECK) == 0)) { - RegLocation rl_obj = LoadValue(info->args[0], kRefReg); - GenNullCheck(rl_obj.reg); - } - return; - } DCHECK(cu_->compiler_driver->GetMethodInlinerMap() != nullptr); if (cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file) ->GenIntrinsic(this, info)) { diff --git a/compiler/dex/quick/mir_to_lir.cc b/compiler/dex/quick/mir_to_lir.cc index 6942c0fb1..e7160ad6c 100644 --- a/compiler/dex/quick/mir_to_lir.cc +++ b/compiler/dex/quick/mir_to_lir.cc @@ -500,17 +500,11 @@ void Mir2Lir::CompileDalvikInstruction(MIR* mir, BasicBlock* bb, LIR* label_list break; case Instruction::MOVE_RESULT_WIDE: - if ((opt_flags & MIR_INLINED) != 0) { - break; // Nop - combined w/ previous invoke. - } StoreValueWide(rl_dest, GetReturnWide(LocToRegClass(rl_dest))); break; case Instruction::MOVE_RESULT: case Instruction::MOVE_RESULT_OBJECT: - if ((opt_flags & MIR_INLINED) != 0) { - break; // Nop - combined w/ previous invoke. - } StoreValue(rl_dest, GetReturn(LocToRegClass(rl_dest))); break; @@ -867,7 +861,7 @@ void Mir2Lir::CompileDalvikInstruction(MIR* mir, BasicBlock* bb, LIR* label_list case Instruction::INVOKE_STATIC_RANGE: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kStatic, true)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { // If the invocation is not inlined, we can assume there is already a // suspend check at the return site mir_graph_->AppendGenSuspendTestList(bb); @@ -875,59 +869,59 @@ void Mir2Lir::CompileDalvikInstruction(MIR* mir, BasicBlock* bb, LIR* label_list break; case Instruction::INVOKE_STATIC: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kStatic, false)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_DIRECT: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kDirect, false)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_DIRECT_RANGE: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kDirect, true)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_VIRTUAL: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kVirtual, false)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_VIRTUAL_RANGE: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kVirtual, true)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_SUPER: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kSuper, false)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_SUPER_RANGE: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kSuper, true)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_INTERFACE: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kInterface, false)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; case Instruction::INVOKE_INTERFACE_RANGE: GenInvoke(mir_graph_->NewMemCallInfo(bb, mir, kInterface, true)); - if (!kLeafOptimization && (opt_flags & MIR_INLINED) == 0) { + if (!kLeafOptimization) { mir_graph_->AppendGenSuspendTestList(bb); } break; diff --git a/compiler/dex/quick/x86/utility_x86.cc b/compiler/dex/quick/x86/utility_x86.cc index 30384ec44..6898b5078 100644 --- a/compiler/dex/quick/x86/utility_x86.cc +++ b/compiler/dex/quick/x86/utility_x86.cc @@ -1113,20 +1113,18 @@ void X86Mir2Lir::AnalyzeInvokeStatic(int opcode, BasicBlock * bb, MIR *mir) { } uint32_t index = mir->dalvikInsn.vB; - if (!(mir->optimization_flags & MIR_INLINED)) { - DCHECK(cu_->compiler_driver->GetMethodInlinerMap() != nullptr); - DexFileMethodInliner* method_inliner = - cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file); - InlineMethod method; - if (method_inliner->IsIntrinsic(index, &method)) { - switch (method.opcode) { - case kIntrinsicAbsDouble: - case kIntrinsicMinMaxDouble: - store_method_addr_ = true; - break; - default: - break; - } + DCHECK(cu_->compiler_driver->GetMethodInlinerMap() != nullptr); + DexFileMethodInliner* method_inliner = + cu_->compiler_driver->GetMethodInlinerMap()->GetMethodInliner(cu_->dex_file); + InlineMethod method; + if (method_inliner->IsIntrinsic(index, &method)) { + switch (method.opcode) { + case kIntrinsicAbsDouble: + case kIntrinsicMinMaxDouble: + store_method_addr_ = true; + break; + default: + break; } } } -- 2.11.0