private static void ToReductionList( IEnumerable <ValueTag> arguments, InstructionPrototype prototype, List <ValueTag> reductionArgs, HashSet <ValueTag> reductionOps, ValueUses uses, FlowGraph graph) { foreach (var arg in arguments) { NamedInstruction insn; if (graph.TryGetInstruction(arg, out insn)) { ToReductionList( insn, prototype, reductionArgs, reductionOps, uses); } else { reductionArgs.Add(arg); } } }
private static void ToReductionList( NamedInstruction instruction, InstructionPrototype prototype, List <ValueTag> reductionArgs, HashSet <ValueTag> reductionOps, ValueUses uses) { if (uses.GetUseCount(instruction) == 1 && instruction.Prototype == prototype) { ToReductionList( instruction.Instruction.Arguments, prototype, reductionArgs, reductionOps, uses, instruction.Block.Graph); reductionOps.Add(instruction); } else { reductionArgs.Add(instruction); } }