Skip to content

Conversation

h-vetinari
Copy link
Contributor

DroppedVariableStats.cpp includes llvm/include/llvm/Analysis/DroppedVariableStats.h through its header, which transitively requires llvm/CodeGen/GenVT.inc (which is what vt_gen depends on) through llvm/include/llvm/CodeGenTypes/MachineValueType.h

Based on my testing, this should address #107687, at least for the case where only llvm is being built. There may be further places in clang, mlir etc. that need to add DEPENDS vt_gen for using llvm/include/llvm/CodeGenTypes/MachineValueType.h

CC @chapuni as author of 631bfdb

DroppedVariableStats.cpp includes `llvm/include/llvm/Analysis/DroppedVariableStats.h`
through its header, which transitively requires `llvm/CodeGen/GenVT.inc` (which is
what `vt_gen` depends on) through `llvm/include/llvm/CodeGenTypes/MachineValueType.h`
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Dec 20, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 20, 2024

@llvm/pr-subscribers-llvm-analysis

Author: None (h-vetinari)

Changes

DroppedVariableStats.cpp includes llvm/include/llvm/Analysis/DroppedVariableStats.h through its header, which transitively requires llvm/CodeGen/GenVT.inc (which is what vt_gen depends on) through llvm/include/llvm/CodeGenTypes/MachineValueType.h

Based on my testing, this should address #107687, at least for the case where only llvm is being built. There may be further places in clang, mlir etc. that need to add DEPENDS vt_gen for using llvm/include/llvm/CodeGenTypes/MachineValueType.h

CC @chapuni as author of 631bfdb


Full diff: https://github.com/llvm/llvm-project/pull/120661.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/CMakeLists.txt (+1)
diff --git a/llvm/lib/Analysis/CMakeLists.txt b/llvm/lib/Analysis/CMakeLists.txt
index 0db5b80f336cb5..cf393850ec3e68 100644
--- a/llvm/lib/Analysis/CMakeLists.txt
+++ b/llvm/lib/Analysis/CMakeLists.txt
@@ -150,6 +150,7 @@ add_llvm_component_library(LLVMAnalysis
 
   DEPENDS
   intrinsics_gen
+  vt_gen
   ${MLDeps}
 
   LINK_LIBS

Copy link
Contributor

@chapuni chapuni left a comment

Choose a reason for hiding this comment

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

LLVMAnalysis doesn't depend on vt_gen. It's too early.

I revisited #120502. Is MachinePassBuilder.h really required in DroppedVariableStats.h?

@h-vetinari
Copy link
Contributor Author

LLVMAnalysis doesn't depend on vt_gen.

Currently, it does.

I revisited #120502. Is MachinePassBuilder.h really required in DroppedVariableStats.h?

Sorry, no idea about this, I'm just trying to fix a build failure because any TU that ends up including MachineValueType.h must depend on vt_gen (or risk running into build failures with missing header files due to missing build graph enforcement, c.f. #107687).

@chapuni
Copy link
Contributor

chapuni commented Dec 20, 2024

@h-vetinari Possibly it is an apparent fix "just works for you".

@nikic
Copy link
Contributor

nikic commented Dec 20, 2024

I think the correct fix here would be to revert #120502.

@h-vetinari
Copy link
Contributor Author

If I read the discussion in #120502 correctly, 0b5b09b should have fixed the dependence of analysis on codegen?

@h-vetinari
Copy link
Contributor Author

Closing this as solved elsewhere

@h-vetinari h-vetinari closed this Dec 20, 2024
@h-vetinari h-vetinari deleted the vt_gen branch December 20, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:analysis Includes value tracking, cost tables and constant folding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants