/** * This method takes as input a map of operands to their values, and outputs * the result of this instruction. * * If the value map provides a value for any of the instruction's operands * the expectation is that the operand will be replaced with the simplified value. * It is not required that it do so -- code correctness is not compromised by failure * to simplify. * * @param scope where this instr exists * @param valueMap Mapping from operands to their simplified values * @return simplified result / output of this instruction */ public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); return null; // By default, no simplifications! }
/** * This method takes as input a map of operands to their values, and outputs * the result of this instruction. * * If the value map provides a value for any of the instruction's operands * the expectation is that the operand will be replaced with the simplified value. * It is not required that it do so -- code correctness is not compromised by failure * to simplify. * * @param scope where this instr exists * @param valueMap Mapping from operands to their simplified values * @return simplified result / output of this instruction */ public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); return null; // By default, no simplifications! }
/** * This method takes as input a map of operands to their values, and outputs * the result of this instruction. * * If the value map provides a value for any of the instruction's operands * the expectation is that the operand will be replaced with the simplified value. * It is not required that it do so -- code correctness is not compromised by failure * to simplify. * * @param valueMap Mapping from operands to their simplified values * @returns simplified result / output of this instruction */ public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); return null; // By default, no simplifications! }
/** * This method takes as input a map of operands to their values, and outputs * the result of this instruction. * * If the value map provides a value for any of the instruction's operands * the expectation is that the operand will be replaced with the simplified value. * It is not required that it do so -- code correctness is not compromised by failure * to simplify. * * @param valueMap Mapping from operands to their simplified values * @returns simplified result / output of this instruction */ public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); return null; // By default, no simplifications! }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
copyMap.put(v, src); Instr soleUse = uses.get(0); soleUse.simplifyOperands(copyMap, true);
copyMap.put(v, src); Instr soleUse = uses.get(0); soleUse.simplifyOperands(copyMap, true);