15 Commits

Author SHA1 Message Date
Simon Pilgrim
b739c0c2b7 [utils] Fix update scripts output when run on python3.
This fixes a "bytes-like object is required, not 'str'" python3 error I hit on update_llc_test_checks.py (but present on the other scripts as well) by matching what update_mca_test_checks.py already does, plus I've added an explicit 'utf-8' encoding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352633 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 16:15:59 +00:00
Serge Guelton
6da47bee84 Python compat - no explicit reference to Python version
Update documentation and shebang.

Differential Revision: https://reviews.llvm.org/D56252

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350327 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-03 15:44:24 +00:00
Greg Bedwell
11ead03db9 [llvm-mca][UpdateTestChecks] Don't try to align blocks that have already been subject to alignment in update_mca_test_checks.py
This fixes PR39466.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345499 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-29 13:24:20 +00:00
Greg Bedwell
59b22373c7 [utils] Ensure that update_mca_test_checks.py writes prefixes in alphabetical order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343783 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-04 14:42:19 +00:00
Greg Bedwell
440a48b3e4 [utils] simple refactor in update_mca_test_checks.py to make intent more readable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343782 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-04 14:42:06 +00:00
Greg Bedwell
076b15bac0 [utils] Cope with the binary having a .exe extension in update_mca_test_checks.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343333 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 15:39:18 +00:00
Greg Bedwell
340f0f6086 [utils] Stricter checking from update_mca_test_checks.py
If any prefixes have been specified on the RUN lines that do not end up
ever actually getting printed, raise an Error. This is either an
indication that the run lines just need cleaning up, or that something
is more fundamentally wrong with the test.

Also raise an Error if there are any blocks which cannot be checked
because they are not uniquely covered by a prefix.

Fixed up a couple of tests where the extra checking flagged up issues.

Differential Revision: https://reviews.llvm.org/D48276

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343332 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 15:39:09 +00:00
Greg Bedwell
29869b91c0 [utils] Allow better identification of matching blocks in update_mca_test_checks.py
Insert empty blocks to cause the positions of matching blocks to match
across lists where possible so that later stages of the algorithm can
actually identify them as being identical.

Regenerated all tests with this change.

Differential Revision: https://reviews.llvm.org/D52560

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343331 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-28 15:38:56 +00:00
Greg Bedwell
8ca27f22af [UpdateTestChecks] Error if --llvm-mca-binary gets an empty string
If the command line was mistyped like:
./update_mca_test_checks.py --llvm-mca-binary= /path/to/llvm-mca *.s
                                              ^-- extra whitespace

then /path/to/llvm-mca would get treated by argparse as a test-path
pattern and could actually be opened in write mode and overwritten.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334029 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-05 17:16:19 +00:00
Greg Bedwell
14d1a66e67 [llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given empty input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333894 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-04 12:30:10 +00:00
Roman Lebedev
c8a936b18e [llvm-mca] Make sure not to end the test files with an empty line.
Summary:
It's super irritating.

[properly configured] git client then complains about that double-newline,
and you have to use `--force` to ignore the warning, since even if you
fix it manually, it will be reintroduced the very next runtime :/

Reviewers: RKSimon, andreadb, courbet, craig.topper, javed.absar, gbedwell

Reviewed By: gbedwell

Subscribers: javed.absar, tschuett, gbedwell, llvm-commits

Differential Revision: https://reviews.llvm.org/D47697

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333887 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-04 11:48:46 +00:00
Greg Bedwell
add59cbbbb [UpdateTestChecks] Improved update_mca_test_checks block analysis
Previously update_mca_test_checks worked entirely at "block" level where
a block is some sequence of lines delimited by at least one empty line.
This generally worked well, but could sometimes lead to excessive
repetition of check lines for various prefixes if some block was almost
identical between prefixes, but not quite (for example, due to a
different dispatch width in the otherwise identical summary views).

This new analyis attempts to split blocks further in the case where the
following conditions are met:
  a) There is some prefix common to every RUN line (typically 'ALL').
  b) The first line of the block is common to the output with every prefix.
  c) The block has the same number of lines for the output with every prefix.

Also, regenerated all llvm-mca test files with the following command:
update_mca_test_checks.py "../test/tools/llvm-mca/*/*.s" "../test/tools/llvm-mca/*/*/*.s"

The new analysis showed a "multiple lines not disambiguated by prefixes" warning
for test "AArch64/Exynos/scheduler-queue-usage.s" so I've also added some
explicit prefixes to each of the RUN lines in that test.

Differential Revision: https://reviews.llvm.org/D47321

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333204 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-24 16:36:44 +00:00
Greg Bedwell
b3a293eadb [UpdateTestChecks] Change update_mca_test_checks.py file mode to match the other scripts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330815 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-25 11:20:42 +00:00
Greg Bedwell
2f0f603361 [UpdateTestChecks] Fix update_mca_test_checks.py slowness issue
The script was using Python's difflib module to calculate the number of
lines changed so that it could report it in its status output.  It turns
out this can be very very slow on large sets of lines (Python bug 6931).
It's not worth the cost, so just remove the usage of difflib entirely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330419 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-20 11:38:11 +00:00
Greg Bedwell
31d0ca3473 [UpdateTestChecks] Add update_mca_test_checks.py script
This script can be used to regenerate tests in the
test/tools/llvm-mca directory (PR36904).

Regenerated a number of tests using the pattern: test/tools/llvm-mca/*/*/*.s

Differential Revision: https://reviews.llvm.org/D45369

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330246 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-18 10:27:45 +00:00