History log of /llvm-project/llvm/utils/update_cc_test_checks.py (Results 1 – 25 of 59)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7
# 5315f3f8 13-Jan-2025 Momchil Velikov <momchil.velikov@arm.com>

Handle leading underscores in update_cc_test_checks.py (#121800)

For some ABIs `update_cc_test_checks.py` is unable to generate tests
because of the mismatch between the mangled function names repo

Handle leading underscores in update_cc_test_checks.py (#121800)

For some ABIs `update_cc_test_checks.py` is unable to generate tests
because of the mismatch between the mangled function names reported by
clang's `-asd-dump` and the function names in LLVM IR.

This patch fixes it by striping the leading underscore from the mangled
name for global functions if the data layout string says they have one.

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7
# 597ac471 18-May-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: match IR basic block labels (#88979)

Labels are matched using a regexp of the form '^(pattern):', which
requires the addition of a "suffix" concept to NamelessValue.

Aside fr

update_test_checks: match IR basic block labels (#88979)

Labels are matched using a regexp of the form '^(pattern):', which
requires the addition of a "suffix" concept to NamelessValue.

Aside from that, the key challenge is that block labels are values, and
we typically capture values including the prefix '%'. However, when
labels appear at the start of a basic block, the prefix '%' is not
included, so we must capture block label values *without* the prefix
'%'.

We don't know ahead of time whether an IR value is a label or not. In
most cases, they are prefixed by the word "label" (their type), but this
isn't the case in phi nodes. We solve this issue by leveraging the
two-phase nature of variable generalization: the first pass finds all
occurences of a variable and determines whether the '%' prefix can be
included or not. The second pass does the actual substitution.

This change also unifies the generalization path for assembly with that
for IR and analysis, in the hope that any future changes avoid diverging
those cases future.

I also considered the alternative of trying to detect the phi node case
using more regular expression special cases but ultimately decided
against that because it seemed more fragile, and perhaps the approach of
keeping a tentative prefix that may later be discarded could also be
eventually applied to some metadata and attribute cases.

Note that an early version of this change was reviewed as
https://reviews.llvm.org/D142452, before version numbers were
introduced. This is a substantially updated version of that change.

show more ...


Revision tags: llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5
# e6eda66c 13-Nov-2023 Henrik G. Olsson <hnrklssn@gmail.com>

Recommit changes to global checks (#71171)

Recommits the changes from https://reviews.llvm.org/D148216.
Explicitly named globals are now matched literally, instead of emitting
a capture group for

Recommit changes to global checks (#71171)

Recommits the changes from https://reviews.llvm.org/D148216.
Explicitly named globals are now matched literally, instead of emitting
a capture group for the name. This resolves #70047.
Metadata and annotations, on the other hand, are captured and matched
against by default, since their identifiers are not stable.

The reasons for revert (#63746) have been fixed:
The first issue, that of duplicated checkers, has already been resolved
in #70050.
This PR resolves the second issue listed in #63746, regarding the order
of named and unnamed globals. This is fixed by recording the index of
substrings containing global values, and sorting the checks according to
that index before emitting them. This results in global value checks
being emitted in the order they were seen instead of being grouped
separately.

show more ...


Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# b9f1df7a 14-Jul-2023 Johannes Doerfert <johannes@jdoerfert.de>

Revert "[UTC] Add fallback support for specific metadata, and check their defs"

This reverts commit 8a3fdf7b908978625e9a7e57fbb443e4e6f98976 as it is
broken. See https://github.com/llvm/llvm-project

Revert "[UTC] Add fallback support for specific metadata, and check their defs"

This reverts commit 8a3fdf7b908978625e9a7e57fbb443e4e6f98976 as it is
broken. See https://github.com/llvm/llvm-project/issues/63746.

Effectively fixes: https://github.com/llvm/llvm-project/issues/63746

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2
# 8a3fdf7b 14-Apr-2023 Henrik G. Olsson <hnrklssn@gmail.com>

[UTC] Add fallback support for specific metadata, and check their defs

This prevents update_cc_tests.py from emitting hard-coded identifiers
for metadata (global variable checkers still check hard-c

[UTC] Add fallback support for specific metadata, and check their defs

This prevents update_cc_tests.py from emitting hard-coded identifiers
for metadata (global variable checkers still check hard-coded
identifiers). Instead it emits regex checkers that match even if the
identifiers change. Also adds a new mode for --check-globals: instead of
simply being on or off, it now has the options 'none', 'smart' and
'all', with 'none' and 'all' corresponding to the previous modes.

The 'smart' mode only emits checks for global definitions referenced
in the IR or other metadata that itself has a definition checker
emitted, making the rule transitive. It does not emit checks for
attribute sets, since that is better checked by --check-attributes. This
mode is made the new default. To make the change in default mode
backwards compatible a version bump is introduced (to v3), and the
default remains 'none' in v1 & v2.

This will result in metadata checks being emitted more often, so filters
are added to not check absolute file paths and compiler version git
hashes.

rdar://105239218

show more ...


# b71edfaa 15-May-2023 Tobias Hieta <tobias@hieta.se>

[NFC][Py Reformat] Reformat python files in llvm

This is the first commit in a series that will reformat
all the python files in the LLVM repository.

Reformatting is done with `black`.

See more in

[NFC][Py Reformat] Reformat python files in llvm

This is the first commit in a series that will reformat
all the python files in the LLVM repository.

Reformatting is done with `black`.

See more information here:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: jhenderson, JDevlieghere, MatzeB

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

show more ...


Revision tags: llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init
# a26d3031 24-Jan-2023 Nikita Popov <npopov@redhat.com>

[UTC] Include return type/attributes under --version 2

If --function-signature is used with --version 2, then also include
the return type/attributes in the check lines. This is the
implementation o

[UTC] Include return type/attributes under --version 2

If --function-signature is used with --version 2, then also include
the return type/attributes in the check lines. This is the
implementation of D133943 rebased on the --version mechanism from
D142473.

This doesn't bump the default version yet, because I'd like to do
that together with D140212 (which enables --function-signature by
default), as these changes seem closely related. For now this
functionality can be accessed by explicitly passing --version 2
to UTC.

Fixes https://github.com/llvm/llvm-project/issues/61058.

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

show more ...


# ae691c38 04-Feb-2023 Shengchen Kan <shengchen.kan@intel.com>

[UpdateTestChecks][NFC] Share the code to get CHECK prefix between all scripts

Reviewed By: MaskRay

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


Revision tags: llvmorg-15.0.7, llvmorg-15.0.6
# 255e7e1c 28-Nov-2022 Mircea Trofin <mtrofin@google.com>

[UpdateTestChecks] Fix `update_*_test_checks.py` to add "unused" prefixes

The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://list

[UpdateTestChecks] Fix `update_*_test_checks.py` to add "unused" prefixes

The support introduced in D124306 was only added to
update_llc_test_checks.py, but the motivating usecases (see
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)
cover update_test_checks.py, update_cc_test_checks.py, and
update_analyze_test_checks.py, too.

Issue #59220.

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

show more ...


Revision tags: llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2
# 01fdc2a3 21-Sep-2022 John McIver <john.mciver.iii@gmail.com>

[Utils] Refactor update_cc_test_checks.py to use shutil

The package `distutils` is deprecated and removal is planned for Python 3.12. All calls to `distutils.spawn.find_executable` are replaced with

[Utils] Refactor update_cc_test_checks.py to use shutil

The package `distutils` is deprecated and removal is planned for Python 3.12. All calls to `distutils.spawn.find_executable` are replaced with local version of `find_executable` which makes use of `shutils.which`.

Reviewed By: arichardson, MaskRay

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

show more ...


# 837caa99 20-Sep-2022 Ben Dunbobbin <Ben.Dunbobbin@sony.com>

Revert "[Utils] Refactor update_cc_test_checks.py to use shutil"

This reverts commit 2e6c50855b7d879ded3776ba87b3d960e2035b89.

This caused failures on windows bots:
- https://lab.llvm.org/buildbot/

Revert "[Utils] Refactor update_cc_test_checks.py to use shutil"

This reverts commit 2e6c50855b7d879ded3776ba87b3d960e2035b89.

This caused failures on windows bots:
- https://lab.llvm.org/buildbot/#/builders/216/builds/10030
- https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/clang-windows-x64/b8802513693562827489/overview

show more ...


# 2e6c5085 20-Sep-2022 John McIver <john.mciver.iii@gmail.com>

[Utils] Refactor update_cc_test_checks.py to use shutil

The package distutils is deprecated and removal is planned for Python 3.12.
All calls to distutils.spawn.find_executable are replaced with shu

[Utils] Refactor update_cc_test_checks.py to use shutil

The package distutils is deprecated and removal is planned for Python 3.12.
All calls to distutils.spawn.find_executable are replaced with shutil.which.

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

show more ...


Revision tags: llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# 5a4033c3 19-Jul-2022 Nicolai Hähnle <nicolai.haehnle@amd.com>

update-test-checks: safely handle tests with #if's

There is at least one Clang test (clang/test/CodeGen/arm_acle.c) which
has functions guarded by #if's that cause those functions to be compiled
onl

update-test-checks: safely handle tests with #if's

There is at least one Clang test (clang/test/CodeGen/arm_acle.c) which
has functions guarded by #if's that cause those functions to be compiled
only for a subset of RUN lines.

This results in a case where one RUN line has a body for the function
and another doesn't. Treat this case as a conflict for any prefixes that
the two RUN lines have in common.

This change exposed a bug where functions with '$' in the name weren't
properly recognized in ARM assembly (despite there being a test case
that was supposed to catch the problem!). This bug is fixed as well.

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

show more ...


# 9f708695 13-Jul-2022 Roman Rusyaev <rusyaev.rm@gmail.com>

Change shebang from python to python3 in update_cc_test_checks.py

All update_test_checks.py scripts were updated in this revision
https://reviews.llvm.org/D70730 except for update_cc_test_checks.py.

Change shebang from python to python3 in update_cc_test_checks.py

All update_test_checks.py scripts were updated in this revision
https://reviews.llvm.org/D70730 except for update_cc_test_checks.py.

Reviewed By: barannikov88

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

show more ...


Revision tags: llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2
# f15c6021 22-Apr-2022 Mircea Trofin <mtrofin@google.com>

[UpdateTestChecks] Auto-generate stub bodies for unused prefixes

This is scoped to autogenerated tests.

The goal is to support having each RUN line specify a list of
check-prefixes where one can sp

[UpdateTestChecks] Auto-generate stub bodies for unused prefixes

This is scoped to autogenerated tests.

The goal is to support having each RUN line specify a list of
check-prefixes where one can specify potentially redundant prefixes. For example,
for X86, if one specified prefixes for both AVX1 and AVX2, and the codegen happened to
match today, one of the prefixes would be used and the onther one not.
If the unused prefix were dropped, and later, codegen differences were
introduced, one would have to go figure out where to add what prefix
(paraphrasing
https://lists.llvm.org/pipermail/llvm-dev/2021-February/148326.html)

To avoid getting errors due to unused prefixes, whole directories can be
opted out (as discussed on that thread), but that means that tests that
aren't autogenerated in such directories could have undetected unused
prefix bugs.

This patch proposes an alternative that both avoids the above, dir-level
optout, and supports the main autogen scenario discussed first. The autogen
tool appends at the end of the test file the list of unused prefixes,
together with a note explaining that is the case. Each prefix is set up
to always pass.

This way, unexpected unused prefixes are easily discoverable, and
expected cases "just work".

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

show more ...


# 37a68497 12-May-2022 Alex Richardson <alexrichardson@google.com>

[update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output

To avoid test churn when backends add/rename new instructions/registers,
it makes sense to use FileCheck captures for the exac

[update_llc_test_checks] Use FileCheck captures for MCInst/MCReg output

To avoid test churn when backends add/rename new instructions/registers,
it makes sense to use FileCheck captures for the exact MCInst/Reg number.
This is motivated by D125307, where I use --asm-show-inst to differentiate
the output for multiple instructions with the same mnemonic.

This does not quite fix the churn issue yet: While files with the generated
checks will be immune to the numbers changing, the update script test
still suffers from this problem since the number is encoded in the
FileCheck variable name. I plan to address this in a follow-up patch.

Reviewed By: MaskRay

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

show more ...


Revision tags: llvmorg-14.0.1
# 062b1ae7 21-Mar-2022 Nikita Popov <npopov@redhat.com>

Reapply [Utils] Fix %S substitution

%S refers to the directory of %s, not to the cwd. This is mostly
handled correctly, but update_cc_test_checks.py used the wrong
path for non-FileCheck RUN lines.

Reapply [Utils] Fix %S substitution

%S refers to the directory of %s, not to the cwd. This is mostly
handled correctly, but update_cc_test_checks.py used the wrong
path for non-FileCheck RUN lines.

Reapplying this with a fix for an update_cc_test_checks test that
was based on cwd semantics.

show more ...


# 7af5fc13 21-Mar-2022 Nikita Popov <npopov@redhat.com>

Revert "[Utils] Fix %S substitution"

This reverts commit 8ee1ef2a087da1a101a6b2c0bea31788da289e0b.

This breaks an update_cc_test_checks test that is based on an
incorrect %S use, revert until I can

Revert "[Utils] Fix %S substitution"

This reverts commit 8ee1ef2a087da1a101a6b2c0bea31788da289e0b.

This breaks an update_cc_test_checks test that is based on an
incorrect %S use, revert until I can fix it.

show more ...


# 8ee1ef2a 21-Mar-2022 Nikita Popov <npopov@redhat.com>

[Utils] Fix %S substitution

%S refers to the directory of %s, not to the cwd. This is mostly
handled correctly, but update_cc_test_checks.py used for the wrong
path for non-FileCheck RUN lines.


Revision tags: llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2
# 8565b6f9 01-Mar-2022 Yatao Wang <ningxinr@live.cn>

[UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py

Add a check on run lines to pick up isel options in llc commands and allow
generating check lines of isel final o

[UpdateLLCTestChecks] Add support for isel debug output in update_llc_test_checks.py

Add a check on run lines to pick up isel options in llc commands and allow
generating check lines of isel final output other than assembly. If llc command
line contains -debug-only=isel, update_llc_test_checks.py will try to scrub isel
output, otherwise, the script will fall back on default behaviour, which is try to
scrub assembly output instead.

The motivation of this change is to allow usage of update_llc_test_checks.py to
autogenerate checks of instruction selection results. In this way, we can detect
errors at an earlier stage before the compilation goes all the way to assembly.
It is an example of having some transparency for the stages between IR and
assembly. These generated tests are almost like "unit tests" of isel stage.

This patch only implements the initial change to differentiate isel output from
assembly output for Lanai. Other targets will not be supported for isel check
generation at the moment. Although adding support for it will only require
implementing the function regex and scrubber for corresponding targets.

The Lanai implementation was chosen mainly for the simplicity of demonstrating
the difference between isel checks and asm checks.

This patch also do not include the implementation of function prefix, which is
required for the generated isel checks to pass. I will put up a follow up revision
for the function prefix change to complete isel support.

Reviewed By: Flakebi

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

show more ...


Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init
# ecd46edd 31-Jan-2022 David Greene <david.greene@cerebras.net>

[UpdateTestChecks] Re-add --filter and --filter-out options

Re-add filtering options with fixes for failed tests. We were not passing the
is_filtered argument in all check generator calls in update

[UpdateTestChecks] Re-add --filter and --filter-out options

Re-add filtering options with fixes for failed tests. We were not passing the
is_filtered argument in all check generator calls in update_cc_test_checks.py

Enhance the various update_*_test_checks.py tools to allow filtering the tool
output with regular expressions. The --filter option will emit only tool output
lines matching the given regular expression while the --filter-out option will
emit only tools output lines not matching the given regular expression. Filters
are applied in order of appearance on the command line (or in UTC_ARGS) and the
first matching filter terminates the search.

This allows test authors to create more focused tests by removing irrelevant
tool output and checking only the pieces of output necessary to test the desired
functionality.

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

show more ...


# 7e32d2b2 29-Jan-2022 David Greene <david.greene@cerebras.net>

Revert "[UpdateTestChecks] Add --filter and --filter-out options"

Broke some update-test-checks tests. Reverting while developing a fix.

This reverts commit 030f71698d52f228929da5e3148602f4a3daff7

Revert "[UpdateTestChecks] Add --filter and --filter-out options"

Broke some update-test-checks tests. Reverting while developing a fix.

This reverts commit 030f71698d52f228929da5e3148602f4a3daff7d.

show more ...


Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3
# 030f7169 19-Jan-2022 David Greene <david.greene@cerebras.net>

[UpdateTestChecks] Add --filter and --filter-out options

Enhance the various update_*_test_checks.py tools to allow filtering the tool
output with regular expressions. The --filter option will emit

[UpdateTestChecks] Add --filter and --filter-out options

Enhance the various update_*_test_checks.py tools to allow filtering the tool
output with regular expressions. The --filter option will emit only tool output
lines matching the given regular expression while the --filter-out option will
emit only tools output lines not matching the given regular expression. Filters
are applied in order of appearance on the command line (or in UTC_ARGS) and the
first matching filter terminates the search.

This allows test authors to create more focused tests by removing irrelevant
tool output and checking only the pieces of output necessary to test the desired
functionality.

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

show more ...


Revision tags: llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1
# 48648931 29-Jul-2021 Sebastian Neubauer <sebastian.neubauer@amd.com>

[Utils] Do not remove comments in llc test script

When checking if two prefixes can be merged for a function,
update_llc_test_checks.py removed IR comments before comparing
llc outputs of different

[Utils] Do not remove comments in llc test script

When checking if two prefixes can be merged for a function,
update_llc_test_checks.py removed IR comments before comparing
llc outputs of different RUN lines.
This means, if one RUN line emited lines starting with ';' and another
RUN line emited the same lines except the ones starting with ';', both
RUNs would be merged (if they share a prefix).

However, CHECK-NEXT lines check the comments, otherwise they fail, so
the script should not merge RUNs if they contain different comments.

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

show more ...


# 0e79a948 28-Jul-2021 Jessica Clarke <jrtc27@jrtc27.com>

[Utils] Support class template specializations in update_cc_test_checks

ClassTemplateSpecializationDecl not within a ClassTemplateDecl
represents an explicit instatiation of a template and so should

[Utils] Support class template specializations in update_cc_test_checks

ClassTemplateSpecializationDecl not within a ClassTemplateDecl
represents an explicit instatiation of a template and so should be
handled as if it were a normal CXXRecordDecl. Unfortunately, having an
equivalent for FunctionTemplateDecl remains a TODO in ASTDumper's
VisitFunctionTemplateDecl, with all the explicit instantiations just
being emitted inside the FunctionTemplateDecl along with all the other
specializations, meaning we can't easily support explicit function
instantiations in update_cc_test_checks.

Reviewed By: arichardson

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

show more ...


123