@Override public void visit(StoreResultNode node) { node.getValue().accept(expressionVisitor); super.visit(node); } }
@Override public void visit(StoreResultNode node) { node.getValue().accept(visitorExp); super.visit(node); } };
@Override public void visit(AssignmentNode node) { node.getVariable().accept(this); code.append("&= "); node.getValue().accept(this); code.append("\\\\\n"); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { System.out.println("MyAssignmentVisit"); isVariable = true; System.out.println("---------Getting Variable----------"); node.getVariable().accept(this); getStringToAssignment().put(lastcomponent, node); String debug = lastcomponent; isVariable = false; System.out.println("---------Getting Value----------"); node.getValue().accept(this); assert toappend != null : "toappend nicht null"; getAssignmentToOperationMap().put(node, toappend); toappend.setDebugMessage(debug); // new VerilogNode(dfg); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { node.getVariable().accept(visitorExp); node.getValue().accept(visitorExp); super.visit(node); }
@Override public void visit(AssignmentNode node) { node.getVariable().accept(expressionVisitor); node.getValue().accept(expressionVisitor); super.visit(node); }
@Override public void visit(AssignmentNode node) { node.getVariable().accept(expressionVisitor); node.getValue().accept(expressionVisitor); super.visit(node); } }
@Override public void visit(AssignmentNode node) { node.setValue(performConstantPropagationOnExpression(node.getValue())); // get variable component of target dfgVisitorUsedVariables.getVariables().clear(); node.getVariable().accept(dfgVisitorUsedVariables); VariableComponent target = dfgVisitorUsedVariables.getVariables().getFirst(); // remove variable component from mapConstants, because of re-assignment mapConstants.remove(target); if (isFloatConstant(node.getValue())) { mapConstants.put(target, (FloatConstant) node.getValue()); } super.visit(node); }
@Override public void visit(AssignmentNode node) { String variable = node.getVariable().getName(); if (assigned.contains(variable)) { String message = "Variable " + variable + " has been reset for reuse."; log.warn(message); Notifications.addWarning(message); code.append("\n"); appendIndentation(); code.append("memset("); code.append(variable); code.append(", 0, sizeof("); code.append(variable); code.append(")); // Reset variable for reuse.\n"); assigned.remove(variable); } appendIndentation(); node.getVariable().accept(this); code.append(" = "); node.getValue().accept(this); code.append(";"); if (node.getVariable() instanceof MultivectorComponent) { code.append(" // "); MultivectorComponent component = (MultivectorComponent) node.getVariable(); code.append(node.getGraph().getAlgebraDefinitionFile().getBladeString(component.getBladeIndex())); } code.append('\n'); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { if (assigned.contains(node.getVariable().getName())) { log.warn("Reuse of variable " + node.getVariable().getName() + ". Make sure to reset this variable or use another name."); code.append("\n"); appendIndentation(); code.append("// Warning: reuse of variable "); code.append(node.getVariable().getName()); code.append(".\n"); appendIndentation(); code.append("// Make sure to reset this variable or use another name.\n"); assigned.remove(node.getVariable().getName()); } appendIndentation(); node.getVariable().accept(this); code.append(" = "); node.getValue().accept(this); code.append(";\n"); node.getSuccessor().accept(this); } }
@Override public void visit(LoopNode node) { node.getCounterVariable().accept(this); node.getBody().accept(this); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { if (assigned.contains(node.getVariable().getName())) { log.warn("Reuse of variable " + node.getVariable().getName() + ". Make sure to reset this variable or use another name."); code.append("\n"); appendIndentation(); code.append("// Warning: reuse of variable "); code.append(node.getVariable().getName()); code.append(".\n"); appendIndentation(); code.append("// Make sure to reset this variable or use another name.\n"); assigned.remove(node.getVariable().getName()); } appendIndentation(); node.getVariable().accept(new MultivectorComponentWriteVisitor()); code.append(" = "); node.getValue().accept(this); code.append(";\n"); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { // just do nothing, because only MulitvectorComponent is important node.getValue().accept(this); node.getVariable().accept(this); node.getSuccessor().accept(this); }
@Override public void visit(AssignmentNode node) { // get the target variable dfgVisitorusedVariables.getVariables().clear(); node.getVariable().accept(dfgVisitorusedVariables); VariableComponent variable = dfgVisitorusedVariables.getVariables().getFirst(); // Here is the optimization: Check, if the variable is used later. // If it isn't used later, then remove this node, because the assignment is unnecessary. if (!variableUsage.isUsed(variable)) { nodeRemovals.addFirst(node); } else { // variable definition variableUsage.addDefinition(variable); // value usage dfgVisitorusedVariables.getVariables().clear(); node.getValue().accept(dfgVisitorusedVariables); for (VariableComponent component : dfgVisitorusedVariables.getVariables()) { variableUsage.addUsage(component); } } }
@Override public void visit(AssignmentNode node) { appendIndentation(); declaredLocal.add(getVarName(node.getVariable())); node.getVariable().accept(this); append(" = "); node.getValue().accept(this); if (node.getVariable() instanceof MultivectorComponent) { append(';'); append(" // "); MultivectorComponent component = (MultivectorComponent) node.getVariable(); append(node.getGraph().getAlgebraDefinitionFile().getBladeString(component.getBladeIndex())); } append(";\n"); node.getSuccessor().accept(this); }