/** * Update the value graph to account for a given PI instruction. * * <p><b>PRECONDITION:</b> <code> s.operator == PI </code> * * @param s the instruction in question */ private void processPi(Instruction s) { Register result = GuardedUnary.getResult(s).getRegister(); ValueGraphVertex v = findOrCreateVertex(result); Operand val = GuardedUnary.getVal(s); // bypass Move instructions that define the right-hand side val = bypassMoves(val); v.copyVertex(findOrCreateVertex(val)); }
/** * Update the value graph to account for a given GuardedUnary instruction. * * <p><b>PRECONDITION:</b> <code> GuardedUnary.conforms(s); </code> Careful: we define two Guarded * Unaries to be equivalent regardless of whether the guards are equivalent! * * @param s the instruction in question */ private void processGuardedUnary(Instruction s) { // label the vertex corresponding to the result with the operator RegisterOperand result = GuardedUnary.getResult(s); ValueGraphVertex v = findOrCreateVertex(result.getRegister()); v.setLabel(s.operator(), 1); // link node v to the operand it uses Operand val = GuardedUnary.getVal(s); // bypass Move instructions val = bypassMoves(val); link(v, findOrCreateVertex(val), 0); }