Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Using our own tablegen with depfile support.#22554

Merged
benvanik merged 1 commit intomainfrom
users/benvanik/td-deps
Nov 5, 2025
Merged

Using our own tablegen with depfile support.#22554
benvanik merged 1 commit intomainfrom
users/benvanik/td-deps

Conversation

@benvanik
Copy link
Collaborator

@benvanik benvanik commented Nov 4, 2025

Experimenting with this. Currently we are incorrect at head: changes to .td included by a target .td will not trigger rebuilds and build with old cached copies. The bazel side handles this by explicitly specifying deps but that doesn't quite work when lowered to cmake as LLVM's rules do a bunch of silly stuff to prevent it. The proper solution is available anyway, though: depfiles. Tablegen can produce them and they give us perfect deps. So here's an attempt at using them.

Experimenting with this. Currently we are incorrect at head: changes to
.td included by a target .td will not trigger rebuilds and build with
old cached copies. The bazel side handles this by explicitly specifying
deps but that doesn't quite work when lowered to cmake as LLVM's rules
do a bunch of silly stuff to prevent it. The proper solution is available
anyway, though: depfiles. Tablegen can produce them and they give us
perfect deps. So here's an attempt at using them.
@benvanik benvanik added the infrastructure Relating to build systems, CI, or testing label Nov 4, 2025
@benvanik benvanik requested a review from qedawkins November 5, 2025 01:34
@benvanik benvanik marked this pull request as ready for review November 5, 2025 01:34
@benvanik benvanik requested a review from ScottTodd as a code owner November 5, 2025 01:34
COMMAND ${_TBLGEN_EXE} ${_COMMAND} ${_DIALECT} ${_INCLUDE_DIRS} ${_FLAGS} ${_TD_FILE_ABS}
--write-if-changed -o ${_OUTPUT_FILE} -d ${_OUTPUT_FILE}.d
DEPENDS ${_TBLGEN_TARGET} ${_TBLGEN_EXE} ${_TD_FILE_ABS}
DEPFILE ${_OUTPUT_FILE}.d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is DEPFILE ninja only? I'm a complete noob at this build file stuff and don't know why this would be ninja only (or if we care about other generators).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly just because that's what LLVM does upstream - Makefiles should support DEPFILE, but I haven't tested them.

@benvanik benvanik merged commit c65dc6d into main Nov 5, 2025
46 of 50 checks passed
@benvanik benvanik deleted the users/benvanik/td-deps branch November 5, 2025 01:50
bangtianliu pushed a commit to bangtianliu/iree that referenced this pull request Nov 19, 2025
Experimenting with this. Currently we are incorrect at head: changes to
.td included by a target .td will not trigger rebuilds and build with
old cached copies. The bazel side handles this by explicitly specifying
deps but that doesn't quite work when lowered to cmake as LLVM's rules
do a bunch of silly stuff to prevent it. The proper solution is
available anyway, though: depfiles. Tablegen can produce them and they
give us perfect deps. So here's an attempt at using them.
pstarkcdpr pushed a commit to pstarkcdpr/iree that referenced this pull request Nov 28, 2025
Experimenting with this. Currently we are incorrect at head: changes to
.td included by a target .td will not trigger rebuilds and build with
old cached copies. The bazel side handles this by explicitly specifying
deps but that doesn't quite work when lowered to cmake as LLVM's rules
do a bunch of silly stuff to prevent it. The proper solution is
available anyway, though: depfiles. Tablegen can produce them and they
give us perfect deps. So here's an attempt at using them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Relating to build systems, CI, or testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants