Lines Matching refs:mir
329 void MirConverter::ConvertCompareAndBranch(BasicBlock* bb, MIR* mir,
331 if (mir_graph_->GetBasicBlock(bb->taken)->start_offset <= mir->offset) {
345 MIR* mir, ConditionCode cc, RegLocation rl_src1) {
346 if (mir_graph_->GetBasicBlock(bb->taken)->start_offset <= mir->offset) {
467 void MirConverter::ConvertInvoke(BasicBlock* bb, MIR* mir,
469 CallInfo* info = mir_graph_->NewMemCallInfo(bb, mir, invoke_type, is_range);
703 bool MirConverter::ConvertMIRNode(MIR* mir, BasicBlock* bb,
708 Instruction::Code opcode = mir->dalvikInsn.opcode;
710 uint32_t vB = mir->dalvikInsn.vB;
711 uint32_t vC = mir->dalvikInsn.vC;
712 int opt_flags = mir->optimization_flags;
729 rl_src[next_loc++] = mir_graph_->GetSrcWide(mir, next_sreg);
732 rl_src[next_loc++] = mir_graph_->GetSrc(mir, next_sreg);
738 rl_src[next_loc++] = mir_graph_->GetSrcWide(mir, next_sreg);
741 rl_src[next_loc++] = mir_graph_->GetSrc(mir, next_sreg);
747 rl_src[next_loc++] = mir_graph_->GetSrcWide(mir, next_sreg);
749 rl_src[next_loc++] = mir_graph_->GetSrc(mir, next_sreg);
754 rl_dest = mir_graph_->GetDestWide(mir);
756 rl_dest = mir_graph_->GetDest(mir);
776 * MIR (at least until we stop using the Dalvik register maps).
814 irb_->getJLong(mir->dalvikInsn.vB_wide);
922 ConvertCompareAndBranch(bb, mir, kCondEq, rl_src[0], rl_src[1]);
925 ConvertCompareAndBranch(bb, mir, kCondNe, rl_src[0], rl_src[1]);
928 ConvertCompareAndBranch(bb, mir, kCondLt, rl_src[0], rl_src[1]);
931 ConvertCompareAndBranch(bb, mir, kCondGe, rl_src[0], rl_src[1]);
934 ConvertCompareAndBranch(bb, mir, kCondGt, rl_src[0], rl_src[1]);
937 ConvertCompareAndBranch(bb, mir, kCondLe, rl_src[0], rl_src[1]);
940 ConvertCompareZeroAndBranch(bb, mir, kCondEq, rl_src[0]);
943 ConvertCompareZeroAndBranch(bb, mir, kCondNe, rl_src[0]);
946 ConvertCompareZeroAndBranch(bb, mir, kCondLt, rl_src[0]);
949 ConvertCompareZeroAndBranch(bb, mir, kCondGe, rl_src[0]);
952 ConvertCompareZeroAndBranch(bb, mir, kCondGt, rl_src[0]);
955 ConvertCompareZeroAndBranch(bb, mir, kCondLe, rl_src[0]);
1128 ConvertInvoke(bb, mir, kStatic, false /*range*/,
1132 ConvertInvoke(bb, mir, kStatic, true /*range*/,
1137 ConvertInvoke(bb, mir, kDirect, false /*range*/,
1141 ConvertInvoke(bb, mir, kDirect, true /*range*/,
1146 ConvertInvoke(bb, mir, kVirtual, false /*range*/,
1150 ConvertInvoke(bb, mir, kVirtual, true /*range*/,
1155 ConvertInvoke(bb, mir, kSuper, false /*range*/,
1159 ConvertInvoke(bb, mir, kSuper, true /*range*/,
1164 ConvertInvoke(bb, mir, kInterface, false /*range*/,
1168 ConvertInvoke(bb, mir, kInterface, true /*range*/,
1172 ConvertInvoke(bb, mir, kInterface, false /*range*/,
1176 ConvertInvoke(bb, mir, kInterface, true /*range*/,
1551 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) {
1552 int opcode = mir->dalvikInsn.opcode;
1554 // Stop after first non-pseudo MIR op.
1558 // Skip other mir Pseudos.
1561 RegLocation rl_dest = mir_graph_->reg_location_[mir->ssa_rep->defs[0]];
1572 BasicBlockId* incoming = mir->meta.phi_incoming;
1575 ::llvm::PHINode* phi = irb_->CreatePHI(phi_type, mir->ssa_rep->num_uses);
1576 for (int i = 0; i < mir->ssa_rep->num_uses; i++) {
1579 loc = mir_graph_->GetRawSrc(mir, i);
1597 /* Extended MIR instructions like PHI */
1598 void MirConverter::ConvertExtendedMIR(BasicBlock* bb, MIR* mir,
1600 switch (static_cast<ExtendedMIROpcode>(mir->dalvikInsn.opcode)) {
1603 RegLocation rl_dest = mir_graph_->reg_location_[mir->ssa_rep->defs[0]];
1617 if ((mir == bb->last_mir_insn) && (bb->taken == NullBasicBlockId) &&
1706 * Because of the differences between how MIR/LIR and llvm handle exit
1722 for (MIR* mir = bb->first_mir_insn; mir != NULL; mir = mir->next) {
1723 SetDexOffset(mir->offset);
1725 int opcode = mir->dalvikInsn.opcode;
1727 Instruction::FormatOf(mir->dalvikInsn.opcode);
1731 MIR* work_half = mir->meta.throw_insn;
1732 mir->dalvikInsn.opcode = work_half->dalvikInsn.opcode;
1733 opcode = mir->dalvikInsn.opcode;
1735 work_half->ssa_rep = mir->ssa_rep;
1736 mir->ssa_rep = ssa_rep;
1742 irb_->CreateCall(intr, irb_->getInt32(mir->offset));
1763 ConvertExtendedMIR(bb, mir, llvm_bb);
1767 bool not_handled = ConvertMIRNode(mir, bb, llvm_bb);
1771 mir->offset, opcode,
1880 * Convert MIR to LLVM_IR
1883 * o For each MIR basic block, create an LLVM basic block.
1884 * o Iterate through the MIR a basic block at a time, setting arguments
1893 // Create an LLVM basic block for each MIR block in dfs preorder
1900 * Create an llvm named value for each MIR SSA name. Note: we'll use