Skip to content

[IR] Don't include Module.h in Analysis.h (NFC) #97023

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

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

nikic
Copy link
Contributor

@nikic nikic commented Jun 28, 2024

Replace it with a forward declaration instead. Analysis.h is pulled in by all passes, but not all passes need to access the module.

Replace it with a forward declaration instead. Analysis.h is
pulled in by all passes, but not all passes need to access the
module.
@nikic nikic added the skip-precommit-approval PR for CI feedback, not intended for review label Jun 28, 2024
@llvmbot llvmbot added clang Clang issues not falling into any other category backend:ARM backend:AArch64 backend:AMDGPU backend:RISC-V backend:PowerPC backend:SystemZ backend:WebAssembly backend:X86 clang:frontend Language frontend issues, e.g. anything involving "Sema" debuginfo PGO Profile Guided Optimizations LTO Link time optimization (regular/full LTO or ThinLTO) mlgo llvm:SelectionDAG SelectionDAGISel as well llvm:ir llvm:analysis llvm:transforms labels Jun 28, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 28, 2024

@llvm/pr-subscribers-backend-systemz
@llvm/pr-subscribers-llvm-ir
@llvm/pr-subscribers-backend-webassembly
@llvm/pr-subscribers-backend-x86
@llvm/pr-subscribers-pgo
@llvm/pr-subscribers-backend-aarch64
@llvm/pr-subscribers-llvm-selectiondag
@llvm/pr-subscribers-debuginfo
@llvm/pr-subscribers-backend-arm
@llvm/pr-subscribers-clang

@llvm/pr-subscribers-backend-amdgpu

Author: Nikita Popov (nikic)

Changes

Replace it with a forward declaration instead. Analysis.h is pulled in by all passes, but not all passes need to access the module.


Patch is 53.62 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/97023.diff

107 Files Affected:

  • (modified) clang/lib/Interpreter/DeviceOffload.cpp (+1)
  • (modified) llvm/include/llvm/Analysis/TargetTransformInfo.h (+1)
  • (modified) llvm/include/llvm/Analysis/VectorUtils.h (+1)
  • (modified) llvm/include/llvm/IR/Analysis.h (+3-1)
  • (modified) llvm/include/llvm/Transforms/IPO/Attributor.h (+1)
  • (modified) llvm/include/llvm/Transforms/Utils/Debugify.h (+2-1)
  • (modified) llvm/lib/Analysis/CallPrinter.cpp (+1)
  • (modified) llvm/lib/Analysis/InlineAdvisor.cpp (+1)
  • (modified) llvm/lib/Analysis/LazyValueInfo.cpp (+1)
  • (modified) llvm/lib/Analysis/LoopInfo.cpp (+1)
  • (modified) llvm/lib/Analysis/LoopPass.cpp (+1)
  • (modified) llvm/lib/Analysis/MLInlineAdvisor.cpp (+1)
  • (modified) llvm/lib/Analysis/StructuralHash.cpp (+1)
  • (modified) llvm/lib/Analysis/TargetLibraryInfo.cpp (+1)
  • (modified) llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp (+1)
  • (modified) llvm/lib/CodeGen/AsmPrinter/AIXException.cpp (+1)
  • (modified) llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp (+1)
  • (modified) llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp (+1)
  • (modified) llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp (+1)
  • (modified) llvm/lib/CodeGen/CFGuardLongjmp.cpp (+1)
  • (modified) llvm/lib/CodeGen/EHContGuardCatchret.cpp (+1)
  • (modified) llvm/lib/CodeGen/GCMetadata.cpp (+1)
  • (modified) llvm/lib/CodeGen/KCFI.cpp (+1)
  • (modified) llvm/lib/CodeGen/MachineCheckDebugify.cpp (+1)
  • (modified) llvm/lib/CodeGen/MachineFunctionPass.cpp (+1)
  • (modified) llvm/lib/CodeGen/MachineModuleSlotTracker.cpp (+1)
  • (modified) llvm/lib/CodeGen/RegAllocBase.cpp (+1)
  • (modified) llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp (+1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (+1)
  • (modified) llvm/lib/CodeGen/WinEHPrepare.cpp (+1)
  • (modified) llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp (+1)
  • (modified) llvm/lib/IR/PassManager.cpp (+1)
  • (modified) llvm/lib/LTO/UpdateCompilerUsed.cpp (+2-1)
  • (modified) llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/AArch64/AArch64FastISel.cpp (+1)
  • (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp (+1)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h (+1)
  • (modified) llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp (+1)
  • (modified) llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp (+1)
  • (modified) llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/ARM/ARMInstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp (+1)
  • (modified) llvm/lib/Target/ARM/Thumb1InstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/ARM/Thumb2InstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/AVR/AVRAsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/BPF/BPFAsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/BPF/BPFMISimplifyPatchable.cpp (+1)
  • (modified) llvm/lib/Target/BPF/BTFDebug.cpp (+1)
  • (modified) llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/Mips/MipsAsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/Mips/MipsISelLowering.cpp (+1)
  • (modified) llvm/lib/Target/PowerPC/PPCMCInstLower.cpp (+1)
  • (modified) llvm/lib/Target/PowerPC/PPCSubtarget.cpp (+2)
  • (modified) llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/RISCV/RISCVInstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp (+1)
  • (modified) llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/SystemZ/SystemZISelLowering.cpp (+1)
  • (modified) llvm/lib/Target/Target.cpp (+1)
  • (modified) llvm/lib/Target/TargetMachine.cpp (+1)
  • (modified) llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp (+1)
  • (modified) llvm/lib/Target/WebAssembly/WebAssemblyMCLowerPrePass.cpp (+1)
  • (modified) llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86FrameLowering.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86ISelDAGToDAG.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86IndirectBranchTracking.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86InsertPrefetch.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86InstrInfo.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86PreTileConfig.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86ReturnThunks.cpp (+1)
  • (modified) llvm/lib/Target/X86/X86Subtarget.cpp (+1)
  • (modified) llvm/lib/Transforms/IPO/CalledValuePropagation.cpp (+1)
  • (modified) llvm/lib/Transforms/Instrumentation/LowerAllowCheckPass.cpp (+1)
  • (modified) llvm/lib/Transforms/Instrumentation/PGOForceFunctionAttrs.cpp (+1)
  • (modified) llvm/lib/Transforms/Scalar/ConstantHoisting.cpp (+1)
  • (modified) llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp (+1)
  • (modified) llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp (+1)
  • (modified) llvm/lib/Transforms/Utils/CanonicalizeAliases.cpp (+1)
  • (modified) llvm/lib/Transforms/Utils/DemoteRegToStack.cpp (+1)
  • (modified) llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp (+1)
  • (modified) llvm/unittests/Analysis/AssumeBundleQueriesTest.cpp (+4-3)
  • (modified) llvm/unittests/Analysis/DDGTest.cpp (+1)
  • (modified) llvm/unittests/Analysis/GlobalsModRefTest.cpp (+1)
  • (modified) llvm/unittests/Analysis/IVDescriptorsTest.cpp (+1)
  • (modified) llvm/unittests/Analysis/LoopInfoTest.cpp (+1)
  • (modified) llvm/unittests/Analysis/LoopNestTest.cpp (+1)
  • (modified) llvm/unittests/CodeGen/AArch64SelectionDAGTest.cpp (+1)
  • (modified) llvm/unittests/CodeGen/AMDGPUMetadataTest.cpp (+1)
  • (modified) llvm/unittests/CodeGen/MLRegAllocDevelopmentFeatures.cpp (+1)
  • (modified) llvm/unittests/CodeGen/SelectionDAGAddressAnalysisTest.cpp (+1)
  • (modified) llvm/unittests/CodeGen/SelectionDAGPatternMatchTest.cpp (+1)
  • (modified) llvm/unittests/MI/LiveIntervalTest.cpp (+1)
  • (modified) llvm/unittests/MIR/MachineMetadata.cpp (+1)
  • (modified) llvm/unittests/Target/AArch64/InstSizes.cpp (+1)
  • (modified) llvm/unittests/Target/ARM/InstSizes.cpp (+1)
  • (modified) llvm/unittests/Target/LoongArch/InstSizes.cpp (+1)
  • (modified) llvm/unittests/Target/RISCV/RISCVInstrInfoTest.cpp (+1)
  • (modified) llvm/unittests/Target/WebAssembly/WebAssemblyExceptionInfoTest.cpp (+1)
  • (modified) llvm/unittests/Target/X86/MachineSizeOptsTest.cpp (+1)
  • (modified) llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp (+1)
  • (modified) llvm/unittests/Transforms/Utils/LoopRotationUtilsTest.cpp (+1)
  • (modified) llvm/unittests/Transforms/Utils/LoopUtilsTest.cpp (+1)
  • (modified) llvm/unittests/Transforms/Utils/UnrollLoopTest.cpp (+1)
  • (modified) polly/lib/Analysis/ScopBuilder.cpp (+2-2)
  • (modified) polly/lib/Support/SCEVAffinator.cpp (+2-1)
  • (modified) polly/lib/Transform/DeLICM.cpp (+1)
diff --git a/clang/lib/Interpreter/DeviceOffload.cpp b/clang/lib/Interpreter/DeviceOffload.cpp
index fb42964e4936f..07c9e3005e5fd 100644
--- a/clang/lib/Interpreter/DeviceOffload.cpp
+++ b/clang/lib/Interpreter/DeviceOffload.cpp
@@ -17,6 +17,7 @@
 #include "clang/Frontend/CompilerInstance.h"
 
 #include "llvm/IR/LegacyPassManager.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Target/TargetMachine.h"
 
diff --git a/llvm/include/llvm/Analysis/TargetTransformInfo.h b/llvm/include/llvm/Analysis/TargetTransformInfo.h
index f5c0127e1d422..dcdd9f82cde8e 100644
--- a/llvm/include/llvm/Analysis/TargetTransformInfo.h
+++ b/llvm/include/llvm/Analysis/TargetTransformInfo.h
@@ -21,6 +21,7 @@
 #ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
 #define LLVM_ANALYSIS_TARGETTRANSFORMINFO_H
 
+#include "llvm/ADT/APInt.h"
 #include "llvm/ADT/SmallBitVector.h"
 #include "llvm/IR/FMF.h"
 #include "llvm/IR/InstrTypes.h"
diff --git a/llvm/include/llvm/Analysis/VectorUtils.h b/llvm/include/llvm/Analysis/VectorUtils.h
index 132571c694d4e..3c9495c1b372c 100644
--- a/llvm/include/llvm/Analysis/VectorUtils.h
+++ b/llvm/include/llvm/Analysis/VectorUtils.h
@@ -16,6 +16,7 @@
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Analysis/LoopAccessAnalysis.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/VFABIDemangler.h"
 #include "llvm/Support/CheckedArithmetic.h"
 
diff --git a/llvm/include/llvm/IR/Analysis.h b/llvm/include/llvm/IR/Analysis.h
index da250c031396b..ea7e2c3d0a08b 100644
--- a/llvm/include/llvm/IR/Analysis.h
+++ b/llvm/include/llvm/IR/Analysis.h
@@ -14,9 +14,11 @@
 
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/IR/Function.h"
-#include "llvm/IR/Module.h"
 
 namespace llvm {
+
+class Module;
+
 /// A special type used by analysis passes to provide an address that
 /// identifies that particular analysis pass type.
 ///
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 6ba04dbc31db3..f70fd02ca573c 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -123,6 +123,7 @@
 #include "llvm/IR/InstIterator.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/Value.h"
 #include "llvm/Support/Alignment.h"
diff --git a/llvm/include/llvm/Transforms/Utils/Debugify.h b/llvm/include/llvm/Transforms/Utils/Debugify.h
index 7981b9ec70364..10c8c5897b943 100644
--- a/llvm/include/llvm/Transforms/Utils/Debugify.h
+++ b/llvm/include/llvm/Transforms/Utils/Debugify.h
@@ -19,8 +19,9 @@
 #include "llvm/Bitcode/BitcodeWriterPass.h"
 #include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/IR/LegacyPassManager.h"
-#include "llvm/IR/PassManager.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassInstrumentation.h"
+#include "llvm/IR/PassManager.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
 
diff --git a/llvm/lib/Analysis/CallPrinter.cpp b/llvm/lib/Analysis/CallPrinter.cpp
index effa25f276dd2..672dae1642cb3 100644
--- a/llvm/lib/Analysis/CallPrinter.cpp
+++ b/llvm/lib/Analysis/CallPrinter.cpp
@@ -20,6 +20,7 @@
 #include "llvm/Analysis/CallGraph.h"
 #include "llvm/Analysis/HeatUtils.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/DOTGraphTraits.h"
diff --git a/llvm/lib/Analysis/InlineAdvisor.cpp b/llvm/lib/Analysis/InlineAdvisor.cpp
index 71dfcbc9b7bb7..c6907cb128bb4 100644
--- a/llvm/lib/Analysis/InlineAdvisor.cpp
+++ b/llvm/lib/Analysis/InlineAdvisor.cpp
@@ -23,6 +23,7 @@
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/Analysis/Utils/ImportedFunctionsInliningStatistics.h"
 #include "llvm/IR/DebugInfoMetadata.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index ef4d14dbe6045..d8b03eaa3928f 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -31,6 +31,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PatternMatch.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/InitializePasses.h"
diff --git a/llvm/lib/Analysis/LoopInfo.cpp b/llvm/lib/Analysis/LoopInfo.cpp
index 6f89a01aea931..6bb5f001e9bd1 100644
--- a/llvm/lib/Analysis/LoopInfo.cpp
+++ b/llvm/lib/Analysis/LoopInfo.cpp
@@ -31,6 +31,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Metadata.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/PrintPasses.h"
 #include "llvm/InitializePasses.h"
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index 2159c45a8e5c5..3dc9e75b6168f 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -16,6 +16,7 @@
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/OptBisect.h"
 #include "llvm/IR/PassTimingInfo.h"
 #include "llvm/IR/PrintPasses.h"
diff --git a/llvm/lib/Analysis/MLInlineAdvisor.cpp b/llvm/lib/Analysis/MLInlineAdvisor.cpp
index ec6f3780fe2e4..f4a782b4f168b 100644
--- a/llvm/lib/Analysis/MLInlineAdvisor.cpp
+++ b/llvm/lib/Analysis/MLInlineAdvisor.cpp
@@ -29,6 +29,7 @@
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/InstIterator.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Support/CommandLine.h"
 
diff --git a/llvm/lib/Analysis/StructuralHash.cpp b/llvm/lib/Analysis/StructuralHash.cpp
index 244ed5d55f3f8..24985f0a9d314 100644
--- a/llvm/lib/Analysis/StructuralHash.cpp
+++ b/llvm/lib/Analysis/StructuralHash.cpp
@@ -12,6 +12,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/StructuralHash.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/StructuralHash.h"
 #include "llvm/Support/CommandLine.h"
 
diff --git a/llvm/lib/Analysis/TargetLibraryInfo.cpp b/llvm/lib/Analysis/TargetLibraryInfo.cpp
index 6b760fbde5bba..bf53f562ec419 100644
--- a/llvm/lib/Analysis/TargetLibraryInfo.cpp
+++ b/llvm/lib/Analysis/TargetLibraryInfo.cpp
@@ -14,6 +14,7 @@
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/IR/Constants.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/TargetParser/Triple.h"
diff --git a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
index a9d5743bdaac0..e1cb63a9ab8f9 100644
--- a/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp
@@ -110,6 +110,7 @@
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/MemoryLocation.h"
 #include "llvm/IR/Constants.h"
+#include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/InstrTypes.h"
 #include "llvm/IR/LLVMContext.h"
diff --git a/llvm/lib/CodeGen/AsmPrinter/AIXException.cpp b/llvm/lib/CodeGen/AsmPrinter/AIXException.cpp
index 82b5ccdc70ea1..5d7c97adcacad 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AIXException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AIXException.cpp
@@ -14,6 +14,7 @@
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCSectionXCOFF.h"
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/Target/TargetLoweringObjectFile.h"
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index 24cd1b15a5736..25d4bbddd9851 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
 #include "llvm/IR/DebugInfo.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCStreamer.h"
 #include "llvm/Support/CommandLine.h"
 
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp b/llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
index cd18703b359e1..1a1e6f0117e2b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/InstrTypes.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCObjectFileInfo.h"
 #include "llvm/MC/MCStreamer.h"
 
diff --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index 0eef93f1128a6..cbec482d4cdc5 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -23,6 +23,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/IR/PrintPasses.h"
 #include "llvm/InitializePasses.h"
diff --git a/llvm/lib/CodeGen/CFGuardLongjmp.cpp b/llvm/lib/CodeGen/CFGuardLongjmp.cpp
index c3bf938551110..b5d88a7432b17 100644
--- a/llvm/lib/CodeGen/CFGuardLongjmp.cpp
+++ b/llvm/lib/CodeGen/CFGuardLongjmp.cpp
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineOperand.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 
 using namespace llvm;
diff --git a/llvm/lib/CodeGen/EHContGuardCatchret.cpp b/llvm/lib/CodeGen/EHContGuardCatchret.cpp
index b26aa792bb937..f7c6580a73da5 100644
--- a/llvm/lib/CodeGen/EHContGuardCatchret.cpp
+++ b/llvm/lib/CodeGen/EHContGuardCatchret.cpp
@@ -19,6 +19,7 @@
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/Passes.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 
 using namespace llvm;
diff --git a/llvm/lib/CodeGen/GCMetadata.cpp b/llvm/lib/CodeGen/GCMetadata.cpp
index cad7d1f1137bb..e1af457c9b9d7 100644
--- a/llvm/lib/CodeGen/GCMetadata.cpp
+++ b/llvm/lib/CodeGen/GCMetadata.cpp
@@ -14,6 +14,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/IR/Function.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/MC/MCSymbol.h"
 #include "llvm/Pass.h"
diff --git a/llvm/lib/CodeGen/KCFI.cpp b/llvm/lib/CodeGen/KCFI.cpp
index bffa02ca8afd0..91c6ac2618279 100644
--- a/llvm/lib/CodeGen/KCFI.cpp
+++ b/llvm/lib/CodeGen/KCFI.cpp
@@ -21,6 +21,7 @@
 #include "llvm/CodeGen/TargetInstrInfo.h"
 #include "llvm/CodeGen/TargetLowering.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 
 using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineCheckDebugify.cpp b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
index 874f726d29471..9b703d5401cb9 100644
--- a/llvm/lib/CodeGen/MachineCheckDebugify.cpp
+++ b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DebugInfoMetadata.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 
diff --git a/llvm/lib/CodeGen/MachineFunctionPass.cpp b/llvm/lib/CodeGen/MachineFunctionPass.cpp
index d57a912f418b7..62ac3e32d24d9 100644
--- a/llvm/lib/CodeGen/MachineFunctionPass.cpp
+++ b/llvm/lib/CodeGen/MachineFunctionPass.cpp
@@ -26,6 +26,7 @@
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Function.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PrintPasses.h"
 
 using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp b/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
index aa63411df9651..965539ddaca8d 100644
--- a/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
+++ b/llvm/lib/CodeGen/MachineModuleSlotTracker.cpp
@@ -9,6 +9,7 @@
 #include "llvm/CodeGen/MachineModuleSlotTracker.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/IR/Module.h"
 
 using namespace llvm;
 
diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp
index 71288469b8f0f..648036e5d89da 100644
--- a/llvm/lib/CodeGen/RegAllocBase.cpp
+++ b/llvm/lib/CodeGen/RegAllocBase.cpp
@@ -23,6 +23,7 @@
 #include "llvm/CodeGen/Spiller.h"
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/CodeGen/VirtRegMap.h"
+#include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
diff --git a/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp b/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
index 47ad9c168b923..a1dccc4d59723 100644
--- a/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
+++ b/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
@@ -17,6 +17,7 @@
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/RegisterClassInfo.h"
 #include "llvm/CodeGen/VirtRegMap.h"
+#include "llvm/IR/Module.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CommandLine.h"
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 796481501c74e..e5a34bccff8e1 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -78,6 +78,7 @@
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/IntrinsicsWebAssembly.h"
 #include "llvm/IR/Metadata.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PrintPasses.h"
 #include "llvm/IR/Statepoint.h"
 #include "llvm/IR/Type.h"
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index b4f8678963f1d..c58c67b70fe3c 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -25,6 +25,7 @@
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/EHPersonalities.h"
 #include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
diff --git a/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp b/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
index 17a96dee1000b..540728ea0fd99 100644
--- a/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
@@ -8,6 +8,7 @@
 
 #include "llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h"
 
+#include "llvm/ADT/StringMap.h"
 #include "llvm/MC/TargetRegistry.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/TargetParser/Host.h"
diff --git a/llvm/lib/IR/PassManager.cpp b/llvm/lib/IR/PassManager.cpp
index 64a6effe5c0db..bf8f7906d3368 100644
--- a/llvm/lib/IR/PassManager.cpp
+++ b/llvm/lib/IR/PassManager.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/IR/PassManager.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/PassManagerImpl.h"
 #include <optional>
 
diff --git a/llvm/lib/LTO/UpdateCompilerUsed.cpp b/llvm/lib/LTO/UpdateCompilerUsed.cpp
index 8dff5418dedba..2882ea9d14b23 100644
--- a/llvm/lib/LTO/UpdateCompilerUsed.cpp
+++ b/llvm/lib/LTO/UpdateCompilerUsed.cpp
@@ -15,8 +15,9 @@
 #include "llvm/CodeGen/TargetLowering.h"
 #include "llvm/CodeGen/TargetSubtargetInfo.h"
 #include "llvm/IR/Mangler.h"
-#include "llvm/Transforms/Utils/ModuleUtils.h"
+#include "llvm/IR/Module.h"
 #include "llvm/Target/TargetMachine.h"
+#include "llvm/Transforms/Utils/ModuleUtils.h"
 
 using namespace llvm;
 
diff --git a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
index 00b8d7bd257e4..64d41d4147644 100644
--- a/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
+++ b/llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
@@ -43,6 +43,7 @@
 #include "llvm/CodeGen/TargetRegisterInfo.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DebugInfoMetadata.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCInst.h"
diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
index 56fd15f23363d..e3c5a143b2889 100644
--- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp
+++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp
@@ -55,6 +55,7 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/IntrinsicsAArch64.h"
+#include "llvm/IR/Module.h"
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/Type.h"
 #include "llvm/IR/User.h"
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
index ee397db3fba6d..93278a2ba0d09 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
@@ -40,6 +40,7 @@
 #include "llvm/IR/DebugInfoMetadata.h"
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/GlobalValue.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCInstBuilder.h"
diff --git a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp
index 1c1e87d723ac7..3c0facd586732 100644
--- a/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp
+++ b/llvm/lib/Target/AArch64/AArch64TargetObjectFile.cpp
@@ -13,6 +13,7 @@
 #include "llvm/BinaryFormat/Dwarf.h"
 #include "llvm/CodeGen/MachineModuleInfoImpls.h"
 #include "llvm/IR/Mangler.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/MCExpr.h"
 #include "llvm/MC/MCStreamer.h"
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
index 05fd411b35e54..aa0e9974667b7 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
+++ b/llvm/lib/Target/AMDGPU/AMDGPUAliasAnalysis.h
@@ -13,6 +13,7 @@
 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUALIASANALYSIS_H
 
 #include "llvm/Analysis/AliasAnalysis.h"
+#include "llvm/IR/Module.h"
 
 namespace llvm {
 
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp
index 2d48be9ea542a..5354ccf65b1cc 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineModuleInfo.cpp
@@ -13,6 +13,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "AMDGPUMachineModuleInfo.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCSymbol.h"
 
 namespace llvm {
diff --git a/llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp b/llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp
index 195dc4f9a0f41..c1a5e3b593748 100644
--- a/llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp
+++ b/llvm/lib/Target/AMDGPU/R600OpenCLImageTypeLoweringPass.cpp
@@ -31,6 +31,7 @@
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Metadata.h"
+#include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
index e81e6bb697588..bf6bb8c295efe 100644
--- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
@@ -49,6 +49,7 @@
 #include "llvm/IR/DebugLoc.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/GlobalValue.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/MC/MCInstrItineraries.h"
diff --git a/llvm/lib/Target/ARM/ARMInstrInfo.cpp b/llvm/lib/Target/ARM/ARMInstrInfo.cpp
index ccc883f646a62..66d273e7ca9dd 100644
--- a/llvm/lib/Target/ARM/ARMInstrInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMInstrInfo.cpp
@@ -24,6 +24,7 @@
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/GlobalVariable.h"
+#include "llvm/IR/Module.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCInst.h"
 using namespace llvm;
diff --git a/llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp b/llvm/lib/Target/ARM/ARMMachineFunctionInfo.cpp
index 54207562dbaeb..75f5d80b2e0d2 100644
--- a/llvm/lib/Targe...
[truncated]

@nikic nikic merged commit 4169338 into llvm:main Jun 28, 2024
5 of 6 checks passed
@nikic nikic deleted the analysis-module-include branch June 28, 2024 12:30
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 28, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-dev-x86-64 running on ml-opt-dev-x86-64-b2 while building clang,llvm,polly at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/137/builds/829

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
33.359 [2882/64/672] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/DebugLoc.cpp.o
33.414 [2881/64/673] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/ExpandPostRAPseudos.cpp.o
34.097 [2880/64/674] Building CXX object examples/IRTransforms/CMakeFiles/ExampleIRTransforms.dir/SimplifyCFG.cpp.o
34.454 [2879/64/675] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/PassManager.cpp.o
34.504 [2878/64/676] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FaultMaps.cpp.o
34.556 [2877/64/677] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FEntryInserter.cpp.o
35.882 [2876/64/678] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/ConvergenceVerifier.cpp.o
35.966 [2875/64/679] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FixupStatepointCallerSaved.cpp.o
36.028 [2874/64/680] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/FuncletLayout.cpp.o
36.876 [2873/64/681] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o
FAILED: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o 
ccache /usr/bin/c++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/ml-opt-dev-x86-64-b1/build/lib/CodeGen -I/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen -I/b/ml-opt-dev-x86-64-b1/build/include -I/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include -isystem /tmp/tflitebuild/tensorflow/include -isystem /tmp/tflitebuild/eigen/include/eigen3 -isystem /tmp/tflitebuild/abseil-cpp/include -isystem /tmp/tflitebuild/flatbuffers/include -isystem /tmp/tflitebuild/gemmlowp/include/gemmlowp -isystem /tmp/tflitebuild/ml_dtypes/src/ml_dtypes -isystem /tmp/tflitebuild/ml_dtypes/src/ml_dtypes/ml_dtypes -isystem /tmp/tflitebuild/ruy/include -isystem /tmp/tflitebuild/cpuinfo/include -isystem /tmp/tflitebuild/ARM_NEON_2_x86_SSE/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -DEIGEN_NEON_GEBP_NR=4 -DTFL_STATIC_LIBRARY_BUILD -std=c++17 -MD -MT lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o -MF lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o.d -o lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegAllocPriorityAdvisor.cpp.o -c /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp: In member function ‘virtual bool llvm::DevelopmentModePriorityAdvisorAnalysis::doInitialization(llvm::Module&)’:
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:223:24: error: invalid use of incomplete type ‘class llvm::Module’
  223 |     LLVMContext &Ctx = M.getContext();
      |                        ^
In file included from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/User.h:24,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Constant.h:16,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Metadata.h:26,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/MemoryLocation.h:19,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:23,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/MachineBasicBlock.h:20,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:26,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/LiveInterval.h:29,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/InterferenceCache.h:18,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/RegAllocGreedy.h:15,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:14:
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Value.h:47:7: note: forward declaration of ‘class llvm::Module’
   47 | class Module;
      |       ^~~~~~
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:243:7: error: invalid use of incomplete type ‘class llvm::Module’
  243 |       M.getContext().emitError(EC.message() + ":" + TrainingLog);
      |       ^
In file included from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/User.h:24,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Constant.h:16,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Metadata.h:26,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/MemoryLocation.h:19,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:23,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/MachineBasicBlock.h:20,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:26,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/CodeGen/LiveInterval.h:29,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/InterferenceCache.h:18,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/RegAllocGreedy.h:15,
                 from /b/ml-opt-dev-x86-64-b1/llvm-project/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp:14:
/b/ml-opt-dev-x86-64-b1/llvm-project/llvm/include/llvm/IR/Value.h:47:7: note: forward declaration of ‘class llvm::Module’
   47 | class Module;
      |       ^~~~~~
37.219 [2873/63/682] Building X86GenSubtargetInfo.inc...
38.035 [2873/62/683] Building CXX object lib/FuzzMutate/CMakeFiles/LLVMFuzzMutate.dir/RandomIRBuilder.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 28, 2024

LLVM Buildbot has detected a new failure on builder ml-opt-devrel-x86-64 running on ml-opt-devrel-x86-64-b2 while building clang,llvm,polly at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/175/builds/833

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
210.665 [1476/64/2101] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CaptureTracking.cpp.o
211.223 [1475/64/2102] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/HeatUtils.cpp.o
212.463 [1474/64/2103] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/NewGVN.cpp.o
212.498 [1473/64/2104] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CFGPrinter.cpp.o
212.935 [1472/64/2105] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CallGraph.cpp.o
213.155 [1471/64/2106] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/SROA.cpp.o
213.187 [1470/64/2107] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/MemoryProfileInfo.cpp.o
213.596 [1469/64/2108] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/Delinearization.cpp.o
213.749 [1468/64/2109] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CycleAnalysis.cpp.o
215.395 [1467/64/2110] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o
FAILED: lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o 
ccache /usr/bin/c++ -DCPUINFO_SUPPORTED_PLATFORM=1 -DGTEST_HAS_RTTI=0 -DHAS_LOGF128 -DLLVM_HAVE_TF_AOT_INLINERSIZEMODEL -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/ml-opt-devrel-x86-64-b1/build/lib/Analysis -I/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis -I/var/lib/buildbot/.local/lib/python3.7/site-packages/tensorflow/include -I/b/ml-opt-devrel-x86-64-b1/build/include -I/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include -isystem /tmp/tflitebuild/tensorflow/include -isystem /tmp/tflitebuild/eigen/include/eigen3 -isystem /tmp/tflitebuild/abseil-cpp/include -isystem /tmp/tflitebuild/flatbuffers/include -isystem /tmp/tflitebuild/gemmlowp/include/gemmlowp -isystem /tmp/tflitebuild/ml_dtypes/src/ml_dtypes -isystem /tmp/tflitebuild/ml_dtypes/src/ml_dtypes/ml_dtypes -isystem /tmp/tflitebuild/ruy/include -isystem /tmp/tflitebuild/cpuinfo/include -isystem /tmp/tflitebuild/ARM_NEON_2_x86_SSE/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -DEIGEN_NEON_GEBP_NR=4 -DTFL_STATIC_LIBRARY_BUILD -std=c++17 -MD -MT lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o -MF lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o.d -o lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DevelopmentModeInlineAdvisor.cpp.o -c /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp: In member function ‘std::optional<long unsigned int> {anonymous}::DevelopmentModeMLInlineAdvisor::getNativeSizeEstimate(const llvm::Function&) const’:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:348:18: error: invalid use of incomplete type ‘const class llvm::Module’
  348 |     F.getParent()->getContext().emitError(
      |                  ^~
In file included from /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/TensorSpec.h:15,
                 from /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:13:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/IR/LLVMContext.h:32:7: note: forward declaration of ‘class llvm::Module’
   32 | class Module;
      |       ^~~~~~
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp: In member function ‘size_t {anonymous}::DevelopmentModeMLInlineAdvisor::getTotalSizeEstimate()’:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:391:18: error: range-based ‘for’ expression of type ‘llvm::Module’ has incomplete type
  391 |   for (auto &F : M) {
      |                  ^
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp: In function ‘std::unique_ptr<llvm::InlineAdvisor> llvm::getDevelopmentModeAdvisor(llvm::Module&, llvm::ModuleAnalysisManager&, std::function<bool(llvm::CallBase&)>)’:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:402:15: error: invalid use of incomplete type ‘class llvm::Module’
  402 |   auto &Ctx = M.getContext();
      |               ^
In file included from /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/Analysis/TensorSpec.h:15,
                 from /b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp:13:
/b/ml-opt-devrel-x86-64-b1/llvm-project/llvm/include/llvm/IR/LLVMContext.h:32:7: note: forward declaration of ‘class llvm::Module’
   32 | class Module;
      |       ^~~~~~
216.000 [1467/63/2111] Building CXX object lib/Transforms/IPO/CMakeFiles/LLVMipo.dir/IROutliner.cpp.o
216.546 [1467/62/2112] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/BranchProbabilityInfo.cpp.o
216.842 [1467/61/2113] Building CXX object lib/Transforms/Vectorize/CMakeFiles/LLVMVectorize.dir/VPlanRecipes.cpp.o
217.093 [1467/60/2114] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DDG.cpp.o
217.139 [1467/59/2115] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/InteractiveModelRunner.cpp.o
217.472 [1467/58/2116] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LazyBlockFrequencyInfo.cpp.o
218.109 [1467/57/2117] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DominanceFrontier.cpp.o
218.374 [1467/56/2118] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/BlockFrequencyInfo.cpp.o
218.703 [1467/55/2119] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LazyBranchProbabilityInfo.cpp.o
219.760 [1467/54/2120] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/CGSCCPassManager.cpp.o
219.909 [1467/53/2121] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/BasicAliasAnalysis.cpp.o
220.038 [1467/52/2122] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/InstCount.cpp.o
220.297 [1467/51/2123] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/IVUsers.cpp.o
220.429 [1467/50/2124] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/LoopStrengthReduce.cpp.o
220.607 [1467/49/2125] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/DomTreeUpdater.cpp.o

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 28, 2024

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building clang,llvm,polly at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/712

Here is the relevant piece of the build log for the reference:

Step 6 (test) failure: build (failure)
...
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-index-is-used.cpp (1599 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-implicit-const.s (1600 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5_locations.s (1601 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-line-strp.s (1602 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-partial-index.cpp (1603 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5-split.s (1604 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwarf5_tu_index_abbrev_offset.s (1605 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwo-not-found-warning.cpp (1606 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwo-type-in-main-file.s (1607 of 1981)
PASS: lldb-shell :: SymbolFile/DWARF/x86/dwp-debug-types.s (1608 of 1981)
FAIL: lldb-shell :: SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp (1609 of 1981)
******************** TEST 'lldb-shell :: SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 19: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang --target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux -gdwarf-5 -gsplit-dwarf    -fdebug-types-section -gpubnames -c /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp -o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang --target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux -gdwarf-5 -gsplit-dwarf -fdebug-types-section -gpubnames -c /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp -o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o
RUN: at line 21: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang --target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux -gdwarf-5 -gsplit-dwarf -DVARIANT    -fdebug-types-section -gpubnames -c /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp -o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang --target=specify-a-target-or-use-a-_host-substitution -target x86_64-pc-linux -gdwarf-5 -gsplit-dwarf -DVARIANT -fdebug-types-section -gpubnames -c /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp -o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o
RUN: at line 23: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/ld.lld /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o -o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/ld.lld /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.main.o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.foo.o -o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp
ld.lld: warning: cannot find entry symbol _start; not setting start address
RUN: at line 26: rm -f /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.dwp
+ rm -f /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp.dwp
RUN: at line 27: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/lldb --no-lldbinit -S /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/lit-lldb-init-quiet    -o "type lookup IntegerType"    -o "type lookup FloatType"    -o "type lookup CustomType"    -b /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp | /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/FileCheck /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp --check-prefix=NODWP
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/lldb --no-lldbinit -S /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/lit-lldb-init-quiet -o 'type lookup IntegerType' -o 'type lookup FloatType' -o 'type lookup CustomType' -b /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/SymbolFile/DWARF/x86/Output/dwp-foreign-type-units.cpp.tmp
+ /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/FileCheck /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp --check-prefix=NODWP
/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp:36:16: error: NODWP-NEXT: is not on the line after the previous match
// NODWP-NEXT: double
               ^
<stdin>:11:1: note: 'next' match was here
double
^
<stdin>:9:29: note: previous match ended here
(lldb) type lookup FloatType
                            ^
<stdin>:10:1: note: non-matching line after previous match is here
float
^

Input file: <stdin>
Check file: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/Shell/SymbolFile/DWARF/x86/dwp-foreign-type-units.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
         .

MaskRay added a commit that referenced this pull request Jun 28, 2024
MaskRay added a commit that referenced this pull request Jun 28, 2024
Sisyph added a commit to Sisyph/llvm-dialects that referenced this pull request Jun 28, 2024
ZijunZhaoCCK added a commit that referenced this pull request Jun 29, 2024
dstutt pushed a commit to GPUOpen-Drivers/llvm-dialects that referenced this pull request Jul 1, 2024
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
Replace it with a forward declaration instead. Analysis.h is pulled in
by all passes, but not all passes need to access the module.
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:AArch64 backend:AMDGPU backend:ARM backend:PowerPC backend:RISC-V backend:SystemZ backend:WebAssembly backend:X86 clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category debuginfo llvm:analysis llvm:ir llvm:SelectionDAG SelectionDAGISel as well llvm:transforms LTO Link time optimization (regular/full LTO or ThinLTO) mlgo PGO Profile Guided Optimizations skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants