improved performance of arch_semantics and reg dependency matching

This commit is contained in:
Julian Hammer
2020-11-09 19:27:47 +01:00
parent f64253b2b9
commit 314ff4cf9d
4 changed files with 43 additions and 57 deletions

View File

@@ -398,9 +398,7 @@ class ArchSemantics(ISASemantics):
def g(obj, value):
obj[item] = value
else:
def g(obj, *values):
for item, value in zip(items, values):
obj[item] = value
@@ -416,7 +414,9 @@ class ArchSemantics(ISASemantics):
@staticmethod
def get_throughput_sum(kernel):
"""Get the overall throughput sum separated by port of all instructions of a kernel."""
port_pressures = [instr['port_pressure'] for instr in kernel]
# ignoring all lines with throughput == 0.0, because there won't be anything to sum up
# typically comment, label and non-instruction lines
port_pressures = [instr['port_pressure'] for instr in kernel if instr['throughput'] != 0.0]
# Essentially summing up each columns of port_pressures, where each column is one port
# and each row is one line of the kernel
# round is necessary to ensure termination of ArchsSemantics.assign_optimal_throughput