18 Commits

Author SHA1 Message Date
David Bolvansky
8b74c63fb1 [UpdateTestChecks] Emit warning when invalid value for -check-prefix(es) option
Summary:
The script is silent for the following issue:
FileCheck %s -check-prefix=CHECK,POPCOUNT

FileCheck will catch it later, but I think we can warn here too.

Now it warns:
 ./update_llc_test_checks.py file.ll 
WARNING: Supplied prefix 'CHECK,POPCOUNT' is invalid. Prefix must contain only alphanumeric characters, hyphens and underscores. Did you mean --check-prefixes=CHECK,POPCOUNT?



Reviewers: lebedev.ri, spatel, RKSimon, craig.topper, nikic, gbedwell

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367244 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-29 17:41:00 +00:00
Simon Pilgrim
cf02f1a2eb Add wildcard support to all update_*_test_checks.py scripts (PR37500)
We can already update multiple files in each update call, this extends it to work with wildcards as well in the same way as update_mca_test_checks.py (to support shells that won't do this for us - windows command prompt etc.)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355386 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 10:44:37 +00:00
Simon Pilgrim
610d2e424e Fix update_mir_test_checks.py to run on python3
Split off from D58817

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355268 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-02 11:14:01 +00:00
Justin Bogner
78c10b0e5a update_mir_test_checks: Fix handling of IR input after r326284
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327305 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-12 18:06:58 +00:00
Justin Bogner
60285814dd update_mir_test_checks: Use the regexes from UpdateTestChecks.common
Some of the update_*_test_checks regexes have been moved into a
library, so we might as well use them in update_mir_test_checks.
Also includes minor bugfixes to the regexes that are there so we
don't regress update_mir_test_checks

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326288 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-28 00:56:24 +00:00
Justin Bogner
ddf3aca34a update_mir_test_checks: Drop support for vreg block checks
Since vregs are printed in the instruction stream now, checking the
vreg block is always redundant. Remove the temporary feature that
allowed us to do that.

This reverts r316134

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326284 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-28 00:44:46 +00:00
Justin Bogner
7bf5988467 update_mir_test_checks: Accept "." in function names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323573 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 22:56:31 +00:00
Justin Bogner
95461910b8 update_mir_test_checks: Improve the check for LLVM IR in MIR files
The LLVM IR section of a MIR document can start with "--- |" rather
than just "---", because "|" is a sigil for a freeform document in
YAML. We need to handle this so that we don't try to add check lines
to the LLVM IR functions in a MIR file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323178 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 06:39:04 +00:00
Justin Bogner
437b240ff1 update_mir_test_checks: Accept IR as input as well as MIR
We need to handle IR for tests that want to do lowering (or just
-stop-after with IR as input). I've run this on one AArch64 test to
demonstrate what it looks like.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321048 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19 00:49:04 +00:00
Justin Bogner
537c6eec36 update_mir_test_checks: Add "mir" to some states and regex names
For tests that do lowering we need to support IR as input, so here we
clarify some names to avoid ambiguity in upcoming commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321039 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18 23:31:55 +00:00
Justin Bogner
82cd943eb1 update_mir_test_checks: Be careful about replacing entire vregs
Previously, this could end up replacing a vreg like %14 with
[[VREG1]]4, where VREG1 was the match for %1. That's obviously not
correct, though it hasn't actually come up in any tests I've converted
so far.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-06 21:06:09 +00:00
Justin Bogner
d0f1843940 update_mir_test_checks: Support adding checks for vreg classes
This is a temporary hack to support adding checks for the "registers:"
block of mir functions. This is necessary to convert a number of tests
so that there's less churn when we change the MIR printer to put the
vreg classes on defs instead of in their own block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316134 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 22:39:55 +00:00
Justin Bogner
0ee6442d44 update_mir_test_checks: Improve message when updating fails
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 22:36:08 +00:00
Justin Bogner
ad73a3da68 update_mir_test_checks: Handle empty liveins
An empty livein block doesn't make much sense (why not just omit it?)
but they're legal and some tests have them, so its best to handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316089 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 15:38:56 +00:00
Justin Bogner
2457f45686 update_mir_test_checks: Do a better job of disambiguating names
Matching prefixes isn't good enough, because it leads to things like
calling the first constant C3 just because there were two copies
before it. Tighten up the check to match more precisely, but also be
careful about ambiguity when dealing with target opcodes that end in a
number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316088 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 15:37:09 +00:00
Justin Bogner
f50103299d update_mir_test_checks: Support '-' in function names
Some AArch64 and AMDGPU tests have functions with hyphens in the names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316063 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 05:52:56 +00:00
Justin Bogner
4f42787ca5 update_mir_test_checks: Fix a typo I made while preparing for commit
I accidentally added an extra arg here, so this didn't work at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316062 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 05:39:22 +00:00
Justin Bogner
ae96b7ff9f Add a utility to update MIR checks, similar to update_llc_test_checks
This adds update_mir_test_checks, which updates the check lines in mir
tests. This can only update tests that start and end with .mir
currently (ie, -run-pass) but it should be sufficient for updating at
least some of the GlobalISel tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-18 02:20:31 +00:00