/** * Simulate the phis in a block and note the results in the lattice. * @param block Block to visit */ private void simulatePhiBlock(SsaBasicBlock block) { for (SsaInsn insn : block.getInsns()) { if (insn instanceof PhiInsn) { simulatePhi((PhiInsn) insn); } else { return; } } }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding instruction for a given move result * * @param moveInsn {@code non-null;} a move result instruction * @return {@code non-null;} the instruction that produces the result for * the move */ private SsaInsn getInsnForMove(SsaInsn moveInsn) { int pred = moveInsn.getBlock().getPredecessors().nextSetBit(0); ArrayList<SsaInsn> predInsns = ssaMeth.getBlocks().get(pred).getInsns(); return predInsns.get(predInsns.size()-1); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Finds the corresponding move result for a given instruction * * @param insn {@code non-null;} an instruction that must always be * followed by a move result * @return {@code non-null;} the move result for the given instruction */ private SsaInsn getMoveForInsn(SsaInsn insn) { int succ = insn.getBlock().getSuccessors().nextSetBit(0); ArrayList<SsaInsn> succInsns = ssaMeth.getBlocks().get(succ).getInsns(); return succInsns.get(0); }
/** * Simulate a block and note the results in the lattice. * @param block Block to visit */ private void simulateBlock(SsaBasicBlock block) { for (SsaInsn insn : block.getInsns()) { if (insn instanceof PhiInsn) { simulatePhi((PhiInsn) insn); } else { simulateStmt(insn); } } }
/** * Simulate a block and note the results in the lattice. * @param block Block to visit */ private void simulateBlock(SsaBasicBlock block) { for (SsaInsn insn : block.getInsns()) { if (insn instanceof PhiInsn) { simulatePhi((PhiInsn) insn); } else { simulateStmt(insn); } } }
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }
/** * "v is live-out at s." */ private void liveOutAtStatement() { SsaInsn statement = blockN.getInsns().get(statementIndex); RegisterSpec rs = statement.getResult(); if (!statement.isResultReg(regV)) { if (rs != null) { interference.add(regV, rs.getReg()); } nextFunction = NextFunction.LIVE_IN_AT_STATEMENT; } }