[PATCH] D44834: [MachineScheduler] Add itinerary to schedcover.py. Make default work in the command line filter
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 26 21:30:18 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL328608: [MachineScheduler] Add itinerary to schedcover.py. Make default work in theā¦ (authored by ctopper, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D44834?vs=139612&id=139884#toc
Repository:
rL LLVM
https://reviews.llvm.org/D44834
Files:
llvm/trunk/utils/schedcover.py
Index: llvm/trunk/utils/schedcover.py
===================================================================
--- llvm/trunk/utils/schedcover.py
+++ llvm/trunk/utils/schedcover.py
@@ -31,20 +31,26 @@
def display():
global table, models
+ # remove default and itinerary so we can control their sort order to make
+ # them first
+ models.discard("default")
+ models.discard("itinerary")
+
ordered_table = sorted(table.items(), key=operator.itemgetter(0))
- ordered_models = filter(filter_model, sorted(models))
+ ordered_models = ["itinerary", "default"]
+ ordered_models.extend(sorted(models))
+ ordered_models = filter(filter_model, ordered_models)
# print header
sys.stdout.write("instruction")
for model in ordered_models:
- if not model: model = "default"
sys.stdout.write(", {}".format(model))
sys.stdout.write(os.linesep)
for (instr, mapping) in ordered_table:
sys.stdout.write(instr)
for model in ordered_models:
- if model in mapping:
+ if model in mapping and mapping[model] is not None:
sys.stdout.write(", {}".format(mapping[model]))
else:
sys.stdout.write(", ")
@@ -57,18 +63,21 @@
re_sched_no_default = re.compile("No machine model for ([^ ]*)\n");
re_sched_spec = re.compile("InstRW on ([^ ]*) for ([^ ]*) (.*)\n");
re_sched_no_spec = re.compile("No machine model for ([^ ]*) on processor (.*)\n");
+ re_sched_itin = re.compile("Itinerary for ([^ ]*): ([^ ]*)\n")
# scan the file
with open(path, 'r') as f:
for line in f.readlines():
match = re_sched_default.match(line)
- if match: add(match.group(1), None, match.group(2))
+ if match: add(match.group(1), "default", match.group(2))
match = re_sched_no_default.match(line)
- if match: add(match.group(1), None)
+ if match: add(match.group(1), "default")
match = re_sched_spec.match(line)
if match: add(match.group(2), match.group(1), match.group(3))
- match = re_sched_no_default.match(line)
- if match: add(match.group(1), None)
+ match = re_sched_no_spec.match(line)
+ if match: add(match.group(1), match.group(2))
+ match = re_sched_itin.match(line)
+ if match: add(match.group(1), "itinerary", match.group(2))
display()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44834.139884.patch
Type: text/x-patch
Size: 2464 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180327/4ba1997c/attachment.bin>
More information about the llvm-commits
mailing list