if (iop.isCall() && !instr.isDead()) { valueMap = new HashMap<>(); simplificationMap = new HashMap<>();
if (iop.isCall() && !instr.isDead()) { valueMap = new HashMap<>(); simplificationMap = new HashMap<>();
Operation(int flags) { this.flags = flags; if (this.isArgReceive()) { this.opClass = OpClass.ARG_OP; } else if (this.isBranch()) { this.opClass = OpClass.BRANCH_OP; } else if (this.isBookKeepingOp()) { this.opClass = OpClass.BOOK_KEEPING_OP; } else if (this.isCall()) { this.opClass = OpClass.CALL_OP; } else { this.opClass = OpClass.OTHER_OP; } }
Operation(int flags) { this.flags = flags; if (this.isArgReceive()) { this.opClass = OpClass.ARG_OP; } else if (this.isBranch()) { this.opClass = OpClass.BRANCH_OP; } else if (this.isBookKeepingOp()) { this.opClass = OpClass.BOOK_KEEPING_OP; } else if (this.isCall()) { this.opClass = OpClass.CALL_OP; } else { this.opClass = OpClass.OTHER_OP; } }
public static void runLocalOptsOnInstrArray(IRScope s, Instr[] instrs) { // Reset value map if this instruction is the start/end of a basic block Map<Operand,Operand> valueMap = new HashMap<>(); Map<Variable,List<Variable>> simplificationMap = new HashMap<>(); for (int i = 0; i < instrs.length; i++) { Instr instr = instrs[i]; Instr newInstr = optInstr(s, instr, valueMap, simplificationMap); if (newInstr != instr) { instrs[i] = newInstr; } // If the call has been optimized away in the previous step, it is no longer a hard boundary for opts! // // Right now, calls are considered hard boundaries for optimization and // information cannot be propagated across them! // // SSS FIXME: Rather than treat all calls with a broad brush, what we need // is to capture different attributes about a call : // - uses closures // - known call target // - can modify scope, // - etc. // // This information is present in instruction flags on CallBase. Use it! Operation iop = instr.getOperation(); if (iop.startsBasicBlock() || iop.endsBasicBlock() || (iop.isCall() && !instr.isDead())) { valueMap = new HashMap<>(); simplificationMap = new HashMap<>(); } } }
public static void runLocalOptsOnInstrArray(IRScope s, Instr[] instrs) { // Reset value map if this instruction is the start/end of a basic block Map<Operand,Operand> valueMap = new HashMap<>(); Map<Variable,List<Variable>> simplificationMap = new HashMap<>(); for (int i = 0; i < instrs.length; i++) { Instr instr = instrs[i]; Instr newInstr = optInstr(s, instr, valueMap, simplificationMap); if (newInstr != instr) { instrs[i] = newInstr; } // If the call has been optimized away in the previous step, it is no longer a hard boundary for opts! // // Right now, calls are considered hard boundaries for optimization and // information cannot be propagated across them! // // SSS FIXME: Rather than treat all calls with a broad brush, what we need // is to capture different attributes about a call : // - uses closures // - known call target // - can modify scope, // - etc. // // This information is present in instruction flags on CallBase. Use it! Operation iop = instr.getOperation(); if (iop.startsBasicBlock() || iop.endsBasicBlock() || (iop.isCall() && !instr.isDead())) { valueMap = new HashMap<>(); simplificationMap = new HashMap<>(); } } }
Operation(int flags) { this.flags = flags; if (this.isArgReceive()) { this.opClass = OpClass.ARG_OP; } else if ((flags & OpFlags.f_is_return) > 0) { this.opClass = OpClass.RET_OP; } else if (this.isBranch()) { this.opClass = OpClass.BRANCH_OP; } else if (this.isBookKeepingOp()) { this.opClass = OpClass.BOOK_KEEPING_OP; } else if (this.isCall()) { this.opClass = OpClass.CALL_OP; } else if ((flags & OpFlags.f_is_int_op) > 0) { this.opClass = OpClass.INT_OP; } else if ((flags & OpFlags.f_is_float_op) > 0) { this.opClass = OpClass.FLOAT_OP; } else { this.opClass = OpClass.OTHER_OP; } }
Operation(int flags) { this.flags = flags; if (this.isArgReceive()) { this.opClass = OpClass.ARG_OP; } else if ((flags & OpFlags.f_is_return) > 0) { this.opClass = OpClass.RET_OP; } else if (this.isBranch()) { this.opClass = OpClass.BRANCH_OP; } else if (this.isBookKeepingOp()) { this.opClass = OpClass.BOOK_KEEPING_OP; } else if (this.isCall()) { this.opClass = OpClass.CALL_OP; } else if ((flags & OpFlags.f_is_int_op) > 0) { this.opClass = OpClass.INT_OP; } else if ((flags & OpFlags.f_is_float_op) > 0) { this.opClass = OpClass.FLOAT_OP; } else { this.opClass = OpClass.OTHER_OP; } }
if ((preCFG && iop.endsBasicBlock()) || (iop.isCall() && !i.isDead())) { valueMap = new HashMap<Operand,Operand>(); simplificationMap = new HashMap<Variable,List<Variable>>();
if ((preCFG && iop.endsBasicBlock()) || (iop.isCall() && !i.isDead())) { valueMap = new HashMap<Operand,Operand>(); simplificationMap = new HashMap<Variable,List<Variable>>();