Lines Matching refs:mir
40 MIR* mir; in DoConstantPropogation() local
42 for (mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { in DoConstantPropogation()
43 int df_attributes = oat_data_flow_attributes_[mir->dalvikInsn.opcode]; in DoConstantPropogation()
45 DecodedInstruction *d_insn = &mir->dalvikInsn; in DoConstantPropogation()
57 SetConstant(mir->ssa_rep->defs[0], vB); in DoConstantPropogation()
60 SetConstant(mir->ssa_rep->defs[0], vB << 16); in DoConstantPropogation()
64 SetConstantWide(mir->ssa_rep->defs[0], static_cast<int64_t>(vB)); in DoConstantPropogation()
67 SetConstantWide(mir->ssa_rep->defs[0], d_insn->vB_wide); in DoConstantPropogation()
70 SetConstantWide(mir->ssa_rep->defs[0], static_cast<int64_t>(vB) << 48); in DoConstantPropogation()
80 for (i = 0; i < mir->ssa_rep->num_uses; i++) { in DoConstantPropogation()
81 if (!is_constant_v_->IsBitSet(mir->ssa_rep->uses[i])) break; in DoConstantPropogation()
84 if (i == mir->ssa_rep->num_uses) { in DoConstantPropogation()
85 SetConstant(mir->ssa_rep->defs[0], constant_values_[mir->ssa_rep->uses[0]]); in DoConstantPropogation()
87 SetConstant(mir->ssa_rep->defs[1], constant_values_[mir->ssa_rep->uses[1]]); in DoConstantPropogation()
106 static MIR* AdvanceMIR(BasicBlock** p_bb, MIR* mir) { in AdvanceMIR() argument
108 if (mir != NULL) { in AdvanceMIR()
109 mir = mir->next; in AdvanceMIR()
110 if (mir == NULL) { in AdvanceMIR()
113 mir = NULL; in AdvanceMIR()
116 mir = bb->first_mir_insn; in AdvanceMIR()
120 return mir; in AdvanceMIR()
130 MIR* MIRGraph::FindMoveResult(BasicBlock* bb, MIR* mir) { in FindMoveResult() argument
132 mir = AdvanceMIR(&tbb, mir); in FindMoveResult()
133 while (mir != NULL) { in FindMoveResult()
134 int opcode = mir->dalvikInsn.opcode; in FindMoveResult()
135 if ((mir->dalvikInsn.opcode == Instruction::MOVE_RESULT) || in FindMoveResult()
136 (mir->dalvikInsn.opcode == Instruction::MOVE_RESULT_OBJECT) || in FindMoveResult()
137 (mir->dalvikInsn.opcode == Instruction::MOVE_RESULT_WIDE)) { in FindMoveResult()
142 mir = NULL; in FindMoveResult()
144 mir = AdvanceMIR(&tbb, mir); in FindMoveResult()
147 return mir; in FindMoveResult()
172 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { in FindPhi() local
173 if (static_cast<int>(mir->dalvikInsn.opcode) == kMirOpPhi) { in FindPhi()
174 for (int i = 0; i < mir->ssa_rep->num_uses; i++) { in FindPhi()
175 if (mir->ssa_rep->uses[i] == ssa_name) { in FindPhi()
176 return mir; in FindPhi()
184 static SelectInstructionKind SelectKind(MIR* mir) { in SelectKind() argument
185 switch (mir->dalvikInsn.opcode) { in SelectKind()
219 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { in BasicBlockOpt() local
221 local_valnum.GetValueNumber(mir); in BasicBlockOpt()
223 Instruction::Code opcode = mir->dalvikInsn.opcode; in BasicBlockOpt()
234 if (mir->next != NULL) { in BasicBlockOpt()
235 MIR* mir_next = mir->next; in BasicBlockOpt()
262 (mir->ssa_rep->defs[0] == mir_next->ssa_rep->uses[0]) && in BasicBlockOpt()
263 (GetSSAUseCount(mir->ssa_rep->defs[0]) == 1)) { in BasicBlockOpt()
288 mir->dalvikInsn.opcode = static_cast<Instruction::Code>(kMirOpNop); in BasicBlockOpt()
289 mir_next->ssa_rep->num_uses = mir->ssa_rep->num_uses; in BasicBlockOpt()
290 mir_next->ssa_rep->uses = mir->ssa_rep->uses; in BasicBlockOpt()
291 mir_next->ssa_rep->fp_use = mir->ssa_rep->fp_use; in BasicBlockOpt()
293 mir->ssa_rep->num_uses = 0; in BasicBlockOpt()
294 mir->ssa_rep->num_defs = 0; in BasicBlockOpt()
316 mir->optimization_flags |= MIR_IGNORE_SUSPEND_CHECK; in BasicBlockOpt()
318 … LOG(INFO) << "Suppressed suspend check on branch to return at 0x" << std::hex << mir->offset; in BasicBlockOpt()
329 ((mir->dalvikInsn.opcode == Instruction::IF_EQZ) || in BasicBlockOpt()
330 (mir->dalvikInsn.opcode == Instruction::IF_NEZ))) { in BasicBlockOpt()
383 mir->dalvikInsn.opcode = static_cast<Instruction::Code>(kMirOpSelect); in BasicBlockOpt()
395 mir->dalvikInsn.vB = if_true->dalvikInsn.vB; in BasicBlockOpt()
397 mir->dalvikInsn.vC = if_false->dalvikInsn.vB; in BasicBlockOpt()
403 src_ssa[0] = mir->ssa_rep->uses[0]; in BasicBlockOpt()
406 mir->ssa_rep->uses = src_ssa; in BasicBlockOpt()
407 mir->ssa_rep->num_uses = 3; in BasicBlockOpt()
409 mir->ssa_rep->num_defs = 1; in BasicBlockOpt()
410 mir->ssa_rep->defs = in BasicBlockOpt()
412 mir->ssa_rep->fp_def = in BasicBlockOpt()
414 mir->ssa_rep->fp_def[0] = if_true->ssa_rep->fp_def[0]; in BasicBlockOpt()
416 mir->ssa_rep->fp_use = in BasicBlockOpt()
417 static_cast<bool*>(arena_->Alloc(sizeof(bool) * mir->ssa_rep->num_uses, in BasicBlockOpt()
419 for (int i = 0; i < mir->ssa_rep->num_uses; i++) { in BasicBlockOpt()
420 mir->ssa_rep->fp_use[i] = mir->ssa_rep->fp_def[0]; in BasicBlockOpt()
431 mir->ssa_rep->defs[0] = phi->ssa_rep->defs[0]; in BasicBlockOpt()
436 mir->ssa_rep->defs[0] = live_def; in BasicBlockOpt()
481 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { in CountChecks() local
482 if (mir->ssa_rep == NULL) { in CountChecks()
485 int df_attributes = oat_data_flow_attributes_[mir->dalvikInsn.opcode]; in CountChecks()
488 if (mir->optimization_flags & MIR_IGNORE_NULL_CHECK) { in CountChecks()
494 if (mir->optimization_flags & MIR_IGNORE_RANGE_CHECK) { in CountChecks()
566 MIR* mir = bb->last_mir_insn; in CombineBlocks() local
568 MIR* throw_insn = mir->meta.throw_insn; in CombineBlocks()
672 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) { in EliminateNullChecks() local
673 if (mir->ssa_rep == NULL) { in EliminateNullChecks()
676 int df_attributes = oat_data_flow_attributes_[mir->dalvikInsn.opcode]; in EliminateNullChecks()
680 temp_ssa_register_v_->SetBit(mir->ssa_rep->defs[0]); in EliminateNullChecks()
685 MIR* next_mir = mir->next; in EliminateNullChecks()
721 int tgt_sreg = mir->ssa_rep->defs[0]; in EliminateNullChecks()
723 mir->ssa_rep->num_uses; in EliminateNullChecks()
726 null_checked &= temp_ssa_register_v_->IsBitSet(mir->ssa_rep->uses[i]); in EliminateNullChecks()
734 if ((df_attributes & DF_HAS_NULL_CHKS) && !(mir->optimization_flags & MIR_IGNORE_NULL_CHECK)) { in EliminateNullChecks()
743 int src_sreg = mir->ssa_rep->uses[src_idx]; in EliminateNullChecks()
746 mir->optimization_flags |= MIR_IGNORE_NULL_CHECK; in EliminateNullChecks()