[all-commits] [llvm/llvm-project] 384601: update_test_checks: keep meta variables stable by ...

Nicolai Hähnle via All-commits all-commits at lists.llvm.org
Thu Mar 7 19:34:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3846019d8f6379ea1a8bf3a0fdfb0202de8e2f2a
      https://github.com/llvm/llvm-project/commit/3846019d8f6379ea1a8bf3a0fdfb0202de8e2f2a
  Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
  Date:   2024-03-08 (Fri, 08 Mar 2024)

  Changed paths:
    M llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values.ll.expected
    A llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values.ll.expected.reset
    M llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values2.ll.expected
    M llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values3.ll
    M llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values3.ll.expected
    M llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/stable_ir_values4.ll.expected
    M llvm/test/tools/UpdateTestChecks/update_test_checks/stable_ir_values.test
    M llvm/utils/UpdateTestChecks/common.py
    M llvm/utils/update_test_checks.py

  Log Message:
  -----------
  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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list