Lines Matching refs:MIR
464 const MIR* mir = fall_through_bb->first_mir_insn;
465 DCHECK(mir != nullptr);
467 if ((Instruction::FlagsOf(mir->dalvikInsn.opcode) & Instruction::kInvoke) != 0) {
468 for (uint16_t i = 0u; i != mir->ssa_rep->num_uses; ++i) {
469 uint16_t value_name = lvn->GetOperandValue(mir->ssa_rep->uses[i]);
933 uint16_t LocalValueNumbering::MarkNonAliasingNonNull(MIR* mir) {
934 uint16_t res = GetOperandValue(mir->ssa_rep->defs[0]);
975 void LocalValueNumbering::HandleNullCheck(MIR* mir, uint16_t reg) {
980 LOG(INFO) << "Removing null check for 0x" << std::hex << mir->offset;
982 mir->optimization_flags |= MIR_IGNORE_NULL_CHECK;
989 void LocalValueNumbering::HandleRangeCheck(MIR* mir, uint16_t array, uint16_t index) {
995 LOG(INFO) << "Removing range check for 0x" << std::hex << mir->offset;
997 mir->optimization_flags |= MIR_IGNORE_RANGE_CHECK;
1005 void LocalValueNumbering::HandlePutObject(MIR* mir) {
1007 uint16_t base = GetOperandValue(mir->ssa_rep->uses[0]);
1019 uint16_t LocalValueNumbering::HandlePhi(MIR* mir) {
1024 int16_t num_uses = mir->ssa_rep->num_uses;
1025 int32_t* uses = mir->ssa_rep->uses;
1027 if (mir->ssa_rep->defs[0] != 0 &&
1028 sreg_wide_value_map_.count(mir->ssa_rep->defs[0] - 1) != 0u) {
1042 BasicBlockId* incoming = mir->meta.phi_incoming;
1046 DCHECK_LT(pos, mir->ssa_rep->num_uses);
1049 DCHECK_LT(pos, mir->ssa_rep->num_uses);
1065 value_name = gvn_->LookupValue(kNoValue, mir->ssa_rep->defs[0], kNoValue, kNoValue);
1073 SetOperandValueWide(mir->ssa_rep->defs[0], value_name);
1075 SetOperandValue(mir->ssa_rep->defs[0], value_name);
1080 uint16_t LocalValueNumbering::HandleAGet(MIR* mir, uint16_t opcode) {
1082 uint16_t array = GetOperandValue(mir->ssa_rep->uses[0]);
1083 HandleNullCheck(mir, array);
1084 uint16_t index = GetOperandValue(mir->ssa_rep->uses[1]);
1085 HandleRangeCheck(mir, array, index);
1098 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1100 SetOperandValue(mir->ssa_rep->defs[0], res);
1105 void LocalValueNumbering::HandleAPut(MIR* mir, uint16_t opcode) {
1108 uint16_t array = GetOperandValue(mir->ssa_rep->uses[array_idx]);
1109 HandleNullCheck(mir, array);
1110 uint16_t index = GetOperandValue(mir->ssa_rep->uses[index_idx]);
1111 HandleRangeCheck(mir, array, index);
1115 ? GetOperandValueWide(mir->ssa_rep->uses[0])
1116 : GetOperandValue(mir->ssa_rep->uses[0]);
1143 uint16_t LocalValueNumbering::HandleIGet(MIR* mir, uint16_t opcode) {
1144 uint16_t base = GetOperandValue(mir->ssa_rep->uses[0]);
1145 HandleNullCheck(mir, base);
1146 const MirFieldInfo& field_info = gvn_->GetMirGraph()->GetIFieldLoweringInfo(mir);
1152 res = gvn_->LookupValue(kNoValue, mir->ssa_rep->defs[0], kNoValue, kNoValue);
1171 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1173 SetOperandValue(mir->ssa_rep->defs[0], res);
1178 void LocalValueNumbering::HandleIPut(MIR* mir, uint16_t opcode) {
1181 uint16_t base = GetOperandValue(mir->ssa_rep->uses[base_reg]);
1182 HandleNullCheck(mir, base);
1183 const MirFieldInfo& field_info = gvn_->GetMirGraph()->GetIFieldLoweringInfo(mir);
1186 // Use mir->offset as modifier; without elaborate inlining, it will be unique.
1188 gvn_->LookupValue(kUnresolvedIFieldOp, kNoValue, kNoValue, mir->offset);
1214 ? GetOperandValueWide(mir->ssa_rep->uses[0])
1215 : GetOperandValue(mir->ssa_rep->uses[0]);
1247 uint16_t LocalValueNumbering::HandleSGet(MIR* mir, uint16_t opcode) {
1248 const MirSFieldLoweringInfo& field_info = gvn_->GetMirGraph()->GetSFieldLoweringInfo(mir);
1249 if (!field_info.IsInitialized() && (mir->optimization_flags & MIR_IGNORE_CLINIT_CHECK) == 0) {
1251 HandleInvokeOrClInit(mir);
1258 res = gvn_->LookupValue(kNoValue, mir->ssa_rep->defs[0], kNoValue, kNoValue);
1275 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1277 SetOperandValue(mir->ssa_rep->defs[0], res);
1282 void LocalValueNumbering::HandleSPut(MIR* mir, uint16_t opcode) {
1283 const MirSFieldLoweringInfo& field_info = gvn_->GetMirGraph()->GetSFieldLoweringInfo(mir);
1284 if (!field_info.IsInitialized() && (mir->optimization_flags & MIR_IGNORE_CLINIT_CHECK) == 0) {
1286 HandleInvokeOrClInit(mir);
1291 // Use mir->offset as modifier; without elaborate inlining, it will be unique.
1293 gvn_->LookupValue(kUnresolvedSFieldOp, kNoValue, kNoValue, mir->offset);
1301 ? GetOperandValueWide(mir->ssa_rep->uses[0])
1302 : GetOperandValue(mir->ssa_rep->uses[0]);
1331 void LocalValueNumbering::HandleInvokeOrClInit(MIR* mir) {
1332 // Use mir->offset as modifier; without elaborate inlining, it will be unique.
1334 gvn_->LookupValue(kInvokeMemoryVersionBumpOp, 0u, 0u, mir->offset);
1345 uint16_t LocalValueNumbering::GetValueNumber(MIR* mir) {
1347 uint16_t opcode = mir->dalvikInsn.opcode;
1383 HandleNullCheck(mir, GetOperandValue(mir->ssa_rep->uses[0]));
1390 HandleNullCheck(mir, GetOperandValue(mir->ssa_rep->uses[0]));
1393 gvn_->CanModify() && (mir->optimization_flags & MIR_IGNORE_NULL_CHECK) == 0) {
1395 << mir->offset << " in " << PrettyMethod(gvn_->cu_->method_idx, *gvn_->cu_->dex_file);
1402 if (mir->next != nullptr && mir->next->dalvikInsn.opcode == Instruction::MOVE_RESULT_OBJECT) {
1403 uint16_t array = MarkNonAliasingNonNull(mir->next);
1405 if (kLocalValueNumberingEnableFilledNewArrayTracking && mir->ssa_rep->num_uses != 0u) {
1409 for (size_t i = 0u, count = mir->ssa_rep->num_uses; i != count; ++i) {
1412 uint16_t value = GetOperandValue(mir->ssa_rep->uses[i]);
1421 for (size_t i = 0u, count = mir->ssa_rep->num_uses; i != count; ++i) {
1422 uint16_t reg = GetOperandValue(mir->ssa_rep->uses[i]);
1436 uint16_t reg = GetOperandValue(mir->ssa_rep->uses[0]);
1437 HandleNullCheck(mir, reg);
1442 if ((mir->optimization_flags & MIR_INLINED) == 0) {
1444 for (size_t i = 0u, count = mir->ssa_rep->num_uses; i != count; ++i) {
1445 uint16_t reg = GetOperandValue(mir->ssa_rep->uses[i]);
1448 HandleInvokeOrClInit(mir);
1456 res = GetOperandValue(mir->ssa_rep->defs[0]);
1457 SetOperandValue(mir->ssa_rep->defs[0], res);
1464 res = MarkNonAliasingNonNull(mir);
1465 SetOperandValue(mir->ssa_rep->defs[0], res);
1470 res = gvn_->LookupValue(Instruction::CONST_STRING, Low16Bits(mir->dalvikInsn.vB),
1471 High16Bits(mir->dalvikInsn.vB), 0);
1472 SetOperandValue(mir->ssa_rep->defs[0], res);
1482 res = GetOperandValueWide(mir->ssa_rep->defs[0]);
1483 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1487 res = HandlePhi(mir);
1498 res = GetOperandValue(mir->ssa_rep->uses[0]);
1499 SetOperandValue(mir->ssa_rep->defs[0], res);
1506 res = GetOperandValueWide(mir->ssa_rep->uses[0]);
1507 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1513 mir->dalvikInsn.vB),
1514 High16Bits(mir->dalvikInsn.vB), 0);
1515 SetOperandValue(mir->ssa_rep->defs[0], res);
1519 res = gvn_->LookupValue(Instruction::CONST, 0, mir->dalvikInsn.vB, 0);
1520 SetOperandValue(mir->ssa_rep->defs[0], res);
1525 uint16_t low_res = gvn_->LookupValue(Instruction::CONST, Low16Bits(mir->dalvikInsn.vB),
1526 High16Bits(mir->dalvikInsn.vB >> 16), 1);
1528 if (mir->dalvikInsn.vB & 0x80000000) {
1534 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1539 uint32_t low_word = Low32Bits(mir->dalvikInsn.vB_wide);
1540 uint32_t high_word = High32Bits(mir->dalvikInsn.vB_wide);
1546 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1553 Low16Bits(mir->dalvikInsn.vB), 2);
1555 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1561 uint16_t reg = GetOperandValue(mir->ssa_rep->uses[0]);
1562 HandleNullCheck(mir, reg);
1574 uint16_t operand1 = GetOperandValue(mir->ssa_rep->uses[0]);
1576 SetOperandValue(mir->ssa_rep->defs[0], res);
1585 uint16_t operand1 = GetOperandValueWide(mir->ssa_rep->uses[0]);
1587 SetOperandValue(mir->ssa_rep->defs[0], res);
1598 uint16_t operand1 = GetOperandValueWide(mir->ssa_rep->uses[0]);
1600 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1609 uint16_t operand1 = GetOperandValue(mir->ssa_rep->uses[0]);
1611 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1619 uint16_t operand1 = GetOperandValueWide(mir->ssa_rep->uses[0]);
1620 uint16_t operand2 = GetOperandValueWide(mir->ssa_rep->uses[2]);
1622 SetOperandValue(mir->ssa_rep->defs[0], res);
1651 uint16_t operand1 = GetOperandValue(mir->ssa_rep->uses[0]);
1652 uint16_t operand2 = GetOperandValue(mir->ssa_rep->uses[1]);
1654 SetOperandValue(mir->ssa_rep->defs[0], res);
1685 uint16_t operand1 = GetOperandValueWide(mir->ssa_rep->uses[0]);
1686 uint16_t operand2 = GetOperandValueWide(mir->ssa_rep->uses[2]);
1688 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1699 uint16_t operand1 = GetOperandValueWide(mir->ssa_rep->uses[0]);
1700 uint16_t operand2 = GetOperandValue(mir->ssa_rep->uses[2]);
1702 SetOperandValueWide(mir->ssa_rep->defs[0], res);
1717 uint16_t operand1 = GetOperandValue(mir->ssa_rep->uses[0]);
1718 uint16_t operand2 = GetOperandValue(mir->ssa_rep->uses[1]);
1720 SetOperandValue(mir->ssa_rep->defs[0], res);
1744 uint16_t operand1 = GetOperandValue(mir->ssa_rep->uses[0]);
1745 uint16_t operand2 = gvn_->LookupValue(Instruction::CONST, mir->dalvikInsn.vC, 0, 0);
1747 SetOperandValue(mir->ssa_rep->defs[0], res);
1758 res = HandleAGet(mir, opcode);
1762 HandlePutObject(mir);
1770 HandleAPut(mir, opcode);
1780 res = HandleIGet(mir, opcode);
1784 HandlePutObject(mir);
1792 HandleIPut(mir, opcode);
1802 res = HandleSGet(mir, opcode);
1806 HandlePutObject(mir);
1814 HandleSPut(mir, opcode);