-
Notifications
You must be signed in to change notification settings - Fork 15.1k
[LLVM] Specialize test suites for TableGen and FileCheck to use smaller set of dependencies
#155929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I'm confused by the title, shouldn't it be instead "Add support to define lit test suites with an include/exclude list of folders" or something like this? I don't see the "dependency" part here. |
I believe the |
|
OK but it still does not seem to be "Add support to define lit test suites with ..." but "Add LLVM lit test suites with ..."? |
|
Right, maybe this works: Specialize LLVM lit test suites for TableGen and FileCheck with a smaller set of dependencies? |
TableGen and FileCheck with a smaller set of dependencies
e283a43 to
03c8d0d
Compare
Or because the dependencies were found in the system. I've once ran into this with These warnings should not be ignored and they can be confusing. Instead, we should specialize the list of needed tools per subdirectory (is it possible to add something to lit.local.cfg to achieve that?). Not a blocker to me, but others may find the warnings confusing. |
Right, so assuming the list of dependencies is correct, we get a warning for the unused dependencies and its benign. If the list of dependencies itself is missing a dependency, then you're right that this will end up using the command without substitution (from somewhere else or even from the same build/bin directory, just that it hasn't been rebuilt). This does not address that (or make it worse as well). Again, assuming the trimmed list of dependencies is kept correct |
TableGen and FileCheck with a smaller set of dependenciesTableGen and FileCheck to use smaller set of dependencies
This is a very strong assumption? The list may be incomplete from the start or become outdated (unlikely for TableGen/FileCheck, but for other subdirectories -- not impossible).
I imagine one big list makes it less likely that there is something missing from it. |
|
I agree that one giant list makes it less likely than several smaller lists and it's more likely that one of the smaller lists can become outdated. This was discussed on the discourse thread and was agreed as a practical but imperfect solution. |
|
I understand the utility of what you're trying to do here, but I worry that if we extrapolate this pattern out across the test subdirectories we're going to create an unmanageable mess. Every subdirectory under the test suite gets its own target, and if each target gets configured for its own dependency subset manually we're creating a real mess to maintain. |
For codegen and the middle-end tests like Analysis and Transforms, this (relatively short) list of dependencies doesn't change really frequently, so personally I'm not super worry about managing lists in those places. That being said, some places like MC might have a more diversified dependencies. |
|
Right, it's not a perfect solution, but as @mshockwave said limiting it to top-level directories only (I can add a comment to say so) can both avoid the issue @llvm-beanz is worried about and also such specialization is likely only needed in that scenarios for coarse level separation of dependencies. So it's a combination of having the ability and some discipline on our side to limit this to top level directories. |
|
@llvm-beanz will restricting specialization to top-level directories only address your concerns? |
9690778 to
b0664e8
Compare
|
@llvm/pr-subscribers-testing-tools Author: Rahul Joshi (jurahul) ChangesChange Note that building but the lit tests run fine since all the dependencies specified do get rebuilt. Full diff: https://github.com/llvm/llvm-project/pull/155929.diff 3 Files Affected:
diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt
index f6333d68a8ea5..82570c4e3f4ea 100644
--- a/llvm/test/CMakeLists.txt
+++ b/llvm/test/CMakeLists.txt
@@ -59,100 +59,104 @@ configure_lit_site_cfg(
# Set the depends list as a variable so that it can grow conditionally.
# NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
+
+set(LLVM_TEST_DEPENDS_COMMON
+ FileCheck
+ count
+ llvm-config
+ not
+ )
+
set(LLVM_TEST_DEPENDS
- BugpointPasses
- FileCheck
- LLVMWindowsDriver
- UnitTests
- bugpoint
- count
- llc
- lli
- lli-child-target
- llvm-addr2line
- llvm-ar
- llvm-as
- llvm-bcanalyzer
- llvm-bitcode-strip
- llvm-c-test
- llvm-cat
- llvm-cfi-verify
- llvm-cgdata
- llvm-config
- llvm-cov
- llvm-ctxprof-util
- llvm-cvtres
- llvm-cxxdump
- llvm-cxxfilt
- llvm-cxxmap
- llvm-debuginfo-analyzer
- llvm-debuginfod-find
- llvm-diff
- llvm-dis
- llvm-dlltool
- dsymutil
- llvm-dwarfdump
- llvm-dwarfutil
- llvm-dwp
- llvm-exegesis
- llvm-extract
- llvm-gsymutil
- llvm-ir2vec
- llvm-isel-fuzzer
- llvm-ifs
- llvm-install-name-tool
- llvm-jitlink
- llvm-lib
- llvm-libtool-darwin
- llvm-link
- llvm-lipo
- llvm-locstats
- llvm-lto2
- llvm-mc
- llvm-mca
- llvm-ml
- llvm-ml64
- llvm-modextract
- llvm-nm
- llvm-objcopy
- llvm-objdump
- llvm-opt-fuzzer
- llvm-opt-report
- llvm-offload-wrapper
- llvm-otool
- llvm-pdbutil
- llvm-profdata
- llvm-profgen
- llvm-ranlib
- llvm-rc
- llvm-readobj
- llvm-readelf
- llvm-reduce
- llvm-remarkutil
- llvm-rtdyld
- llvm-sim
- llvm-size
- llvm-split
- llvm-stress
- llvm-strings
- llvm-strip
- llvm-symbolizer
- llvm-tblgen
- llvm-readtapi
- llvm-tli-checker
- llvm-undname
- llvm-windres
- llvm-xray
- not
- obj2yaml
- opt
- sancov
- sanstats
- split-file
- verify-uselistorder
- yaml-bench
- yaml2obj
- )
+ BugpointPasses
+ LLVMWindowsDriver
+ UnitTests
+ bugpoint
+ llc
+ lli
+ lli-child-target
+ llvm-addr2line
+ llvm-ar
+ llvm-as
+ llvm-bcanalyzer
+ llvm-bitcode-strip
+ llvm-c-test
+ llvm-cat
+ llvm-cfi-verify
+ llvm-cgdata
+ llvm-cov
+ llvm-ctxprof-util
+ llvm-cvtres
+ llvm-cxxdump
+ llvm-cxxfilt
+ llvm-cxxmap
+ llvm-debuginfo-analyzer
+ llvm-debuginfod-find
+ llvm-diff
+ llvm-dis
+ llvm-dlltool
+ dsymutil
+ llvm-dwarfdump
+ llvm-dwarfutil
+ llvm-dwp
+ llvm-exegesis
+ llvm-extract
+ llvm-gsymutil
+ llvm-ir2vec
+ llvm-isel-fuzzer
+ llvm-ifs
+ llvm-install-name-tool
+ llvm-jitlink
+ llvm-lib
+ llvm-libtool-darwin
+ llvm-link
+ llvm-lipo
+ llvm-locstats
+ llvm-lto2
+ llvm-mc
+ llvm-mca
+ llvm-ml
+ llvm-ml64
+ llvm-modextract
+ llvm-nm
+ llvm-objcopy
+ llvm-objdump
+ llvm-opt-fuzzer
+ llvm-opt-report
+ llvm-offload-wrapper
+ llvm-otool
+ llvm-pdbutil
+ llvm-profdata
+ llvm-profgen
+ llvm-ranlib
+ llvm-rc
+ llvm-readobj
+ llvm-readelf
+ llvm-reduce
+ llvm-remarkutil
+ llvm-rtdyld
+ llvm-sim
+ llvm-size
+ llvm-split
+ llvm-stress
+ llvm-strings
+ llvm-strip
+ llvm-symbolizer
+ llvm-tblgen
+ llvm-readtapi
+ llvm-tli-checker
+ llvm-undname
+ llvm-windres
+ llvm-xray
+ obj2yaml
+ opt
+ sancov
+ sanstats
+ split-file
+ verify-uselistorder
+ yaml-bench
+ yaml2obj
+ )
if(TARGET llvm-lto)
set(LLVM_TEST_DEPENDS ${LLVM_TEST_DEPENDS} llvm-lto)
@@ -259,11 +263,18 @@ add_lit_testsuite(check-llvm "Running the LLVM regression tests"
)
set_target_properties(check-llvm PROPERTIES FOLDER "LLVM/Tests")
+# Note, exclude TableGen and FileCheck directories as we define them with a
+# reduced set of dependencies in their individual CMakeLists.txt
add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
${exclude_from_check_all}
+ DEPENDS ${LLVM_TEST_DEPENDS_COMMON}
DEPENDS ${LLVM_TEST_DEPENDS}
FOLDER "Tests/Subdirectories"
+ SKIP "^FileCheck"
+ SKIP "^TableGen"
)
+add_subdirectory(FileCheck)
+add_subdirectory(TableGen)
# Setup an alias for 'check-all'.
add_custom_target(check)
diff --git a/llvm/test/FileCheck/CMakeLists.txt b/llvm/test/FileCheck/CMakeLists.txt
new file mode 100644
index 0000000000000..a5bd0daac9b7a
--- /dev/null
+++ b/llvm/test/FileCheck/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_lit_testsuite(check-llvm-filecheck "Running lit suite for FileCheck"
+ ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${LLVM_TEST_DEPENDS_COMMON}
+ )
diff --git a/llvm/test/TableGen/CMakeLists.txt b/llvm/test/TableGen/CMakeLists.txt
new file mode 100644
index 0000000000000..cc514402b1801
--- /dev/null
+++ b/llvm/test/TableGen/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Subset of dependencies for TableGen lit test.
+set(LLVM_TEST_TABLEGEN_DEPENDS
+ llvm-tblgen
+ )
+
+add_lit_testsuite(check-llvm-tablegen "Running lit suite for TableGen"
+ ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${LLVM_TEST_DEPENDS_COMMON}
+ DEPENDS ${LLVM_TEST_TABLEGEN_DEPENDS}
+ )
|
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/154/builds/21709 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/3/builds/22188 Here is the relevant piece of the build log for the reference |
|
Attempted fix has landed here: #159781 |
|
Looks like the fix is working: |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/11007 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/198/builds/8008 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/17/builds/11130 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/14031 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/108/builds/17856 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/169/builds/15068 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/145/builds/9904 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/161/builds/7948 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/95/builds/18314 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/125/builds/10449 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/202/builds/3409 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/39/builds/7942 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/13/builds/9641 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/14/builds/4311 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/76/builds/12947 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/127/builds/4787 Here is the relevant piece of the build log for the reference |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/49/builds/2279 Here is the relevant piece of the build log for the reference |
…165935) To avoid depending on all of the tools in clang-tools-extra, the `check-clang-extra-clang-doc` target is specialized in its own CMake file in clang-tools-extra/test/clang-doc. This eliminates around 800 files to be processed when building that target, plus linking every tool. Similar to [#155929](#155929).
…it tests (#165935) To avoid depending on all of the tools in clang-tools-extra, the `check-clang-extra-clang-doc` target is specialized in its own CMake file in clang-tools-extra/test/clang-doc. This eliminates around 800 files to be processed when building that target, plus linking every tool. Similar to [#155929](llvm/llvm-project#155929).
…lvm#165935) To avoid depending on all of the tools in clang-tools-extra, the `check-clang-extra-clang-doc` target is specialized in its own CMake file in clang-tools-extra/test/clang-doc. This eliminates around 800 files to be processed when building that target, plus linking every tool. Similar to [llvm#155929](llvm#155929).
…lvm#165935) To avoid depending on all of the tools in clang-tools-extra, the `check-clang-extra-clang-doc` target is specialized in its own CMake file in clang-tools-extra/test/clang-doc. This eliminates around 800 files to be processed when building that target, plus linking every tool. Similar to [llvm#155929](llvm#155929).
Define lit testsuite for FileCheck and TableGen with smaller set of dependencies. This uses the new
SKIPargument toadd_lit_testsuitesthat was added in #157176.