You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
eng
libcxx
libcxxabi
libunwind
lld
lldb
llvm
bindings
cmake
docs
examples
include
lib
projects
resources
runtimes
scripts
test
tools
unittests
utils
FileCheck
KillTheDoctor
LLVMVisualizers
Misc
PerfectShuffle
TableGen
Target
bugpoint
count
crosstool
docker
emacs
fpcmp
gdb-scripts
git
git-svn
jedit
kate
lint
lit
llvm-build
llvm-lit
not
release
sanitizers
testgen
textmate
unittest
valgrind
vim
vscode
yaml-bench
DSAclean.py
DSAextract.py
GenLibDeps.pl
GetRepositoryPath
GetSourceVersion
LLVMBuild.txt
UpdateCMakeLists.pl
abtest.py
bisect
bisect-skip-count
check-each-file
clang-parse-diagnostics-file
codegen-diff
countloc.sh
create_ladder_graph.py
extract_symbols.py
findmisopt
findoptdiff
findsym.pl
getsrcs.sh
lldbDataFormatters.py
llvm-compilers-check
llvm-gisel-cov.py
llvm-native-gxx
llvm.grm
llvmdo
llvmgrep
makellvm
prepare-code-coverage-artifact.py
schedcover.py
shuffle_fuzz.py
shuffle_select_fuzz_tester.py
sort_includes.py
update_llc_test_checks.py
update_mir_test_checks.py
update_test_checks.py
wciia.py
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
version.txt.in
nuget
openmp
polly
Directory.Build.props
Directory.Build.targets
NuGet.config
azure-pipelines.yml
build.cmd
build.sh
dir.common.props
global.json
llvm.proj
mxe-Win64.cmake.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
78 lines
2.3 KiB
Python
78 lines
2.3 KiB
Python
![]() |
#!/usr/bin/python
|
||
|
|
||
|
# This creates a CSV file from the output of the debug output of subtarget:
|
||
|
# llvm-tblgen --gen-subtarget --debug-only=subtarget-emitter
|
||
|
# With thanks to Dave Estes for mentioning the idea at 2014 LLVM Developers' Meeting
|
||
|
|
||
|
import os;
|
||
|
import sys;
|
||
|
import re;
|
||
|
import operator;
|
||
|
|
||
|
table = {}
|
||
|
models = set()
|
||
|
filt = None
|
||
|
|
||
|
def add(instr, model, resource=None):
|
||
|
global table, models
|
||
|
|
||
|
entry = table.setdefault(instr, dict())
|
||
|
entry[model] = resource
|
||
|
models.add(model)
|
||
|
|
||
|
def filter_model(m):
|
||
|
global filt
|
||
|
if m and filt:
|
||
|
return filt.search(m) != None
|
||
|
else:
|
||
|
return True
|
||
|
|
||
|
|
||
|
def display():
|
||
|
global table, models
|
||
|
|
||
|
ordered_table = sorted(table.items(), key=operator.itemgetter(0))
|
||
|
ordered_models = filter(filter_model, sorted(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:
|
||
|
sys.stdout.write(", {}".format(mapping[model]))
|
||
|
else:
|
||
|
sys.stdout.write(", ")
|
||
|
sys.stdout.write(os.linesep)
|
||
|
|
||
|
|
||
|
def machineModelCover(path):
|
||
|
# The interesting bits
|
||
|
re_sched_default = re.compile("SchedRW machine model for ([^ ]*) (.*)\n");
|
||
|
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");
|
||
|
|
||
|
# 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))
|
||
|
match = re_sched_no_default.match(line)
|
||
|
if match: add(match.group(1), None)
|
||
|
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)
|
||
|
|
||
|
display()
|
||
|
|
||
|
if len(sys.argv) > 2:
|
||
|
filt = re.compile(sys.argv[2], re.IGNORECASE)
|
||
|
machineModelCover(sys.argv[1])
|