History log of /llvm-project/llvm/utils/UpdateTestChecks/common.py (Results 1 – 25 of 159)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 46f9cddf 29-Jan-2025 Sebastian Pop <568397+sebpop@users.noreply.github.com>

[DA] enable update_analyze_test_checks.py (#123435)

Modify the DA pretty printer to match the output of other analysis
passes. This enables update_analyze_test_checks.py to also work on DA
tests.

[DA] enable update_analyze_test_checks.py (#123435)

Modify the DA pretty printer to match the output of other analysis
passes. This enables update_analyze_test_checks.py to also work on DA
tests. Auto generate all the Dependence Analysis tests.

show more ...


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 ...


# d07762e4 08-Jan-2025 Jessica Del <50999226+OutOfCache@users.noreply.github.com>

[UpdateTestChecks][NFC] - Fix typos (#121964)

substition -> substitution
in-betweem -> in-between


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# 6f973fd4 30-Oct-2024 Brox Chen <guochen2@amd.com>

[AMDGPU][test] fix the error case in update_mc_test_check script (#112731)

update_mc_test_check script handle the "error case testline" wrong in
three cases:

1. when user select "--llvm-mc-binar

[AMDGPU][test] fix the error case in update_mc_test_check script (#112731)

update_mc_test_check script handle the "error case testline" wrong in
three cases:

1. when user select "--llvm-mc-binary" with a path, the script does not
add "not" on top of the "--llvm-mc-binary" and thus getting non-zero
exit code and failed.
2. When "not" is presented in runline while not all testlines are
expected to fail, the script need to check if the "not" is needed when
it execute llvm-mc line by line. Otherwise the script will fail on
testline which is passing.
3. When there are multiple runlines, the error checkline need to use
correct line offset for "[[LINE-X]]"

This patch solve these three issues

show more ...


# 528e975a 29-Oct-2024 Brox Chen <guochen2@amd.com>

[AMDGPU][test]added unique and sort options for update_mc_test_check script (#111769)

add a unique and a sort option to the update_mc_test_check script.

These mc asm/dasm files are usually large

[AMDGPU][test]added unique and sort options for update_mc_test_check script (#111769)

add a unique and a sort option to the update_mc_test_check script.

These mc asm/dasm files are usually large in number of lines, and these
lines are mostly similar to each other. These options can be useful when
maintainer is merging or resolving conflicts by making the file
identifical

Also fixed a small issue in asm/dasm such that the auto generated header
line is
1. asm using ";" instead of "//" as comment marker
2. dasm using ";" instead of "#" as comment marker

show more ...


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2
# ae6af37b 07-Oct-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: fix a simple regression (#111347)

Reported-by: Yingwei Zheng <dtcxzyw2333@gmail.com>
Fixes: 02debcef12793b5 ("update_test_checks: improve IR value name
stability (#110940)")


# 9f3f76a6 04-Oct-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: collect original check lines for old versions of lit tests (#111148)

Old versions of UTC produced function labels like:

; CHECK-LABEL: @func(

Fix the regular expression

update_test_checks: collect original check lines for old versions of lit tests (#111148)

Old versions of UTC produced function labels like:

; CHECK-LABEL: @func(

Fix the regular expression used when scanning for old check lines to
recognize this form of label.

This allows meta variable stability to apply when running UTC on tests
using this form of label.

Reported-by: Nikita Popov <npopov@redhat.com>

show more ...


# 02debcef 04-Oct-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: improve IR value name stability (#110940)

By default, UTC attempts to keep the produced diff small by keeping IR
value name variables stable. The old algorithm was roughly:

1

update_test_checks: improve IR value name stability (#110940)

By default, UTC attempts to keep the produced diff small by keeping IR
value name variables stable. The old algorithm was roughly:

1. Compute a diff between the old and new check lines, where
"uncommitted" variable names are replaced by a wildcard.
This leads to a set of non-crossing "candidate" pairs of
(old line, new line) that we can try to make equal.

2. Greedily walk this list of candidates, committing to variable names
that make candidate lines equal if possible.

The greedy approach in the second step has the downside that committing
to a variable name greedily can sometimes prevent many subsequent
candidates from getting the variable name assignment that would make
them equal.

We keep the first step as-is, but replace the second one by an algorithm
that finds a large independent set of candidates, i.e. candidate pairs
of (old line, new line) which are non-conflicting in the sense that
their desired variable name mappings are not in conflict.

We find the large independent set by greedily assigning a coloring to
the conflict graph and taking the largest color class. We then commit to
all the variable name mappings which are desired by candidates in this
largest color class.

As before, we then recurse into regions between matching lines. This is
required in large cases. For example, running this algorithm at the
top-level of the new test case (stable_ir_values5.ll) matches up most of
the instructions, but not the names of the result values of all the
`load`s. This is because (unlike e.g. the getelementptrs) the load
instructions are all equal except for variable names, and so step 1 (the
diff algorithm) doesn't consider them as candidates. However, they are
trivially matched by recursion.

This also happens to fix a bug in tracking line indices that went
unnoticed previously...

As is usually the case with these changes, the quality improvement is
hard to see from the diff of this patch. However, it becomes obvious
when
comparing the diff of stable_ir_values5.ll against
stable_ir_value5.ll.expected
before and after this change.

show more ...


Revision tags: llvmorg-19.1.1
# 2b892b05 23-Sep-2024 Brox Chen <guochen2@amd.com>

added a script to update llvm-mc test file (#107246)

Added a script to update the test file generated by llvm-mc binary. The
script accepts .s and .txt for asm and dasm.

For mc test I am targett

added a script to update llvm-mc test file (#107246)

Added a script to update the test file generated by llvm-mc binary. The
script accepts .s and .txt for asm and dasm.

For mc test I am targetting there is no function name which can be used
as a key, thus no clear mapping between input and output. The script
assumes the test are always line-by-line and it update the output marker
for each test line-by-line.

---------

Co-authored-by: Alexander Richardson <mail@alexrichardson.me>

show more ...


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4
# c49770c6 30-Aug-2024 Nicolas van Kempen <nvankemp@gmail.com>

[NFC] Prefer subprocess.DEVNULL over os.devnull (#106500)

There is no need to support Python 2.7 anymore, Python 3.3+ has
`subprocess.DEVNULL`. This is good practice and also prevents file
handles

[NFC] Prefer subprocess.DEVNULL over os.devnull (#106500)

There is no need to support Python 2.7 anymore, Python 3.3+ has
`subprocess.DEVNULL`. This is good practice and also prevents file
handles from
staying open unnecessarily.

Also remove a couple unused or unneeded `__future__` imports.

show more ...


# 2d1fba67 28-Aug-2024 Denis.G <34353767+DenisGZM@users.noreply.github.com>

[NVPTX] Support __usAtomicCAS builtin (#99646)

Supported `__usAtomicCAS` builtin originally defined in
`/usr/local/cuda/inlcude/crt/sm_70_rt.hpp`

---------

Co-authored-by: Denis Gerasimov <De

[NVPTX] Support __usAtomicCAS builtin (#99646)

Supported `__usAtomicCAS` builtin originally defined in
`/usr/local/cuda/inlcude/crt/sm_70_rt.hpp`

---------

Co-authored-by: Denis Gerasimov <Denis.Gerasimov@baikalelectronics.ru>
Co-authored-by: Gonzalo Brito Gadeschi <gonzalob@nvidia.com>
Co-authored-by: Denis.Gerasimov <dengzmm@gmail.com>

show more ...


Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 915ee0b8 03-Jul-2024 Ramkumar Ramachandra <ramkumar.ramachandra@codasip.com>

UTC: support debug output from LDist (#93208)

Tweak the LoopDistribute debug output to be prefixed with "LDist: ", get
it to be stable, and extend update_analyze_test_checks.py trivially to
suppor

UTC: support debug output from LDist (#93208)

Tweak the LoopDistribute debug output to be prefixed with "LDist: ", get
it to be stable, and extend update_analyze_test_checks.py trivially to
support this output.

show more ...


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7
# 779be6fd 23-May-2024 Eli Friedman <efriedma@quicinc.com>

Fix update-test-checks.py on Python 3.6 (#93116)

re.Match apparently doesn't exist in older versions.


# 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
# a634f3ef 17-Apr-2024 Stephen Tozer <stephen.tozer@sony.com>

[RemoveDIs] Update update_test_checks script to recognize dbg_records (#87388)

As we've added new IR elements for the RemoveDIs project,
we need the update_test_checks script to understand them. Fo

[RemoveDIs] Update update_test_checks script to recognize dbg_records (#87388)

As we've added new IR elements for the RemoveDIs project,
we need the update_test_checks script to understand them. For the
records themselves this is already done automatically, but their
metadata arguments are not recognized as such due to lacking the
`metadata` prefix, which means they won't be checked by the script. This
patch fixes this by adding a check for all `![0-9]+` patterns as long as
they are not at the start of a line (which avoids matching global
values).

show more ...


# f4737a2e 17-Apr-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: keep names stable with generated functions (#87988)

Collect the original check lines in a manner that is independent of
where the check lines appear in the file. This is so that

update_test_checks: keep names stable with generated functions (#87988)

Collect the original check lines in a manner that is independent of
where the check lines appear in the file. This is so that we keep
FileCheck variable names stable even when --include-generated-funcs is
used.

Reported-by: Ruiling Song <ruiling.song@amd.com>

show more ...


Revision tags: llvmorg-18.1.4
# 377a2767 03-Apr-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: remove an unused function


Revision tags: 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
# 3846019d 23-Nov-2023 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: keep meta variables stable by default

Resubmitting this after previous revert with the following changes:

- Split table into table_rhs_idx and table_candidate_idx so that
bise

update_test_checks: keep meta variables stable by default

Resubmitting this after previous revert with the following changes:

- Split table into table_rhs_idx and table_candidate_idx so that
bisect.bisect_left can be used without the `key` argument, which
was introduced in Python 3.10
- Remove a re.Pattern type annotation

Original commit message:

Prior to this change, running UTC on larger tests, especially tests
with unnamed IR values, often resulted in a spuriously large diff
because e.g. TMPnn variables in the CHECK lines were renumbered. This
change attempts to reduce the diff by keeping those variable names the
same.

There are cases in which this "drift" of variable names can end up being
more confusing. The old behavior can be re-enabled with the
--reset-variable-names command line argument.

The improvement may not be immediately apparent in the diff of this change.
The point is that the diff of stable_ir_values.ll against
stable_ir_values.ll.expected after this change is smaller.

Ideally, we'd also keep meta variables for "global" objects stable, e.g.
for attributes (#nn) and metadata (!nn). However, that would require a
much more substantial refactoring of how we generate check lines, so I
left it for future work.

show more ...


# b565126b 08-Mar-2024 Nicolai Hähnle <nicolai.haehnle@amd.com>

Revert "update_test_checks: keep meta variables stable by default"

This reverts commit fb02f9ac84a6151e41aba8f7391edd132a9aaf14.

Looks like some Python version incompatibility, will investigate.


# fb02f9ac 23-Nov-2023 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: keep meta variables stable by default

Prior to this change, running UTC on larger tests, especially tests
with unnamed IR values, often resulted in a spuriously large diff
becaus

update_test_checks: keep meta variables stable by default

Prior to this change, running UTC on larger tests, especially tests
with unnamed IR values, often resulted in a spuriously large diff
because e.g. TMPnn variables in the CHECK lines were renumbered. This
change attempts to reduce the diff by keeping those variable names the
same.

There are cases in which this "drift" of variable names can end up being
more confusing. The old behavior can be re-enabled with the
--reset-variable-names command line argument.

The improvement may not be immediately apparent in the diff of this change.
The point is that the diff of stable_ir_values.ll against
stable_ir_values.ll.expected after this change is smaller.

Ideally, we'd also keep meta variables for "global" objects stable, e.g.
for attributes (#nn) and metadata (!nn). However, that would require a
much more substantial refactoring of how we generate check lines, so I
left it for future work.

show more ...


# 5747f9d3 23-Dec-2023 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: simplify get_ir_regex

The match argument isn't used.


# fc1e5f97 23-Dec-2023 Nicolai Hähnle <nicolai.haehnle@amd.com>

update_test_checks: simplify is_local_def_ir_value

The match argument is unused.


# 6a65b443 29-Feb-2024 Henrik G. Olsson <hnrklssn@gmail.com>

[UTC] Don't leave dangling CHECK-SAME when removing CHECK lines (#82569)

When removing only lines that are global value CHECK lines, a related
CHECK-SAME line could be left dangling without a previ

[UTC] Don't leave dangling CHECK-SAME when removing CHECK lines (#82569)

When removing only lines that are global value CHECK lines, a related
CHECK-SAME line could be left dangling without a previous line to belong
to.

Resolves #78517

show more ...


# 283a6b99 20-Feb-2024 Luke Lau <luke@igalia.com>

[UTC] Fix SyntaxWarning on Python 3.12 (#82327)

On Python 3.12 we now get a warning in common.py:

llvm/utils/UpdateTestChecks/common.py:488: SyntaxWarning: invalid escape
sequence '\s'

This f

[UTC] Fix SyntaxWarning on Python 3.12 (#82327)

On Python 3.12 we now get a warning in common.py:

llvm/utils/UpdateTestChecks/common.py:488: SyntaxWarning: invalid escape
sequence '\s'

This fixes it by using a raw string literal, see
https://github.com/llvm/llvm-project/pull/78036 and
https://docs.python.org/3/library/re.html

show more ...


# d6c2cbbc 07-Feb-2024 Yi Kong <yikong@google.com>

Fix test failure if CLANG_VENDOR contains spaces (#81017)


1234567