[llvm] [TargetParser][cmake] Recurse for TableGen deps (PR #177274)

Brendan Dahl via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 22 11:57:43 PST 2026


brendandahl wrote:

> > I'm trying to understand which `tablegen(...)` invocation requires the recursive glob - can you point to it for me? I can believe it exists, I just want to examine the cmake a little closer.
> 
> There's more in the comment [here](https://github.com/llvm/llvm-project/issues/156744#issuecomment-3256197172).

Hmm...github link to the comment seems to be broken since it autohides.

from dschuff
> OK, I've reproduced it locally, and I think I have an idea what's going wrong.
> 
> The instruction selectors (namely WebAssemblyISelDAGToDAG.cpp) depend on generated files such as <build>/lib/Target/WebAssembly/WebAssemblyGenDAGISel.inc. These are generated by tablegen from other generated files such as build/llvm-out/include/llvm/IR/IntrinsicsWebAssembly.h which contains an enum for all the wasm intrinsics. IntrinsicsWebAssembly.h is in turn generated from llvm/include/llvm/IR/Intrinsics.td.
> Notably, Intrinsics.td #includes all of the target-specific intrinsics files (such as llvm/include/IR/IntrinsicsWebAssembly.td) and the enum space includes all intrinsics, including those from all targets. This means when a change like [this one](https://github.com/llvm/llvm-project/commit/e2bd10cf16c3f90813de5b64f348ece035a6bb68) modifies a file like include/llvm/IR/IntrinsicsAMDGPU.td, all of the intrinsics across all of the targets get different enum values. As a result, the headers such as build/llvm-out/include/llvm/IR/IntrinsicsWebAssembly.h need to be regenerated (and they are), and then build/lib/Target/WebAssembly/WebAssemblyGenDAGISel.inc needs to be regenerated. But it isn't!
> I'm not sure exactly why yet, or how to fix it. I guess I'll have to dive into CMake some more.
> 
> Also the same issue seems to be affecting the X86 backend (the same logic applies, and its GenDAGISel.inc should also be getting regenerated but isn't) so I don't think this issue is specific to WebAssembly.

https://github.com/llvm/llvm-project/pull/177274


More information about the llvm-commits mailing list