[clang] [clang-tools-extra] [flang] [libclc] [lld] [lldb] [llvm] [mlir] [polly] [MLIR][CMake] LLVM_UNITY_BUILD support (PR #188403)
Maksim Levental via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 24 21:50:25 PDT 2026
https://github.com/makslevental updated https://github.com/llvm/llvm-project/pull/188403
>From 2d57f362dc3cfc6768d43b595cb57be549657dde Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Wed, 18 Mar 2026 17:17:54 -0700
Subject: [PATCH 01/25] UNITY_BUILD
---
llvm/include/llvm/ADT/GenericCycleImpl.h | 1 +
llvm/include/llvm/ADT/GenericUniformityImpl.h | 1 +
.../llvm/Analysis/BlockFrequencyInfoImpl.h | 1 +
llvm/include/llvm/Analysis/CGSCCPassManager.h | 1 +
.../include/llvm/Analysis/SparsePropagation.h | 1 +
.../llvm/Support/GenericDomTreeConstruction.h | 1 +
.../llvm/Transforms/Utils/SSAUpdaterImpl.h | 1 +
.../Utils/SampleProfileLoaderBaseImpl.h | 1 +
.../Vectorize/SandboxVectorizer/Debug.h | 1 +
llvm/lib/Analysis/AssumeBundleQueries.cpp | 1 +
llvm/lib/Analysis/BasicAliasAnalysis.cpp | 1 +
llvm/lib/Analysis/BranchProbabilityInfo.cpp | 1 +
llvm/lib/Analysis/CallGraphSCCPass.cpp | 1 +
llvm/lib/Analysis/DXILMetadataAnalysis.cpp | 1 +
.../Analysis/FunctionPropertiesAnalysis.cpp | 1 +
llvm/lib/Analysis/InlineCost.cpp | 1 +
llvm/lib/Analysis/InlineOrder.cpp | 1 +
llvm/lib/Analysis/InstCount.cpp | 1 +
llvm/lib/Analysis/InstructionSimplify.cpp | 1 +
llvm/lib/Analysis/MemoryBuiltins.cpp | 1 +
.../lib/Analysis/MemoryDependenceAnalysis.cpp | 1 +
llvm/lib/Analysis/MemoryProfileInfo.cpp | 1 +
llvm/lib/Analysis/MemorySSA.cpp | 1 +
llvm/lib/Analysis/RegionPass.cpp | 1 +
llvm/lib/Analysis/ScalarEvolution.cpp | 1 +
llvm/lib/Analysis/ScalarEvolutionDivision.cpp | 1 +
llvm/lib/Analysis/StackLifetime.cpp | 1 +
llvm/lib/Analysis/StackSafetyAnalysis.cpp | 1 +
llvm/lib/Bitcode/Reader/CMakeLists.txt | 6 ++++
.../AsmPrinter/DbgEntityHistoryCalculator.cpp | 1 +
llvm/lib/CodeGen/CMakeLists.txt | 20 +++++++++++
llvm/lib/CodeGen/GlobalISel/CMakeLists.txt | 5 +++
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/Combiner.cpp | 1 +
.../GlobalISel/GIMatchTableExecutor.cpp | 1 +
.../CodeGen/GlobalISel/GISelValueTracking.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 1 +
.../CodeGen/GlobalISel/InlineAsmLowering.cpp | 1 +
.../CodeGen/GlobalISel/InstructionSelect.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/Localizer.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 1 +
llvm/lib/CodeGen/GlobalISel/Utils.cpp | 1 +
.../LiveDebugValues/LiveDebugValues.cpp | 1 +
llvm/lib/CodeGen/LiveRangeShrink.cpp | 1 +
llvm/lib/CodeGen/LiveRegMatrix.cpp | 1 +
llvm/lib/CodeGen/LiveStacks.cpp | 1 +
llvm/lib/CodeGen/LowerEmuTLS.cpp | 1 +
llvm/lib/CodeGen/MIR2Vec.cpp | 1 +
llvm/lib/CodeGen/MIRCanonicalizerPass.cpp | 1 +
llvm/lib/CodeGen/MIRNamerPass.cpp | 1 +
llvm/lib/CodeGen/MIRParser/CMakeLists.txt | 4 +++
llvm/lib/CodeGen/MIRVRegNamerUtils.cpp | 1 +
llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp | 1 +
llvm/lib/CodeGen/MachineBasicBlock.cpp | 1 +
llvm/lib/CodeGen/MachineBlockPlacement.cpp | 1 +
llvm/lib/CodeGen/MachineCFGPrinter.cpp | 1 +
llvm/lib/CodeGen/MachineCSE.cpp | 1 +
llvm/lib/CodeGen/MachineCheckDebugify.cpp | 1 +
llvm/lib/CodeGen/MachineCombiner.cpp | 1 +
llvm/lib/CodeGen/MachineCopyPropagation.cpp | 1 +
llvm/lib/CodeGen/MachineLICM.cpp | 1 +
llvm/lib/CodeGen/MachinePipeliner.cpp | 1 +
llvm/lib/CodeGen/MachineScheduler.cpp | 1 +
llvm/lib/CodeGen/MachineSink.cpp | 1 +
llvm/lib/CodeGen/MachineStableHash.cpp | 1 +
llvm/lib/CodeGen/MachineStripDebug.cpp | 1 +
llvm/lib/CodeGen/MachineTraceMetrics.cpp | 1 +
llvm/lib/CodeGen/ModuloSchedule.cpp | 1 +
llvm/lib/CodeGen/OptimizePHIs.cpp | 1 +
llvm/lib/CodeGen/PHIElimination.cpp | 1 +
llvm/lib/CodeGen/PeepholeOptimizer.cpp | 1 +
llvm/lib/CodeGen/PostRAHazardRecognizer.cpp | 1 +
llvm/lib/CodeGen/PostRASchedulerList.cpp | 1 +
llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp | 1 +
llvm/lib/CodeGen/ProcessImplicitDefs.cpp | 1 +
llvm/lib/CodeGen/PrologEpilogInserter.cpp | 1 +
llvm/lib/CodeGen/PseudoProbeInserter.cpp | 1 +
llvm/lib/CodeGen/RegAllocBase.cpp | 1 +
llvm/lib/CodeGen/RegAllocScore.cpp | 1 +
llvm/lib/CodeGen/RegisterBank.cpp | 1 +
llvm/lib/CodeGen/RegisterBankInfo.cpp | 1 +
llvm/lib/CodeGen/RegisterClassInfo.cpp | 1 +
llvm/lib/CodeGen/RegisterScavenging.cpp | 1 +
llvm/lib/CodeGen/Rematerializer.cpp | 1 +
llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp | 1 +
.../CodeGen/RemoveRedundantDebugValues.cpp | 1 +
llvm/lib/CodeGen/RenameIndependentSubregs.cpp | 1 +
llvm/lib/CodeGen/ReplaceWithVeclib.cpp | 1 +
llvm/lib/CodeGen/ResetMachineFunctionPass.cpp | 1 +
llvm/lib/CodeGen/SafeStackLayout.cpp | 1 +
llvm/lib/CodeGen/ScheduleDAG.cpp | 1 +
llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 1 +
.../CodeGen/ScoreboardHazardRecognizer.cpp | 1 +
llvm/lib/CodeGen/SelectOptimize.cpp | 1 +
llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt | 9 +++++
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 1 +
.../SelectionDAG/FunctionLoweringInfo.cpp | 1 +
.../lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 1 +
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 1 +
.../SelectionDAG/LegalizeFloatTypes.cpp | 1 +
.../SelectionDAG/LegalizeVectorOps.cpp | 1 +
.../SelectionDAG/LegalizeVectorTypes.cpp | 1 +
.../SelectionDAG/ResourcePriorityQueue.cpp | 1 +
.../CodeGen/SelectionDAG/ScheduleDAGFast.cpp | 1 +
.../lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 +
.../SelectionDAG/SelectionDAGBuilder.cpp | 1 +
.../CodeGen/SelectionDAG/SelectionDAGISel.cpp | 1 +
.../SelectionDAG/SelectionDAGPrinter.cpp | 1 +
.../SelectionDAG/StatepointLowering.cpp | 1 +
llvm/lib/CodeGen/ShrinkWrap.cpp | 1 +
llvm/lib/CodeGen/SjLjEHPrepare.cpp | 1 +
llvm/lib/CodeGen/SlotIndexes.cpp | 1 +
llvm/lib/CodeGen/SpillPlacement.cpp | 1 +
llvm/lib/CodeGen/SplitKit.cpp | 1 +
llvm/lib/CodeGen/StackColoring.cpp | 1 +
.../CodeGen/StackFrameLayoutAnalysisPass.cpp | 1 +
llvm/lib/CodeGen/StackProtector.cpp | 1 +
llvm/lib/CodeGen/StackSlotColoring.cpp | 1 +
llvm/lib/CodeGen/StaticDataAnnotator.cpp | 1 +
llvm/lib/CodeGen/StaticDataSplitter.cpp | 1 +
.../lib/CodeGen/TwoAddressInstructionPass.cpp | 1 +
llvm/lib/CodeGen/TypePromotion.cpp | 1 +
llvm/lib/CodeGen/VLIWMachineScheduler.cpp | 1 +
llvm/lib/CodeGen/WasmEHPrepare.cpp | 1 +
llvm/lib/CodeGen/WinEHPrepare.cpp | 1 +
llvm/lib/CodeGen/WindowScheduler.cpp | 1 +
llvm/lib/CodeGen/WindowsSecureHotPatching.cpp | 1 +
llvm/lib/DebugInfo/BTF/BTFContext.cpp | 1 +
llvm/lib/DebugInfo/CodeView/CMakeLists.txt | 10 ++++++
llvm/lib/DebugInfo/GSYM/CMakeLists.txt | 5 +++
llvm/lib/Demangle/CMakeLists.txt | 11 +++++++
.../ExecutionEngine/JITLink/CMakeLists.txt | 5 +++
llvm/lib/ExecutionEngine/Orc/CMakeLists.txt | 5 +++
.../Orc/TargetProcess/JITLoaderGDB.cpp | 1 +
.../Orc/TargetProcess/LibraryScanner.cpp | 1 +
.../RuntimeDyld/CMakeLists.txt | 4 +++
.../RuntimeDyld/RuntimeDyldChecker.cpp | 1 +
.../Targets/RuntimeDyldCOFFAArch64.h | 1 +
llvm/lib/Frontend/HLSL/CMakeLists.txt | 7 ++++
llvm/lib/IR/ConstantsContext.h | 1 +
llvm/lib/IR/ModuleSummaryIndex.cpp | 1 +
llvm/lib/IR/PassTimingInfo.cpp | 1 +
llvm/lib/IR/VFABIDemangler.cpp | 1 +
llvm/lib/IR/ValueSymbolTable.cpp | 1 +
llvm/lib/MC/CMakeLists.txt | 10 ++++++
llvm/lib/MC/MachObjectWriter.cpp | 1 +
llvm/lib/Object/CMakeLists.txt | 9 +++++
llvm/lib/ObjectYAML/CMakeLists.txt | 6 ++++
llvm/lib/ProfileData/CMakeLists.txt | 12 +++++++
llvm/lib/ProfileData/InstrProfCorrelator.cpp | 1 +
llvm/lib/ProfileData/SampleProfReader.cpp | 1 +
llvm/lib/ProfileData/SampleProfWriter.cpp | 1 +
llvm/lib/Support/regexec.c | 1 +
llvm/lib/TableGen/Record.cpp | 1 +
llvm/lib/Target/AArch64/CMakeLists.txt | 21 ++++++++++++
llvm/lib/Target/AMDGPU/CMakeLists.txt | 14 ++++++++
.../Target/ARM/MCTargetDesc/CMakeLists.txt | 4 +++
llvm/lib/Target/Hexagon/CMakeLists.txt | 4 +++
llvm/lib/Target/MSP430/CMakeLists.txt | 4 +++
.../Target/NVPTX/MCTargetDesc/CMakeLists.txt | 4 +++
llvm/lib/Target/RISCV/CMakeLists.txt | 14 ++++++++
llvm/lib/Target/SPIRV/CMakeLists.txt | 9 +++++
.../Target/SPIRV/MCTargetDesc/CMakeLists.txt | 5 +++
llvm/lib/Target/WebAssembly/CMakeLists.txt | 14 ++++++++
llvm/lib/Target/X86/CMakeLists.txt | 19 +++++++++++
llvm/lib/Target/XCore/CMakeLists.txt | 8 +++++
llvm/lib/TargetParser/CMakeLists.txt | 10 ++++++
llvm/lib/TargetParser/Host.cpp | 1 +
llvm/lib/TextAPI/CMakeLists.txt | 5 +++
llvm/lib/Transforms/Coroutines/CMakeLists.txt | 5 +++
.../lib/Transforms/Coroutines/CoroCleanup.cpp | 1 +
llvm/lib/Transforms/Coroutines/CoroEarly.cpp | 1 +
llvm/lib/Transforms/Coroutines/CoroElide.cpp | 1 +
llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 1 +
llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 1 +
.../Coroutines/SuspendCrossingInfo.cpp | 1 +
.../Transforms/IPO/Annotation2Metadata.cpp | 1 +
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 1 +
llvm/lib/Transforms/IPO/Attributor.cpp | 1 +
llvm/lib/Transforms/IPO/BlockExtractor.cpp | 1 +
llvm/lib/Transforms/IPO/FunctionImport.cpp | 1 +
.../Transforms/IPO/FunctionSpecialization.cpp | 1 +
llvm/lib/Transforms/IPO/GlobalDCE.cpp | 1 +
llvm/lib/Transforms/IPO/GlobalOpt.cpp | 1 +
llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 1 +
.../lib/Transforms/IPO/InferFunctionAttrs.cpp | 1 +
llvm/lib/Transforms/IPO/Internalize.cpp | 1 +
llvm/lib/Transforms/IPO/LoopExtractor.cpp | 1 +
llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 1 +
.../IPO/MemProfContextDisambiguation.cpp | 1 +
llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 1 +
llvm/lib/Transforms/IPO/PartialInlining.cpp | 1 +
.../Transforms/IPO/SampleContextTracker.cpp | 1 +
.../Transforms/IPO/SampleProfileMatcher.cpp | 1 +
.../lib/Transforms/IPO/SampleProfileProbe.cpp | 1 +
.../Transforms/IPO/StripDeadPrototypes.cpp | 1 +
.../Transforms/Instrumentation/CMakeLists.txt | 4 +++
.../Instrumentation/HWAddressSanitizer.cpp | 1 +
.../Instrumentation/TypeSanitizer.cpp | 1 +
llvm/lib/Transforms/ObjCARC/CMakeLists.txt | 4 +++
.../Transforms/ObjCARC/DependencyAnalysis.cpp | 1 +
.../Transforms/ObjCARC/ObjCARCContract.cpp | 1 +
llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | 1 +
llvm/lib/Transforms/ObjCARC/PtrState.cpp | 1 +
.../Scalar/AlignmentFromAssumptions.cpp | 1 +
.../Transforms/Scalar/AnnotationRemarks.cpp | 1 +
llvm/lib/Transforms/Scalar/BDCE.cpp | 1 +
llvm/lib/Transforms/Scalar/CMakeLists.txt | 7 ++++
.../Transforms/Scalar/CallSiteSplitting.cpp | 1 +
.../Transforms/Scalar/ConstantHoisting.cpp | 1 +
.../Scalar/ConstraintElimination.cpp | 1 +
.../Scalar/CorrelatedValuePropagation.cpp | 1 +
llvm/lib/Transforms/Scalar/DCE.cpp | 1 +
.../Scalar/DeadStoreElimination.cpp | 1 +
llvm/lib/Transforms/Scalar/DivRemPairs.cpp | 1 +
llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 1 +
llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp | 1 +
llvm/lib/Transforms/Scalar/Float2Int.cpp | 1 +
llvm/lib/Transforms/Scalar/GVN.cpp | 1 +
llvm/lib/Transforms/Scalar/GVNHoist.cpp | 1 +
llvm/lib/Transforms/Scalar/GVNSink.cpp | 1 +
llvm/lib/Transforms/Scalar/GuardWidening.cpp | 1 +
llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp | 1 +
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 1 +
.../Scalar/InductiveRangeCheckElimination.cpp | 1 +
.../Transforms/Scalar/InferAddressSpaces.cpp | 1 +
.../Transforms/Scalar/InstSimplifyPass.cpp | 1 +
llvm/lib/Transforms/Scalar/JumpThreading.cpp | 1 +
llvm/lib/Transforms/Scalar/LICM.cpp | 1 +
.../Scalar/LoopAccessAnalysisPrinter.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp | 1 +
.../Transforms/Scalar/LoopDataPrefetch.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopDistribute.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopFlatten.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopFuse.cpp | 1 +
.../Transforms/Scalar/LoopIdiomRecognize.cpp | 1 +
.../Transforms/Scalar/LoopInstSimplify.cpp | 1 +
.../lib/Transforms/Scalar/LoopInterchange.cpp | 1 +
.../Transforms/Scalar/LoopLoadElimination.cpp | 1 +
.../lib/Transforms/Scalar/LoopPredication.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopRotation.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopSink.cpp | 1 +
.../Transforms/Scalar/LoopStrengthReduce.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopTermFold.cpp | 1 +
.../Scalar/LoopUnrollAndJamPass.cpp | 1 +
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 1 +
.../Transforms/Scalar/LoopVersioningLICM.cpp | 1 +
.../lib/Transforms/Scalar/LowerAtomicPass.cpp | 1 +
.../Scalar/LowerConstantIntrinsics.cpp | 1 +
.../Scalar/LowerMatrixIntrinsics.cpp | 1 +
.../lib/Transforms/Scalar/MemCpyOptimizer.cpp | 1 +
llvm/lib/Transforms/Scalar/MergeICmps.cpp | 1 +
.../Scalar/MergedLoadStoreMotion.cpp | 1 +
llvm/lib/Transforms/Scalar/NewGVN.cpp | 1 +
.../Scalar/PartiallyInlineLibCalls.cpp | 1 +
.../lib/Transforms/Scalar/PlaceSafepoints.cpp | 1 +
llvm/lib/Transforms/Scalar/Reassociate.cpp | 1 +
llvm/lib/Transforms/Scalar/Reg2Mem.cpp | 1 +
.../Scalar/RewriteStatepointsForGC.cpp | 1 +
llvm/lib/Transforms/Scalar/SCCP.cpp | 1 +
.../Scalar/ScalarizeMaskedMemIntrin.cpp | 1 +
llvm/lib/Transforms/Scalar/Scalarizer.cpp | 1 +
.../Transforms/Scalar/SimpleLoopUnswitch.cpp | 1 +
.../lib/Transforms/Scalar/SimplifyCFGPass.cpp | 1 +
llvm/lib/Transforms/Scalar/Sink.cpp | 1 +
.../Scalar/StraightLineStrengthReduce.cpp | 1 +
llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 1 +
.../Scalar/TailRecursionElimination.cpp | 1 +
.../Scalar/WarnMissedTransforms.cpp | 1 +
llvm/lib/Transforms/Utils/CMakeLists.txt | 8 +++++
llvm/lib/Transforms/Utils/CloneFunction.cpp | 1 +
llvm/lib/Transforms/Utils/CodeLayout.cpp | 1 +
.../lib/Transforms/Utils/LoopUnrollAndJam.cpp | 1 +
.../Transforms/Utils/LoopUnrollRuntime.cpp | 1 +
llvm/lib/Transforms/Utils/LoopUtils.cpp | 1 +
llvm/lib/Transforms/Utils/LoopVersioning.cpp | 1 +
llvm/lib/Transforms/Utils/LowerAtomic.cpp | 1 +
.../lib/Transforms/Utils/LowerGlobalDtors.cpp | 1 +
llvm/lib/Transforms/Utils/LowerInvoke.cpp | 1 +
llvm/lib/Transforms/Utils/LowerSwitch.cpp | 1 +
.../Utils/LowerVectorIntrinsics.cpp | 1 +
llvm/lib/Transforms/Utils/Mem2Reg.cpp | 1 +
llvm/lib/Transforms/Utils/ModuleUtils.cpp | 1 +
llvm/lib/Transforms/Utils/MoveAutoInit.cpp | 1 +
llvm/lib/Transforms/Utils/PredicateInfo.cpp | 1 +
.../Utils/PromoteMemoryToRegister.cpp | 1 +
llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp | 1 +
.../Utils/SampleProfileInference.cpp | 1 +
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 1 +
llvm/lib/Transforms/Utils/SplitModule.cpp | 1 +
.../Utils/SplitModuleByCategory.cpp | 1 +
llvm/lib/Transforms/Utils/SymbolRewriter.cpp | 1 +
llvm/lib/Transforms/Utils/VNCoercion.cpp | 1 +
llvm/lib/Transforms/Utils/ValueMapper.cpp | 1 +
llvm/lib/Transforms/Vectorize/CMakeLists.txt | 29 ++++++++++++++++
.../Vectorize/LoopIdiomVectorize.cpp | 1 +
.../Vectorize/LoopVectorizationLegality.cpp | 1 +
.../lib/Transforms/Vectorize/VPlanRecipes.cpp | 1 +
llvm/lib/Transforms/Vectorize/VPlanSLP.cpp | 1 +
.../Transforms/Vectorize/VPlanVerifier.cpp | 1 +
.../Transforms/Vectorize/VectorCombine.cpp | 1 +
llvm/utils/TableGen/AsmWriterEmitter.cpp | 1 +
llvm/utils/TableGen/Basic/CMakeLists.txt | 15 +++++++++
llvm/utils/TableGen/CMakeLists.txt | 33 +++++++++++++++++++
llvm/utils/TableGen/CTagsEmitter.cpp | 1 +
llvm/utils/TableGen/CompressInstEmitter.cpp | 1 +
llvm/utils/TableGen/DAGISelEmitter.cpp | 1 +
llvm/utils/TableGen/DAGISelMatcherOpt.cpp | 1 +
llvm/utils/TableGen/DecoderEmitter.cpp | 1 +
llvm/utils/TableGen/ExegesisEmitter.cpp | 1 +
.../TableGen/GlobalISelCombinerEmitter.cpp | 1 +
llvm/utils/TableGen/GlobalISelEmitter.cpp | 1 +
llvm/utils/TableGen/PseudoLoweringEmitter.cpp | 1 +
llvm/utils/TableGen/RegisterBankEmitter.cpp | 1 +
llvm/utils/TableGen/SubtargetEmitter.cpp | 1 +
.../DataFlow/ConstantPropagationAnalysis.cpp | 1 +
.../Analysis/DataFlow/DeadCodeAnalysis.cpp | 1 +
mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp | 1 +
.../DataFlow/IntegerRangeAnalysis.cpp | 1 +
.../Analysis/DataFlow/LivenessAnalysis.cpp | 1 +
.../DataFlow/StridedMetadataRangeAnalysis.cpp | 1 +
.../Analysis/FlatLinearValueConstraints.cpp | 1 +
mlir/lib/Conversion/LLVMCommon/CMakeLists.txt | 5 +++
.../MemRefToSPIRV/MemRefToSPIRV.cpp | 1 +
mlir/lib/Conversion/SCFToGPU/CMakeLists.txt | 4 +++
.../Conversion/ShapeToStandard/CMakeLists.txt | 5 +++
mlir/lib/Debug/CMakeLists.txt | 4 +++
.../Affine/Analysis/AffineStructures.cpp | 1 +
.../Dialect/Affine/Analysis/LoopAnalysis.cpp | 1 +
mlir/lib/Dialect/Affine/Analysis/Utils.cpp | 1 +
.../AffineLoopInvariantCodeMotion.cpp | 1 +
.../Affine/Transforms/AffineParallelize.cpp | 1 +
.../Transforms/AffineScalarReplacement.cpp | 1 +
.../Dialect/Affine/Transforms/CMakeLists.txt | 4 +++
.../Affine/Transforms/DecomposeAffineOps.cpp | 1 +
.../Dialect/Affine/Transforms/LoopFusion.cpp | 1 +
.../Dialect/Affine/Transforms/LoopTiling.cpp | 1 +
.../Dialect/Affine/Transforms/LoopUnroll.cpp | 1 +
.../Affine/Transforms/LoopUnrollAndJam.cpp | 1 +
.../Transforms/PipelineDataTransfer.cpp | 1 +
.../Affine/Transforms/RaiseMemrefDialect.cpp | 1 +
.../Transforms/SimplifyAffineMinMax.cpp | 1 +
.../Transforms/SimplifyAffineStructures.cpp | 1 +
mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp | 1 +
mlir/lib/Dialect/Affine/Utils/Utils.cpp | 1 +
.../Dialect/Arith/Transforms/CMakeLists.txt | 4 +++
.../ArmSME/Transforms/OuterProductFusion.cpp | 1 +
.../ArmSME/Transforms/VectorLegalization.cpp | 1 +
.../Transforms/AsyncRuntimeRefCounting.cpp | 1 +
.../Transforms/AsyncRuntimeRefCountingOpt.cpp | 1 +
.../Async/Transforms/AsyncToAsyncRuntime.cpp | 1 +
.../Bufferization/Transforms/CMakeLists.txt | 5 +++
.../Transforms/OptimizeAllocationLiveness.cpp | 1 +
.../Transforms/InlinerInterfaceImpl.cpp | 1 +
.../Dialect/Linalg/Transforms/CMakeLists.txt | 4 +++
.../Linalg/Transforms/DropUnitDims.cpp | 1 +
.../Linalg/Transforms/FoldIntoElementwise.cpp | 1 +
mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp | 1 +
.../Linalg/Transforms/Generalization.cpp | 1 +
.../Linalg/Transforms/HoistPadding.cpp | 1 +
.../Dialect/Linalg/Transforms/Hoisting.cpp | 1 +
.../Dialect/Linalg/Transforms/Interchange.cpp | 1 +
.../Dialect/Linalg/Transforms/MorphOps.cpp | 1 +
.../Linalg/Transforms/NamedToElementwise.cpp | 1 +
.../Linalg/Transforms/PadTilingInterface.cpp | 1 +
.../lib/Dialect/Linalg/Transforms/Padding.cpp | 1 +
.../Dialect/Linalg/Transforms/Promotion.cpp | 1 +
.../Dialect/Linalg/Transforms/Specialize.cpp | 1 +
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp | 1 +
.../Linalg/Transforms/TilingInterfaceImpl.cpp | 1 +
.../Dialect/Linalg/Transforms/Transforms.cpp | 1 +
.../Linalg/Transforms/TransposeMatmul.cpp | 1 +
.../Linalg/Transforms/Vectorization.cpp | 1 +
.../Dialect/MemRef/Transforms/CMakeLists.txt | 4 +++
.../Dialect/MemRef/Transforms/MultiBuffer.cpp | 1 +
.../MemRef/Transforms/NormalizeMemRefs.cpp | 1 +
.../MemRef/Transforms/ReifyResultShapes.cpp | 1 +
mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt | 4 +++
.../ACCDeclareGPUModuleInsertion.cpp | 1 +
.../Transforms/ACCIfClauseLowering.cpp | 1 +
.../OpenACC/Transforms/ACCImplicitData.cpp | 1 +
.../OpenACC/Transforms/ACCImplicitDeclare.cpp | 1 +
.../OpenACC/Transforms/ACCLegalizeSerial.cpp | 1 +
.../OpenACC/Transforms/ACCLoopTiling.cpp | 1 +
.../Transforms/ACCRecipeMaterialization.cpp | 1 +
.../OpenACC/Transforms/ACCRoutineLowering.cpp | 1 +
.../Transforms/ACCSpecializeForHost.cpp | 1 +
.../OffloadLiveInValueCanonicalization.cpp | 1 +
.../Transforms/OffloadTargetVerifier.cpp | 1 +
mlir/lib/Dialect/Ptr/IR/CMakeLists.txt | 4 +++
.../SCF/Transforms/ParallelLoopCollapsing.cpp | 1 +
.../SCF/Transforms/TileUsingInterface.cpp | 1 +
mlir/lib/Dialect/SCF/Utils/Utils.cpp | 1 +
mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt | 17 ++++++++++
.../SparseTensor/Transforms/CMakeLists.txt | 5 +++
mlir/lib/Dialect/Transform/IR/Utils.cpp | 1 +
.../Dialect/Vector/Transforms/CMakeLists.txt | 4 +++
.../Transforms/LowerVectorBroadcast.cpp | 1 +
.../Vector/Transforms/LowerVectorContract.cpp | 1 +
.../Vector/Transforms/LowerVectorGather.cpp | 1 +
.../Transforms/LowerVectorInterleave.cpp | 1 +
.../Vector/Transforms/LowerVectorMask.cpp | 1 +
.../Transforms/LowerVectorMultiReduction.cpp | 1 +
.../Transforms/LowerVectorShapeCast.cpp | 1 +
.../Vector/Transforms/LowerVectorShuffle.cpp | 1 +
.../Vector/Transforms/LowerVectorStep.cpp | 1 +
...LowerVectorToFromElementsToShuffleTree.cpp | 1 +
.../Transforms/LowerVectorTranspose.cpp | 1 +
.../Transforms/VectorEmulateNarrowType.cpp | 1 +
.../Transforms/VectorTransferOpTransforms.cpp | 1 +
.../VectorTransferSplitRewritePatterns.cpp | 1 +
.../Vector/Transforms/VectorTransforms.cpp | 1 +
.../Vector/Transforms/VectorUnroll.cpp | 1 +
.../Transforms/XeGPUPeepHoleOptimizer.cpp | 1 +
.../XeGPU/Transforms/XeGPUPropagateLayout.cpp | 1 +
.../XeGPUSgToWiDistributeExperimental.cpp | 1 +
.../Transforms/XeGPUSubgroupDistribute.cpp | 1 +
.../Dialect/XeGPU/Transforms/XeGPUUnroll.cpp | 1 +
.../XeGPU/Transforms/XeGPUVectorLinearize.cpp | 1 +
mlir/lib/IR/CMakeLists.txt | 6 ++++
mlir/lib/IR/Dialect.cpp | 1 +
mlir/lib/Support/TypeID.cpp | 1 +
mlir/lib/TableGen/CMakeLists.txt | 6 ++++
mlir/lib/TableGen/Pattern.cpp | 1 +
mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt | 4 +++
mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt | 4 +++
.../Tools/tblgen-lsp-server/CMakeLists.txt | 4 +++
mlir/lib/Transforms/RemoveDeadValues.cpp | 1 +
mlir/lib/Transforms/SROA.cpp | 1 +
mlir/lib/Transforms/Utils/CMakeLists.txt | 4 +++
.../Transforms/Utils/DialectConversion.cpp | 1 +
.../Utils/GreedyPatternRewriteDriver.cpp | 1 +
mlir/lib/Transforms/Utils/Inliner.cpp | 1 +
.../Utils/LoopInvariantCodeMotionUtils.cpp | 1 +
.../Utils/WalkPatternRewriteDriver.cpp | 1 +
mlir/test/lib/Analysis/CMakeLists.txt | 11 +++++++
.../Analysis/TestMemRefDependenceCheck.cpp | 1 +
.../lib/Conversion/FuncToLLVM/CMakeLists.txt | 4 +++
mlir/test/lib/Dialect/Affine/CMakeLists.txt | 16 +++++++++
.../lib/Dialect/Affine/TestLoopFusion.cpp | 1 +
.../lib/Dialect/Bufferization/CMakeLists.txt | 4 +++
mlir/test/lib/Dialect/SCF/CMakeLists.txt | 4 +++
mlir/test/lib/Dialect/Test/CMakeLists.txt | 13 ++++++++
.../test/lib/Dialect/Transform/CMakeLists.txt | 5 +++
mlir/test/lib/IR/CMakeLists.txt | 21 ++++++++++++
mlir/test/lib/Pass/CMakeLists.txt | 4 +++
mlir/test/lib/Transforms/CMakeLists.txt | 9 +++++
mlir/tools/mlir-tblgen/CMakeLists.txt | 23 +++++++++++++
mlir/unittests/ExecutionEngine/CMakeLists.txt | 8 +++++
mlir/unittests/IR/CMakeLists.txt | 7 ++++
mlir/unittests/Pass/CMakeLists.txt | 4 +++
454 files changed, 984 insertions(+)
diff --git a/llvm/include/llvm/ADT/GenericCycleImpl.h b/llvm/include/llvm/ADT/GenericCycleImpl.h
index 1a28fb1cef921..d04e6df2ab195 100644
--- a/llvm/include/llvm/ADT/GenericCycleImpl.h
+++ b/llvm/include/llvm/ADT/GenericCycleImpl.h
@@ -28,6 +28,7 @@
#include "llvm/ADT/GenericCycleInfo.h"
#include "llvm/ADT/StringExtras.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "generic-cycle-impl"
namespace llvm {
diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h
index 6089f69b393bd..b65c260442d2f 100644
--- a/llvm/include/llvm/ADT/GenericUniformityImpl.h
+++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h
@@ -53,6 +53,7 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "uniformity"
namespace llvm {
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
index 54f4e70bf2f84..aa9a009548166 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -49,6 +49,7 @@
#include <utility>
#include <vector>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "block-freq"
namespace llvm {
diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h
index 87cfd9e6064e9..7c357a259c5dd 100644
--- a/llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h
@@ -106,6 +106,7 @@ struct CGSCCUpdateResult;
class Module;
// Allow debug logging in this inline function.
+#undef DEBUG_TYPE
#define DEBUG_TYPE "cgscc"
/// Extern template declaration for the analysis set for this IR unit.
diff --git a/llvm/include/llvm/Analysis/SparsePropagation.h b/llvm/include/llvm/Analysis/SparsePropagation.h
index f8a940ae357a1..1cf08d41c0ca6 100644
--- a/llvm/include/llvm/Analysis/SparsePropagation.h
+++ b/llvm/include/llvm/Analysis/SparsePropagation.h
@@ -20,6 +20,7 @@
#include "llvm/Support/Debug.h"
#include <set>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sparseprop"
namespace llvm {
diff --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
index 511c28400e347..62f110ed276f3 100644
--- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h
+++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
@@ -46,6 +46,7 @@
#include <optional>
#include <queue>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dom-tree-builder"
namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
index c4aedbf3159db..240891839286e 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
@@ -21,6 +21,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "ssaupdater"
namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
index bcd33ac07ad8c..c14962ce174e4 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
@@ -53,6 +53,7 @@ namespace vfs {
class FileSystem;
} // namespace vfs
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-profile-impl"
namespace afdo_detail {
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h
index 85b25c0249e7d..ae78ad597d2dd 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h
@@ -15,6 +15,7 @@
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sandbox-vectorizer"
#define DEBUG_PREFIX "SBVec: "
diff --git a/llvm/lib/Analysis/AssumeBundleQueries.cpp b/llvm/lib/Analysis/AssumeBundleQueries.cpp
index aa1cb3c26d63f..21634914ff601 100644
--- a/llvm/lib/Analysis/AssumeBundleQueries.cpp
+++ b/llvm/lib/Analysis/AssumeBundleQueries.cpp
@@ -16,6 +16,7 @@
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/DebugCounter.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "assume-queries"
using namespace llvm;
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 80b14646c8889..4dfe08f4c3f30 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -61,6 +61,7 @@
#include <optional>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "basicaa"
using namespace llvm;
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
index 490bfbc0fb7ca..7b6c6e2d407de 100644
--- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "branch-prob"
static cl::opt<bool> PrintBranchProb(
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index 1228d5b4b78be..54db44b4edfa1 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -41,6 +41,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "cgscc-passmgr"
namespace llvm {
diff --git a/llvm/lib/Analysis/DXILMetadataAnalysis.cpp b/llvm/lib/Analysis/DXILMetadataAnalysis.cpp
index bd77cba385667..822c37ff023ad 100644
--- a/llvm/lib/Analysis/DXILMetadataAnalysis.cpp
+++ b/llvm/lib/Analysis/DXILMetadataAnalysis.cpp
@@ -17,6 +17,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/Support/ErrorHandling.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dxil-metadata-analysis"
using namespace llvm;
diff --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
index 4a66d8835281a..76b5b2146d394 100644
--- a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
+++ b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
@@ -27,6 +27,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "func-properties-stats"
#define FUNCTION_PROPERTY(Name, Description) STATISTIC(Num##Name, Description);
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index d674743669ba6..c0b3f85afff52 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -52,6 +52,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "inline-cost"
STATISTIC(NumCallsAnalyzed, "Number of call sites analyzed");
diff --git a/llvm/lib/Analysis/InlineOrder.cpp b/llvm/lib/Analysis/InlineOrder.cpp
index 8d920153f250d..ee475e3e56966 100644
--- a/llvm/lib/Analysis/InlineOrder.cpp
+++ b/llvm/lib/Analysis/InlineOrder.cpp
@@ -20,6 +20,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "inline-order"
enum class InlinePriorityMode : int { Size, Cost, CostBenefit, ML };
diff --git a/llvm/lib/Analysis/InstCount.cpp b/llvm/lib/Analysis/InstCount.cpp
index 7a797767f97cb..fe522e56ecc83 100644
--- a/llvm/lib/Analysis/InstCount.cpp
+++ b/llvm/lib/Analysis/InstCount.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "instcount"
STATISTIC(TotalInsts, "Number of instructions (of all types)");
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 12c3edc0ced30..20e7c6527c106 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -52,6 +52,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "instsimplify"
enum { RecursionLimit = 3 };
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index c7f89de9f8b11..df33887eb0e6b 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memory-builtins"
static cl::opt<unsigned> ObjectSizeOffsetVisitorMaxVisitInstructions(
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 9a022d9ed09ce..9bedf46d6060b 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -54,6 +54,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memdep"
STATISTIC(NumCacheNonLocal, "Number of fully cached non-local responses");
diff --git a/llvm/lib/Analysis/MemoryProfileInfo.cpp b/llvm/lib/Analysis/MemoryProfileInfo.cpp
index 27d741f310914..5145097c0dbc0 100644
--- a/llvm/lib/Analysis/MemoryProfileInfo.cpp
+++ b/llvm/lib/Analysis/MemoryProfileInfo.cpp
@@ -20,6 +20,7 @@
using namespace llvm;
using namespace llvm::memprof;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memory-profile-info"
namespace llvm {
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index 62c351499c3fc..b72000420f849 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -58,6 +58,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memoryssa"
static cl::opt<std::string>
diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp
index ae1d84659de86..23ada499f16ca 100644
--- a/llvm/lib/Analysis/RegionPass.cpp
+++ b/llvm/lib/Analysis/RegionPass.cpp
@@ -24,6 +24,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regionpassmgr"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index d99488121baba..b8c9631b7ab37 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -135,6 +135,7 @@ using namespace llvm;
using namespace PatternMatch;
using namespace SCEVPatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "scalar-evolution"
STATISTIC(NumExitCountsComputed,
diff --git a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
index 710473191f8c6..33da5087b4078 100644
--- a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
@@ -21,6 +21,7 @@
#include <cassert>
#include <cstdint>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "scev-division"
namespace llvm {
diff --git a/llvm/lib/Analysis/StackLifetime.cpp b/llvm/lib/Analysis/StackLifetime.cpp
index 30e0316b882cc..ec88db561d2cf 100644
--- a/llvm/lib/Analysis/StackLifetime.cpp
+++ b/llvm/lib/Analysis/StackLifetime.cpp
@@ -29,6 +29,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-lifetime"
const StackLifetime::LiveRange &
diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
index fbe74d21c7199..abbccc79a0b89 100644
--- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp
+++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
@@ -34,6 +34,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-safety"
STATISTIC(NumAllocaStackSafe, "Number of safe allocas");
diff --git a/llvm/lib/Bitcode/Reader/CMakeLists.txt b/llvm/lib/Bitcode/Reader/CMakeLists.txt
index 7a385613105ac..c86804c079677 100644
--- a/llvm/lib/Bitcode/Reader/CMakeLists.txt
+++ b/llvm/lib/Bitcode/Reader/CMakeLists.txt
@@ -17,3 +17,9 @@ add_llvm_component_library(LLVMBitReader
Support
TargetParser
)
+
+# Both files define a static 'error' function that conflicts in unity builds.
+set_source_files_properties(
+ BitcodeReader.cpp
+ MetadataLoader.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
index aff6a76879062..a8abeba34c3c2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
@@ -29,6 +29,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dwarfdebug"
namespace {
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 7620d546091c8..9bf93487af6ce 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -299,3 +299,23 @@ add_subdirectory(SelectionDAG)
add_subdirectory(AsmPrinter)
add_subdirectory(MIRParser)
add_subdirectory(GlobalISel)
+
+set_source_files_properties(
+ LiveIntervalCalc.cpp
+ MLRegAllocPriorityAdvisor.cpp
+ MachineOutliner.cpp
+ PostRASchedulerList.cpp
+ RegAllocPriorityAdvisor.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ MLRegAllocEvictAdvisor.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ ModuloSchedule.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ PatchableFunction.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
index 27b6ea745921a..539a37ca64f38 100644
--- a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
+++ b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
@@ -47,3 +47,8 @@ add_llvm_component_library(LLVMGlobalISel
Target
TransformUtils
)
+
+set_source_files_properties(
+ IRTranslator.cpp
+ LegacyLegalizerInfo.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index 4775dd6c8be31..e3b2a086e5426 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -25,6 +25,7 @@
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "call-lowering"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
index 81b79f36f95fb..829e396161c6e 100644
--- a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -24,6 +24,7 @@
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gi-combiner"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp b/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp
index 1edfc09310554..49555a48a8401 100644
--- a/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp
@@ -17,6 +17,7 @@
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gi-match-table-executor"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
index b8613aabe7fd1..6f0639bd1cf13 100644
--- a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
@@ -39,6 +39,7 @@
#include "llvm/Support/KnownFPClass.h"
#include "llvm/Target/TargetMachine.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gisel-known-bits"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index c1d8de3778177..9098baa352846 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -90,6 +90,7 @@
#include <utility>
#include <vector>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "irtranslator"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp b/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
index 6481d0e180352..ca2b45d9b4154 100644
--- a/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
@@ -19,6 +19,7 @@
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/IR/Module.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "inline-asm-lowering"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
index 5fb31a04e5fd0..8b98e4fbc9efa 100644
--- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
@@ -35,6 +35,7 @@
#include "llvm/Support/DebugCounter.h"
#include "llvm/Target/TargetMachine.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "instruction-select"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index c2d474fdde696..bb9834d455cf7 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -27,6 +27,7 @@
using namespace llvm;
using namespace LegalizeActions;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "legalizer-info"
cl::opt<bool> llvm::DisableGISelLegalityCheck(
diff --git a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
index 1dbba820b3dea..2085132c5434f 100644
--- a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
@@ -37,6 +37,7 @@
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loadstore-opt"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/Localizer.cpp b/llvm/lib/CodeGen/GlobalISel/Localizer.cpp
index 77ca27bcc43e2..16fffba5b8423 100644
--- a/llvm/lib/CodeGen/GlobalISel/Localizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Localizer.cpp
@@ -20,6 +20,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "localizer"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
index 4dfd5179a4e56..9fbd20c0aa26f 100644
--- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -47,6 +47,7 @@
#include <memory>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regbankselect"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/Utils.cpp b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
index d019633369163..7593780308673 100644
--- a/llvm/lib/CodeGen/GlobalISel/Utils.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
@@ -38,6 +38,7 @@
#include <numeric>
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "globalisel-utils"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
index 27fbed36cf1de..cc9bce8dc42e2 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -34,6 +34,7 @@
/// user to pick which implementation will be used to propagate variable
/// locations.
+#undef DEBUG_TYPE
#define DEBUG_TYPE "livedebugvalues"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/LiveRangeShrink.cpp b/llvm/lib/CodeGen/LiveRangeShrink.cpp
index 3e4725eb0dbe6..42dce5c2cfe8f 100644
--- a/llvm/lib/CodeGen/LiveRangeShrink.cpp
+++ b/llvm/lib/CodeGen/LiveRangeShrink.cpp
@@ -33,6 +33,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lrshrink"
STATISTIC(NumInstrsHoistedToShrinkLiveRange,
diff --git a/llvm/lib/CodeGen/LiveRegMatrix.cpp b/llvm/lib/CodeGen/LiveRegMatrix.cpp
index 67076959b2bce..e8ffcc909a9be 100644
--- a/llvm/lib/CodeGen/LiveRegMatrix.cpp
+++ b/llvm/lib/CodeGen/LiveRegMatrix.cpp
@@ -32,6 +32,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
STATISTIC(NumAssigned , "Number of registers assigned");
diff --git a/llvm/lib/CodeGen/LiveStacks.cpp b/llvm/lib/CodeGen/LiveStacks.cpp
index c07d985a09d1f..9de7e138f5404 100644
--- a/llvm/lib/CodeGen/LiveStacks.cpp
+++ b/llvm/lib/CodeGen/LiveStacks.cpp
@@ -18,6 +18,7 @@
#include "llvm/IR/Function.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "livestacks"
char LiveStacksWrapperLegacy::ID = 0;
diff --git a/llvm/lib/CodeGen/LowerEmuTLS.cpp b/llvm/lib/CodeGen/LowerEmuTLS.cpp
index 3bcf1fad53a42..ed05414108570 100644
--- a/llvm/lib/CodeGen/LowerEmuTLS.cpp
+++ b/llvm/lib/CodeGen/LowerEmuTLS.cpp
@@ -28,6 +28,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-emutls"
namespace {
diff --git a/llvm/lib/CodeGen/MIR2Vec.cpp b/llvm/lib/CodeGen/MIR2Vec.cpp
index 42e299834b77b..7ca30af58a212 100644
--- a/llvm/lib/CodeGen/MIR2Vec.cpp
+++ b/llvm/lib/CodeGen/MIR2Vec.cpp
@@ -25,6 +25,7 @@
using namespace llvm;
using namespace mir2vec;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mir2vec"
STATISTIC(MIRVocabMissCounter,
diff --git a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
index 3f954da8ef319..5b02ca5248502 100644
--- a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
+++ b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
@@ -35,6 +35,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-canonicalizer"
static cl::opt<unsigned>
diff --git a/llvm/lib/CodeGen/MIRNamerPass.cpp b/llvm/lib/CodeGen/MIRNamerPass.cpp
index cbf8867d569cb..3f5192e0796d9 100644
--- a/llvm/lib/CodeGen/MIRNamerPass.cpp
+++ b/llvm/lib/CodeGen/MIRNamerPass.cpp
@@ -23,6 +23,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-namer"
namespace {
diff --git a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
index 8e85c0476c7ad..2558efc86e8af 100644
--- a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
+++ b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
@@ -19,3 +19,7 @@ add_llvm_component_library(LLVMMIRParser
Support
Target
)
+
+set_source_files_properties(
+ MIParser.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp b/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
index c6b5a445f6e3d..7cd3dbe35fe46 100644
--- a/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
+++ b/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
@@ -13,6 +13,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-vregnamer-utils"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
index 2f2ee6f535f40..ee5fadc0b75fb 100644
--- a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
+++ b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
@@ -46,6 +46,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "ml-regalloc"
// Generated header in release (AOT) mode
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index ad0742bf49292..525cdc48e6a54 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -40,6 +40,7 @@
#include <cmath>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "codegen"
static cl::opt<bool> PrintSlotIndexes(
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 08acf4e716c7c..24fd1f88ea02c 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -76,6 +76,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "block-placement"
STATISTIC(NumCondBranches, "Number of conditional branches");
diff --git a/llvm/lib/CodeGen/MachineCFGPrinter.cpp b/llvm/lib/CodeGen/MachineCFGPrinter.cpp
index 19f9297600e34..5acdecceceb61 100644
--- a/llvm/lib/CodeGen/MachineCFGPrinter.cpp
+++ b/llvm/lib/CodeGen/MachineCFGPrinter.cpp
@@ -22,6 +22,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dot-machine-cfg"
static cl::opt<std::string>
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index 67ecb80bc3ee0..d469f8584e190 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-cse"
STATISTIC(NumCoalesces, "Number of copies coalesced");
diff --git a/llvm/lib/CodeGen/MachineCheckDebugify.cpp b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
index 9b703d5401cb9..c7d2f4aaa92d2 100644
--- a/llvm/lib/CodeGen/MachineCheckDebugify.cpp
+++ b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
@@ -22,6 +22,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-check-debugify"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp
index b86e70f265786..ea21666e91605 100644
--- a/llvm/lib/CodeGen/MachineCombiner.cpp
+++ b/llvm/lib/CodeGen/MachineCombiner.cpp
@@ -34,6 +34,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-combiner"
STATISTIC(NumInstCombined, "Number of machineinst combined");
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 58ff6f77830b3..77aa5ecf05200 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -77,6 +77,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-cp"
STATISTIC(NumDeletes, "Number of dead copies deleted");
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 53fbd3bec76cd..b43d0158ba840 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -55,6 +55,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machinelicm"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 43bb19bf4f181..2dcc0cf1a693a 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -98,6 +98,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pipeliner"
STATISTIC(NumTrytoPipeline, "Number of loops that we attempt to pipeline");
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 482dea0ca0626..52be6d2f594f1 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -73,6 +73,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-scheduler"
STATISTIC(NumInstrsInSourceOrderPreRA,
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index ffb2c507e2294..e39a4360ad5f6 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -68,6 +68,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-sink"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/MachineStableHash.cpp b/llvm/lib/CodeGen/MachineStableHash.cpp
index 2f5f5aeccb2e4..b0479ed4c752f 100644
--- a/llvm/lib/CodeGen/MachineStableHash.cpp
+++ b/llvm/lib/CodeGen/MachineStableHash.cpp
@@ -33,6 +33,7 @@
#include "llvm/Support/Alignment.h"
#include "llvm/Support/ErrorHandling.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-stable-hash"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineStripDebug.cpp b/llvm/lib/CodeGen/MachineStripDebug.cpp
index d54fe023a4a7e..cfe2c4147a4f7 100644
--- a/llvm/lib/CodeGen/MachineStripDebug.cpp
+++ b/llvm/lib/CodeGen/MachineStripDebug.cpp
@@ -18,6 +18,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/Debugify.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-strip-debug"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineTraceMetrics.cpp b/llvm/lib/CodeGen/MachineTraceMetrics.cpp
index 81dd68a519e76..ea6c35dffa010 100644
--- a/llvm/lib/CodeGen/MachineTraceMetrics.cpp
+++ b/llvm/lib/CodeGen/MachineTraceMetrics.cpp
@@ -34,6 +34,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-trace-metrics"
AnalysisKey MachineTraceMetricsAnalysis::Key;
diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp
index 36db54cc516e7..9bcee43e9f5f9 100644
--- a/llvm/lib/CodeGen/ModuloSchedule.cpp
+++ b/llvm/lib/CodeGen/ModuloSchedule.cpp
@@ -20,6 +20,7 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pipeliner"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/OptimizePHIs.cpp b/llvm/lib/CodeGen/OptimizePHIs.cpp
index c27f2c4cc577c..12f8f5f75138c 100644
--- a/llvm/lib/CodeGen/OptimizePHIs.cpp
+++ b/llvm/lib/CodeGen/OptimizePHIs.cpp
@@ -26,6 +26,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "opt-phis"
STATISTIC(NumPHICycles, "Number of PHI cycles replaced");
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp
index 1b44cee10af99..d373b9e93404b 100644
--- a/llvm/lib/CodeGen/PHIElimination.cpp
+++ b/llvm/lib/CodeGen/PHIElimination.cpp
@@ -50,6 +50,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "phi-node-elimination"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index 73aecda4e522c..dd63b4ad617dd 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -100,6 +100,7 @@ using namespace llvm;
using RegSubRegPair = TargetInstrInfo::RegSubRegPair;
using RegSubRegPairAndIdx = TargetInstrInfo::RegSubRegPairAndIdx;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "peephole-opt"
// Optimize Extensions
diff --git a/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp b/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
index 906eea29f1a15..d076ba7da8309 100644
--- a/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
+++ b/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
@@ -37,6 +37,7 @@
#include "llvm/Pass.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "post-RA-hazard-rec"
STATISTIC(NumNoops, "Number of noops inserted");
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 06e5b18c19301..c2f120b285834 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -43,6 +43,7 @@
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "post-RA-sched"
STATISTIC(NumNoops, "Number of noops inserted");
diff --git a/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp b/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
index 9ae3f4e866b42..5adf497c43c13 100644
--- a/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
@@ -45,6 +45,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pre-isel-intrinsic-lowering"
/// Threshold to leave statically sized memory intrinsic calls. Calls of known
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
index 6b58b6574f5bd..3db6aafa4439d 100644
--- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
@@ -22,6 +22,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "processimpdefs"
namespace {
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index 68fd54cf00146..d4b5ae45a52f3 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -67,6 +67,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "prologepilog"
using MBBVector = SmallVector<MachineBasicBlock *, 4>;
diff --git a/llvm/lib/CodeGen/PseudoProbeInserter.cpp b/llvm/lib/CodeGen/PseudoProbeInserter.cpp
index 521792a591a86..e6feac2137332 100644
--- a/llvm/lib/CodeGen/PseudoProbeInserter.cpp
+++ b/llvm/lib/CodeGen/PseudoProbeInserter.cpp
@@ -23,6 +23,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/ProfileData/SampleProf.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pseudo-probe-inserter"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp
index 9ba6007fc1cb9..a660d8b6b7490 100644
--- a/llvm/lib/CodeGen/RegAllocBase.cpp
+++ b/llvm/lib/CodeGen/RegAllocBase.cpp
@@ -35,6 +35,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
STATISTIC(NumNewQueued, "Number of new live ranges queued");
diff --git a/llvm/lib/CodeGen/RegAllocScore.cpp b/llvm/lib/CodeGen/RegAllocScore.cpp
index 280946bb0d0b3..e9ebc6d360120 100644
--- a/llvm/lib/CodeGen/RegAllocScore.cpp
+++ b/llvm/lib/CodeGen/RegAllocScore.cpp
@@ -37,6 +37,7 @@ LLVM_ABI cl::opt<double> ExpensiveRematWeight("regalloc-expensive-remat-weight",
cl::init(1.0), cl::Hidden);
} // end namespace llvm
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc-score"
RegAllocScore &RegAllocScore::operator+=(const RegAllocScore &Other) {
diff --git a/llvm/lib/CodeGen/RegisterBank.cpp b/llvm/lib/CodeGen/RegisterBank.cpp
index bdc6df78fd3d9..94c5418e68451 100644
--- a/llvm/lib/CodeGen/RegisterBank.cpp
+++ b/llvm/lib/CodeGen/RegisterBank.cpp
@@ -16,6 +16,7 @@
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "registerbank"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RegisterBankInfo.cpp b/llvm/lib/CodeGen/RegisterBankInfo.cpp
index 79b3c73ea34f1..2eeb0e61ff7c2 100644
--- a/llvm/lib/CodeGen/RegisterBankInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterBankInfo.cpp
@@ -26,6 +26,7 @@
#include <algorithm> // For std::max.
+#undef DEBUG_TYPE
#define DEBUG_TYPE "registerbankinfo"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RegisterClassInfo.cpp b/llvm/lib/CodeGen/RegisterClassInfo.cpp
index acf306f32dd1d..96d26284f6d6f 100644
--- a/llvm/lib/CodeGen/RegisterClassInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -31,6 +31,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
static cl::opt<unsigned>
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp
index bcac08ba322a8..e553ea868874a 100644
--- a/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -43,6 +43,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "reg-scavenging"
STATISTIC(NumScavengedRegs, "Number of frame index regs scavenged");
diff --git a/llvm/lib/CodeGen/Rematerializer.cpp b/llvm/lib/CodeGen/Rematerializer.cpp
index 1c28c8afc52eb..631a069b58a33 100644
--- a/llvm/lib/CodeGen/Rematerializer.cpp
+++ b/llvm/lib/CodeGen/Rematerializer.cpp
@@ -25,6 +25,7 @@
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "rematerializer"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp b/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp
index 98d531c9982a0..e0c7dcce831a8 100644
--- a/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp
+++ b/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp
@@ -38,6 +38,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "remove-loads-into-fake-uses"
STATISTIC(NumLoadsDeleted, "Number of dead load instructions deleted");
diff --git a/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp b/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
index 11468245f8400..f3cfa4a09cd4b 100644
--- a/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
+++ b/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
@@ -25,6 +25,7 @@
/// The RemoveRedundantDebugValues pass removes redundant DBG_VALUEs that
/// appear in MIR after the register allocator.
+#undef DEBUG_TYPE
#define DEBUG_TYPE "removeredundantdebugvalues"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RenameIndependentSubregs.cpp b/llvm/lib/CodeGen/RenameIndependentSubregs.cpp
index 2482a0da1e0fe..61758a3315ebd 100644
--- a/llvm/lib/CodeGen/RenameIndependentSubregs.cpp
+++ b/llvm/lib/CodeGen/RenameIndependentSubregs.cpp
@@ -40,6 +40,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "rename-independent-subregs"
namespace {
diff --git a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
index 407d6d503cb10..85047703a21fe 100644
--- a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
+++ b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
@@ -32,6 +32,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "replace-with-veclib"
STATISTIC(NumCallsReplaced,
diff --git a/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp b/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
index 14c3cc2ebe354..0d29f168016ac 100644
--- a/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
+++ b/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
@@ -25,6 +25,7 @@
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "reset-machine-function"
STATISTIC(NumFunctionsReset, "Number of functions reset");
diff --git a/llvm/lib/CodeGen/SafeStackLayout.cpp b/llvm/lib/CodeGen/SafeStackLayout.cpp
index f821145f4b63d..38b89e75f0002 100644
--- a/llvm/lib/CodeGen/SafeStackLayout.cpp
+++ b/llvm/lib/CodeGen/SafeStackLayout.cpp
@@ -18,6 +18,7 @@
using namespace llvm;
using namespace llvm::safestack;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "safestacklayout"
static cl::opt<bool> ClLayout("safe-stack-layout",
diff --git a/llvm/lib/CodeGen/ScheduleDAG.cpp b/llvm/lib/CodeGen/ScheduleDAG.cpp
index e630b80e33ab4..5501dfe85dffd 100644
--- a/llvm/lib/CodeGen/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAG.cpp
@@ -35,6 +35,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pre-RA-sched"
STATISTIC(NumNewPredsAdded, "Number of times a single predecessor was added");
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 9662511e584c0..23a1c4732ea43 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -60,6 +60,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-scheduler"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp b/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
index 209c6d81f6020..21ec70690194c 100644
--- a/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
+++ b/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
@@ -25,6 +25,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE DebugType
ScoreboardHazardRecognizer::ScoreboardHazardRecognizer(
diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp
index 4c6a20910f9af..0d6739b1717d0 100644
--- a/llvm/lib/CodeGen/SelectOptimize.cpp
+++ b/llvm/lib/CodeGen/SelectOptimize.cpp
@@ -44,6 +44,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "select-optimize"
STATISTIC(NumSelectOptAnalyzed,
diff --git a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
index 93a742a19aa79..c5709e388ffe4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
+++ b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
@@ -40,3 +40,12 @@ add_llvm_component_library(LLVMSelectionDAG
TargetParser
TransformUtils
)
+
+set_source_files_properties(
+ ScheduleDAGRRList.cpp
+ SelectionDAG.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ TargetLowering.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 9774f2c721d1f..4b88c003dfa05 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -110,6 +110,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "isel"
STATISTIC(NumFastIselSuccessIndependent, "Number of insts selected by "
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index b0e7ae4f9e845..647892ccd9e73 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -39,6 +39,7 @@
#include <algorithm>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "function-lowering-info"
/// isUsedOutsideOfDefiningBlock - Return true if this instruction is used by
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index 322766dee5aa9..016a489b85e35 100644
--- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -31,6 +31,7 @@
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "instr-emitter"
/// MinRCSize - Smallest register class we allow when constraining virtual
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index a4e4a5ee640f6..c7e5d85384001 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -56,6 +56,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "legalizedag"
namespace {
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 25f4f75eaedea..3013ed59a4821 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -24,6 +24,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "legalize-types"
/// GetFPLibCall - Return the right libcall for the given floating point type.
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index 2409a1f31e26e..90d56fe36ede7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "legalizevectorops"
namespace {
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 564bf3b7f152e..801cff5e19cc5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -32,6 +32,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "legalize-types"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp b/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
index 72ea0898f9754..88c98e0ced87f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
@@ -30,6 +30,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "scheduler"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
index 5af3df161b6c5..07fbd7045b144 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
@@ -25,6 +25,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pre-RA-sched"
STATISTIC(NumUnfolds, "Number of nodes unfolded");
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index c2f6256c8e965..8d1e8cdefea88 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -98,6 +98,7 @@ void SelectionDAG::DAGUpdateListener::NodeInserted(SDNode *) {}
void SelectionDAG::DAGNodeDeletedListener::anchor() {}
void SelectionDAG::DAGNodeInsertedListener::anchor() {}
+#undef DEBUG_TYPE
#define DEBUG_TYPE "selectiondag"
static cl::opt<bool> EnableMemCpyDAGOpt("enable-memcpy-dag-opt",
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 04b17b56b3d49..9fbd88bf2ba60 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -111,6 +111,7 @@ using namespace llvm;
using namespace PatternMatch;
using namespace SwitchCG;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "isel"
/// LimitFloatPrecision - Generate low-precision inline sequences for
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 02c2444fc9d9e..281cb4155d69c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -113,6 +113,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "isel"
#define ISEL_DUMP_DEBUG_TYPE DEBUG_TYPE "-dump"
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index ac28f62894788..c83aa43d4fa4c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -20,6 +20,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dag-printer"
namespace llvm {
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index d66d6f5a99416..0cb714a783d7f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -53,6 +53,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "statepoint-lowering"
STATISTIC(NumSlotsAllocatedForStatepoints,
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp
index b27139ca7ac18..65ac2b5381690 100644
--- a/llvm/lib/CodeGen/ShrinkWrap.cpp
+++ b/llvm/lib/CodeGen/ShrinkWrap.cpp
@@ -88,6 +88,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "shrink-wrap"
STATISTIC(NumFunc, "Number of functions");
diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
index 7ba743c206a21..0fa14189a5d79 100644
--- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
@@ -32,6 +32,7 @@
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sjlj-eh-prepare"
STATISTIC(NumInvokes, "Number of invokes replaced");
diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp
index 6861c6f0e9b02..7da54d65ec5b6 100644
--- a/llvm/lib/CodeGen/SlotIndexes.cpp
+++ b/llvm/lib/CodeGen/SlotIndexes.cpp
@@ -16,6 +16,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "slotindexes"
AnalysisKey SlotIndexesAnalysis::Key;
diff --git a/llvm/lib/CodeGen/SpillPlacement.cpp b/llvm/lib/CodeGen/SpillPlacement.cpp
index 55a96a22a00ec..3ae0171b57c23 100644
--- a/llvm/lib/CodeGen/SpillPlacement.cpp
+++ b/llvm/lib/CodeGen/SpillPlacement.cpp
@@ -42,6 +42,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "spill-code-placement"
char SpillPlacementWrapperLegacy::ID = 0;
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index 560aa03f38164..59e41fac3176f 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -42,6 +42,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp
index 65f9ae5433195..f165147e8b15a 100644
--- a/llvm/lib/CodeGen/StackColoring.cpp
+++ b/llvm/lib/CodeGen/StackColoring.cpp
@@ -63,6 +63,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-coloring"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp b/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp
index 95a9c3f781d1b..e07c9ab1a6ebe 100644
--- a/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp
+++ b/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp
@@ -37,6 +37,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-frame-layout"
namespace {
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp
index cad3ea7868e37..056b12bf206a4 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -52,6 +52,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-protector"
STATISTIC(NumFunProtected, "Number of functions protected");
diff --git a/llvm/lib/CodeGen/StackSlotColoring.cpp b/llvm/lib/CodeGen/StackSlotColoring.cpp
index 105f9e93c7fbb..d10f35907a93e 100644
--- a/llvm/lib/CodeGen/StackSlotColoring.cpp
+++ b/llvm/lib/CodeGen/StackSlotColoring.cpp
@@ -47,6 +47,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-slot-coloring"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/StaticDataAnnotator.cpp b/llvm/lib/CodeGen/StaticDataAnnotator.cpp
index 196963ffa2b41..2001ca726f25d 100644
--- a/llvm/lib/CodeGen/StaticDataAnnotator.cpp
+++ b/llvm/lib/CodeGen/StaticDataAnnotator.cpp
@@ -36,6 +36,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "static-data-annotator"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/StaticDataSplitter.cpp b/llvm/lib/CodeGen/StaticDataSplitter.cpp
index 7e87ec248e781..e5838a2fbcd4e 100644
--- a/llvm/lib/CodeGen/StaticDataSplitter.cpp
+++ b/llvm/lib/CodeGen/StaticDataSplitter.cpp
@@ -34,6 +34,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "static-data-splitter"
STATISTIC(NumHotJumpTables, "Number of hot jump tables seen.");
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index ace5c6e49596e..7750466fecc49 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -66,6 +66,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "twoaddressinstruction"
STATISTIC(NumTwoAddressInstrs, "Number of two-address instructions");
diff --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp
index 77f82b3851904..1e4a1bbc25dc7 100644
--- a/llvm/lib/CodeGen/TypePromotion.cpp
+++ b/llvm/lib/CodeGen/TypePromotion.cpp
@@ -39,6 +39,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "type-promotion"
#define PASS_NAME "Type Promotion"
diff --git a/llvm/lib/CodeGen/VLIWMachineScheduler.cpp b/llvm/lib/CodeGen/VLIWMachineScheduler.cpp
index 53d166d277cb8..7706cb8c29d21 100644
--- a/llvm/lib/CodeGen/VLIWMachineScheduler.cpp
+++ b/llvm/lib/CodeGen/VLIWMachineScheduler.cpp
@@ -38,6 +38,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-scheduler"
static cl::opt<bool> IgnoreBBRegPressure("ignore-bb-reg-pressure", cl::Hidden,
diff --git a/llvm/lib/CodeGen/WasmEHPrepare.cpp b/llvm/lib/CodeGen/WasmEHPrepare.cpp
index 2f54578da5113..a422f0a748aef 100644
--- a/llvm/lib/CodeGen/WasmEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WasmEHPrepare.cpp
@@ -91,6 +91,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "wasm-eh-prepare"
namespace {
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index 40cb11cbeb0de..293ec648971b8 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -40,6 +40,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "win-eh-prepare"
static cl::opt<bool> DisableDemotion(
diff --git a/llvm/lib/CodeGen/WindowScheduler.cpp b/llvm/lib/CodeGen/WindowScheduler.cpp
index 2492dfc3ca553..0e59b0ed26700 100644
--- a/llvm/lib/CodeGen/WindowScheduler.cpp
+++ b/llvm/lib/CodeGen/WindowScheduler.cpp
@@ -49,6 +49,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pipeliner"
namespace {
diff --git a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
index 4a4d911844584..d7997b4b17614 100644
--- a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
+++ b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
@@ -150,6 +150,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "windows-secure-hot-patch"
// A file containing list of mangled function names to mark for hot patching.
diff --git a/llvm/lib/DebugInfo/BTF/BTFContext.cpp b/llvm/lib/DebugInfo/BTF/BTFContext.cpp
index 412bd42ee0b67..5c43dd62b75d6 100644
--- a/llvm/lib/DebugInfo/BTF/BTFContext.cpp
+++ b/llvm/lib/DebugInfo/BTF/BTFContext.cpp
@@ -14,6 +14,7 @@
#include "llvm/DebugInfo/BTF/BTFContext.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "debug-info-btf-context"
using namespace llvm;
diff --git a/llvm/lib/DebugInfo/CodeView/CMakeLists.txt b/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
index 48cbad0f6751a..e5b14f29999d7 100644
--- a/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
@@ -46,3 +46,13 @@ add_llvm_component_library(LLVMDebugInfoCodeView
LINK_COMPONENTS
Support
)
+
+# These files define static functions/arrays with identical names (stabilize,
+# LeafTypeNames, getLeafTypeName) that conflict in unity builds.
+set_source_files_properties(
+ AppendingTypeTableBuilder.cpp
+ GlobalTypeTableBuilder.cpp
+ MergingTypeTableBuilder.cpp
+ TypeDumpVisitor.cpp
+ TypeRecordMapping.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
index eb610a6b34f51..7c4a07bd2683c 100644
--- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
@@ -31,3 +31,8 @@ add_llvm_component_library(LLVMDebugInfoGSYM
TargetParser
DebugInfoDWARF
)
+
+# FunctionInfo.cpp defines an enum value 'InlineInfo' that conflicts with
+# the struct InlineInfo in InlineInfo.cpp in unity builds.
+set_source_files_properties(FunctionInfo.cpp InlineInfo.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Demangle/CMakeLists.txt b/llvm/lib/Demangle/CMakeLists.txt
index eb7d212a02449..9b971dd69e195 100644
--- a/llvm/lib/Demangle/CMakeLists.txt
+++ b/llvm/lib/Demangle/CMakeLists.txt
@@ -10,3 +10,14 @@ add_llvm_component_library(LLVMDemangle
"${LLVM_MAIN_INCLUDE_DIR}/llvm/Demangle"
)
+
+# These demangler files each define classes/type aliases named 'Demangler' and
+# use "using namespace" directives that bring conflicting symbols (Node,
+# Qualifiers, etc.) into scope from different namespaces, which cannot coexist
+# in a single translation unit.
+set_source_files_properties(
+ ItaniumDemangle.cpp
+ MicrosoftDemangle.cpp
+ RustDemangle.cpp
+ DLangDemangle.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
index 0b530fb1bc478..68bb2c7188525 100644
--- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
@@ -75,3 +75,8 @@ target_link_libraries(LLVMJITLink
LLVMSupport
LLVMTargetParser
)
+
+set_source_files_properties(
+ ELF_x86.cpp
+ ELF_x86_64.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
index 8c78c0250cfb8..2906f44d31c3b 100644
--- a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
@@ -105,3 +105,8 @@ target_link_libraries(LLVMOrcJIT
LLVMBitWriter
LLVMPasses
)
+
+set_source_files_properties(
+ ELFNixPlatform.cpp
+ RTDyldObjectLinkingLayer.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
index 326279ccd862b..386c08d3e645f 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
@@ -14,6 +14,7 @@
#include <cstdint>
#include <mutex>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "orc"
// First version as landed in August 2009
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
index 5d5b2ae543e57..f9422c709821e 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
@@ -36,6 +36,7 @@
#undef LC_RPATH
#endif // __APPLE__
+#undef DEBUG_TYPE
#define DEBUG_TYPE "orc-scanner"
namespace llvm::orc {
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
index 1278e2f43c3bc..ecbd5a515d808 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
@@ -19,3 +19,7 @@ add_llvm_component_library(LLVMRuntimeDyld
Support
TargetParser
)
+
+set_source_files_properties(
+ RuntimeDyldELF.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
index afe3b671547d8..4137d72539d97 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
@@ -25,6 +25,7 @@
#include <memory>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "rtdyld"
using namespace llvm;
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
index 3ca6309874de5..343eb638e188f 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
@@ -19,6 +19,7 @@
#include "llvm/Object/COFF.h"
#include "llvm/Support/Endian.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dyld"
namespace llvm {
diff --git a/llvm/lib/Frontend/HLSL/CMakeLists.txt b/llvm/lib/Frontend/HLSL/CMakeLists.txt
index 3d225770e8d5b..0c0ea29a9a5d8 100644
--- a/llvm/lib/Frontend/HLSL/CMakeLists.txt
+++ b/llvm/lib/Frontend/HLSL/CMakeLists.txt
@@ -18,3 +18,10 @@ add_llvm_component_library(LLVMFrontendHLSL
Core
Support
)
+
+# RootSignatureMetadata.cpp redefines 'OverloadedVisit' from
+# HLSLRootSignature.cpp in unity builds.
+set_source_files_properties(
+ HLSLRootSignature.cpp
+ RootSignatureMetadata.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h
index cc9bad431787c..f217813d04b1f 100644
--- a/llvm/lib/IR/ConstantsContext.h
+++ b/llvm/lib/IR/ConstantsContext.h
@@ -37,6 +37,7 @@
#include <cstdint>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "ir"
namespace llvm {
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index 98876c87ef6db..27d32d500f204 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "module-summary-index"
STATISTIC(ReadOnlyLiveGVars,
diff --git a/llvm/lib/IR/PassTimingInfo.cpp b/llvm/lib/IR/PassTimingInfo.cpp
index cb1b91a98b036..934a98125e2d2 100644
--- a/llvm/lib/IR/PassTimingInfo.cpp
+++ b/llvm/lib/IR/PassTimingInfo.cpp
@@ -30,6 +30,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "time-passes"
using namespace llvm;
diff --git a/llvm/lib/IR/VFABIDemangler.cpp b/llvm/lib/IR/VFABIDemangler.cpp
index 4fcf43616d60c..479414ab740a8 100644
--- a/llvm/lib/IR/VFABIDemangler.cpp
+++ b/llvm/lib/IR/VFABIDemangler.cpp
@@ -18,6 +18,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vfabi-demangler"
/// Utilities for the Vector Function ABI name parser.
diff --git a/llvm/lib/IR/ValueSymbolTable.cpp b/llvm/lib/IR/ValueSymbolTable.cpp
index 3bf52f6ef024e..dbc857cb07f3a 100644
--- a/llvm/lib/IR/ValueSymbolTable.cpp
+++ b/llvm/lib/IR/ValueSymbolTable.cpp
@@ -26,6 +26,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "valuesymtab"
// Class destructor
diff --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt
index 7a9e26af415c6..b398c53e1e0da 100644
--- a/llvm/lib/MC/CMakeLists.txt
+++ b/llvm/lib/MC/CMakeLists.txt
@@ -87,3 +87,13 @@ add_llvm_component_library(LLVMMC
add_subdirectory(MCParser)
add_subdirectory(MCDisassembler)
+
+# These object writer files each define 'isDwoSection' in anonymous namespaces,
+# which conflicts in unity builds. MCAsmInfoELF/Wasm both define 'printName'.
+set_source_files_properties(
+ ELFObjectWriter.cpp
+ MCAsmInfoELF.cpp
+ MCAsmInfoWasm.cpp
+ WasmObjectWriter.cpp
+ WinCOFFObjectWriter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index b42155d18bf0a..25b8ae9809fdf 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -38,6 +38,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mc"
void MachObjectWriter::reset() {
diff --git a/llvm/lib/Object/CMakeLists.txt b/llvm/lib/Object/CMakeLists.txt
index 0f6d2f7c59a5c..17e68c01f42e2 100644
--- a/llvm/lib/Object/CMakeLists.txt
+++ b/llvm/lib/Object/CMakeLists.txt
@@ -54,3 +54,12 @@ add_llvm_component_library(LLVMObject
TargetParser
TextAPI
)
+
+# MachOUniversal.cpp/MachOObjectFile.cpp: ambiguous 'malformedError'
+# ModuleSymbolTable.cpp: 'Module' conflicts with llvm::minidump::Module
+set_source_files_properties(
+ MachOObjectFile.cpp
+ MachOUniversal.cpp
+ ModuleSymbolTable.cpp
+ OffloadBinary.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ObjectYAML/CMakeLists.txt b/llvm/lib/ObjectYAML/CMakeLists.txt
index b36974d47d9f8..c502154acf5ef 100644
--- a/llvm/lib/ObjectYAML/CMakeLists.txt
+++ b/llvm/lib/ObjectYAML/CMakeLists.txt
@@ -40,3 +40,9 @@ add_llvm_component_library(LLVMObjectYAML
DebugInfoCodeView
MC
)
+
+set_source_files_properties(
+ CodeViewYAMLTypes.cpp
+ MinidumpEmitter.cpp
+ MinidumpYAML.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ProfileData/CMakeLists.txt b/llvm/lib/ProfileData/CMakeLists.txt
index c2366dc0ae03e..56fbc69c4f9e1 100644
--- a/llvm/lib/ProfileData/CMakeLists.txt
+++ b/llvm/lib/ProfileData/CMakeLists.txt
@@ -39,4 +39,16 @@ add_llvm_component_library(LLVMProfileData
TargetParser
)
+# InstrProfReader.cpp and InstrProfWriter.cpp have ambiguous 'Summary' due
+# to namespace conflicts in unity builds.
+set_source_files_properties(
+ InstrProfReader.cpp
+ InstrProfWriter.cpp
+ SampleProf.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
add_subdirectory(Coverage)
+
+set_source_files_properties(
+ SampleProfReader.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ProfileData/InstrProfCorrelator.cpp b/llvm/lib/ProfileData/InstrProfCorrelator.cpp
index b38189de31606..1b4e8ad242a7f 100644
--- a/llvm/lib/ProfileData/InstrProfCorrelator.cpp
+++ b/llvm/lib/ProfileData/InstrProfCorrelator.cpp
@@ -20,6 +20,7 @@
#include "llvm/Support/WithColor.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "correlator"
using namespace llvm;
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 766c0814ca067..09d25e73cbb51 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
using namespace sampleprof;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "samplepgo-reader"
// This internal option specifies if the profile uses FS discriminators.
diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp
index e5f31348578b8..7a18d96c3b08e 100644
--- a/llvm/lib/ProfileData/SampleProfWriter.cpp
+++ b/llvm/lib/ProfileData/SampleProfWriter.cpp
@@ -36,6 +36,7 @@
#include <utility>
#include <vector>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "llvm-profdata"
using namespace llvm;
diff --git a/llvm/lib/Support/regexec.c b/llvm/lib/Support/regexec.c
index bd5e72d4c5220..75adbab413aeb 100644
--- a/llvm/lib/Support/regexec.c
+++ b/llvm/lib/Support/regexec.c
@@ -142,6 +142,7 @@ llvm_regexec(const llvm_regex_t *preg, const char *string, size_t nmatch,
llvm_regmatch_t pmatch[], int eflags)
{
struct re_guts *g = preg->re_g;
+#undef GOODFLAGS
#ifdef REDEBUG
# define GOODFLAGS(f) (f)
#else
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 8ad20b45f5e16..851cc255a4a6e 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -40,6 +40,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "tblgen-records"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt
index 2fe554217c1ba..ac4d432eb0629 100644
--- a/llvm/lib/Target/AArch64/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/CMakeLists.txt
@@ -129,3 +129,24 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
+
+set_source_files_properties(
+ AArch64AdvSIMDScalarPass.cpp
+ SVEIntrinsicOpts.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ AArch64ISelLowering.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ SMEABIPass.cpp
+ GISel/AArch64CallLowering.cpp
+ GISel/AArch64InstructionSelector.cpp
+ GISel/AArch64LegalizerInfo.cpp
+ GISel/AArch64O0PreLegalizerCombiner.cpp
+ GISel/AArch64PostLegalizerCombiner.cpp
+ GISel/AArch64PostLegalizerLowering.cpp
+ GISel/AArch64PreLegalizerCombiner.cpp
+ GISel/AArch64RegisterBankInfo.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/AMDGPU/CMakeLists.txt b/llvm/lib/Target/AMDGPU/CMakeLists.txt
index cda288e012925..4df71d1c9180f 100644
--- a/llvm/lib/Target/AMDGPU/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/CMakeLists.txt
@@ -225,3 +225,17 @@ add_subdirectory(MCA)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
+
+set_source_files_properties(
+ AMDGPUISelDAGToDAG.cpp
+ AMDGPUInstCombineIntrinsic.cpp
+ AMDGPURegisterBankInfo.cpp
+ AMDGPUSwLowerLDS.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ AMDGPUInstructionSelector.cpp
+ AMDGPUPostLegalizerCombiner.cpp
+ AMDGPUPreLegalizerCombiner.cpp
+ AMDGPURegBankCombiner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
index 977f8bf5548fd..3c8d5f7f311c4 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
@@ -27,3 +27,7 @@ add_llvm_component_library(LLVMARMDesc
ADD_TO_COMPONENT
ARM
)
+
+set_source_files_properties(
+ ARMELFObjectWriter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/Hexagon/CMakeLists.txt b/llvm/lib/Target/Hexagon/CMakeLists.txt
index b4716693c3dc9..0a894daff705f 100644
--- a/llvm/lib/Target/Hexagon/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/CMakeLists.txt
@@ -104,3 +104,7 @@ add_subdirectory(AsmParser)
add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
+
+set_source_files_properties(
+ HexagonOptimizeSZextends.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/MSP430/CMakeLists.txt b/llvm/lib/Target/MSP430/CMakeLists.txt
index bcf9fd288dbd1..aa472942d1892 100644
--- a/llvm/lib/Target/MSP430/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/CMakeLists.txt
@@ -50,3 +50,7 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(AsmParser)
add_subdirectory(Disassembler)
+
+set_source_files_properties(
+ MSP430MCInstLower.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
index 1255be2dbf1c2..181b592639dd9 100644
--- a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
@@ -13,3 +13,7 @@ add_llvm_component_library(LLVMNVPTXDesc
ADD_TO_COMPONENT
NVPTX
)
+
+set_source_files_properties(
+ NVPTXMCTargetDesc.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/RISCV/CMakeLists.txt b/llvm/lib/Target/RISCV/CMakeLists.txt
index 3b529c1471d54..a41486c9813c7 100644
--- a/llvm/lib/Target/RISCV/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/CMakeLists.txt
@@ -112,3 +112,17 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(MCA)
add_subdirectory(TargetInfo)
+
+set_source_files_properties(
+ RISCVInsertWriteVXRM.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ RISCVO0PreLegalizerCombiner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ GISel/RISCVO0PreLegalizerCombiner.cpp
+ GISel/RISCVPreLegalizerCombiner.cpp
+ GISel/RISCVPostLegalizerCombiner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/SPIRV/CMakeLists.txt b/llvm/lib/Target/SPIRV/CMakeLists.txt
index 58989237ad3ea..7fd89ba1a0ea5 100644
--- a/llvm/lib/Target/SPIRV/CMakeLists.txt
+++ b/llvm/lib/Target/SPIRV/CMakeLists.txt
@@ -83,3 +83,12 @@ add_llvm_target(SPIRVCodeGen
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Analysis)
+
+set_source_files_properties(
+ SPIRVBuiltins.cpp
+ SPIRVEmitIntrinsics.cpp
+ SPIRVModuleAnalysis.cpp
+ SPIRVPreLegalizerCombiner.cpp
+ SPIRVRegisterBankInfo.cpp
+ SPIRVRegisterInfo.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
index 7cfd30b876563..5b1361e8b37f4 100644
--- a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
@@ -17,3 +17,8 @@ add_llvm_component_library(LLVMSPIRVDesc
ADD_TO_COMPONENT
SPIRV
)
+
+set_source_files_properties(
+ SPIRVBaseInfo.cpp
+ SPIRVMCCodeEmitter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/WebAssembly/CMakeLists.txt b/llvm/lib/Target/WebAssembly/CMakeLists.txt
index 39ee5e86f0191..4582f6fc40791 100644
--- a/llvm/lib/Target/WebAssembly/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/CMakeLists.txt
@@ -108,3 +108,17 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
+
+set_source_files_properties(
+ WebAssemblyFixIrreducibleControlFlow.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ WebAssemblyPreLegalizerCombiner.cpp
+ WebAssemblyPostLegalizerCombiner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ GISel/WebAssemblyPreLegalizerCombiner.cpp
+ GISel/WebAssemblyPostLegalizerCombiner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/X86/CMakeLists.txt b/llvm/lib/Target/X86/CMakeLists.txt
index c2dd34efb844d..0e13d586e446a 100644
--- a/llvm/lib/Target/X86/CMakeLists.txt
+++ b/llvm/lib/Target/X86/CMakeLists.txt
@@ -130,3 +130,22 @@ add_subdirectory(Disassembler)
add_subdirectory(MCA)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
+
+set_source_files_properties(
+ X86FastTileConfig.cpp
+ X86FixupVectorConstants.cpp
+ X86ISelLowering.cpp
+ X86LoadValueInjectionRetHardening.cpp
+ X86LowerAMXIntrinsics.cpp
+ X86SpeculativeExecutionSideEffectSuppression.cpp
+ X86WinEHState.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ X86CompressEVEX.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ GISel/X86PreLegalizerCombiner.cpp
+ GISel/X86PostLegalizerCombiner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/XCore/CMakeLists.txt b/llvm/lib/Target/XCore/CMakeLists.txt
index f411c658b43b0..ded6a197ee7b1 100644
--- a/llvm/lib/Target/XCore/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/CMakeLists.txt
@@ -51,3 +51,11 @@ add_llvm_target(XCoreCodeGen
add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
+
+set_source_files_properties(
+ XCoreInstrInfo.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ XCoreRegisterInfo.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/TargetParser/CMakeLists.txt b/llvm/lib/TargetParser/CMakeLists.txt
index 8d474497f5308..0a4f76e8a318a 100644
--- a/llvm/lib/TargetParser/CMakeLists.txt
+++ b/llvm/lib/TargetParser/CMakeLists.txt
@@ -44,3 +44,13 @@ add_llvm_component_library(LLVMTargetParser
DEPENDS
target_parser_gen
)
+
+# Unity build conflicts:
+# - CSKYTargetParser.cpp: redefines 'stripNegationPrefix' from ARMTargetParser
+# - X86TargetParser.cpp: 'FeatureBitset' ambiguous due to namespace conflicts
+# - RISCVTargetParser.cpp: incomplete type 'CPUInfo[]' due to include ordering
+set_source_files_properties(
+ CSKYTargetParser.cpp
+ RISCVTargetParser.cpp
+ X86TargetParser.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index dfe97f178bd46..922d8e92f91e0 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -60,6 +60,7 @@
#endif
#endif
+#undef DEBUG_TYPE
#define DEBUG_TYPE "host-detection"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/TextAPI/CMakeLists.txt b/llvm/lib/TextAPI/CMakeLists.txt
index 29533756e41ae..805b0507bde8e 100644
--- a/llvm/lib/TextAPI/CMakeLists.txt
+++ b/llvm/lib/TextAPI/CMakeLists.txt
@@ -24,4 +24,9 @@ add_llvm_component_library(LLVMTextAPI
TargetParser
)
+# RecordsSlice.cpp has ambiguous 'Target' due to namespace conflicts in
+# unity builds.
+set_source_files_properties(RecordsSlice.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
add_subdirectory(BinaryReader)
diff --git a/llvm/lib/Transforms/Coroutines/CMakeLists.txt b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
index 46ef5cd4e8cfe..c5fdbbe800387 100644
--- a/llvm/lib/Transforms/Coroutines/CMakeLists.txt
+++ b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
@@ -27,3 +27,8 @@ add_llvm_component_library(LLVMCoroutines
TransformUtils
TargetParser
)
+
+set_source_files_properties(
+ CoroEarly.cpp
+ CoroElide.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp b/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
index 01b5a0a24ced0..3da8fdfa613bd 100644
--- a/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
@@ -20,6 +20,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-cleanup"
namespace {
diff --git a/llvm/lib/Transforms/Coroutines/CoroEarly.cpp b/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
index e003812f81192..54dcd2312bd54 100644
--- a/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
@@ -16,6 +16,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-early"
namespace {
diff --git a/llvm/lib/Transforms/Coroutines/CoroElide.cpp b/llvm/lib/Transforms/Coroutines/CoroElide.cpp
index 3e260d48a5d88..8de246d2f9084 100644
--- a/llvm/lib/Transforms/Coroutines/CoroElide.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroElide.cpp
@@ -21,6 +21,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-elide"
STATISTIC(NumOfCoroElided, "The # of coroutine get elided.");
diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
index 83b40ee927b51..3f285e775ac2c 100644
--- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
@@ -43,6 +43,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-frame"
namespace {
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 897463186431f..9f4b21f1abd77 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -77,6 +77,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-split"
// FIXME:
diff --git a/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp b/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp
index c9bb3395a9949..2050d4184758a 100644
--- a/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp
+++ b/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp
@@ -17,6 +17,7 @@
// The "coro-suspend-crossing" flag is very noisy. There is another debug type,
// "coro-frame", which results in leaner debug spew.
+#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-suspend-crossing"
namespace llvm {
diff --git a/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp b/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp
index 1019be9ce36bf..8532195277a4e 100644
--- a/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp
+++ b/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp
@@ -20,6 +20,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "annotation2metadata"
static bool convertAnnotation2Metadata(Module &M) {
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index cfbf9dec01619..1223ba963dcab 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -80,6 +80,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "argpromotion"
STATISTIC(NumArgumentsPromoted, "Number of pointer arguments promoted");
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 8079fd89c9c37..1698b2d18e8fc 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -62,6 +62,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "attributor"
#define VERBOSE_DEBUG_TYPE DEBUG_TYPE "-verbose"
diff --git a/llvm/lib/Transforms/IPO/BlockExtractor.cpp b/llvm/lib/Transforms/IPO/BlockExtractor.cpp
index 23991afc511a0..17c7cd63ec2cc 100644
--- a/llvm/lib/Transforms/IPO/BlockExtractor.cpp
+++ b/llvm/lib/Transforms/IPO/BlockExtractor.cpp
@@ -26,6 +26,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "block-extractor"
STATISTIC(NumExtracted, "Number of basic blocks extracted");
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index 4d4b32749a045..705cd3b2da489 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -55,6 +55,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "function-import"
STATISTIC(NumImportedFunctionsThinLink,
diff --git a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
index cd914db8434ef..7463357cae332 100644
--- a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
@@ -24,6 +24,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "function-specialization"
STATISTIC(NumSpecsCreated, "Number of specializations created");
diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
index d6b19bd4e204e..faf4c56f7ff43 100644
--- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
@@ -30,6 +30,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "globaldce"
namespace {
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index 3ef2d377b7a0f..a4c7c9f53c6d7 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -72,6 +72,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "globalopt"
STATISTIC(NumMarked , "Number of globals marked constant");
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index 85668cfe3ede0..d952a22984f32 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -57,6 +57,7 @@
#include <limits>
#include <string>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "hotcoldsplit"
STATISTIC(NumColdRegionsFound, "Number of cold regions found.");
diff --git a/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp b/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
index 18d5911d10f12..1a46436804d82 100644
--- a/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
@@ -14,6 +14,7 @@
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "inferattrs"
static bool inferAllPrototypeAttributes(
diff --git a/llvm/lib/Transforms/IPO/Internalize.cpp b/llvm/lib/Transforms/IPO/Internalize.cpp
index c2b8a6257ae6f..e61915f495864 100644
--- a/llvm/lib/Transforms/IPO/Internalize.cpp
+++ b/llvm/lib/Transforms/IPO/Internalize.cpp
@@ -33,6 +33,7 @@
#include "llvm/Transforms/IPO.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "internalize"
STATISTIC(NumAliases, "Number of aliases internalized");
diff --git a/llvm/lib/Transforms/IPO/LoopExtractor.cpp b/llvm/lib/Transforms/IPO/LoopExtractor.cpp
index 8182ef6449d02..451f332337c48 100644
--- a/llvm/lib/Transforms/IPO/LoopExtractor.cpp
+++ b/llvm/lib/Transforms/IPO/LoopExtractor.cpp
@@ -28,6 +28,7 @@
#include "llvm/Transforms/Utils/CodeExtractor.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-extract"
STATISTIC(NumExtracted, "Number of loops extracted");
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index 00991cf73dafa..b128a1e76b171 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -89,6 +89,7 @@
using namespace llvm;
using namespace lowertypetests;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lowertypetests"
STATISTIC(ByteArraySizeBits, "Byte array size in bits");
diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
index 015b6bc5caf9f..40de7e58412e8 100644
--- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
@@ -54,6 +54,7 @@
using namespace llvm;
using namespace llvm::memprof;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memprof-context-disambiguation"
STATISTIC(FunctionClonesAnalysis,
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index 5266103d1ac24..fdd96a036c96d 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -64,6 +64,7 @@
using namespace llvm;
using namespace omp;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "openmp-opt"
static cl::opt<bool> DisableOpenMPOptimizations(
diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp
index c00402f8ef102..b81078dde0998 100644
--- a/llvm/lib/Transforms/IPO/PartialInlining.cpp
+++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp
@@ -60,6 +60,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "partial-inlining"
STATISTIC(NumPartialInlined,
diff --git a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
index c8f203e8ce3ee..7975f3078af14 100644
--- a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
+++ b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
@@ -23,6 +23,7 @@
using namespace llvm;
using namespace sampleprof;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-context-tracker"
namespace llvm {
diff --git a/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp b/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
index 848c1915882f7..62f6c5ecae756 100644
--- a/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
@@ -24,6 +24,7 @@
using namespace llvm;
using namespace sampleprof;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-profile-matcher"
STATISTIC(NumDirectProfileMatch,
diff --git a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
index 7fd7d4d4f750b..1555c32bf30f8 100644
--- a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
@@ -34,6 +34,7 @@
#include <vector>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pseudo-probe"
STATISTIC(ArtificialDbgLine,
diff --git a/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp b/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
index 25c24b13c7dda..b1508340c4316 100644
--- a/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
+++ b/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
@@ -19,6 +19,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "strip-dead-prototypes"
STATISTIC(NumDeadPrototypes, "Number of dead prototypes removed");
diff --git a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
index 80576c61fd80c..55b07b5b116c7 100644
--- a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
+++ b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
@@ -44,3 +44,7 @@ add_llvm_component_library(LLVMInstrumentation
TransformUtils
ProfileData
)
+
+set_source_files_properties(
+ HWAddressSanitizer.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index 2fbdc3adb32d6..32fedb13202cc 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -68,6 +68,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "hwasan"
const char kHwasanModuleCtorName[] = "hwasan.module_ctor";
diff --git a/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
index 98a8068cac946..3c74fcb134b34 100644
--- a/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
@@ -42,6 +42,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "tysan"
static const char *const kTysanModuleCtorName = "tysan.module_ctor";
diff --git a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
index 4274667a2c2b7..9e46e0313fdd6 100644
--- a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
+++ b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
@@ -24,3 +24,7 @@ add_llvm_component_library(LLVMObjCARCOpts
TargetParser
TransformUtils
)
+
+set_source_files_properties(
+ ObjCARCContract.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp b/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
index b4cc00033e720..0e2aa0147685e 100644
--- a/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
+++ b/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
@@ -28,6 +28,7 @@
using namespace llvm;
using namespace llvm::objcarc;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-dependency"
/// Test whether the given instruction can result in a reference count
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
index 86d7e2f07c1d9..bb0754ccb56df 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
using namespace llvm::objcarc;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-contract"
STATISTIC(NumPeeps, "Number of calls peephole-optimized");
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
index bb0a01b78a96f..31452e696dd51 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
@@ -34,6 +34,7 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/ObjCARC.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-expand"
using namespace llvm;
diff --git a/llvm/lib/Transforms/ObjCARC/PtrState.cpp b/llvm/lib/Transforms/ObjCARC/PtrState.cpp
index 3af238996fa76..a470efa75a5de 100644
--- a/llvm/lib/Transforms/ObjCARC/PtrState.cpp
+++ b/llvm/lib/Transforms/ObjCARC/PtrState.cpp
@@ -28,6 +28,7 @@
using namespace llvm;
using namespace llvm::objcarc;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-ptr-state"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
index e54a2e54f9943..2906d955aeae1 100644
--- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
+++ b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
@@ -31,6 +31,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "alignment-from-assumptions"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp b/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
index 7f9129697995a..89a56d12caf37 100644
--- a/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
+++ b/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
@@ -21,6 +21,7 @@
using namespace llvm;
using namespace llvm::ore;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "annotation-remarks"
#define REMARK_PASS DEBUG_TYPE
diff --git a/llvm/lib/Transforms/Scalar/BDCE.cpp b/llvm/lib/Transforms/Scalar/BDCE.cpp
index d96dbca30fdb1..696d33b9efe27 100644
--- a/llvm/lib/Transforms/Scalar/BDCE.cpp
+++ b/llvm/lib/Transforms/Scalar/BDCE.cpp
@@ -31,6 +31,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "bdce"
STATISTIC(NumRemoved, "Number of instructions removed (unused)");
diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt
index 37dbb34605646..8ba505263a582 100644
--- a/llvm/lib/Transforms/Scalar/CMakeLists.txt
+++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt
@@ -100,3 +100,10 @@ add_llvm_component_library(LLVMScalarOpts
Support
TransformUtils
)
+
+set_source_files_properties(
+ BDCE.cpp
+ ConstraintElimination.cpp
+ GVNSink.cpp
+ LoopInterchange.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
index ce73c44959a0e..3c0d43b99abd9 100644
--- a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
+++ b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
@@ -70,6 +70,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "callsite-splitting"
STATISTIC(NumCallSiteSplit, "Number of call-site split");
diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
index db594e033e21e..52d0a6c188ede 100644
--- a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -70,6 +70,7 @@
using namespace llvm;
using namespace consthoist;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "consthoist"
STATISTIC(NumConstantsHoisted, "Number of constants hoisted");
diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index c457ff74610ce..a10ff9f49eb02 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -49,6 +49,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "constraint-elimination"
STATISTIC(NumCondsRemoved, "Number of instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
index 8eaf385065737..94f15ed0ea9ed 100644
--- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
+++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
@@ -47,6 +47,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "correlated-value-propagation"
STATISTIC(NumPhis, "Number of phis propagated");
diff --git a/llvm/lib/Transforms/Scalar/DCE.cpp b/llvm/lib/Transforms/Scalar/DCE.cpp
index 2ad46130dc945..8cbb491a9a98c 100644
--- a/llvm/lib/Transforms/Scalar/DCE.cpp
+++ b/llvm/lib/Transforms/Scalar/DCE.cpp
@@ -30,6 +30,7 @@
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dce"
STATISTIC(DCEEliminated, "Number of insts removed");
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 2714074dddafc..ffa417c84da14 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -92,6 +92,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dse"
STATISTIC(NumRemainingStores, "Number of stores remaining after DSE");
diff --git a/llvm/lib/Transforms/Scalar/DivRemPairs.cpp b/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
index 3adb3539f5890..cf234743d3b08 100644
--- a/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
+++ b/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
@@ -28,6 +28,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "div-rem-pairs"
STATISTIC(NumPairs, "Number of div/rem pairs");
STATISTIC(NumRecomposed, "Number of instructions recomposed");
diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
index ff3d55e5747e5..29d89a7afa425 100644
--- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
@@ -60,6 +60,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "early-cse"
STATISTIC(NumSimplify, "Number of instructions simplified or DCE'd");
diff --git a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
index 1335665e114dd..8b23b85ad4924 100644
--- a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
@@ -21,6 +21,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "flatten-cfg"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/Float2Int.cpp b/llvm/lib/Transforms/Scalar/Float2Int.cpp
index 37822cf05f144..b3e3ee671461f 100644
--- a/llvm/lib/Transforms/Scalar/Float2Int.cpp
+++ b/llvm/lib/Transforms/Scalar/Float2Int.cpp
@@ -25,6 +25,7 @@
#include "llvm/Support/raw_ostream.h"
#include <deque>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "float2int"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 7cab4be169123..a1886576b826a 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -85,6 +85,7 @@ using namespace llvm::gvn;
using namespace llvm::VNCoercion;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gvn"
STATISTIC(NumGVNInstr, "Number of instructions deleted");
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
index 3022f4a8481d0..e019342fd034f 100644
--- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -76,6 +76,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gvn-hoist"
STATISTIC(NumHoisted, "Number of instructions hoisted");
diff --git a/llvm/lib/Transforms/Scalar/GVNSink.cpp b/llvm/lib/Transforms/Scalar/GVNSink.cpp
index b371684416b0f..a17ddaf054af0 100644
--- a/llvm/lib/Transforms/Scalar/GVNSink.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNSink.cpp
@@ -75,6 +75,7 @@
using namespace llvm;
using namespace llvm::GVNExpression;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gvn-sink"
STATISTIC(NumRemoved, "Number of instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
index 9967221651472..ee70ac4cd931d 100644
--- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp
+++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
@@ -63,6 +63,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "guard-widening"
STATISTIC(GuardsEliminated, "Number of eliminated guards");
diff --git a/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp b/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp
index 26f2db183fbf1..10624ab6845bc 100644
--- a/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp
+++ b/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp
@@ -10,6 +10,7 @@
#include "llvm/Analysis/IVUsers.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "iv-users"
PreservedAnalyses IVUsersPrinterPass::run(Loop &L, LoopAnalysisManager &AM,
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index c92efadded635..c7e49ffe56666 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -81,6 +81,7 @@ using namespace llvm;
using namespace PatternMatch;
using namespace SCEVPatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "indvars"
STATISTIC(NumWidened , "Number of indvars widened");
diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
index 98da1e9225172..8a6323e5e0d37 100644
--- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
@@ -126,6 +126,7 @@ static cl::opt<bool>
PrintScaledBoundaryRangeChecks("irce-print-scaled-boundary-range-checks",
cl::Hidden, cl::init(false));
+#undef DEBUG_TYPE
#define DEBUG_TYPE "irce"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
index 1082625d12a15..5922357d7e3db 100644
--- a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+++ b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
@@ -136,6 +136,7 @@
#include <utility>
#include <vector>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "infer-address-spaces"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
index 326849a4eb395..3ff91e3ead209 100644
--- a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
+++ b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
@@ -21,6 +21,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "instsimplify"
STATISTIC(NumSimplified, "Number of redundant instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 7f8e10eb201a6..07d738dce99c5 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -78,6 +78,7 @@
using namespace llvm;
using namespace jumpthreading;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "jump-threading"
STATISTIC(NumThreads, "Number of jumps threaded");
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 859bc4cf83898..ef0428f7358ef 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -91,6 +91,7 @@ namespace llvm {
class LPMUpdater;
} // namespace llvm
+#undef DEBUG_TYPE
#define DEBUG_TYPE "licm"
STATISTIC(NumCreatedBlocks, "Number of blocks created");
diff --git a/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp b/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
index 7253c7f222509..b8222c1204893 100644
--- a/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
@@ -14,6 +14,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-accesses"
PreservedAnalyses LoopAccessInfoPrinterPass::run(Function &F,
diff --git a/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp b/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
index a461e1f7fe074..d861ba1d1d149 100644
--- a/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
@@ -19,6 +19,7 @@
#include "llvm/Transforms/Utils/LoopSimplify.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-bound-split"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
index fe20c24318e12..45e26e92bf322 100644
--- a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
@@ -30,6 +30,7 @@
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-data-prefetch"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
index 0664eed072a9a..955984124f8e8 100644
--- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -31,6 +31,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-delete"
STATISTIC(NumDeleted, "Number of loops deleted");
diff --git a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
index 00eac14845c57..b843dfc8aaae8 100644
--- a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
@@ -69,6 +69,7 @@
using namespace llvm;
#define LDIST_NAME "loop-distribute"
+#undef DEBUG_TYPE
#define DEBUG_TYPE LDIST_NAME
/// @{
diff --git a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
index e48c47f1b4b89..f8426c48a7c5f 100644
--- a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
@@ -79,6 +79,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-flatten"
STATISTIC(NumFlattened, "Number of loops flattened");
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index 23bba139212e8..9c42820853cb7 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -68,6 +68,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-fusion"
STATISTIC(FuseCounter, "Loops fused");
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 105757140c758..065320480de3c 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -95,6 +95,7 @@
using namespace llvm;
using namespace SCEVPatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-idiom"
STATISTIC(NumMemSet, "Number of memset's formed from loop stores");
diff --git a/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
index fe689981083e3..84a255f48b8d1 100644
--- a/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
@@ -35,6 +35,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-instsimplify"
STATISTIC(NumSimplified, "Number of redundant instructions simplified");
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index 49a9e77ef8deb..3a4b7c57b40d2 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -52,6 +52,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-interchange"
STATISTIC(LoopsInterchanged, "Number of loops interchanged");
diff --git a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
index 82c55011df1cd..edf65ac1da023 100644
--- a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
@@ -62,6 +62,7 @@
using namespace llvm;
#define LLE_OPTION "loop-load-elim"
+#undef DEBUG_TYPE
#define DEBUG_TYPE LLE_OPTION
static cl::opt<unsigned> CheckPerElim(
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
index de5365271e233..803d3704902e1 100644
--- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
@@ -202,6 +202,7 @@
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-predication"
STATISTIC(TotalConsidered, "Number of guards considered");
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 50d44369a40d0..7fc0732595908 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -27,6 +27,7 @@
#include <optional>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-rotate"
static cl::opt<unsigned> DefaultRotationThreshold(
diff --git a/llvm/lib/Transforms/Scalar/LoopSink.cpp b/llvm/lib/Transforms/Scalar/LoopSink.cpp
index b9fde4c6a3b76..211477b80b3d0 100644
--- a/llvm/lib/Transforms/Scalar/LoopSink.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopSink.cpp
@@ -48,6 +48,7 @@
#include "llvm/Transforms/Utils/LoopUtils.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loopsink"
STATISTIC(NumLoopSunk, "Number of instructions sunk into loop");
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 5421cad31c3ba..19a2d317b2c9a 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -129,6 +129,7 @@
using namespace llvm;
using namespace SCEVPatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-reduce"
/// MaxIVUsers is an arbitrary threshold that provides an early opportunity for
diff --git a/llvm/lib/Transforms/Scalar/LoopTermFold.cpp b/llvm/lib/Transforms/Scalar/LoopTermFold.cpp
index e6eccdd7d616e..029431dee3485 100644
--- a/llvm/lib/Transforms/Scalar/LoopTermFold.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopTermFold.cpp
@@ -43,6 +43,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-term-fold"
STATISTIC(NumTermFold,
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
index e2bca3dd37304..1d63f67705838 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
@@ -50,6 +50,7 @@ class Value;
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll-and-jam"
/// @{
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index 9fdf7ef1b0a86..bf13dfa01e27f 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -70,6 +70,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll"
cl::opt<bool> llvm::ForgetSCEVInLoopUnroll(
diff --git a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
index 3aed643ee8065..e530453db99ac 100644
--- a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
@@ -87,6 +87,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-versioning-licm"
static const char *LICMVersioningMetaData = "llvm.loop.licm_versioning.disable";
diff --git a/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp b/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
index c93baf38e079b..e6a769d796639 100644
--- a/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
@@ -19,6 +19,7 @@
#include "llvm/Transforms/Utils/LowerAtomic.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-atomic"
static bool LowerFenceInst(FenceInst *FI) {
diff --git a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
index 0c94ed27880f0..52a474bafb4c0 100644
--- a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
@@ -36,6 +36,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-is-constant-intrinsic"
STATISTIC(IsConstantIntrinsicsHandled,
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 0828ffe82af48..8cb40ce815fad 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -55,6 +55,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-matrix-intrinsics"
STATISTIC(FlattenedMatrices, "Number of matrix flattenings");
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 43779d5195714..0ee26e7802525 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -62,6 +62,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memcpyopt"
static cl::opt<bool> EnableMemCpyOptWithoutLibcalls(
diff --git a/llvm/lib/Transforms/Scalar/MergeICmps.cpp b/llvm/lib/Transforms/Scalar/MergeICmps.cpp
index 531d370b6d678..54307b7238fdb 100644
--- a/llvm/lib/Transforms/Scalar/MergeICmps.cpp
+++ b/llvm/lib/Transforms/Scalar/MergeICmps.cpp
@@ -65,6 +65,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mergeicmps"
namespace llvm {
diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
index d6af49fd51f06..a20e3dd015454 100644
--- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
+++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
@@ -88,6 +88,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mldst-motion"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index a3e332ffd62d4..c9a8b1a6e6ca0 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -125,6 +125,7 @@ using namespace llvm::GVNExpression;
using namespace llvm::VNCoercion;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "newgvn"
STATISTIC(NumGVNInstrDeleted, "Number of instructions deleted");
diff --git a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
index f0426e916fb18..16728db9f87c9 100644
--- a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
+++ b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
@@ -32,6 +32,7 @@ namespace llvm {
extern cl::opt<bool> ProfcheckDisableMetadataFixes;
} // namespace llvm
+#undef DEBUG_TYPE
#define DEBUG_TYPE "partially-inline-libcalls"
DEBUG_COUNTER(PILCounter, "partially-inline-libcalls-transform",
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index 44600acf5b418..73b7c264c5217 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -71,6 +71,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "place-safepoints"
STATISTIC(NumEntrySafepoints, "Number of entry safepoints inserted");
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index ea6c394740f22..2c8263609058e 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -65,6 +65,7 @@ using namespace llvm;
using namespace reassociate;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "reassociate"
STATISTIC(NumChanged, "Number of insts reassociated");
diff --git a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp
index 764662441a040..e4a800a90cde8 100644
--- a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp
+++ b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp
@@ -33,6 +33,7 @@
#include <list>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "reg2mem"
STATISTIC(NumRegsDemoted, "Number of registers demoted");
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index c0977ae1b4c6b..9f0b91ad31972 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -73,6 +73,7 @@
#include <utility>
#include <vector>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "rewrite-statepoints-for-gc"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index feee794ffeae1..e7ffe96ddb7a6 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -45,6 +45,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sccp"
STATISTIC(NumInstRemoved, "Number of instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
index da9ceb4f440e5..12a594894a7ab 100644
--- a/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
+++ b/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
@@ -41,6 +41,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "scalarize-masked-mem-intrin"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/Scalarizer.cpp b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
index 0ef8e5790b7f8..4af80e9dbd1bc 100644
--- a/llvm/lib/Transforms/Scalar/Scalarizer.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
@@ -48,6 +48,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "scalarizer"
static BasicBlock::iterator skipPastPhiNodesAndDbg(BasicBlock::iterator Itr) {
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 40a3a23814700..3fd83bb30f1e8 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -66,6 +66,7 @@
#include <optional>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "simple-loop-unswitch"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index debf033c70c41..65449b7632b77 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -44,6 +44,7 @@
#include <utility>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "simplifycfg"
static cl::opt<unsigned> UserBonusInstThreshold(
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp
index 603525b55b9cf..32b69c88aa191 100644
--- a/llvm/lib/Transforms/Scalar/Sink.cpp
+++ b/llvm/lib/Transforms/Scalar/Sink.cpp
@@ -22,6 +22,7 @@
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sink"
STATISTIC(NumSunk, "Number of instructions sunk");
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index ed43fb4b63f87..78d456af3b743 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -107,6 +107,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "slsr"
static const unsigned UnknownAddressSpace =
diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
index 136cb965f94c5..b2c8c2ab349b6 100644
--- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
@@ -54,6 +54,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "structurizecfg"
// The name for newly created blocks.
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 3f7eca1fc7513..0a576cd25ad4d 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -84,6 +84,7 @@
#include <cmath>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "tailcallelim"
STATISTIC(NumEliminated, "Number of tail calls removed");
diff --git a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
index e53019768e881..60234843d6244 100644
--- a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
+++ b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
@@ -17,6 +17,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "transform-warning"
/// Emit warnings for forced (i.e. user-defined) loop transformations which have
diff --git a/llvm/lib/Transforms/Utils/CMakeLists.txt b/llvm/lib/Transforms/Utils/CMakeLists.txt
index 2b5f5cf344e60..09478a1da4377 100644
--- a/llvm/lib/Transforms/Utils/CMakeLists.txt
+++ b/llvm/lib/Transforms/Utils/CMakeLists.txt
@@ -108,3 +108,11 @@ add_llvm_component_library(LLVMTransformUtils
Support
TargetParser
)
+
+set_source_files_properties(
+ LowerGlobalDtors.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ LowerInvoke.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index 031ce978d21ce..d160e02e55a2b 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -40,6 +40,7 @@
#include <optional>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "clone-function"
STATISTIC(RemappedAtomMax, "Highest global NextAtomGroup (after mapping)");
diff --git a/llvm/lib/Transforms/Utils/CodeLayout.cpp b/llvm/lib/Transforms/Utils/CodeLayout.cpp
index 27b13eeaf4d71..c47511f50b75a 100644
--- a/llvm/lib/Transforms/Utils/CodeLayout.cpp
+++ b/llvm/lib/Transforms/Utils/CodeLayout.cpp
@@ -50,6 +50,7 @@
using namespace llvm;
using namespace llvm::codelayout;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "code-layout"
namespace llvm {
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
index 1a08a3d115d9e..5c54839c4c42b 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
@@ -57,6 +57,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll-and-jam"
STATISTIC(NumUnrolledAndJammed, "Number of loops unroll and jammed");
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index 68751cf95bc7a..cf2a5b8a13e17 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -44,6 +44,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll"
STATISTIC(NumRuntimeUnrolled,
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 7573467917c73..3ee461b588f31 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -50,6 +50,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-utils"
static const char *LLVMLoopDisableNonforced = "llvm.loop.disable_nonforced";
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index b90466a8c49cf..8e08c8ba148aa 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -32,6 +32,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-versioning"
static cl::opt<bool>
diff --git a/llvm/lib/Transforms/Utils/LowerAtomic.cpp b/llvm/lib/Transforms/Utils/LowerAtomic.cpp
index d4c0602f6ce52..53810bb715c1e 100644
--- a/llvm/lib/Transforms/Utils/LowerAtomic.cpp
+++ b/llvm/lib/Transforms/Utils/LowerAtomic.cpp
@@ -17,6 +17,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loweratomic"
bool llvm::lowerAtomicCmpXchgInst(AtomicCmpXchgInst *CXI) {
diff --git a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
index d33025adb520c..90cb5bf214044 100644
--- a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
+++ b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
@@ -29,6 +29,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-global-dtors"
namespace {
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
index 488745886ec37..d3aa60fab7ad1 100644
--- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
@@ -22,6 +22,7 @@
#include "llvm/Transforms/Utils.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-invoke"
STATISTIC(NumInvokes, "Number of invokes replaced");
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
index 9313f313cb02d..fb53f7215f4f2 100644
--- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
@@ -44,6 +44,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-switch"
namespace {
diff --git a/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp b/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
index 71c10f5b157c7..8b455feb01815 100644
--- a/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
+++ b/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
@@ -9,6 +9,7 @@
#include "llvm/Transforms/Utils/LowerVectorIntrinsics.h"
#include "llvm/IR/IRBuilder.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-intrinsics"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
index 5ad7aeb463ecb..a1c1d170fb454 100644
--- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
@@ -28,6 +28,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mem2reg"
STATISTIC(NumPromoted, "Number of alloca's promoted");
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 63a234960a0ad..66a97e07e5a2f 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -25,6 +25,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "moduleutils"
static void appendToGlobalArray(StringRef ArrayName, Module &M, Function *F,
diff --git a/llvm/lib/Transforms/Utils/MoveAutoInit.cpp b/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
index 9302d5e284fd3..0ed1fb8402015 100644
--- a/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
+++ b/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
@@ -26,6 +26,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "move-auto-init"
STATISTIC(NumMoved, "Number of instructions moved");
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index 3d3c70522fb55..150f83ea99d0d 100644
--- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp
+++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
@@ -26,6 +26,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugCounter.h"
#include "llvm/Support/FormattedStream.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "predicateinfo"
using namespace llvm;
using namespace PatternMatch;
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index ef668e575f3ea..ccf4697ceea75 100644
--- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -56,6 +56,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mem2reg"
STATISTIC(NumLocalPromoted, "Number of alloca's promoted within one block");
diff --git a/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp b/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
index c5bd0567d8d66..ed7eda22a1b48 100644
--- a/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
+++ b/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
@@ -21,6 +21,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "ssaupdaterbulk"
/// Helper function for finding a block which should have a value for the given
diff --git a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
index 3e40cced8771c..df67b8862df1c 100644
--- a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
+++ b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
@@ -23,6 +23,7 @@
#include <unordered_set>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-profile-inference"
namespace {
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index 9e0bbe9cf3b62..dcf9bbd712fa0 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -31,6 +31,7 @@
using namespace llvm;
using namespace llvm::PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "indvars"
STATISTIC(NumElimIdentity, "Number of IV identities eliminated");
diff --git a/llvm/lib/Transforms/Utils/SplitModule.cpp b/llvm/lib/Transforms/Utils/SplitModule.cpp
index c39771733ee0d..3d9d8ac2058b4 100644
--- a/llvm/lib/Transforms/Utils/SplitModule.cpp
+++ b/llvm/lib/Transforms/Utils/SplitModule.cpp
@@ -46,6 +46,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "split-module"
namespace {
diff --git a/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp b/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
index 77bac5c98478a..9b4612e53ec02 100644
--- a/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
+++ b/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
@@ -24,6 +24,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "split-module-by-category"
namespace {
diff --git a/llvm/lib/Transforms/Utils/SymbolRewriter.cpp b/llvm/lib/Transforms/Utils/SymbolRewriter.cpp
index 6319fd524ff0f..4fb0366c868c5 100644
--- a/llvm/lib/Transforms/Utils/SymbolRewriter.cpp
+++ b/llvm/lib/Transforms/Utils/SymbolRewriter.cpp
@@ -83,6 +83,7 @@
using namespace llvm;
using namespace SymbolRewriter;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "symbol-rewriter"
static cl::list<std::string> RewriteMapFiles("rewrite-map-file",
diff --git a/llvm/lib/Transforms/Utils/VNCoercion.cpp b/llvm/lib/Transforms/Utils/VNCoercion.cpp
index 0dabd065b6723..7828bec8307ad 100644
--- a/llvm/lib/Transforms/Utils/VNCoercion.cpp
+++ b/llvm/lib/Transforms/Utils/VNCoercion.cpp
@@ -4,6 +4,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vncoerce"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index 6e36006890df4..bda33cf420c6a 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -45,6 +45,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "value-mapper"
// Out of line method to get vtable etc for class.
diff --git a/llvm/lib/Transforms/Vectorize/CMakeLists.txt b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
index 9f4a242214471..612c2c26f1484 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -48,3 +48,32 @@ add_llvm_component_library(LLVMVectorize
TransformUtils
SandboxIR
)
+
+set_source_files_properties(
+ VPlan.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ LoopVectorize.cpp VPlanAnalysis.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ VPlanConstruction.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ VPlanPredicator.cpp
+ VPlanRecipes.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ VPlanTransforms.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ VPlanUnroll.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(VPlanVerifier.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(VPlanUtils.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
index 7cdb0763223df..1e6f10379a5fa 100644
--- a/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
@@ -80,6 +80,7 @@
using namespace llvm;
using namespace PatternMatch;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-idiom-vectorize"
static cl::opt<bool> DisableAll("disable-loop-idiom-vectorize-all", cl::Hidden,
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
index b3dd07b3c46e3..6ec491706ae86 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
@@ -35,6 +35,7 @@ using namespace llvm;
using namespace PatternMatch;
#define LV_NAME "loop-vectorize"
+#undef DEBUG_TYPE
#define DEBUG_TYPE LV_NAME
static cl::opt<bool>
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 4748b880721fa..87f1356b07303 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -45,6 +45,7 @@ using namespace llvm::VPlanPatternMatch;
using VectorParts = SmallVector<Value *, 2>;
#define LV_NAME "loop-vectorize"
+#undef DEBUG_TYPE
#define DEBUG_TYPE LV_NAME
bool VPRecipeBase::mayWriteToMemory() const {
diff --git a/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp b/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp
index fb7e1dd5b1e4e..d1addb284315c 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp
@@ -37,6 +37,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vplan-slp"
// Number of levels to look ahead when re-ordering multi node operands.
diff --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
index 1dff1831c305c..ec8f7c3e918e9 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -22,6 +22,7 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/TypeSwitch.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-vectorize"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 136f4fe238b34..9e6f64d22f2f1 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -41,6 +41,7 @@
#include <queue>
#include <set>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-combine"
#include "llvm/Transforms/Utils/InstructionWorklist.h"
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 86ee350834b5c..42634a6fc7f09 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -50,6 +50,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "asm-writer-emitter"
namespace {
diff --git a/llvm/utils/TableGen/Basic/CMakeLists.txt b/llvm/utils/TableGen/Basic/CMakeLists.txt
index 01ab8a0ef2250..f7347f4646505 100644
--- a/llvm/utils/TableGen/Basic/CMakeLists.txt
+++ b/llvm/utils/TableGen/Basic/CMakeLists.txt
@@ -24,6 +24,21 @@ add_llvm_library(LLVMTableGenBasic OBJECT EXCLUDE_FROM_ALL DISABLE_LLVM_LINK_LLV
VTEmitter.cpp
)
+# These emitter files each define a static TableGen::Emitter::Opt[Class]
+# variable named 'X' (and sometimes 'Y') at file scope for self-registration,
+# which conflicts in unity builds.
+set_source_files_properties(
+ ARMTargetDefEmitter.cpp
+ Attributes.cpp
+ DirectiveEmitter.cpp
+ IntrinsicEmitter.cpp
+ RISCVTargetDefEmitter.cpp
+ RuntimeLibcallsEmitter.cpp
+ TargetFeaturesEmitter.cpp
+ TargetLibraryInfoEmitter.cpp
+ VTEmitter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
# Users may include its headers as "Basic/*.h"
target_include_directories(LLVMTableGenBasic
INTERFACE
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index e18279cffa74c..e1c37c705f2e6 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -81,3 +81,36 @@ add_tablegen(llvm-tblgen LLVM
DEPENDS
intrinsics_gen # via llvm-min-tablegen
)
+
+set_source_files_properties(
+ AsmWriterEmitter.cpp
+ CTagsEmitter.cpp
+ CallingConvEmitter.cpp
+ CodeEmitterGen.cpp
+ CompressInstEmitter.cpp
+ DAGISelEmitter.cpp
+ DXILEmitter.cpp
+ DisassemblerEmitter.cpp
+ ExegesisEmitter.cpp
+ FastISelEmitter.cpp
+ GlobalISelCombinerEmitter.cpp
+ GlobalISelEmitter.cpp
+ InstrDocsEmitter.cpp
+ MacroFusionPredicatorEmitter.cpp
+ OptionParserEmitter.cpp
+ OptionRSTEmitter.cpp
+ PseudoLoweringEmitter.cpp
+ RegisterBankEmitter.cpp
+ RegisterInfoEmitter.cpp
+ SearchableTableEmitter.cpp
+ SubtargetEmitter.cpp
+ X86FoldTablesEmitter.cpp
+ X86InstrMappingEmitter.cpp
+ X86MnemonicTables.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ DFAPacketizerEmitter.cpp
+ InstrInfoEmitter.cpp
+ SDNodeInfoEmitter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/utils/TableGen/CTagsEmitter.cpp b/llvm/utils/TableGen/CTagsEmitter.cpp
index 413d8f5dbcff0..e637667d94dfb 100644
--- a/llvm/utils/TableGen/CTagsEmitter.cpp
+++ b/llvm/utils/TableGen/CTagsEmitter.cpp
@@ -21,6 +21,7 @@
#include <vector>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "ctags-emitter"
namespace {
diff --git a/llvm/utils/TableGen/CompressInstEmitter.cpp b/llvm/utils/TableGen/CompressInstEmitter.cpp
index f118bd69c9737..6d14efb2a37fd 100644
--- a/llvm/utils/TableGen/CompressInstEmitter.cpp
+++ b/llvm/utils/TableGen/CompressInstEmitter.cpp
@@ -81,6 +81,7 @@
#include <vector>
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "compress-inst-emitter"
namespace {
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index eba4a95bd24ba..d598a15c0927d 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -20,6 +20,7 @@
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dag-isel-emitter"
namespace {
diff --git a/llvm/utils/TableGen/DAGISelMatcherOpt.cpp b/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
index 2a7b834dea138..89c5eb99007e1 100644
--- a/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
@@ -18,6 +18,7 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "isel-opt"
/// ContractNodes - Turn multiple matcher node patterns like 'MoveChild+Record'
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index 664c3009ff504..ae81e067b4853 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -56,6 +56,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "decoder-emitter"
extern cl::OptionCategory DisassemblerEmitterCat;
diff --git a/llvm/utils/TableGen/ExegesisEmitter.cpp b/llvm/utils/TableGen/ExegesisEmitter.cpp
index bd69919bb462e..c5897af3a333f 100644
--- a/llvm/utils/TableGen/ExegesisEmitter.cpp
+++ b/llvm/utils/TableGen/ExegesisEmitter.cpp
@@ -24,6 +24,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "exegesis-emitter"
namespace {
diff --git a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
index 56b39fcd1cc9e..f4369ed6d4919 100644
--- a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
@@ -59,6 +59,7 @@
using namespace llvm;
using namespace llvm::gi;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gicombiner-emitter"
static cl::OptionCategory
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index 15b5ae24bd5d1..ec94059fef5e9 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -55,6 +55,7 @@ using namespace llvm::gi;
using action_iterator = RuleMatcher::action_iterator;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "gisel-emitter"
STATISTIC(NumPatternTotal, "Total number of patterns");
diff --git a/llvm/utils/TableGen/PseudoLoweringEmitter.cpp b/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
index 76806c32033d5..cc5dd59eb45fb 100644
--- a/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
+++ b/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
@@ -19,6 +19,7 @@
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pseudo-lowering"
namespace {
diff --git a/llvm/utils/TableGen/RegisterBankEmitter.cpp b/llvm/utils/TableGen/RegisterBankEmitter.cpp
index c2cb06fe456c7..f3b55250bcf4a 100644
--- a/llvm/utils/TableGen/RegisterBankEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterBankEmitter.cpp
@@ -23,6 +23,7 @@
#include "llvm/TableGen/TGTimer.h"
#include "llvm/TableGen/TableGenBackend.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "register-bank-emitter"
using namespace llvm;
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp
index c3a9d69d6ec3e..af1d6a2146db8 100644
--- a/llvm/utils/TableGen/SubtargetEmitter.cpp
+++ b/llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -41,6 +41,7 @@
using namespace llvm;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "subtarget-emitter"
namespace {
diff --git a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
index fb5649e670656..17a753fa695bb 100644
--- a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/DebugLog.h"
#include <cassert>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "constant-propagation"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
index 936b0c678f20c..c65fdf675e039 100644
--- a/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
@@ -29,6 +29,7 @@
#include <cassert>
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dead-code-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
index 22bc0b32a9bd1..8ee8a43895c34 100644
--- a/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
@@ -24,6 +24,7 @@
using namespace mlir;
using namespace mlir::dataflow;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dense-analysis"
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
index 818450e2bc696..506a127b0d7ec 100644
--- a/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
@@ -36,6 +36,7 @@
#include <optional>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "int-range-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp b/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp
index 4afc35d23fafa..1b2db0b748120 100644
--- a/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp
@@ -20,6 +20,7 @@
#include <mlir/Interfaces/SideEffectInterfaces.h>
#include <mlir/Support/LLVM.h>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "liveness-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp
index 01c9dafaddf10..d5328d465b881 100644
--- a/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugLog.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "strided-metadata-range-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
index 0e0c5f2159382..ea6d72173c1b0 100644
--- a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
+++ b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "flat-value-constraints"
using namespace mlir;
diff --git a/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt b/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
index 568d9339aaabc..ca6a69fa1dafc 100644
--- a/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
+++ b/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
@@ -17,3 +17,8 @@ add_mlir_conversion_library(MLIRLLVMCommonConversion
MLIRSupport
MLIRTransforms
)
+
+set_source_files_properties(
+ StructBuilder.cpp
+ TypeConverter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp b/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
index 3b2aab6c9a824..a0aea824528b4 100644
--- a/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
+++ b/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
@@ -25,6 +25,7 @@
#include <limits>
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memref-to-spirv-pattern"
using namespace mlir;
diff --git a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
index b7853634bc44e..582fb4e687847 100644
--- a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
+++ b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
@@ -22,3 +22,7 @@ add_mlir_conversion_library(MLIRSCFToGPU
MLIRSideEffectInterfaces
MLIRTransforms
)
+
+set_source_files_properties(
+ SCFToGPUPass.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt b/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
index 246f10b389911..c8bc551242449 100644
--- a/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
+++ b/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
@@ -25,3 +25,8 @@ add_mlir_conversion_library(MLIRShapeToStandard
MLIRSCFDialect
MLIRTransforms
)
+
+set_source_files_properties(
+ ShapeToStandard.cpp
+ ConvertShapeConstraints.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Debug/CMakeLists.txt b/mlir/lib/Debug/CMakeLists.txt
index d270eb2e7534f..8025d6af69e14 100644
--- a/mlir/lib/Debug/CMakeLists.txt
+++ b/mlir/lib/Debug/CMakeLists.txt
@@ -17,3 +17,7 @@ add_mlir_library(MLIRDebug
MLIRObservers
)
+
+set_source_files_properties(
+ DebuggerExecutionContextHook.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp b/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
index 8bf773dd817f2..214ed453f0a0f 100644
--- a/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
@@ -23,6 +23,7 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-structures"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
index 166d39e88d41e..01dc6a6b53d10 100644
--- a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
@@ -25,6 +25,7 @@
#include <numeric>
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-analysis"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Analysis/Utils.cpp b/mlir/lib/Dialect/Affine/Analysis/Utils.cpp
index ee893c14c9c6b..78ecae7c9acd9 100644
--- a/mlir/lib/Dialect/Affine/Analysis/Utils.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/Utils.cpp
@@ -28,6 +28,7 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "analysis-utils"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
index c8d8b8d62e59d..1ff2f7cb8d780 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
@@ -23,6 +23,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-licm"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
index 6175e52f96009..7e401d8a93b94 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
@@ -31,6 +31,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-parallel"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
index 92a4cf3c0ad76..91b027ffda5de 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
@@ -25,6 +25,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-scalrep"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
index 7bce124817032..33de0690406fd 100644
--- a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
@@ -46,3 +46,7 @@ add_mlir_dialect_library(MLIRAffineTransforms
MLIRVectorUtils
)
+
+set_source_files_properties(
+ AffineExpandIndexOpsAsAffine.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp b/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
index 11007a08f7edc..7417f2fe6f029 100644
--- a/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
@@ -22,6 +22,7 @@
using namespace mlir;
using namespace mlir::affine;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "decompose-affine-ops"
/// Count the number of loops surrounding `operand` such that operand could be
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
index 1ec5fbfef50c3..6a3c2fc4a0f5b 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
@@ -39,6 +39,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-fusion"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
index 188db218a5220..8402b98fccac1 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
@@ -34,6 +34,7 @@ namespace affine {
using namespace mlir;
using namespace mlir::affine;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-tile"
namespace {
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
index 837d4f714d25e..562439db7c76e 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
@@ -25,6 +25,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-unroll"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
index f97174065a475..b34c7f54c435e 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
@@ -49,6 +49,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-unroll-jam"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
index d84cb4f0cde5f..84f9426ff52ec 100644
--- a/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
@@ -31,6 +31,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-pipeline-data-transfer"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp b/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
index 29cc256cb90f9..7a2fe77a1b391 100644
--- a/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
@@ -31,6 +31,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "raise-memref-to-affine"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp
index ea7f3157c82ea..8768b5841296a 100644
--- a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/InterleavedRange.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-min-max"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
index c09afc03c5257..914f3e9e04a66 100644
--- a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
@@ -26,6 +26,7 @@ namespace affine {
} // namespace affine
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "simplify-affine-structure"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
index 8f1249e3afaf0..eaa73902d4ea3 100644
--- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
@@ -29,6 +29,7 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-utils"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Utils/Utils.cpp b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
index 7b976943e1bb7..4b9a298f78645 100644
--- a/mlir/lib/Dialect/Affine/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
@@ -29,6 +29,7 @@
#include "llvm/ADT/SmallVectorExtras.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-utils"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
index 637e16a3963d6..cd41efdc90c85 100644
--- a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
@@ -37,3 +37,7 @@ add_mlir_dialect_library(MLIRArithTransforms
MLIRValueBoundsOpInterface
MLIRVectorDialect
)
+
+set_source_files_properties(
+ BufferizableOpInterfaceImpl.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp b/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
index f1c36edac6094..ae51e71071eb2 100644
--- a/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
+++ b/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
@@ -19,6 +19,7 @@
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/TypeSwitch.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "arm-sme-outerproduct-fusion"
namespace mlir::arm_sme {
diff --git a/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp b/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
index 6e2654ab468f9..beed448aa8522 100644
--- a/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
+++ b/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
@@ -28,6 +28,7 @@
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "arm-sme-vector-legalization"
namespace mlir::arm_sme {
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
index 91e37dd9ac36e..ac312382c0942 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
@@ -25,6 +25,7 @@ namespace mlir {
#include "mlir/Dialect/Async/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "async-runtime-ref-counting"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp
index 303bbcacb6f2f..42529b8c30697 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp
@@ -21,6 +21,7 @@ namespace mlir {
#include "mlir/Dialect/Async/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "async-ref-counting"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
index 112d69ce87f7f..aeb6e715dadbc 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
@@ -38,6 +38,7 @@ namespace mlir {
using namespace mlir;
using namespace mlir::async;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "async-to-async-runtime"
// Prefix for functions outlined from `async.execute` op regions.
static constexpr const char kAsyncFnPrefix[] = "async_execute_fn";
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
index 7c38621be1bb5..20281b51c49d8 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
@@ -42,3 +42,8 @@ add_mlir_dialect_library(MLIRBufferizationTransforms
MLIRViewLikeInterface
MLIRSupport
)
+
+set_source_files_properties(
+ BufferViewFlowAnalysis.cpp
+ OwnershipBasedBufferDeallocation.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp
index 28ee5b8e32b99..d01d5eed9919f 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp
@@ -20,6 +20,7 @@
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "llvm/Support/DebugLog.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "optimize-allocation-liveness"
namespace mlir {
diff --git a/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp b/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
index 680fafcc099f2..d0321eb6549af 100644
--- a/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
@@ -24,6 +24,7 @@
#include "llvm/Support/DebugLog.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "llvm-inliner"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
index a2149478e4c2d..5326297d477d0 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
@@ -87,3 +87,7 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRVectorUtils
MLIRVectorToSCF
)
+
+set_source_files_properties(
+ DecomposeLinalgOps.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
index c3dca148b7f94..9a592de9d3419 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
@@ -36,6 +36,7 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-drop-unit-dims"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp b/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
index 0be128c3b5e87..0b1490eed780d 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
@@ -26,6 +26,7 @@ namespace mlir {
using namespace mlir;
using namespace mlir::linalg;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-fold-into-elementwise"
namespace {
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
index f11f230a8909b..eefc3d0a3a5d0 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
@@ -24,6 +24,7 @@
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-fusion"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
index 35abdc027f194..1454b6656cb15 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
@@ -25,6 +25,7 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-generalization"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
index 867171583b010..69d2fbec9ba93 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
@@ -31,6 +31,7 @@
using llvm::dbgs;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "hoist-padding"
#define DBGS() (dbgs() << '[' << DEBUG_TYPE << "] ")
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
index e1dc40d6d37d9..0572be1a43537 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
@@ -27,6 +27,7 @@
using llvm::dbgs;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-hoisting"
#define DBGS() (dbgs() << '[' << DEBUG_TYPE << "] ")
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp b/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp
index 1a293da883fd6..be7953e1bd71c 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp
@@ -22,6 +22,7 @@
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/ScopeExit.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-interchange"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp b/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
index fee293647deda..c73d0a1375199 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
@@ -24,6 +24,7 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-morphism"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp b/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
index c9045566473cb..06095b0429d09 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
@@ -23,6 +23,7 @@
using namespace mlir;
using namespace mlir::linalg;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-named-to-elementwise"
namespace {
diff --git a/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp b/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
index ab2629b41a463..bd2b443d9f1a0 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
@@ -23,6 +23,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Casting.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "pad-tiling-interface"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp b/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp
index dd8437985197d..876886aeed569 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp
@@ -15,6 +15,7 @@
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-padding"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
index 6519c4f64dd05..959747f175ac8 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
@@ -34,6 +34,7 @@ using namespace mlir::scf;
using llvm::MapVector;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-promotion"
/// Alloc a new buffer of `size` * `width` i8; where `width` is given by the
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
index 60b18fb2e8d93..c65423b896b2b 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
@@ -26,6 +26,7 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-specialization"
#define REPLACE_BINARY_OP(NEWOP, OPERANDS_SWAP) \
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
index 39fdfa9cdbd47..fc65bb8121099 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
@@ -38,6 +38,7 @@ using namespace mlir::affine;
using namespace mlir::linalg;
using namespace mlir::scf;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-tiling"
std::tuple<SmallVector<Range, 4>, LoopIndexToRangeIndexMap>
diff --git a/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp b/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
index 558ebdebd65c5..73bec7a9e1b1b 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
@@ -28,6 +28,7 @@
#include "llvm/Support/Debug.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-tiling-interface-impl"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
index 260e36fb47f04..0e8ba2cbc7e31 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
@@ -38,6 +38,7 @@
#include <type_traits>
#include <utility>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-transforms"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp b/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp
index 2650488c17993..aedf896425f84 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp
@@ -12,6 +12,7 @@
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/IR/PatternMatch.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-transpose-matmul"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
index a7acdd2c018ea..d4d6ddd409b11 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -49,6 +49,7 @@
using namespace mlir;
using namespace mlir::linalg;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-vectorization"
/// Try to vectorize `convOp` as a convolution.
diff --git a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
index 1c5e07f89b338..47bd094fa954d 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
@@ -44,3 +44,7 @@ add_mlir_dialect_library(MLIRMemRefTransforms
MLIRVectorDialect
)
+
+set_source_files_properties(
+ EmulateNarrowType.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp b/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
index ce45f847ccaed..9aabc40ce976d 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
@@ -26,6 +26,7 @@
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "memref-transforms"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
#define DBGSNL() (llvm::dbgs() << "\n")
diff --git a/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp b/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
index fa7991e6c6a80..7a39983f9c64b 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
@@ -24,6 +24,7 @@ namespace memref {
} // namespace memref
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "normalize-memrefs"
using namespace mlir;
diff --git a/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp b/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp
index d65825bbdf391..6bf9054b9a4c7 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp
@@ -20,6 +20,7 @@
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "llvm/Support/InterleavedRange.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "reify-result-shapes"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
diff --git a/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt b/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
index 2ba1778532860..f297faaf65769 100644
--- a/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
@@ -21,3 +21,7 @@ add_mlir_dialect_library(MLIROpenACCDialect
MLIROpenACCMPCommon
)
+
+set_source_files_properties(
+ OpenACCCG.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp
index f815245882630..ece8947f87918 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp
@@ -64,6 +64,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-declare-gpu-module-insertion"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp
index 9095d7c915fa8..57d26560540ae 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp
@@ -74,6 +74,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-if-clause-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp
index 3b83a25429234..325597f065988 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp
@@ -225,6 +225,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-implicit-data"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
index e99a27a7bb89a..339953dbf4da7 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
@@ -194,6 +194,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-implicit-declare"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp
index f41ce276f994f..4b8b803a6bdc8 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp
@@ -41,6 +41,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-legalize-serial"
namespace {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp
index 495d0247d86d3..9ab138200a180 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp
@@ -73,6 +73,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-loop-tile"
namespace {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp
index b60103e9cd85f..89440f0ba8d4b 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp
@@ -67,6 +67,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-recipe-materialization"
namespace {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp
index 04b2260045838..029729c89e7dd 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp
@@ -54,6 +54,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-routine-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp
index 633538069c268..f160f3d43aab4 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp
@@ -97,6 +97,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-specialize-for-host"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp b/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
index 7dbde227b2fab..729bf45705ee3 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
@@ -91,6 +91,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "offload-livein-value-canonicalization"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp b/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp
index 91a7c7d6489a4..1d7c3a349e4e9 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp
@@ -66,6 +66,7 @@ namespace acc {
} // namespace acc
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "offload-target-verifier"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt b/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
index a6b0d416a4165..42c167bd24ad5 100644
--- a/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
@@ -37,3 +37,7 @@ add_mlir_dialect_library(
MLIRViewLikeInterface
MLIRPtrMemorySpaceInterfaces
)
+
+set_source_files_properties(
+ PtrTypes.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
index 0f00806870d8a..7b33d5142c2ac 100644
--- a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
@@ -19,6 +19,7 @@ namespace mlir {
#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "parallel-loop-collapsing"
using namespace mlir;
diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index 963e2d6d4f37b..ba37f01201c27 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -30,6 +30,7 @@
#include "llvm/Support/Debug.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "tile-using-interface"
using namespace mlir;
diff --git a/mlir/lib/Dialect/SCF/Utils/Utils.cpp b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
index bae6e68400e22..0b131e67dd3b1 100644
--- a/mlir/lib/Dialect/SCF/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
@@ -31,6 +31,7 @@
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "scf-utils"
SmallVector<scf::ForOp> mlir::replaceLoopNestWithNewYields(
diff --git a/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
index f05f596aa9f23..bbbe2b4805142 100644
--- a/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
@@ -51,3 +51,20 @@ add_mlir_dialect_library(MLIRSPIRVDialect
MLIRTransforms
MLIRUBDialect
)
+
+set_source_files_properties(
+ ArmGraphOps.cpp
+ AtomicOps.cpp
+ CastOps.cpp
+ ControlFlowOps.cpp
+ CooperativeMatrixOps.cpp
+ DotProductOps.cpp
+ GroupOps.cpp
+ MemoryOps.cpp
+ SPIRVCanonicalization.cpp
+ SPIRVDialect.cpp
+ SPIRVGLCanonicalization.cpp
+ SPIRVOpDefinition.cpp
+ SPIRVOps.cpp
+ SPIRVParsingUtils.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
index 43e5c3251c525..d1db102598f4e 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
@@ -53,3 +53,8 @@ add_mlir_dialect_library(MLIRSparseTensorTransforms
MLIRTransforms
MLIRVectorDialect
)
+
+set_source_files_properties(
+ SparseTensorConversion.cpp
+ Sparsification.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Transform/IR/Utils.cpp b/mlir/lib/Dialect/Transform/IR/Utils.cpp
index 773eb138cdf62..0d41af5d685fd 100644
--- a/mlir/lib/Dialect/Transform/IR/Utils.cpp
+++ b/mlir/lib/Dialect/Transform/IR/Utils.cpp
@@ -15,6 +15,7 @@
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "transform-dialect-utils"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
diff --git a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
index 4e0f07af95984..ae41b614f0b44 100644
--- a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
@@ -55,3 +55,7 @@ add_mlir_dialect_library(MLIRVectorTransforms
MLIRVectorInterfaces
MLIRVectorUtils
)
+
+set_source_files_properties(
+ VectorInsertExtractStridedSliceRewritePatterns.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
index 61d9357e19bb4..eceafda76fecf 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
@@ -22,6 +22,7 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-broadcast-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
index 14fbdd2243676..42261f2f6a75b 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
@@ -23,6 +23,7 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-contract-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
index 7194d41d60df7..e37caee4fc374 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
@@ -26,6 +26,7 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-broadcast-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
index 13ad98de284e2..ce67a7a82af5f 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
@@ -18,6 +18,7 @@
#include "mlir/IR/PatternMatch.h"
#include "llvm/ADT/SmallVectorExtras.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-interleave-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
index 7730c4e7c950a..60f023a8761b2 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
@@ -19,6 +19,7 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-mask"
namespace mlir {
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp
index 76599822fbfe4..7392c2bf17795 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp
@@ -26,6 +26,7 @@ namespace vector {
} // namespace vector
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-multi-reduction"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
index 0eba0b12259ac..7620fb9d34416 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
@@ -24,6 +24,7 @@
#include "llvm/ADT/STLExtras.h"
#include <numeric>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-shape-cast-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp
index ef49c863683ad..063cf766449fb 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp
@@ -16,6 +16,7 @@
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
#include "mlir/IR/PatternMatch.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-shuffle-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp
index 08e7c895831ce..ee4ef92fa94d6 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp
@@ -16,6 +16,7 @@
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
#include "mlir/IR/PatternMatch.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-step-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp
index 7521e2491335b..7d3928fcee915 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp
@@ -31,6 +31,7 @@ namespace vector {
} // namespace vector
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-to-from-elements-to-shuffle-tree"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
index c3f7de0ac3c4e..4ab711c77b889 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
@@ -23,6 +23,7 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-transpose"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
index c53242b526cb6..6bc18ef80c046 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
@@ -42,6 +42,7 @@
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-narrow-type-emulation"
using VectorValue = TypedValue<VectorType>;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp
index 19db8b3b48a25..c7a0cf059b7bf 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp
@@ -28,6 +28,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DebugLog.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-transfer-opt"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
index bd14e43747f81..21d697dd47755 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
@@ -28,6 +28,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVectorExtras.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-transfer-split"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
index c694f4f58faa1..529fd5558dd95 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
@@ -36,6 +36,7 @@
#include <functional>
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-to-vector"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
index 37a691c4fce7c..47569d0de2b6f 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
@@ -21,6 +21,7 @@
#include "llvm/Support/InterleavedRange.h"
#include <optional>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-unroll"
using namespace mlir;
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
index 0ece695aed512..1c21cabd5c3a9 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
@@ -37,6 +37,7 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-optimize-peephole"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
index 8675fe8b5cce1..047409c13d8d1 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
@@ -46,6 +46,7 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-propagate-layout"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
index 0961ddfb92040..6aa1ffc36834e 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
@@ -39,6 +39,7 @@ namespace xegpu {
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-sg-to-wi-distribute-experimental"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
index 69c2fb7493086..0241b706a2d30 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
@@ -46,6 +46,7 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-subgroup-distribute"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
index d633c1531955d..97f68e8880db9 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
@@ -27,6 +27,7 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-unroll"
using namespace mlir;
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp
index e31c37a2459ad..6f759037d0c82 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp
@@ -29,6 +29,7 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-vector-linearize"
using namespace mlir;
diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt
index 6cadc3131ccd4..d5c728210d109 100644
--- a/mlir/lib/IR/CMakeLists.txt
+++ b/mlir/lib/IR/CMakeLists.txt
@@ -75,3 +75,9 @@ add_mlir_library(MLIRIR
LINK_LIBS PUBLIC
MLIRSupport
)
+
+# SymbolTable.cpp has ambiguous 'function_ref', 'SetVector', 'detail', 'impl'
+# due to 'using namespace llvm;' from other files in the unity batch.
+# Types.cpp has ambiguous 'Type' (mlir::Type vs llvm::Type).
+set_source_files_properties(SymbolTable.cpp TypeRange.cpp TypeUtilities.cpp Types.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/IR/Dialect.cpp b/mlir/lib/IR/Dialect.cpp
index 952619b4477a7..0f429d90d3b9e 100644
--- a/mlir/lib/IR/Dialect.cpp
+++ b/mlir/lib/IR/Dialect.cpp
@@ -23,6 +23,7 @@
#include "llvm/Support/Regex.h"
#include <memory>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dialect"
using namespace mlir;
diff --git a/mlir/lib/Support/TypeID.cpp b/mlir/lib/Support/TypeID.cpp
index 3526a0d49cc79..6a71c03e47eb3 100644
--- a/mlir/lib/Support/TypeID.cpp
+++ b/mlir/lib/Support/TypeID.cpp
@@ -17,6 +17,7 @@
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "typeid"
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/TableGen/CMakeLists.txt b/mlir/lib/TableGen/CMakeLists.txt
index a90c55847718e..d874640c9516b 100644
--- a/mlir/lib/TableGen/CMakeLists.txt
+++ b/mlir/lib/TableGen/CMakeLists.txt
@@ -41,6 +41,12 @@ llvm_add_library(MLIRTableGen STATIC
${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
+
+# CodeGenHelpers.cpp has "using namespace llvm;" which makes DenseMapInfo
+# ambiguous in Constraint.cpp's DenseMapInfo<Constraint> implementations
+# when compiled together in a unity build.
+set_source_files_properties(Constraint.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
set_target_properties(MLIRTableGen PROPERTIES FOLDER "MLIR/Tablegenning")
mlir_check_all_link_libraries(MLIRTableGen)
diff --git a/mlir/lib/TableGen/Pattern.cpp b/mlir/lib/TableGen/Pattern.cpp
index ce09f5c3f5183..becc6b4fcaa23 100644
--- a/mlir/lib/TableGen/Pattern.cpp
+++ b/mlir/lib/TableGen/Pattern.cpp
@@ -22,6 +22,7 @@
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "mlir-tblgen-pattern"
using namespace mlir;
diff --git a/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt b/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
index f378a28af2db9..48826f21191c1 100644
--- a/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
+++ b/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
@@ -8,3 +8,7 @@ add_mlir_library(MLIRPDLLCodeGen
MLIRPDLDialect
MLIRSupport
)
+
+set_source_files_properties(
+ MLIRGen.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt b/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
index e2acba54e5624..45df59513c07e 100644
--- a/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
@@ -17,3 +17,7 @@ add_mlir_library(MLIRLspServerLib
MLIRLspServerSupportLib
MLIRParser
)
+
+set_source_files_properties(
+ MLIRServer.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt b/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
index b21650ed03b6f..02bd1cfcaa0e9 100644
--- a/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
+++ b/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
@@ -19,3 +19,7 @@ llvm_add_library(TableGenLspServerLib
MLIRLspServerSupportLib
MLIRSupport
)
+
+set_source_files_properties(
+ TableGenServer.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp
index ade7647890830..0ea22924b5481 100644
--- a/mlir/lib/Transforms/RemoveDeadValues.cpp
+++ b/mlir/lib/Transforms/RemoveDeadValues.cpp
@@ -60,6 +60,7 @@
#include <optional>
#include <vector>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "remove-dead-values"
namespace mlir {
diff --git a/mlir/lib/Transforms/SROA.cpp b/mlir/lib/Transforms/SROA.cpp
index 859c0302185e6..cac976bea7521 100644
--- a/mlir/lib/Transforms/SROA.cpp
+++ b/mlir/lib/Transforms/SROA.cpp
@@ -19,6 +19,7 @@ namespace mlir {
#include "mlir/Transforms/Passes.h.inc"
} // namespace mlir
+#undef DEBUG_TYPE
#define DEBUG_TYPE "sroa"
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt
index 3ca16239ba33c..766090ac874e0 100644
--- a/mlir/lib/Transforms/Utils/CMakeLists.txt
+++ b/mlir/lib/Transforms/Utils/CMakeLists.txt
@@ -24,3 +24,7 @@ add_mlir_library(MLIRTransformUtils
MLIRSubsetOpInterface
MLIRRewrite
)
+
+set_source_files_properties(
+ GreedyPatternRewriteDriver.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index cf59234ded233..c35e009655560 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -31,6 +31,7 @@
using namespace mlir;
using namespace mlir::detail;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "dialect-conversion"
/// A utility function to log a successful result for the given reason.
diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
index 578e680535bed..f86a9f0aa3986 100644
--- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
@@ -35,6 +35,7 @@
using namespace mlir;
+#undef DEBUG_TYPE
#define DEBUG_TYPE "greedy-rewriter"
namespace {
diff --git a/mlir/lib/Transforms/Utils/Inliner.cpp b/mlir/lib/Transforms/Utils/Inliner.cpp
index 40950312d566f..ff324b08821e4 100644
--- a/mlir/lib/Transforms/Utils/Inliner.cpp
+++ b/mlir/lib/Transforms/Utils/Inliner.cpp
@@ -23,6 +23,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/DebugLog.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "inlining"
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp b/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
index 5f3b04a6d8bce..87a7f6a89a342 100644
--- a/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
@@ -22,6 +22,7 @@
#include "llvm/Support/DebugLog.h"
#include <queue>
+#undef DEBUG_TYPE
#define DEBUG_TYPE "licm"
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
index 1382550e0f7e6..945994cd7d425 100644
--- a/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
@@ -23,6 +23,7 @@
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/ErrorHandling.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "walk-rewriter"
namespace mlir {
diff --git a/mlir/test/lib/Analysis/CMakeLists.txt b/mlir/test/lib/Analysis/CMakeLists.txt
index c37671ade37b3..1fa56d2b11c73 100644
--- a/mlir/test/lib/Analysis/CMakeLists.txt
+++ b/mlir/test/lib/Analysis/CMakeLists.txt
@@ -37,3 +37,14 @@ target_include_directories(MLIRTestAnalysis
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+
+set_source_files_properties(
+ TestMemRefDependenceCheck.cpp
+ TestSlice.cpp
+ DataFlow/TestDeadCodeAnalysis.cpp
+ DataFlow/TestDenseBackwardDataFlowAnalysis.cpp
+ DataFlow/TestDenseForwardDataFlowAnalysis.cpp
+ DataFlow/TestLivenessAnalysis.cpp
+ DataFlow/TestSparseBackwardDataFlowAnalysis.cpp
+ DataFlow/TestStridedMetadataRangeAnalysis.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
index b3b9a590773b0..71f13046260a4 100644
--- a/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
+++ b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
@@ -18,6 +18,7 @@
#include "mlir/Pass/Pass.h"
#include "llvm/Support/Debug.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "test-memref-dependence-check"
using namespace mlir;
diff --git a/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt b/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
index f190b2da5a190..911844de3c3df 100644
--- a/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
+++ b/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
@@ -21,3 +21,7 @@ target_include_directories(MLIRTestFuncToLLVM
${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
)
+
+set_source_files_properties(
+ TestConvertFuncOp.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Affine/CMakeLists.txt b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
index 885bc9b4c3afc..cd6dbb081cd0b 100644
--- a/mlir/test/lib/Dialect/Affine/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
@@ -42,3 +42,19 @@ target_include_directories(MLIRAffineTransformsTestPasses
${CMAKE_CURRENT_BINARY_DIR}/../Test
)
+
+set_source_files_properties(
+ TestVectorizationUtils.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ TestReifyValueBounds.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ TestAccessAnalysis.cpp
+ TestAffineLoopUnswitching.cpp
+ TestDecomposeAffineOps.cpp
+ TestLoopFusion.cpp
+ TestLoopPermutation.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp b/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
index bf11d94596fa7..a00bb524d4259 100644
--- a/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
+++ b/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
@@ -18,6 +18,7 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Pass/Pass.h"
+#undef DEBUG_TYPE
#define DEBUG_TYPE "test-loop-fusion"
using namespace mlir;
diff --git a/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt b/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
index 2ee3222160d91..5d541019a9034 100644
--- a/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
@@ -19,3 +19,7 @@ target_include_directories(MLIRBufferizationTestPasses
${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
)
+
+set_source_files_properties(
+ TestTensorLikeAndBufferLike.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/SCF/CMakeLists.txt b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
index d2f97e816cc14..bd39448bbd456 100644
--- a/mlir/test/lib/Dialect/SCF/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
@@ -18,3 +18,7 @@ mlir_target_link_libraries(MLIRSCFTestPasses PUBLIC
MLIRSCFUtils
MLIRTransformUtils
)
+
+set_source_files_properties(
+ TestParallelLoopUnrolling.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Test/CMakeLists.txt b/mlir/test/lib/Dialect/Test/CMakeLists.txt
index 9354a85d984c9..97e820de0e64a 100644
--- a/mlir/test/lib/Dialect/Test/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Test/CMakeLists.txt
@@ -130,3 +130,16 @@ add_mlir_translation_library(MLIRTestToLLVMIRTranslation
MLIRBuiltinToLLVMIRTranslation
MLIRLLVMToLLVMIRTranslation
)
+
+set_source_files_properties(
+ TestAttributes.cpp
+ TestDialect.cpp
+ TestDialectInterfaces.cpp
+ TestInterfaces.cpp
+ TestOpDefs.cpp
+ TestOps.cpp
+ TestOpsSyntax.cpp
+ TestPatterns.cpp
+ TestTraits.cpp
+ TestTypes.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Transform/CMakeLists.txt b/mlir/test/lib/Dialect/Transform/CMakeLists.txt
index 512a0a89bfea9..5d53235cbaed1 100644
--- a/mlir/test/lib/Dialect/Transform/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Transform/CMakeLists.txt
@@ -26,3 +26,8 @@ mlir_target_link_libraries(MLIRTestTransformDialect PUBLIC
MLIRTransformLoopExtension
MLIRTransformPDLExtension
)
+
+set_source_files_properties(
+ TestTransformDialectInterpreter.cpp
+ TestTransformStateExtension.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index 1abcfc77d2d9b..c060b7621a724 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -44,3 +44,24 @@ target_include_directories(MLIRTestIR
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+
+set_source_files_properties(
+ TestDominance.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ TestBuiltinAttributeInterfaces.cpp
+ TestBuiltinDistinctAttributes.cpp
+ TestBytecodeRoundtrip.cpp
+ TestClone.cpp
+ TestLazyLoading.cpp
+ TestRegions.cpp
+ TestSideEffects.cpp
+ TestSymbolUses.cpp
+ TestTypes.cpp
+ TestVisitorsGeneric.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(
+ TestInterfaces.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt
index 04c91635def85..206add03e338c 100644
--- a/mlir/test/lib/Pass/CMakeLists.txt
+++ b/mlir/test/lib/Pass/CMakeLists.txt
@@ -28,3 +28,7 @@ target_include_directories(MLIRTestPass
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+
+set_source_files_properties(
+ TestPassManager.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index ddc0a779e8f69..6c5b4b3c292b5 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -59,3 +59,12 @@ target_include_directories(MLIRTestTransforms
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+
+set_source_files_properties(
+ TestCommutativityUtils.cpp
+ TestDialectConversion.cpp
+ TestInlining.cpp
+ TestInliningCallback.cpp
+ TestMakeIsolatedFromAbove.cpp
+ TestTransformDialectExtension.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/tools/mlir-tblgen/CMakeLists.txt b/mlir/tools/mlir-tblgen/CMakeLists.txt
index d7087cba3c874..e081590ac871a 100644
--- a/mlir/tools/mlir-tblgen/CMakeLists.txt
+++ b/mlir/tools/mlir-tblgen/CMakeLists.txt
@@ -37,6 +37,29 @@ add_tablegen(mlir-tblgen MLIR
CppGenUtilities.cpp
)
+# Unity build conflicts:
+# - BytecodeDialectGen.cpp/DialectGen.cpp: both define static 'dialectGenCat'
+# - PassGen.cpp/PassCAPIGen.cpp: both define 'passGenCat', 'groupName',
+# 'passGroupRegistrationCode', 'fileHeader'
+# - SPIRVUtilsGen.cpp/TosaUtilsGen.cpp: both define 'Availability' class and
+# related functions in anonymous namespaces
+# - LLVMIRIntrinsicGen.cpp, OpDocGen.cpp, OpPythonBindingGen.cpp, RewriterGen.cpp:
+# 'using namespace llvm;' from other files makes DenseMap, Type, StringSwitch,
+# SetVector ambiguous with mlir::tblgen equivalents
+set_source_files_properties(
+ BytecodeDialectGen.cpp
+ DialectGen.cpp
+ LLVMIRIntrinsicGen.cpp
+ OpDocGen.cpp
+ OpFormatGen.cpp
+ OpPythonBindingGen.cpp
+ PassCAPIGen.cpp
+ PassGen.cpp
+ RewriterGen.cpp
+ SPIRVUtilsGen.cpp
+ TosaUtilsGen.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
target_link_libraries(mlir-tblgen
PRIVATE
MLIRTblgenLib)
diff --git a/mlir/unittests/ExecutionEngine/CMakeLists.txt b/mlir/unittests/ExecutionEngine/CMakeLists.txt
index b83163e39c014..da9f31ce7fa85 100644
--- a/mlir/unittests/ExecutionEngine/CMakeLists.txt
+++ b/mlir/unittests/ExecutionEngine/CMakeLists.txt
@@ -22,3 +22,11 @@ target_link_libraries(MLIRExecutionEngineTests
PRIVATE
MLIRExecutionEngine
)
+
+# These files include CRunnerUtils.h/RunnerUtils.h which defines
+# UnrankedMemRefType that conflicts with mlir::UnrankedMemRefType in unity builds.
+set_source_files_properties(
+ DynamicMemRef.cpp
+ StridedMemRef.cpp
+ Invoke.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/unittests/IR/CMakeLists.txt b/mlir/unittests/IR/CMakeLists.txt
index f5b522bb5cf22..6cc46fb645844 100644
--- a/mlir/unittests/IR/CMakeLists.txt
+++ b/mlir/unittests/IR/CMakeLists.txt
@@ -33,3 +33,10 @@ mlir_target_link_libraries(MLIRIRTests PRIVATE MLIRIR)
target_link_libraries(MLIRIRTests PRIVATE MLIRBytecodeWriter)
target_link_libraries(MLIRIRTests PRIVATE MLIRTestDialect)
target_link_libraries(MLIRIRTests PRIVATE MLIRRemarkStreamer)
+
+set_source_files_properties(
+ AffineMapTest.cpp
+ OpPropertiesTest.cpp
+ TypeAttrNamesTest.cpp
+ ValueTest.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/unittests/Pass/CMakeLists.txt b/mlir/unittests/Pass/CMakeLists.txt
index a47d2eead6180..6c49bc32833fe 100644
--- a/mlir/unittests/Pass/CMakeLists.txt
+++ b/mlir/unittests/Pass/CMakeLists.txt
@@ -8,3 +8,7 @@ mlir_target_link_libraries(MLIRPassTests
MLIRDebug
MLIRFuncDialect
MLIRPass)
+
+set_source_files_properties(
+ PassManagerTest.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
>From 0d3cfd3720a745411c0fff0675f1a3456d9b4d38 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Wed, 18 Mar 2026 22:17:18 -0700
Subject: [PATCH 02/25] undo #undef
---
llvm/include/llvm/ADT/GenericCycleImpl.h | 1 -
llvm/include/llvm/ADT/GenericUniformityImpl.h | 1 -
llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h | 1 -
llvm/include/llvm/Analysis/CGSCCPassManager.h | 1 -
llvm/include/llvm/Analysis/SparsePropagation.h | 1 -
llvm/include/llvm/Support/GenericDomTreeConstruction.h | 1 -
llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h | 1 -
llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h | 1 -
llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h | 1 -
llvm/lib/Analysis/AssumeBundleQueries.cpp | 1 -
llvm/lib/Analysis/BasicAliasAnalysis.cpp | 1 -
llvm/lib/Analysis/BranchProbabilityInfo.cpp | 1 -
llvm/lib/Analysis/CallGraphSCCPass.cpp | 1 -
llvm/lib/Analysis/DXILMetadataAnalysis.cpp | 1 -
llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp | 1 -
llvm/lib/Analysis/InlineCost.cpp | 1 -
llvm/lib/Analysis/InlineOrder.cpp | 1 -
llvm/lib/Analysis/InstCount.cpp | 1 -
llvm/lib/Analysis/InstructionSimplify.cpp | 1 -
llvm/lib/Analysis/MemoryBuiltins.cpp | 1 -
llvm/lib/Analysis/MemoryDependenceAnalysis.cpp | 1 -
llvm/lib/Analysis/MemoryProfileInfo.cpp | 1 -
llvm/lib/Analysis/MemorySSA.cpp | 1 -
llvm/lib/Analysis/RegionPass.cpp | 1 -
llvm/lib/Analysis/ScalarEvolution.cpp | 1 -
llvm/lib/Analysis/ScalarEvolutionDivision.cpp | 1 -
llvm/lib/Analysis/StackLifetime.cpp | 1 -
llvm/lib/Analysis/StackSafetyAnalysis.cpp | 1 -
llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/Combiner.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/Localizer.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 1 -
llvm/lib/CodeGen/GlobalISel/Utils.cpp | 1 -
llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp | 1 -
llvm/lib/CodeGen/LiveRangeShrink.cpp | 1 -
llvm/lib/CodeGen/LiveRegMatrix.cpp | 1 -
llvm/lib/CodeGen/LiveStacks.cpp | 1 -
llvm/lib/CodeGen/LowerEmuTLS.cpp | 1 -
llvm/lib/CodeGen/MIR2Vec.cpp | 1 -
llvm/lib/CodeGen/MIRCanonicalizerPass.cpp | 1 -
llvm/lib/CodeGen/MIRNamerPass.cpp | 1 -
llvm/lib/CodeGen/MIRVRegNamerUtils.cpp | 1 -
llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp | 1 -
llvm/lib/CodeGen/MachineBasicBlock.cpp | 1 -
llvm/lib/CodeGen/MachineBlockPlacement.cpp | 1 -
llvm/lib/CodeGen/MachineCFGPrinter.cpp | 1 -
llvm/lib/CodeGen/MachineCSE.cpp | 1 -
llvm/lib/CodeGen/MachineCheckDebugify.cpp | 1 -
llvm/lib/CodeGen/MachineCombiner.cpp | 1 -
llvm/lib/CodeGen/MachineCopyPropagation.cpp | 1 -
llvm/lib/CodeGen/MachineLICM.cpp | 1 -
llvm/lib/CodeGen/MachinePipeliner.cpp | 1 -
llvm/lib/CodeGen/MachineScheduler.cpp | 1 -
llvm/lib/CodeGen/MachineSink.cpp | 1 -
llvm/lib/CodeGen/MachineStableHash.cpp | 1 -
llvm/lib/CodeGen/MachineStripDebug.cpp | 1 -
llvm/lib/CodeGen/MachineTraceMetrics.cpp | 1 -
llvm/lib/CodeGen/ModuloSchedule.cpp | 1 -
llvm/lib/CodeGen/OptimizePHIs.cpp | 1 -
llvm/lib/CodeGen/PHIElimination.cpp | 1 -
llvm/lib/CodeGen/PeepholeOptimizer.cpp | 1 -
llvm/lib/CodeGen/PostRAHazardRecognizer.cpp | 1 -
llvm/lib/CodeGen/PostRASchedulerList.cpp | 1 -
llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp | 1 -
llvm/lib/CodeGen/ProcessImplicitDefs.cpp | 1 -
llvm/lib/CodeGen/PrologEpilogInserter.cpp | 1 -
llvm/lib/CodeGen/PseudoProbeInserter.cpp | 1 -
llvm/lib/CodeGen/RegAllocBase.cpp | 1 -
llvm/lib/CodeGen/RegAllocScore.cpp | 1 -
llvm/lib/CodeGen/RegisterBank.cpp | 1 -
llvm/lib/CodeGen/RegisterBankInfo.cpp | 1 -
llvm/lib/CodeGen/RegisterClassInfo.cpp | 1 -
llvm/lib/CodeGen/RegisterScavenging.cpp | 1 -
llvm/lib/CodeGen/Rematerializer.cpp | 1 -
llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp | 1 -
llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp | 1 -
llvm/lib/CodeGen/RenameIndependentSubregs.cpp | 1 -
llvm/lib/CodeGen/ReplaceWithVeclib.cpp | 1 -
llvm/lib/CodeGen/ResetMachineFunctionPass.cpp | 1 -
llvm/lib/CodeGen/SafeStackLayout.cpp | 1 -
llvm/lib/CodeGen/ScheduleDAG.cpp | 1 -
llvm/lib/CodeGen/ScheduleDAGInstrs.cpp | 1 -
llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp | 1 -
llvm/lib/CodeGen/SelectOptimize.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 1 -
llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 1 -
llvm/lib/CodeGen/ShrinkWrap.cpp | 1 -
llvm/lib/CodeGen/SjLjEHPrepare.cpp | 1 -
llvm/lib/CodeGen/SlotIndexes.cpp | 1 -
llvm/lib/CodeGen/SpillPlacement.cpp | 1 -
llvm/lib/CodeGen/SplitKit.cpp | 1 -
llvm/lib/CodeGen/StackColoring.cpp | 1 -
llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp | 1 -
llvm/lib/CodeGen/StackProtector.cpp | 1 -
llvm/lib/CodeGen/StackSlotColoring.cpp | 1 -
llvm/lib/CodeGen/StaticDataAnnotator.cpp | 1 -
llvm/lib/CodeGen/StaticDataSplitter.cpp | 1 -
llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 1 -
llvm/lib/CodeGen/TypePromotion.cpp | 1 -
llvm/lib/CodeGen/VLIWMachineScheduler.cpp | 1 -
llvm/lib/CodeGen/WasmEHPrepare.cpp | 1 -
llvm/lib/CodeGen/WinEHPrepare.cpp | 1 -
llvm/lib/CodeGen/WindowScheduler.cpp | 1 -
llvm/lib/CodeGen/WindowsSecureHotPatching.cpp | 1 -
llvm/lib/DebugInfo/BTF/BTFContext.cpp | 1 -
llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp | 1 -
llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp | 1 -
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp | 1 -
.../ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h | 1 -
llvm/lib/IR/ConstantsContext.h | 1 -
llvm/lib/IR/ModuleSummaryIndex.cpp | 1 -
llvm/lib/IR/PassTimingInfo.cpp | 1 -
llvm/lib/IR/VFABIDemangler.cpp | 1 -
llvm/lib/IR/ValueSymbolTable.cpp | 1 -
llvm/lib/MC/MachObjectWriter.cpp | 1 -
llvm/lib/ProfileData/InstrProfCorrelator.cpp | 1 -
llvm/lib/ProfileData/SampleProfReader.cpp | 1 -
llvm/lib/ProfileData/SampleProfWriter.cpp | 1 -
llvm/lib/TableGen/Record.cpp | 1 -
llvm/lib/TargetParser/Host.cpp | 1 -
llvm/lib/Transforms/Coroutines/CoroCleanup.cpp | 1 -
llvm/lib/Transforms/Coroutines/CoroEarly.cpp | 1 -
llvm/lib/Transforms/Coroutines/CoroElide.cpp | 1 -
llvm/lib/Transforms/Coroutines/CoroFrame.cpp | 1 -
llvm/lib/Transforms/Coroutines/CoroSplit.cpp | 1 -
llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp | 1 -
llvm/lib/Transforms/IPO/Annotation2Metadata.cpp | 1 -
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 1 -
llvm/lib/Transforms/IPO/Attributor.cpp | 1 -
llvm/lib/Transforms/IPO/BlockExtractor.cpp | 1 -
llvm/lib/Transforms/IPO/FunctionImport.cpp | 1 -
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp | 1 -
llvm/lib/Transforms/IPO/GlobalDCE.cpp | 1 -
llvm/lib/Transforms/IPO/GlobalOpt.cpp | 1 -
llvm/lib/Transforms/IPO/HotColdSplitting.cpp | 1 -
llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp | 1 -
llvm/lib/Transforms/IPO/Internalize.cpp | 1 -
llvm/lib/Transforms/IPO/LoopExtractor.cpp | 1 -
llvm/lib/Transforms/IPO/LowerTypeTests.cpp | 1 -
llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp | 1 -
llvm/lib/Transforms/IPO/OpenMPOpt.cpp | 1 -
llvm/lib/Transforms/IPO/PartialInlining.cpp | 1 -
llvm/lib/Transforms/IPO/SampleContextTracker.cpp | 1 -
llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp | 1 -
llvm/lib/Transforms/IPO/SampleProfileProbe.cpp | 1 -
llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp | 1 -
llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | 1 -
llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp | 1 -
llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp | 1 -
llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp | 1 -
llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp | 1 -
llvm/lib/Transforms/ObjCARC/PtrState.cpp | 1 -
llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp | 1 -
llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp | 1 -
llvm/lib/Transforms/Scalar/BDCE.cpp | 1 -
llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp | 1 -
llvm/lib/Transforms/Scalar/ConstantHoisting.cpp | 1 -
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp | 1 -
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp | 1 -
llvm/lib/Transforms/Scalar/DCE.cpp | 1 -
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 1 -
llvm/lib/Transforms/Scalar/DivRemPairs.cpp | 1 -
llvm/lib/Transforms/Scalar/EarlyCSE.cpp | 1 -
llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp | 1 -
llvm/lib/Transforms/Scalar/Float2Int.cpp | 1 -
llvm/lib/Transforms/Scalar/GVN.cpp | 1 -
llvm/lib/Transforms/Scalar/GVNHoist.cpp | 1 -
llvm/lib/Transforms/Scalar/GVNSink.cpp | 1 -
llvm/lib/Transforms/Scalar/GuardWidening.cpp | 1 -
llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp | 1 -
llvm/lib/Transforms/Scalar/IndVarSimplify.cpp | 1 -
llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp | 1 -
llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp | 1 -
llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp | 1 -
llvm/lib/Transforms/Scalar/JumpThreading.cpp | 1 -
llvm/lib/Transforms/Scalar/LICM.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopDeletion.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopDistribute.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopFlatten.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopFuse.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopInterchange.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopPredication.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopRotation.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopSink.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopTermFold.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp | 1 -
llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp | 1 -
llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp | 1 -
llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp | 1 -
llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp | 1 -
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp | 1 -
llvm/lib/Transforms/Scalar/MergeICmps.cpp | 1 -
llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 1 -
llvm/lib/Transforms/Scalar/NewGVN.cpp | 1 -
llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp | 1 -
llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 1 -
llvm/lib/Transforms/Scalar/Reassociate.cpp | 1 -
llvm/lib/Transforms/Scalar/Reg2Mem.cpp | 1 -
llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp | 1 -
llvm/lib/Transforms/Scalar/SCCP.cpp | 1 -
llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp | 1 -
llvm/lib/Transforms/Scalar/Scalarizer.cpp | 1 -
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | 1 -
llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp | 1 -
llvm/lib/Transforms/Scalar/Sink.cpp | 1 -
llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp | 1 -
llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 1 -
llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp | 1 -
llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp | 1 -
llvm/lib/Transforms/Utils/CloneFunction.cpp | 1 -
llvm/lib/Transforms/Utils/CodeLayout.cpp | 1 -
llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp | 1 -
llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp | 1 -
llvm/lib/Transforms/Utils/LoopUtils.cpp | 1 -
llvm/lib/Transforms/Utils/LoopVersioning.cpp | 1 -
llvm/lib/Transforms/Utils/LowerAtomic.cpp | 1 -
llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp | 1 -
llvm/lib/Transforms/Utils/LowerInvoke.cpp | 1 -
llvm/lib/Transforms/Utils/LowerSwitch.cpp | 1 -
llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp | 1 -
llvm/lib/Transforms/Utils/Mem2Reg.cpp | 1 -
llvm/lib/Transforms/Utils/ModuleUtils.cpp | 1 -
llvm/lib/Transforms/Utils/MoveAutoInit.cpp | 1 -
llvm/lib/Transforms/Utils/PredicateInfo.cpp | 1 -
llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | 1 -
llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp | 1 -
llvm/lib/Transforms/Utils/SampleProfileInference.cpp | 1 -
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp | 1 -
llvm/lib/Transforms/Utils/SplitModule.cpp | 1 -
llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp | 1 -
llvm/lib/Transforms/Utils/SymbolRewriter.cpp | 1 -
llvm/lib/Transforms/Utils/VNCoercion.cpp | 1 -
llvm/lib/Transforms/Utils/ValueMapper.cpp | 1 -
llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp | 1 -
llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | 1 -
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 1 -
llvm/lib/Transforms/Vectorize/VPlanSLP.cpp | 1 -
llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp | 1 -
llvm/lib/Transforms/Vectorize/VectorCombine.cpp | 1 -
llvm/utils/TableGen/AsmWriterEmitter.cpp | 1 -
llvm/utils/TableGen/CTagsEmitter.cpp | 1 -
llvm/utils/TableGen/CompressInstEmitter.cpp | 1 -
llvm/utils/TableGen/DAGISelEmitter.cpp | 1 -
llvm/utils/TableGen/DAGISelMatcherOpt.cpp | 1 -
llvm/utils/TableGen/DecoderEmitter.cpp | 1 -
llvm/utils/TableGen/ExegesisEmitter.cpp | 1 -
llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp | 1 -
llvm/utils/TableGen/GlobalISelEmitter.cpp | 1 -
llvm/utils/TableGen/PseudoLoweringEmitter.cpp | 1 -
llvm/utils/TableGen/RegisterBankEmitter.cpp | 1 -
llvm/utils/TableGen/SubtargetEmitter.cpp | 1 -
mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp | 1 -
mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp | 1 -
mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp | 1 -
mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp | 1 -
mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp | 1 -
mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp | 1 -
mlir/lib/Analysis/FlatLinearValueConstraints.cpp | 1 -
mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp | 1 -
mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp | 1 -
mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp | 1 -
mlir/lib/Dialect/Affine/Analysis/Utils.cpp | 1 -
.../Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp | 1 -
mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp | 1 -
mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp | 1 -
mlir/lib/Dialect/Affine/Utils/Utils.cpp | 1 -
mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp | 1 -
mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp | 1 -
mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp | 1 -
mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp | 1 -
mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp | 1 -
.../Bufferization/Transforms/OptimizeAllocationLiveness.cpp | 1 -
mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Padding.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp | 1 -
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp | 1 -
mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp | 1 -
mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp | 1 -
mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp | 1 -
.../Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp | 1 -
.../OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp | 1 -
mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp | 1 -
mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp | 1 -
mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp | 1 -
mlir/lib/Dialect/SCF/Utils/Utils.cpp | 1 -
mlir/lib/Dialect/Transform/IR/Utils.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp | 1 -
.../Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp | 1 -
.../lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp | 1 -
.../Vector/Transforms/VectorTransferSplitRewritePatterns.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp | 1 -
mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp | 1 -
mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp | 1 -
mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp | 1 -
.../XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp | 1 -
mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp | 1 -
mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp | 1 -
mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp | 1 -
mlir/lib/IR/Dialect.cpp | 1 -
mlir/lib/Support/TypeID.cpp | 1 -
mlir/lib/TableGen/Pattern.cpp | 1 -
mlir/lib/Transforms/RemoveDeadValues.cpp | 1 -
mlir/lib/Transforms/SROA.cpp | 1 -
mlir/lib/Transforms/Utils/DialectConversion.cpp | 1 -
mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp | 1 -
mlir/lib/Transforms/Utils/Inliner.cpp | 1 -
mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp | 1 -
mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp | 1 -
mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp | 1 -
mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp | 1 -
381 files changed, 381 deletions(-)
diff --git a/llvm/include/llvm/ADT/GenericCycleImpl.h b/llvm/include/llvm/ADT/GenericCycleImpl.h
index d04e6df2ab195..1a28fb1cef921 100644
--- a/llvm/include/llvm/ADT/GenericCycleImpl.h
+++ b/llvm/include/llvm/ADT/GenericCycleImpl.h
@@ -28,7 +28,6 @@
#include "llvm/ADT/GenericCycleInfo.h"
#include "llvm/ADT/StringExtras.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "generic-cycle-impl"
namespace llvm {
diff --git a/llvm/include/llvm/ADT/GenericUniformityImpl.h b/llvm/include/llvm/ADT/GenericUniformityImpl.h
index b65c260442d2f..6089f69b393bd 100644
--- a/llvm/include/llvm/ADT/GenericUniformityImpl.h
+++ b/llvm/include/llvm/ADT/GenericUniformityImpl.h
@@ -53,7 +53,6 @@
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "uniformity"
namespace llvm {
diff --git a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
index aa9a009548166..54f4e70bf2f84 100644
--- a/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
+++ b/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h
@@ -49,7 +49,6 @@
#include <utility>
#include <vector>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "block-freq"
namespace llvm {
diff --git a/llvm/include/llvm/Analysis/CGSCCPassManager.h b/llvm/include/llvm/Analysis/CGSCCPassManager.h
index 7c357a259c5dd..87cfd9e6064e9 100644
--- a/llvm/include/llvm/Analysis/CGSCCPassManager.h
+++ b/llvm/include/llvm/Analysis/CGSCCPassManager.h
@@ -106,7 +106,6 @@ struct CGSCCUpdateResult;
class Module;
// Allow debug logging in this inline function.
-#undef DEBUG_TYPE
#define DEBUG_TYPE "cgscc"
/// Extern template declaration for the analysis set for this IR unit.
diff --git a/llvm/include/llvm/Analysis/SparsePropagation.h b/llvm/include/llvm/Analysis/SparsePropagation.h
index 1cf08d41c0ca6..f8a940ae357a1 100644
--- a/llvm/include/llvm/Analysis/SparsePropagation.h
+++ b/llvm/include/llvm/Analysis/SparsePropagation.h
@@ -20,7 +20,6 @@
#include "llvm/Support/Debug.h"
#include <set>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sparseprop"
namespace llvm {
diff --git a/llvm/include/llvm/Support/GenericDomTreeConstruction.h b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
index 62f110ed276f3..511c28400e347 100644
--- a/llvm/include/llvm/Support/GenericDomTreeConstruction.h
+++ b/llvm/include/llvm/Support/GenericDomTreeConstruction.h
@@ -46,7 +46,6 @@
#include <optional>
#include <queue>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dom-tree-builder"
namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
index 240891839286e..c4aedbf3159db 100644
--- a/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SSAUpdaterImpl.h
@@ -21,7 +21,6 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "ssaupdater"
namespace llvm {
diff --git a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
index c14962ce174e4..bcd33ac07ad8c 100644
--- a/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
+++ b/llvm/include/llvm/Transforms/Utils/SampleProfileLoaderBaseImpl.h
@@ -53,7 +53,6 @@ namespace vfs {
class FileSystem;
} // namespace vfs
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-profile-impl"
namespace afdo_detail {
diff --git a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h
index ae78ad597d2dd..85b25c0249e7d 100644
--- a/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h
+++ b/llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h
@@ -15,7 +15,6 @@
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sandbox-vectorizer"
#define DEBUG_PREFIX "SBVec: "
diff --git a/llvm/lib/Analysis/AssumeBundleQueries.cpp b/llvm/lib/Analysis/AssumeBundleQueries.cpp
index 21634914ff601..aa1cb3c26d63f 100644
--- a/llvm/lib/Analysis/AssumeBundleQueries.cpp
+++ b/llvm/lib/Analysis/AssumeBundleQueries.cpp
@@ -16,7 +16,6 @@
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/DebugCounter.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "assume-queries"
using namespace llvm;
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index 4dfe08f4c3f30..80b14646c8889 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -61,7 +61,6 @@
#include <optional>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "basicaa"
using namespace llvm;
diff --git a/llvm/lib/Analysis/BranchProbabilityInfo.cpp b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
index 7b6c6e2d407de..490bfbc0fb7ca 100644
--- a/llvm/lib/Analysis/BranchProbabilityInfo.cpp
+++ b/llvm/lib/Analysis/BranchProbabilityInfo.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "branch-prob"
static cl::opt<bool> PrintBranchProb(
diff --git a/llvm/lib/Analysis/CallGraphSCCPass.cpp b/llvm/lib/Analysis/CallGraphSCCPass.cpp
index 54db44b4edfa1..1228d5b4b78be 100644
--- a/llvm/lib/Analysis/CallGraphSCCPass.cpp
+++ b/llvm/lib/Analysis/CallGraphSCCPass.cpp
@@ -41,7 +41,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "cgscc-passmgr"
namespace llvm {
diff --git a/llvm/lib/Analysis/DXILMetadataAnalysis.cpp b/llvm/lib/Analysis/DXILMetadataAnalysis.cpp
index 822c37ff023ad..bd77cba385667 100644
--- a/llvm/lib/Analysis/DXILMetadataAnalysis.cpp
+++ b/llvm/lib/Analysis/DXILMetadataAnalysis.cpp
@@ -17,7 +17,6 @@
#include "llvm/InitializePasses.h"
#include "llvm/Support/ErrorHandling.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dxil-metadata-analysis"
using namespace llvm;
diff --git a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
index 76b5b2146d394..4a66d8835281a 100644
--- a/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
+++ b/llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp
@@ -27,7 +27,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "func-properties-stats"
#define FUNCTION_PROPERTY(Name, Description) STATISTIC(Num##Name, Description);
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index c0b3f85afff52..d674743669ba6 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -52,7 +52,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "inline-cost"
STATISTIC(NumCallsAnalyzed, "Number of call sites analyzed");
diff --git a/llvm/lib/Analysis/InlineOrder.cpp b/llvm/lib/Analysis/InlineOrder.cpp
index ee475e3e56966..8d920153f250d 100644
--- a/llvm/lib/Analysis/InlineOrder.cpp
+++ b/llvm/lib/Analysis/InlineOrder.cpp
@@ -20,7 +20,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "inline-order"
enum class InlinePriorityMode : int { Size, Cost, CostBenefit, ML };
diff --git a/llvm/lib/Analysis/InstCount.cpp b/llvm/lib/Analysis/InstCount.cpp
index fe522e56ecc83..7a797767f97cb 100644
--- a/llvm/lib/Analysis/InstCount.cpp
+++ b/llvm/lib/Analysis/InstCount.cpp
@@ -19,7 +19,6 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "instcount"
STATISTIC(TotalInsts, "Number of instructions (of all types)");
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 20e7c6527c106..12c3edc0ced30 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -52,7 +52,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "instsimplify"
enum { RecursionLimit = 3 };
diff --git a/llvm/lib/Analysis/MemoryBuiltins.cpp b/llvm/lib/Analysis/MemoryBuiltins.cpp
index df33887eb0e6b..c7f89de9f8b11 100644
--- a/llvm/lib/Analysis/MemoryBuiltins.cpp
+++ b/llvm/lib/Analysis/MemoryBuiltins.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memory-builtins"
static cl::opt<unsigned> ObjectSizeOffsetVisitorMaxVisitInstructions(
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 9bedf46d6060b..9a022d9ed09ce 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -54,7 +54,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memdep"
STATISTIC(NumCacheNonLocal, "Number of fully cached non-local responses");
diff --git a/llvm/lib/Analysis/MemoryProfileInfo.cpp b/llvm/lib/Analysis/MemoryProfileInfo.cpp
index 5145097c0dbc0..27d741f310914 100644
--- a/llvm/lib/Analysis/MemoryProfileInfo.cpp
+++ b/llvm/lib/Analysis/MemoryProfileInfo.cpp
@@ -20,7 +20,6 @@
using namespace llvm;
using namespace llvm::memprof;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memory-profile-info"
namespace llvm {
diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp
index b72000420f849..62c351499c3fc 100644
--- a/llvm/lib/Analysis/MemorySSA.cpp
+++ b/llvm/lib/Analysis/MemorySSA.cpp
@@ -58,7 +58,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memoryssa"
static cl::opt<std::string>
diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp
index 23ada499f16ca..ae1d84659de86 100644
--- a/llvm/lib/Analysis/RegionPass.cpp
+++ b/llvm/lib/Analysis/RegionPass.cpp
@@ -24,7 +24,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regionpassmgr"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index b8c9631b7ab37..d99488121baba 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -135,7 +135,6 @@ using namespace llvm;
using namespace PatternMatch;
using namespace SCEVPatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "scalar-evolution"
STATISTIC(NumExitCountsComputed,
diff --git a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
index 33da5087b4078..710473191f8c6 100644
--- a/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
+++ b/llvm/lib/Analysis/ScalarEvolutionDivision.cpp
@@ -21,7 +21,6 @@
#include <cassert>
#include <cstdint>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "scev-division"
namespace llvm {
diff --git a/llvm/lib/Analysis/StackLifetime.cpp b/llvm/lib/Analysis/StackLifetime.cpp
index ec88db561d2cf..30e0316b882cc 100644
--- a/llvm/lib/Analysis/StackLifetime.cpp
+++ b/llvm/lib/Analysis/StackLifetime.cpp
@@ -29,7 +29,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-lifetime"
const StackLifetime::LiveRange &
diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
index abbccc79a0b89..fbe74d21c7199 100644
--- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp
+++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
@@ -34,7 +34,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-safety"
STATISTIC(NumAllocaStackSafe, "Number of safe allocas");
diff --git a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
index a8abeba34c3c2..aff6a76879062 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp
@@ -29,7 +29,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dwarfdebug"
namespace {
diff --git a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
index e3b2a086e5426..4775dd6c8be31 100644
--- a/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
@@ -25,7 +25,6 @@
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "call-lowering"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
index 829e396161c6e..81b79f36f95fb 100644
--- a/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Combiner.cpp
@@ -24,7 +24,6 @@
#include "llvm/CodeGen/MachineOptimizationRemarkEmitter.h"
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gi-combiner"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp b/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp
index 49555a48a8401..1edfc09310554 100644
--- a/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GIMatchTableExecutor.cpp
@@ -17,7 +17,6 @@
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gi-match-table-executor"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
index 6f0639bd1cf13..b8613aabe7fd1 100644
--- a/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
@@ -39,7 +39,6 @@
#include "llvm/Support/KnownFPClass.h"
#include "llvm/Target/TargetMachine.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gisel-known-bits"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index 9098baa352846..c1d8de3778177 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -90,7 +90,6 @@
#include <utility>
#include <vector>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "irtranslator"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp b/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
index ca2b45d9b4154..6481d0e180352 100644
--- a/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp
@@ -19,7 +19,6 @@
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/IR/Module.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "inline-asm-lowering"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
index 8b98e4fbc9efa..5fb31a04e5fd0 100644
--- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
@@ -35,7 +35,6 @@
#include "llvm/Support/DebugCounter.h"
#include "llvm/Target/TargetMachine.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "instruction-select"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
index bb9834d455cf7..c2d474fdde696 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
@@ -27,7 +27,6 @@
using namespace llvm;
using namespace LegalizeActions;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "legalizer-info"
cl::opt<bool> llvm::DisableGISelLegalityCheck(
diff --git a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
index 2085132c5434f..1dbba820b3dea 100644
--- a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
@@ -37,7 +37,6 @@
#include "llvm/Support/ErrorHandling.h"
#include <algorithm>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loadstore-opt"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/Localizer.cpp b/llvm/lib/CodeGen/GlobalISel/Localizer.cpp
index 16fffba5b8423..77ca27bcc43e2 100644
--- a/llvm/lib/CodeGen/GlobalISel/Localizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Localizer.cpp
@@ -20,7 +20,6 @@
#include "llvm/InitializePasses.h"
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "localizer"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
index 9fbd20c0aa26f..4dfd5179a4e56 100644
--- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -47,7 +47,6 @@
#include <memory>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regbankselect"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/GlobalISel/Utils.cpp b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
index 7593780308673..d019633369163 100644
--- a/llvm/lib/CodeGen/GlobalISel/Utils.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Utils.cpp
@@ -38,7 +38,6 @@
#include <numeric>
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "globalisel-utils"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
index cc9bce8dc42e2..27fbed36cf1de 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp
@@ -34,7 +34,6 @@
/// user to pick which implementation will be used to propagate variable
/// locations.
-#undef DEBUG_TYPE
#define DEBUG_TYPE "livedebugvalues"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/LiveRangeShrink.cpp b/llvm/lib/CodeGen/LiveRangeShrink.cpp
index 42dce5c2cfe8f..3e4725eb0dbe6 100644
--- a/llvm/lib/CodeGen/LiveRangeShrink.cpp
+++ b/llvm/lib/CodeGen/LiveRangeShrink.cpp
@@ -33,7 +33,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lrshrink"
STATISTIC(NumInstrsHoistedToShrinkLiveRange,
diff --git a/llvm/lib/CodeGen/LiveRegMatrix.cpp b/llvm/lib/CodeGen/LiveRegMatrix.cpp
index e8ffcc909a9be..67076959b2bce 100644
--- a/llvm/lib/CodeGen/LiveRegMatrix.cpp
+++ b/llvm/lib/CodeGen/LiveRegMatrix.cpp
@@ -32,7 +32,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
STATISTIC(NumAssigned , "Number of registers assigned");
diff --git a/llvm/lib/CodeGen/LiveStacks.cpp b/llvm/lib/CodeGen/LiveStacks.cpp
index 9de7e138f5404..c07d985a09d1f 100644
--- a/llvm/lib/CodeGen/LiveStacks.cpp
+++ b/llvm/lib/CodeGen/LiveStacks.cpp
@@ -18,7 +18,6 @@
#include "llvm/IR/Function.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "livestacks"
char LiveStacksWrapperLegacy::ID = 0;
diff --git a/llvm/lib/CodeGen/LowerEmuTLS.cpp b/llvm/lib/CodeGen/LowerEmuTLS.cpp
index ed05414108570..3bcf1fad53a42 100644
--- a/llvm/lib/CodeGen/LowerEmuTLS.cpp
+++ b/llvm/lib/CodeGen/LowerEmuTLS.cpp
@@ -28,7 +28,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-emutls"
namespace {
diff --git a/llvm/lib/CodeGen/MIR2Vec.cpp b/llvm/lib/CodeGen/MIR2Vec.cpp
index 7ca30af58a212..42e299834b77b 100644
--- a/llvm/lib/CodeGen/MIR2Vec.cpp
+++ b/llvm/lib/CodeGen/MIR2Vec.cpp
@@ -25,7 +25,6 @@
using namespace llvm;
using namespace mir2vec;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mir2vec"
STATISTIC(MIRVocabMissCounter,
diff --git a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
index 5b02ca5248502..3f954da8ef319 100644
--- a/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
+++ b/llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
@@ -35,7 +35,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-canonicalizer"
static cl::opt<unsigned>
diff --git a/llvm/lib/CodeGen/MIRNamerPass.cpp b/llvm/lib/CodeGen/MIRNamerPass.cpp
index 3f5192e0796d9..cbf8867d569cb 100644
--- a/llvm/lib/CodeGen/MIRNamerPass.cpp
+++ b/llvm/lib/CodeGen/MIRNamerPass.cpp
@@ -23,7 +23,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-namer"
namespace {
diff --git a/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp b/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
index 7cd3dbe35fe46..c6b5a445f6e3d 100644
--- a/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
+++ b/llvm/lib/CodeGen/MIRVRegNamerUtils.cpp
@@ -13,7 +13,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-vregnamer-utils"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
index ee5fadc0b75fb..2f2ee6f535f40 100644
--- a/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
+++ b/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
@@ -46,7 +46,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "ml-regalloc"
// Generated header in release (AOT) mode
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 525cdc48e6a54..ad0742bf49292 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp
@@ -40,7 +40,6 @@
#include <cmath>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "codegen"
static cl::opt<bool> PrintSlotIndexes(
diff --git a/llvm/lib/CodeGen/MachineBlockPlacement.cpp b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
index 24fd1f88ea02c..08acf4e716c7c 100644
--- a/llvm/lib/CodeGen/MachineBlockPlacement.cpp
+++ b/llvm/lib/CodeGen/MachineBlockPlacement.cpp
@@ -76,7 +76,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "block-placement"
STATISTIC(NumCondBranches, "Number of conditional branches");
diff --git a/llvm/lib/CodeGen/MachineCFGPrinter.cpp b/llvm/lib/CodeGen/MachineCFGPrinter.cpp
index 5acdecceceb61..19f9297600e34 100644
--- a/llvm/lib/CodeGen/MachineCFGPrinter.cpp
+++ b/llvm/lib/CodeGen/MachineCFGPrinter.cpp
@@ -22,7 +22,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dot-machine-cfg"
static cl::opt<std::string>
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index d469f8584e190..67ecb80bc3ee0 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-cse"
STATISTIC(NumCoalesces, "Number of copies coalesced");
diff --git a/llvm/lib/CodeGen/MachineCheckDebugify.cpp b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
index c7d2f4aaa92d2..9b703d5401cb9 100644
--- a/llvm/lib/CodeGen/MachineCheckDebugify.cpp
+++ b/llvm/lib/CodeGen/MachineCheckDebugify.cpp
@@ -22,7 +22,6 @@
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-check-debugify"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineCombiner.cpp b/llvm/lib/CodeGen/MachineCombiner.cpp
index ea21666e91605..b86e70f265786 100644
--- a/llvm/lib/CodeGen/MachineCombiner.cpp
+++ b/llvm/lib/CodeGen/MachineCombiner.cpp
@@ -34,7 +34,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-combiner"
STATISTIC(NumInstCombined, "Number of machineinst combined");
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 77aa5ecf05200..58ff6f77830b3 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -77,7 +77,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-cp"
STATISTIC(NumDeletes, "Number of dead copies deleted");
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index b43d0158ba840..53fbd3bec76cd 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -55,7 +55,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machinelicm"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 2dcc0cf1a693a..43bb19bf4f181 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -98,7 +98,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pipeliner"
STATISTIC(NumTrytoPipeline, "Number of loops that we attempt to pipeline");
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 52be6d2f594f1..482dea0ca0626 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -73,7 +73,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-scheduler"
STATISTIC(NumInstrsInSourceOrderPreRA,
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index e39a4360ad5f6..ffb2c507e2294 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -68,7 +68,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-sink"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/MachineStableHash.cpp b/llvm/lib/CodeGen/MachineStableHash.cpp
index b0479ed4c752f..2f5f5aeccb2e4 100644
--- a/llvm/lib/CodeGen/MachineStableHash.cpp
+++ b/llvm/lib/CodeGen/MachineStableHash.cpp
@@ -33,7 +33,6 @@
#include "llvm/Support/Alignment.h"
#include "llvm/Support/ErrorHandling.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-stable-hash"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineStripDebug.cpp b/llvm/lib/CodeGen/MachineStripDebug.cpp
index cfe2c4147a4f7..d54fe023a4a7e 100644
--- a/llvm/lib/CodeGen/MachineStripDebug.cpp
+++ b/llvm/lib/CodeGen/MachineStripDebug.cpp
@@ -18,7 +18,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Transforms/Utils/Debugify.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mir-strip-debug"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/MachineTraceMetrics.cpp b/llvm/lib/CodeGen/MachineTraceMetrics.cpp
index ea6c35dffa010..81dd68a519e76 100644
--- a/llvm/lib/CodeGen/MachineTraceMetrics.cpp
+++ b/llvm/lib/CodeGen/MachineTraceMetrics.cpp
@@ -34,7 +34,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-trace-metrics"
AnalysisKey MachineTraceMetricsAnalysis::Key;
diff --git a/llvm/lib/CodeGen/ModuloSchedule.cpp b/llvm/lib/CodeGen/ModuloSchedule.cpp
index 9bcee43e9f5f9..36db54cc516e7 100644
--- a/llvm/lib/CodeGen/ModuloSchedule.cpp
+++ b/llvm/lib/CodeGen/ModuloSchedule.cpp
@@ -20,7 +20,6 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pipeliner"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/OptimizePHIs.cpp b/llvm/lib/CodeGen/OptimizePHIs.cpp
index 12f8f5f75138c..c27f2c4cc577c 100644
--- a/llvm/lib/CodeGen/OptimizePHIs.cpp
+++ b/llvm/lib/CodeGen/OptimizePHIs.cpp
@@ -26,7 +26,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "opt-phis"
STATISTIC(NumPHICycles, "Number of PHI cycles replaced");
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp
index d373b9e93404b..1b44cee10af99 100644
--- a/llvm/lib/CodeGen/PHIElimination.cpp
+++ b/llvm/lib/CodeGen/PHIElimination.cpp
@@ -50,7 +50,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "phi-node-elimination"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index dd63b4ad617dd..73aecda4e522c 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -100,7 +100,6 @@ using namespace llvm;
using RegSubRegPair = TargetInstrInfo::RegSubRegPair;
using RegSubRegPairAndIdx = TargetInstrInfo::RegSubRegPairAndIdx;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "peephole-opt"
// Optimize Extensions
diff --git a/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp b/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
index d076ba7da8309..906eea29f1a15 100644
--- a/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
+++ b/llvm/lib/CodeGen/PostRAHazardRecognizer.cpp
@@ -37,7 +37,6 @@
#include "llvm/Pass.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "post-RA-hazard-rec"
STATISTIC(NumNoops, "Number of noops inserted");
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index c2f120b285834..06e5b18c19301 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -43,7 +43,6 @@
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "post-RA-sched"
STATISTIC(NumNoops, "Number of noops inserted");
diff --git a/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp b/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
index 5adf497c43c13..9ae3f4e866b42 100644
--- a/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp
@@ -45,7 +45,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pre-isel-intrinsic-lowering"
/// Threshold to leave statically sized memory intrinsic calls. Calls of known
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
index 3db6aafa4439d..6b58b6574f5bd 100644
--- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp
@@ -22,7 +22,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "processimpdefs"
namespace {
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index d4b5ae45a52f3..68fd54cf00146 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -67,7 +67,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "prologepilog"
using MBBVector = SmallVector<MachineBasicBlock *, 4>;
diff --git a/llvm/lib/CodeGen/PseudoProbeInserter.cpp b/llvm/lib/CodeGen/PseudoProbeInserter.cpp
index e6feac2137332..521792a591a86 100644
--- a/llvm/lib/CodeGen/PseudoProbeInserter.cpp
+++ b/llvm/lib/CodeGen/PseudoProbeInserter.cpp
@@ -23,7 +23,6 @@
#include "llvm/InitializePasses.h"
#include "llvm/ProfileData/SampleProf.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pseudo-probe-inserter"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp
index a660d8b6b7490..9ba6007fc1cb9 100644
--- a/llvm/lib/CodeGen/RegAllocBase.cpp
+++ b/llvm/lib/CodeGen/RegAllocBase.cpp
@@ -35,7 +35,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
STATISTIC(NumNewQueued, "Number of new live ranges queued");
diff --git a/llvm/lib/CodeGen/RegAllocScore.cpp b/llvm/lib/CodeGen/RegAllocScore.cpp
index e9ebc6d360120..280946bb0d0b3 100644
--- a/llvm/lib/CodeGen/RegAllocScore.cpp
+++ b/llvm/lib/CodeGen/RegAllocScore.cpp
@@ -37,7 +37,6 @@ LLVM_ABI cl::opt<double> ExpensiveRematWeight("regalloc-expensive-remat-weight",
cl::init(1.0), cl::Hidden);
} // end namespace llvm
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc-score"
RegAllocScore &RegAllocScore::operator+=(const RegAllocScore &Other) {
diff --git a/llvm/lib/CodeGen/RegisterBank.cpp b/llvm/lib/CodeGen/RegisterBank.cpp
index 94c5418e68451..bdc6df78fd3d9 100644
--- a/llvm/lib/CodeGen/RegisterBank.cpp
+++ b/llvm/lib/CodeGen/RegisterBank.cpp
@@ -16,7 +16,6 @@
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "registerbank"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RegisterBankInfo.cpp b/llvm/lib/CodeGen/RegisterBankInfo.cpp
index 2eeb0e61ff7c2..79b3c73ea34f1 100644
--- a/llvm/lib/CodeGen/RegisterBankInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterBankInfo.cpp
@@ -26,7 +26,6 @@
#include <algorithm> // For std::max.
-#undef DEBUG_TYPE
#define DEBUG_TYPE "registerbankinfo"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RegisterClassInfo.cpp b/llvm/lib/CodeGen/RegisterClassInfo.cpp
index 96d26284f6d6f..acf306f32dd1d 100644
--- a/llvm/lib/CodeGen/RegisterClassInfo.cpp
+++ b/llvm/lib/CodeGen/RegisterClassInfo.cpp
@@ -31,7 +31,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
static cl::opt<unsigned>
diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp
index e553ea868874a..bcac08ba322a8 100644
--- a/llvm/lib/CodeGen/RegisterScavenging.cpp
+++ b/llvm/lib/CodeGen/RegisterScavenging.cpp
@@ -43,7 +43,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "reg-scavenging"
STATISTIC(NumScavengedRegs, "Number of frame index regs scavenged");
diff --git a/llvm/lib/CodeGen/Rematerializer.cpp b/llvm/lib/CodeGen/Rematerializer.cpp
index 631a069b58a33..1c28c8afc52eb 100644
--- a/llvm/lib/CodeGen/Rematerializer.cpp
+++ b/llvm/lib/CodeGen/Rematerializer.cpp
@@ -25,7 +25,6 @@
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "rematerializer"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp b/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp
index e0c7dcce831a8..98d531c9982a0 100644
--- a/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp
+++ b/llvm/lib/CodeGen/RemoveLoadsIntoFakeUses.cpp
@@ -38,7 +38,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "remove-loads-into-fake-uses"
STATISTIC(NumLoadsDeleted, "Number of dead load instructions deleted");
diff --git a/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp b/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
index f3cfa4a09cd4b..11468245f8400 100644
--- a/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
+++ b/llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp
@@ -25,7 +25,6 @@
/// The RemoveRedundantDebugValues pass removes redundant DBG_VALUEs that
/// appear in MIR after the register allocator.
-#undef DEBUG_TYPE
#define DEBUG_TYPE "removeredundantdebugvalues"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/RenameIndependentSubregs.cpp b/llvm/lib/CodeGen/RenameIndependentSubregs.cpp
index 61758a3315ebd..2482a0da1e0fe 100644
--- a/llvm/lib/CodeGen/RenameIndependentSubregs.cpp
+++ b/llvm/lib/CodeGen/RenameIndependentSubregs.cpp
@@ -40,7 +40,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "rename-independent-subregs"
namespace {
diff --git a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
index 85047703a21fe..407d6d503cb10 100644
--- a/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
+++ b/llvm/lib/CodeGen/ReplaceWithVeclib.cpp
@@ -32,7 +32,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "replace-with-veclib"
STATISTIC(NumCallsReplaced,
diff --git a/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp b/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
index 0d29f168016ac..14c3cc2ebe354 100644
--- a/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
+++ b/llvm/lib/CodeGen/ResetMachineFunctionPass.cpp
@@ -25,7 +25,6 @@
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "reset-machine-function"
STATISTIC(NumFunctionsReset, "Number of functions reset");
diff --git a/llvm/lib/CodeGen/SafeStackLayout.cpp b/llvm/lib/CodeGen/SafeStackLayout.cpp
index 38b89e75f0002..f821145f4b63d 100644
--- a/llvm/lib/CodeGen/SafeStackLayout.cpp
+++ b/llvm/lib/CodeGen/SafeStackLayout.cpp
@@ -18,7 +18,6 @@
using namespace llvm;
using namespace llvm::safestack;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "safestacklayout"
static cl::opt<bool> ClLayout("safe-stack-layout",
diff --git a/llvm/lib/CodeGen/ScheduleDAG.cpp b/llvm/lib/CodeGen/ScheduleDAG.cpp
index 5501dfe85dffd..e630b80e33ab4 100644
--- a/llvm/lib/CodeGen/ScheduleDAG.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAG.cpp
@@ -35,7 +35,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pre-RA-sched"
STATISTIC(NumNewPredsAdded, "Number of times a single predecessor was added");
diff --git a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
index 23a1c4732ea43..9662511e584c0 100644
--- a/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
+++ b/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp
@@ -60,7 +60,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-scheduler"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp b/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
index 21ec70690194c..209c6d81f6020 100644
--- a/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
+++ b/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp
@@ -25,7 +25,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE DebugType
ScoreboardHazardRecognizer::ScoreboardHazardRecognizer(
diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp
index 0d6739b1717d0..4c6a20910f9af 100644
--- a/llvm/lib/CodeGen/SelectOptimize.cpp
+++ b/llvm/lib/CodeGen/SelectOptimize.cpp
@@ -44,7 +44,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "select-optimize"
STATISTIC(NumSelectOptAnalyzed,
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 4b88c003dfa05..9774f2c721d1f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -110,7 +110,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "isel"
STATISTIC(NumFastIselSuccessIndependent, "Number of insts selected by "
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
index 647892ccd9e73..b0e7ae4f9e845 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
@@ -39,7 +39,6 @@
#include <algorithm>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "function-lowering-info"
/// isUsedOutsideOfDefiningBlock - Return true if this instruction is used by
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index 016a489b85e35..322766dee5aa9 100644
--- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -31,7 +31,6 @@
#include "llvm/Target/TargetMachine.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "instr-emitter"
/// MinRCSize - Smallest register class we allow when constraining virtual
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index c7e5d85384001..a4e4a5ee640f6 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -56,7 +56,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "legalizedag"
namespace {
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 3013ed59a4821..25f4f75eaedea 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -24,7 +24,6 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "legalize-types"
/// GetFPLibCall - Return the right libcall for the given floating point type.
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index 90d56fe36ede7..2409a1f31e26e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "legalizevectorops"
namespace {
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
index 801cff5e19cc5..564bf3b7f152e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
@@ -32,7 +32,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "legalize-types"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp b/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
index 88c98e0ced87f..72ea0898f9754 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp
@@ -30,7 +30,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "scheduler"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
index 07fbd7045b144..5af3df161b6c5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp
@@ -25,7 +25,6 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pre-RA-sched"
STATISTIC(NumUnfolds, "Number of nodes unfolded");
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 8d1e8cdefea88..c2f6256c8e965 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -98,7 +98,6 @@ void SelectionDAG::DAGUpdateListener::NodeInserted(SDNode *) {}
void SelectionDAG::DAGNodeDeletedListener::anchor() {}
void SelectionDAG::DAGNodeInsertedListener::anchor() {}
-#undef DEBUG_TYPE
#define DEBUG_TYPE "selectiondag"
static cl::opt<bool> EnableMemCpyDAGOpt("enable-memcpy-dag-opt",
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 9fbd88bf2ba60..04b17b56b3d49 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -111,7 +111,6 @@ using namespace llvm;
using namespace PatternMatch;
using namespace SwitchCG;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "isel"
/// LimitFloatPrecision - Generate low-precision inline sequences for
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 281cb4155d69c..02c2444fc9d9e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -113,7 +113,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "isel"
#define ISEL_DUMP_DEBUG_TYPE DEBUG_TYPE "-dump"
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
index c83aa43d4fa4c..ac28f62894788 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp
@@ -20,7 +20,6 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dag-printer"
namespace llvm {
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index 0cb714a783d7f..d66d6f5a99416 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -53,7 +53,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "statepoint-lowering"
STATISTIC(NumSlotsAllocatedForStatepoints,
diff --git a/llvm/lib/CodeGen/ShrinkWrap.cpp b/llvm/lib/CodeGen/ShrinkWrap.cpp
index 65ac2b5381690..b27139ca7ac18 100644
--- a/llvm/lib/CodeGen/ShrinkWrap.cpp
+++ b/llvm/lib/CodeGen/ShrinkWrap.cpp
@@ -88,7 +88,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "shrink-wrap"
STATISTIC(NumFunc, "Number of functions");
diff --git a/llvm/lib/CodeGen/SjLjEHPrepare.cpp b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
index 0fa14189a5d79..7ba743c206a21 100644
--- a/llvm/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/llvm/lib/CodeGen/SjLjEHPrepare.cpp
@@ -32,7 +32,6 @@
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sjlj-eh-prepare"
STATISTIC(NumInvokes, "Number of invokes replaced");
diff --git a/llvm/lib/CodeGen/SlotIndexes.cpp b/llvm/lib/CodeGen/SlotIndexes.cpp
index 7da54d65ec5b6..6861c6f0e9b02 100644
--- a/llvm/lib/CodeGen/SlotIndexes.cpp
+++ b/llvm/lib/CodeGen/SlotIndexes.cpp
@@ -16,7 +16,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "slotindexes"
AnalysisKey SlotIndexesAnalysis::Key;
diff --git a/llvm/lib/CodeGen/SpillPlacement.cpp b/llvm/lib/CodeGen/SpillPlacement.cpp
index 3ae0171b57c23..55a96a22a00ec 100644
--- a/llvm/lib/CodeGen/SpillPlacement.cpp
+++ b/llvm/lib/CodeGen/SpillPlacement.cpp
@@ -42,7 +42,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "spill-code-placement"
char SpillPlacementWrapperLegacy::ID = 0;
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index 59e41fac3176f..560aa03f38164 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -42,7 +42,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "regalloc"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp
index f165147e8b15a..65f9ae5433195 100644
--- a/llvm/lib/CodeGen/StackColoring.cpp
+++ b/llvm/lib/CodeGen/StackColoring.cpp
@@ -63,7 +63,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-coloring"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp b/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp
index e07c9ab1a6ebe..95a9c3f781d1b 100644
--- a/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp
+++ b/llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp
@@ -37,7 +37,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-frame-layout"
namespace {
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp
index 056b12bf206a4..cad3ea7868e37 100644
--- a/llvm/lib/CodeGen/StackProtector.cpp
+++ b/llvm/lib/CodeGen/StackProtector.cpp
@@ -52,7 +52,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-protector"
STATISTIC(NumFunProtected, "Number of functions protected");
diff --git a/llvm/lib/CodeGen/StackSlotColoring.cpp b/llvm/lib/CodeGen/StackSlotColoring.cpp
index d10f35907a93e..105f9e93c7fbb 100644
--- a/llvm/lib/CodeGen/StackSlotColoring.cpp
+++ b/llvm/lib/CodeGen/StackSlotColoring.cpp
@@ -47,7 +47,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "stack-slot-coloring"
static cl::opt<bool>
diff --git a/llvm/lib/CodeGen/StaticDataAnnotator.cpp b/llvm/lib/CodeGen/StaticDataAnnotator.cpp
index 2001ca726f25d..196963ffa2b41 100644
--- a/llvm/lib/CodeGen/StaticDataAnnotator.cpp
+++ b/llvm/lib/CodeGen/StaticDataAnnotator.cpp
@@ -36,7 +36,6 @@
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "static-data-annotator"
using namespace llvm;
diff --git a/llvm/lib/CodeGen/StaticDataSplitter.cpp b/llvm/lib/CodeGen/StaticDataSplitter.cpp
index e5838a2fbcd4e..7e87ec248e781 100644
--- a/llvm/lib/CodeGen/StaticDataSplitter.cpp
+++ b/llvm/lib/CodeGen/StaticDataSplitter.cpp
@@ -34,7 +34,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "static-data-splitter"
STATISTIC(NumHotJumpTables, "Number of hot jump tables seen.");
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
index 7750466fecc49..ace5c6e49596e 100644
--- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -66,7 +66,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "twoaddressinstruction"
STATISTIC(NumTwoAddressInstrs, "Number of two-address instructions");
diff --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp
index 1e4a1bbc25dc7..77f82b3851904 100644
--- a/llvm/lib/CodeGen/TypePromotion.cpp
+++ b/llvm/lib/CodeGen/TypePromotion.cpp
@@ -39,7 +39,6 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Target/TargetMachine.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "type-promotion"
#define PASS_NAME "Type Promotion"
diff --git a/llvm/lib/CodeGen/VLIWMachineScheduler.cpp b/llvm/lib/CodeGen/VLIWMachineScheduler.cpp
index 7706cb8c29d21..53d166d277cb8 100644
--- a/llvm/lib/CodeGen/VLIWMachineScheduler.cpp
+++ b/llvm/lib/CodeGen/VLIWMachineScheduler.cpp
@@ -38,7 +38,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "machine-scheduler"
static cl::opt<bool> IgnoreBBRegPressure("ignore-bb-reg-pressure", cl::Hidden,
diff --git a/llvm/lib/CodeGen/WasmEHPrepare.cpp b/llvm/lib/CodeGen/WasmEHPrepare.cpp
index a422f0a748aef..2f54578da5113 100644
--- a/llvm/lib/CodeGen/WasmEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WasmEHPrepare.cpp
@@ -91,7 +91,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "wasm-eh-prepare"
namespace {
diff --git a/llvm/lib/CodeGen/WinEHPrepare.cpp b/llvm/lib/CodeGen/WinEHPrepare.cpp
index 293ec648971b8..40cb11cbeb0de 100644
--- a/llvm/lib/CodeGen/WinEHPrepare.cpp
+++ b/llvm/lib/CodeGen/WinEHPrepare.cpp
@@ -40,7 +40,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "win-eh-prepare"
static cl::opt<bool> DisableDemotion(
diff --git a/llvm/lib/CodeGen/WindowScheduler.cpp b/llvm/lib/CodeGen/WindowScheduler.cpp
index 0e59b0ed26700..2492dfc3ca553 100644
--- a/llvm/lib/CodeGen/WindowScheduler.cpp
+++ b/llvm/lib/CodeGen/WindowScheduler.cpp
@@ -49,7 +49,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pipeliner"
namespace {
diff --git a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
index d7997b4b17614..4a4d911844584 100644
--- a/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
+++ b/llvm/lib/CodeGen/WindowsSecureHotPatching.cpp
@@ -150,7 +150,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "windows-secure-hot-patch"
// A file containing list of mangled function names to mark for hot patching.
diff --git a/llvm/lib/DebugInfo/BTF/BTFContext.cpp b/llvm/lib/DebugInfo/BTF/BTFContext.cpp
index 5c43dd62b75d6..412bd42ee0b67 100644
--- a/llvm/lib/DebugInfo/BTF/BTFContext.cpp
+++ b/llvm/lib/DebugInfo/BTF/BTFContext.cpp
@@ -14,7 +14,6 @@
#include "llvm/DebugInfo/BTF/BTFContext.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "debug-info-btf-context"
using namespace llvm;
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
index 386c08d3e645f..326279ccd862b 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.cpp
@@ -14,7 +14,6 @@
#include <cstdint>
#include <mutex>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "orc"
// First version as landed in August 2009
diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
index f9422c709821e..5d5b2ae543e57 100644
--- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp
@@ -36,7 +36,6 @@
#undef LC_RPATH
#endif // __APPLE__
-#undef DEBUG_TYPE
#define DEBUG_TYPE "orc-scanner"
namespace llvm::orc {
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
index 4137d72539d97..afe3b671547d8 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
@@ -25,7 +25,6 @@
#include <memory>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "rtdyld"
using namespace llvm;
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
index 343eb638e188f..3ca6309874de5 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldCOFFAArch64.h
@@ -19,7 +19,6 @@
#include "llvm/Object/COFF.h"
#include "llvm/Support/Endian.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dyld"
namespace llvm {
diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h
index f217813d04b1f..cc9bad431787c 100644
--- a/llvm/lib/IR/ConstantsContext.h
+++ b/llvm/lib/IR/ConstantsContext.h
@@ -37,7 +37,6 @@
#include <cstdint>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "ir"
namespace llvm {
diff --git a/llvm/lib/IR/ModuleSummaryIndex.cpp b/llvm/lib/IR/ModuleSummaryIndex.cpp
index 27d32d500f204..98876c87ef6db 100644
--- a/llvm/lib/IR/ModuleSummaryIndex.cpp
+++ b/llvm/lib/IR/ModuleSummaryIndex.cpp
@@ -19,7 +19,6 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "module-summary-index"
STATISTIC(ReadOnlyLiveGVars,
diff --git a/llvm/lib/IR/PassTimingInfo.cpp b/llvm/lib/IR/PassTimingInfo.cpp
index 934a98125e2d2..cb1b91a98b036 100644
--- a/llvm/lib/IR/PassTimingInfo.cpp
+++ b/llvm/lib/IR/PassTimingInfo.cpp
@@ -30,7 +30,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "time-passes"
using namespace llvm;
diff --git a/llvm/lib/IR/VFABIDemangler.cpp b/llvm/lib/IR/VFABIDemangler.cpp
index 479414ab740a8..4fcf43616d60c 100644
--- a/llvm/lib/IR/VFABIDemangler.cpp
+++ b/llvm/lib/IR/VFABIDemangler.cpp
@@ -18,7 +18,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vfabi-demangler"
/// Utilities for the Vector Function ABI name parser.
diff --git a/llvm/lib/IR/ValueSymbolTable.cpp b/llvm/lib/IR/ValueSymbolTable.cpp
index dbc857cb07f3a..3bf52f6ef024e 100644
--- a/llvm/lib/IR/ValueSymbolTable.cpp
+++ b/llvm/lib/IR/ValueSymbolTable.cpp
@@ -26,7 +26,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "valuesymtab"
// Class destructor
diff --git a/llvm/lib/MC/MachObjectWriter.cpp b/llvm/lib/MC/MachObjectWriter.cpp
index 25b8ae9809fdf..b42155d18bf0a 100644
--- a/llvm/lib/MC/MachObjectWriter.cpp
+++ b/llvm/lib/MC/MachObjectWriter.cpp
@@ -38,7 +38,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mc"
void MachObjectWriter::reset() {
diff --git a/llvm/lib/ProfileData/InstrProfCorrelator.cpp b/llvm/lib/ProfileData/InstrProfCorrelator.cpp
index 1b4e8ad242a7f..b38189de31606 100644
--- a/llvm/lib/ProfileData/InstrProfCorrelator.cpp
+++ b/llvm/lib/ProfileData/InstrProfCorrelator.cpp
@@ -20,7 +20,6 @@
#include "llvm/Support/WithColor.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "correlator"
using namespace llvm;
diff --git a/llvm/lib/ProfileData/SampleProfReader.cpp b/llvm/lib/ProfileData/SampleProfReader.cpp
index 09d25e73cbb51..766c0814ca067 100644
--- a/llvm/lib/ProfileData/SampleProfReader.cpp
+++ b/llvm/lib/ProfileData/SampleProfReader.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
using namespace sampleprof;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "samplepgo-reader"
// This internal option specifies if the profile uses FS discriminators.
diff --git a/llvm/lib/ProfileData/SampleProfWriter.cpp b/llvm/lib/ProfileData/SampleProfWriter.cpp
index 7a18d96c3b08e..e5f31348578b8 100644
--- a/llvm/lib/ProfileData/SampleProfWriter.cpp
+++ b/llvm/lib/ProfileData/SampleProfWriter.cpp
@@ -36,7 +36,6 @@
#include <utility>
#include <vector>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "llvm-profdata"
using namespace llvm;
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 851cc255a4a6e..8ad20b45f5e16 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -40,7 +40,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "tblgen-records"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/TargetParser/Host.cpp b/llvm/lib/TargetParser/Host.cpp
index 922d8e92f91e0..dfe97f178bd46 100644
--- a/llvm/lib/TargetParser/Host.cpp
+++ b/llvm/lib/TargetParser/Host.cpp
@@ -60,7 +60,6 @@
#endif
#endif
-#undef DEBUG_TYPE
#define DEBUG_TYPE "host-detection"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp b/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
index 3da8fdfa613bd..01b5a0a24ced0 100644
--- a/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroCleanup.cpp
@@ -20,7 +20,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-cleanup"
namespace {
diff --git a/llvm/lib/Transforms/Coroutines/CoroEarly.cpp b/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
index 54dcd2312bd54..e003812f81192 100644
--- a/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
@@ -16,7 +16,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-early"
namespace {
diff --git a/llvm/lib/Transforms/Coroutines/CoroElide.cpp b/llvm/lib/Transforms/Coroutines/CoroElide.cpp
index 8de246d2f9084..3e260d48a5d88 100644
--- a/llvm/lib/Transforms/Coroutines/CoroElide.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroElide.cpp
@@ -21,7 +21,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-elide"
STATISTIC(NumOfCoroElided, "The # of coroutine get elided.");
diff --git a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
index 3f285e775ac2c..83b40ee927b51 100644
--- a/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroFrame.cpp
@@ -43,7 +43,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-frame"
namespace {
diff --git a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
index 9f4b21f1abd77..897463186431f 100644
--- a/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
+++ b/llvm/lib/Transforms/Coroutines/CoroSplit.cpp
@@ -77,7 +77,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-split"
// FIXME:
diff --git a/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp b/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp
index 2050d4184758a..c9bb3395a9949 100644
--- a/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp
+++ b/llvm/lib/Transforms/Coroutines/SuspendCrossingInfo.cpp
@@ -17,7 +17,6 @@
// The "coro-suspend-crossing" flag is very noisy. There is another debug type,
// "coro-frame", which results in leaner debug spew.
-#undef DEBUG_TYPE
#define DEBUG_TYPE "coro-suspend-crossing"
namespace llvm {
diff --git a/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp b/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp
index 8532195277a4e..1019be9ce36bf 100644
--- a/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp
+++ b/llvm/lib/Transforms/IPO/Annotation2Metadata.cpp
@@ -20,7 +20,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "annotation2metadata"
static bool convertAnnotation2Metadata(Module &M) {
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index 1223ba963dcab..cfbf9dec01619 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -80,7 +80,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "argpromotion"
STATISTIC(NumArgumentsPromoted, "Number of pointer arguments promoted");
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 1698b2d18e8fc..8079fd89c9c37 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -62,7 +62,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "attributor"
#define VERBOSE_DEBUG_TYPE DEBUG_TYPE "-verbose"
diff --git a/llvm/lib/Transforms/IPO/BlockExtractor.cpp b/llvm/lib/Transforms/IPO/BlockExtractor.cpp
index 17c7cd63ec2cc..23991afc511a0 100644
--- a/llvm/lib/Transforms/IPO/BlockExtractor.cpp
+++ b/llvm/lib/Transforms/IPO/BlockExtractor.cpp
@@ -26,7 +26,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "block-extractor"
STATISTIC(NumExtracted, "Number of basic blocks extracted");
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp
index 705cd3b2da489..4d4b32749a045 100644
--- a/llvm/lib/Transforms/IPO/FunctionImport.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp
@@ -55,7 +55,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "function-import"
STATISTIC(NumImportedFunctionsThinLink,
diff --git a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
index 7463357cae332..cd914db8434ef 100644
--- a/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+++ b/llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
@@ -24,7 +24,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "function-specialization"
STATISTIC(NumSpecsCreated, "Number of specializations created");
diff --git a/llvm/lib/Transforms/IPO/GlobalDCE.cpp b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
index faf4c56f7ff43..d6b19bd4e204e 100644
--- a/llvm/lib/Transforms/IPO/GlobalDCE.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalDCE.cpp
@@ -30,7 +30,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "globaldce"
namespace {
diff --git a/llvm/lib/Transforms/IPO/GlobalOpt.cpp b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
index a4c7c9f53c6d7..3ef2d377b7a0f 100644
--- a/llvm/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/llvm/lib/Transforms/IPO/GlobalOpt.cpp
@@ -72,7 +72,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "globalopt"
STATISTIC(NumMarked , "Number of globals marked constant");
diff --git a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
index d952a22984f32..85668cfe3ede0 100644
--- a/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ b/llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -57,7 +57,6 @@
#include <limits>
#include <string>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "hotcoldsplit"
STATISTIC(NumColdRegionsFound, "Number of cold regions found.");
diff --git a/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp b/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
index 1a46436804d82..18d5911d10f12 100644
--- a/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
+++ b/llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
@@ -14,7 +14,6 @@
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "inferattrs"
static bool inferAllPrototypeAttributes(
diff --git a/llvm/lib/Transforms/IPO/Internalize.cpp b/llvm/lib/Transforms/IPO/Internalize.cpp
index e61915f495864..c2b8a6257ae6f 100644
--- a/llvm/lib/Transforms/IPO/Internalize.cpp
+++ b/llvm/lib/Transforms/IPO/Internalize.cpp
@@ -33,7 +33,6 @@
#include "llvm/Transforms/IPO.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "internalize"
STATISTIC(NumAliases, "Number of aliases internalized");
diff --git a/llvm/lib/Transforms/IPO/LoopExtractor.cpp b/llvm/lib/Transforms/IPO/LoopExtractor.cpp
index 451f332337c48..8182ef6449d02 100644
--- a/llvm/lib/Transforms/IPO/LoopExtractor.cpp
+++ b/llvm/lib/Transforms/IPO/LoopExtractor.cpp
@@ -28,7 +28,6 @@
#include "llvm/Transforms/Utils/CodeExtractor.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-extract"
STATISTIC(NumExtracted, "Number of loops extracted");
diff --git a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
index b128a1e76b171..00991cf73dafa 100644
--- a/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
+++ b/llvm/lib/Transforms/IPO/LowerTypeTests.cpp
@@ -89,7 +89,6 @@
using namespace llvm;
using namespace lowertypetests;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lowertypetests"
STATISTIC(ByteArraySizeBits, "Byte array size in bits");
diff --git a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
index 40de7e58412e8..015b6bc5caf9f 100644
--- a/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+++ b/llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
@@ -54,7 +54,6 @@
using namespace llvm;
using namespace llvm::memprof;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memprof-context-disambiguation"
STATISTIC(FunctionClonesAnalysis,
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index fdd96a036c96d..5266103d1ac24 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -64,7 +64,6 @@
using namespace llvm;
using namespace omp;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "openmp-opt"
static cl::opt<bool> DisableOpenMPOptimizations(
diff --git a/llvm/lib/Transforms/IPO/PartialInlining.cpp b/llvm/lib/Transforms/IPO/PartialInlining.cpp
index b81078dde0998..c00402f8ef102 100644
--- a/llvm/lib/Transforms/IPO/PartialInlining.cpp
+++ b/llvm/lib/Transforms/IPO/PartialInlining.cpp
@@ -60,7 +60,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "partial-inlining"
STATISTIC(NumPartialInlined,
diff --git a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
index 7975f3078af14..c8f203e8ce3ee 100644
--- a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
+++ b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp
@@ -23,7 +23,6 @@
using namespace llvm;
using namespace sampleprof;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-context-tracker"
namespace llvm {
diff --git a/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp b/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
index 62f6c5ecae756..848c1915882f7 100644
--- a/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfileMatcher.cpp
@@ -24,7 +24,6 @@
using namespace llvm;
using namespace sampleprof;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-profile-matcher"
STATISTIC(NumDirectProfileMatch,
diff --git a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
index 1555c32bf30f8..7fd7d4d4f750b 100644
--- a/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
+++ b/llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
@@ -34,7 +34,6 @@
#include <vector>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pseudo-probe"
STATISTIC(ArtificialDbgLine,
diff --git a/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp b/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
index b1508340c4316..25c24b13c7dda 100644
--- a/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
+++ b/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp
@@ -19,7 +19,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "strip-dead-prototypes"
STATISTIC(NumDeadPrototypes, "Number of dead prototypes removed");
diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index 32fedb13202cc..2fbdc3adb32d6 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -68,7 +68,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "hwasan"
const char kHwasanModuleCtorName[] = "hwasan.module_ctor";
diff --git a/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
index 3c74fcb134b34..98a8068cac946 100644
--- a/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/TypeSanitizer.cpp
@@ -42,7 +42,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "tysan"
static const char *const kTysanModuleCtorName = "tysan.module_ctor";
diff --git a/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp b/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
index 0e2aa0147685e..b4cc00033e720 100644
--- a/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
+++ b/llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp
@@ -28,7 +28,6 @@
using namespace llvm;
using namespace llvm::objcarc;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-dependency"
/// Test whether the given instruction can result in a reference count
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
index bb0754ccb56df..86d7e2f07c1d9 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
using namespace llvm::objcarc;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-contract"
STATISTIC(NumPeeps, "Number of calls peephole-optimized");
diff --git a/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp b/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
index 31452e696dd51..bb0a01b78a96f 100644
--- a/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
+++ b/llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp
@@ -34,7 +34,6 @@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/ObjCARC.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-expand"
using namespace llvm;
diff --git a/llvm/lib/Transforms/ObjCARC/PtrState.cpp b/llvm/lib/Transforms/ObjCARC/PtrState.cpp
index a470efa75a5de..3af238996fa76 100644
--- a/llvm/lib/Transforms/ObjCARC/PtrState.cpp
+++ b/llvm/lib/Transforms/ObjCARC/PtrState.cpp
@@ -28,7 +28,6 @@
using namespace llvm;
using namespace llvm::objcarc;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "objc-arc-ptr-state"
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
index 2906d955aeae1..e54a2e54f9943 100644
--- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
+++ b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp
@@ -31,7 +31,6 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "alignment-from-assumptions"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp b/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
index 89a56d12caf37..7f9129697995a 100644
--- a/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
+++ b/llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp
@@ -21,7 +21,6 @@
using namespace llvm;
using namespace llvm::ore;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "annotation-remarks"
#define REMARK_PASS DEBUG_TYPE
diff --git a/llvm/lib/Transforms/Scalar/BDCE.cpp b/llvm/lib/Transforms/Scalar/BDCE.cpp
index 696d33b9efe27..d96dbca30fdb1 100644
--- a/llvm/lib/Transforms/Scalar/BDCE.cpp
+++ b/llvm/lib/Transforms/Scalar/BDCE.cpp
@@ -31,7 +31,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "bdce"
STATISTIC(NumRemoved, "Number of instructions removed (unused)");
diff --git a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
index 3c0d43b99abd9..ce73c44959a0e 100644
--- a/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
+++ b/llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
@@ -70,7 +70,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "callsite-splitting"
STATISTIC(NumCallSiteSplit, "Number of call-site split");
diff --git a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
index 52d0a6c188ede..db594e033e21e 100644
--- a/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstantHoisting.cpp
@@ -70,7 +70,6 @@
using namespace llvm;
using namespace consthoist;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "consthoist"
STATISTIC(NumConstantsHoisted, "Number of constants hoisted");
diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index a10ff9f49eb02..c457ff74610ce 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -49,7 +49,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "constraint-elimination"
STATISTIC(NumCondsRemoved, "Number of instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
index 94f15ed0ea9ed..8eaf385065737 100644
--- a/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
+++ b/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
@@ -47,7 +47,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "correlated-value-propagation"
STATISTIC(NumPhis, "Number of phis propagated");
diff --git a/llvm/lib/Transforms/Scalar/DCE.cpp b/llvm/lib/Transforms/Scalar/DCE.cpp
index 8cbb491a9a98c..2ad46130dc945 100644
--- a/llvm/lib/Transforms/Scalar/DCE.cpp
+++ b/llvm/lib/Transforms/Scalar/DCE.cpp
@@ -30,7 +30,6 @@
#include "llvm/Transforms/Utils/Local.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dce"
STATISTIC(DCEEliminated, "Number of insts removed");
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index ffa417c84da14..2714074dddafc 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -92,7 +92,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dse"
STATISTIC(NumRemainingStores, "Number of stores remaining after DSE");
diff --git a/llvm/lib/Transforms/Scalar/DivRemPairs.cpp b/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
index cf234743d3b08..3adb3539f5890 100644
--- a/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
+++ b/llvm/lib/Transforms/Scalar/DivRemPairs.cpp
@@ -28,7 +28,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "div-rem-pairs"
STATISTIC(NumPairs, "Number of div/rem pairs");
STATISTIC(NumRecomposed, "Number of instructions recomposed");
diff --git a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
index 29d89a7afa425..ff3d55e5747e5 100644
--- a/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
+++ b/llvm/lib/Transforms/Scalar/EarlyCSE.cpp
@@ -60,7 +60,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "early-cse"
STATISTIC(NumSimplify, "Number of instructions simplified or DCE'd");
diff --git a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
index 8b23b85ad4924..1335665e114dd 100644
--- a/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp
@@ -21,7 +21,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "flatten-cfg"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/Float2Int.cpp b/llvm/lib/Transforms/Scalar/Float2Int.cpp
index b3e3ee671461f..37822cf05f144 100644
--- a/llvm/lib/Transforms/Scalar/Float2Int.cpp
+++ b/llvm/lib/Transforms/Scalar/Float2Int.cpp
@@ -25,7 +25,6 @@
#include "llvm/Support/raw_ostream.h"
#include <deque>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "float2int"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index a1886576b826a..7cab4be169123 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -85,7 +85,6 @@ using namespace llvm::gvn;
using namespace llvm::VNCoercion;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gvn"
STATISTIC(NumGVNInstr, "Number of instructions deleted");
diff --git a/llvm/lib/Transforms/Scalar/GVNHoist.cpp b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
index e019342fd034f..3022f4a8481d0 100644
--- a/llvm/lib/Transforms/Scalar/GVNHoist.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNHoist.cpp
@@ -76,7 +76,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gvn-hoist"
STATISTIC(NumHoisted, "Number of instructions hoisted");
diff --git a/llvm/lib/Transforms/Scalar/GVNSink.cpp b/llvm/lib/Transforms/Scalar/GVNSink.cpp
index a17ddaf054af0..b371684416b0f 100644
--- a/llvm/lib/Transforms/Scalar/GVNSink.cpp
+++ b/llvm/lib/Transforms/Scalar/GVNSink.cpp
@@ -75,7 +75,6 @@
using namespace llvm;
using namespace llvm::GVNExpression;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gvn-sink"
STATISTIC(NumRemoved, "Number of instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/GuardWidening.cpp b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
index ee70ac4cd931d..9967221651472 100644
--- a/llvm/lib/Transforms/Scalar/GuardWidening.cpp
+++ b/llvm/lib/Transforms/Scalar/GuardWidening.cpp
@@ -63,7 +63,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "guard-widening"
STATISTIC(GuardsEliminated, "Number of eliminated guards");
diff --git a/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp b/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp
index 10624ab6845bc..26f2db183fbf1 100644
--- a/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp
+++ b/llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp
@@ -10,7 +10,6 @@
#include "llvm/Analysis/IVUsers.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "iv-users"
PreservedAnalyses IVUsersPrinterPass::run(Loop &L, LoopAnalysisManager &AM,
diff --git a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
index c7e49ffe56666..c92efadded635 100644
--- a/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -81,7 +81,6 @@ using namespace llvm;
using namespace PatternMatch;
using namespace SCEVPatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "indvars"
STATISTIC(NumWidened , "Number of indvars widened");
diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
index 8a6323e5e0d37..98da1e9225172 100644
--- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
@@ -126,7 +126,6 @@ static cl::opt<bool>
PrintScaledBoundaryRangeChecks("irce-print-scaled-boundary-range-checks",
cl::Hidden, cl::init(false));
-#undef DEBUG_TYPE
#define DEBUG_TYPE "irce"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
index 5922357d7e3db..1082625d12a15 100644
--- a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+++ b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
@@ -136,7 +136,6 @@
#include <utility>
#include <vector>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "infer-address-spaces"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
index 3ff91e3ead209..326849a4eb395 100644
--- a/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
+++ b/llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp
@@ -21,7 +21,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "instsimplify"
STATISTIC(NumSimplified, "Number of redundant instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index 07d738dce99c5..7f8e10eb201a6 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -78,7 +78,6 @@
using namespace llvm;
using namespace jumpthreading;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "jump-threading"
STATISTIC(NumThreads, "Number of jumps threaded");
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index ef0428f7358ef..859bc4cf83898 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -91,7 +91,6 @@ namespace llvm {
class LPMUpdater;
} // namespace llvm
-#undef DEBUG_TYPE
#define DEBUG_TYPE "licm"
STATISTIC(NumCreatedBlocks, "Number of blocks created");
diff --git a/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp b/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
index b8222c1204893..7253c7f222509 100644
--- a/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp
@@ -14,7 +14,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-accesses"
PreservedAnalyses LoopAccessInfoPrinterPass::run(Function &F,
diff --git a/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp b/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
index d861ba1d1d149..a461e1f7fe074 100644
--- a/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp
@@ -19,7 +19,6 @@
#include "llvm/Transforms/Utils/LoopSimplify.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-bound-split"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
index 45e26e92bf322..fe20c24318e12 100644
--- a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp
@@ -30,7 +30,6 @@
#include "llvm/Transforms/Utils.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-data-prefetch"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
index 955984124f8e8..0664eed072a9a 100644
--- a/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDeletion.cpp
@@ -31,7 +31,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-delete"
STATISTIC(NumDeleted, "Number of loops deleted");
diff --git a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
index b843dfc8aaae8..00eac14845c57 100644
--- a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp
@@ -69,7 +69,6 @@
using namespace llvm;
#define LDIST_NAME "loop-distribute"
-#undef DEBUG_TYPE
#define DEBUG_TYPE LDIST_NAME
/// @{
diff --git a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
index f8426c48a7c5f..e48c47f1b4b89 100644
--- a/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFlatten.cpp
@@ -79,7 +79,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-flatten"
STATISTIC(NumFlattened, "Number of loops flattened");
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index 9c42820853cb7..23bba139212e8 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -68,7 +68,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-fusion"
STATISTIC(FuseCounter, "Loops fused");
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index 065320480de3c..105757140c758 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -95,7 +95,6 @@
using namespace llvm;
using namespace SCEVPatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-idiom"
STATISTIC(NumMemSet, "Number of memset's formed from loop stores");
diff --git a/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp b/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
index 84a255f48b8d1..fe689981083e3 100644
--- a/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp
@@ -35,7 +35,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-instsimplify"
STATISTIC(NumSimplified, "Number of redundant instructions simplified");
diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
index 3a4b7c57b40d2..49a9e77ef8deb 100644
--- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
@@ -52,7 +52,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-interchange"
STATISTIC(LoopsInterchanged, "Number of loops interchanged");
diff --git a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
index edf65ac1da023..82c55011df1cd 100644
--- a/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp
@@ -62,7 +62,6 @@
using namespace llvm;
#define LLE_OPTION "loop-load-elim"
-#undef DEBUG_TYPE
#define DEBUG_TYPE LLE_OPTION
static cl::opt<unsigned> CheckPerElim(
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
index 803d3704902e1..de5365271e233 100644
--- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp
@@ -202,7 +202,6 @@
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-predication"
STATISTIC(TotalConsidered, "Number of guards considered");
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 7fc0732595908..50d44369a40d0 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -27,7 +27,6 @@
#include <optional>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-rotate"
static cl::opt<unsigned> DefaultRotationThreshold(
diff --git a/llvm/lib/Transforms/Scalar/LoopSink.cpp b/llvm/lib/Transforms/Scalar/LoopSink.cpp
index 211477b80b3d0..b9fde4c6a3b76 100644
--- a/llvm/lib/Transforms/Scalar/LoopSink.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopSink.cpp
@@ -48,7 +48,6 @@
#include "llvm/Transforms/Utils/LoopUtils.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loopsink"
STATISTIC(NumLoopSunk, "Number of instructions sunk into loop");
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 19a2d317b2c9a..5421cad31c3ba 100644
--- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -129,7 +129,6 @@
using namespace llvm;
using namespace SCEVPatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-reduce"
/// MaxIVUsers is an arbitrary threshold that provides an early opportunity for
diff --git a/llvm/lib/Transforms/Scalar/LoopTermFold.cpp b/llvm/lib/Transforms/Scalar/LoopTermFold.cpp
index 029431dee3485..e6eccdd7d616e 100644
--- a/llvm/lib/Transforms/Scalar/LoopTermFold.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopTermFold.cpp
@@ -43,7 +43,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-term-fold"
STATISTIC(NumTermFold,
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
index 1d63f67705838..e2bca3dd37304 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
@@ -50,7 +50,6 @@ class Value;
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll-and-jam"
/// @{
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
index bf13dfa01e27f..9fdf7ef1b0a86 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp
@@ -70,7 +70,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll"
cl::opt<bool> llvm::ForgetSCEVInLoopUnroll(
diff --git a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
index e530453db99ac..3aed643ee8065 100644
--- a/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp
@@ -87,7 +87,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-versioning-licm"
static const char *LICMVersioningMetaData = "llvm.loop.licm_versioning.disable";
diff --git a/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp b/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
index e6a769d796639..c93baf38e079b 100644
--- a/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp
@@ -19,7 +19,6 @@
#include "llvm/Transforms/Utils/LowerAtomic.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-atomic"
static bool LowerFenceInst(FenceInst *FI) {
diff --git a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
index 52a474bafb4c0..0c94ed27880f0 100644
--- a/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp
@@ -36,7 +36,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-is-constant-intrinsic"
STATISTIC(IsConstantIntrinsicsHandled,
diff --git a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
index 8cb40ce815fad..0828ffe82af48 100644
--- a/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
@@ -55,7 +55,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-matrix-intrinsics"
STATISTIC(FlattenedMatrices, "Number of matrix flattenings");
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 0ee26e7802525..43779d5195714 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -62,7 +62,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memcpyopt"
static cl::opt<bool> EnableMemCpyOptWithoutLibcalls(
diff --git a/llvm/lib/Transforms/Scalar/MergeICmps.cpp b/llvm/lib/Transforms/Scalar/MergeICmps.cpp
index 54307b7238fdb..531d370b6d678 100644
--- a/llvm/lib/Transforms/Scalar/MergeICmps.cpp
+++ b/llvm/lib/Transforms/Scalar/MergeICmps.cpp
@@ -65,7 +65,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mergeicmps"
namespace llvm {
diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
index a20e3dd015454..d6af49fd51f06 100644
--- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
+++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp
@@ -88,7 +88,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mldst-motion"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index c9a8b1a6e6ca0..a3e332ffd62d4 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -125,7 +125,6 @@ using namespace llvm::GVNExpression;
using namespace llvm::VNCoercion;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "newgvn"
STATISTIC(NumGVNInstrDeleted, "Number of instructions deleted");
diff --git a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
index 16728db9f87c9..f0426e916fb18 100644
--- a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
+++ b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp
@@ -32,7 +32,6 @@ namespace llvm {
extern cl::opt<bool> ProfcheckDisableMetadataFixes;
} // namespace llvm
-#undef DEBUG_TYPE
#define DEBUG_TYPE "partially-inline-libcalls"
DEBUG_COUNTER(PILCounter, "partially-inline-libcalls-transform",
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index 73b7c264c5217..44600acf5b418 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -71,7 +71,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "place-safepoints"
STATISTIC(NumEntrySafepoints, "Number of entry safepoints inserted");
diff --git a/llvm/lib/Transforms/Scalar/Reassociate.cpp b/llvm/lib/Transforms/Scalar/Reassociate.cpp
index 2c8263609058e..ea6c394740f22 100644
--- a/llvm/lib/Transforms/Scalar/Reassociate.cpp
+++ b/llvm/lib/Transforms/Scalar/Reassociate.cpp
@@ -65,7 +65,6 @@ using namespace llvm;
using namespace reassociate;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "reassociate"
STATISTIC(NumChanged, "Number of insts reassociated");
diff --git a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp
index e4a800a90cde8..764662441a040 100644
--- a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp
+++ b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp
@@ -33,7 +33,6 @@
#include <list>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "reg2mem"
STATISTIC(NumRegsDemoted, "Number of registers demoted");
diff --git a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
index 9f0b91ad31972..c0977ae1b4c6b 100644
--- a/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
+++ b/llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
@@ -73,7 +73,6 @@
#include <utility>
#include <vector>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "rewrite-statepoints-for-gc"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/SCCP.cpp b/llvm/lib/Transforms/Scalar/SCCP.cpp
index e7ffe96ddb7a6..feee794ffeae1 100644
--- a/llvm/lib/Transforms/Scalar/SCCP.cpp
+++ b/llvm/lib/Transforms/Scalar/SCCP.cpp
@@ -45,7 +45,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sccp"
STATISTIC(NumInstRemoved, "Number of instructions removed");
diff --git a/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
index 12a594894a7ab..da9ceb4f440e5 100644
--- a/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
+++ b/llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp
@@ -41,7 +41,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "scalarize-masked-mem-intrin"
namespace {
diff --git a/llvm/lib/Transforms/Scalar/Scalarizer.cpp b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
index 4af80e9dbd1bc..0ef8e5790b7f8 100644
--- a/llvm/lib/Transforms/Scalar/Scalarizer.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalarizer.cpp
@@ -48,7 +48,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "scalarizer"
static BasicBlock::iterator skipPastPhiNodesAndDbg(BasicBlock::iterator Itr) {
diff --git a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
index 3fd83bb30f1e8..40a3a23814700 100644
--- a/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
+++ b/llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
@@ -66,7 +66,6 @@
#include <optional>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "simple-loop-unswitch"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
index 65449b7632b77..debf033c70c41 100644
--- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
+++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp
@@ -44,7 +44,6 @@
#include <utility>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "simplifycfg"
static cl::opt<unsigned> UserBonusInstThreshold(
diff --git a/llvm/lib/Transforms/Scalar/Sink.cpp b/llvm/lib/Transforms/Scalar/Sink.cpp
index 32b69c88aa191..603525b55b9cf 100644
--- a/llvm/lib/Transforms/Scalar/Sink.cpp
+++ b/llvm/lib/Transforms/Scalar/Sink.cpp
@@ -22,7 +22,6 @@
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sink"
STATISTIC(NumSunk, "Number of instructions sunk");
diff --git a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
index 78d456af3b743..ed43fb4b63f87 100644
--- a/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+++ b/llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
@@ -107,7 +107,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "slsr"
static const unsigned UnknownAddressSpace =
diff --git a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
index b2c8c2ab349b6..136cb965f94c5 100644
--- a/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
+++ b/llvm/lib/Transforms/Scalar/StructurizeCFG.cpp
@@ -54,7 +54,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "structurizecfg"
// The name for newly created blocks.
diff --git a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
index 0a576cd25ad4d..3f7eca1fc7513 100644
--- a/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
@@ -84,7 +84,6 @@
#include <cmath>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "tailcallelim"
STATISTIC(NumEliminated, "Number of tail calls removed");
diff --git a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
index 60234843d6244..e53019768e881 100644
--- a/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
+++ b/llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp
@@ -17,7 +17,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "transform-warning"
/// Emit warnings for forced (i.e. user-defined) loop transformations which have
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp
index d160e02e55a2b..031ce978d21ce 100644
--- a/llvm/lib/Transforms/Utils/CloneFunction.cpp
+++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp
@@ -40,7 +40,6 @@
#include <optional>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "clone-function"
STATISTIC(RemappedAtomMax, "Highest global NextAtomGroup (after mapping)");
diff --git a/llvm/lib/Transforms/Utils/CodeLayout.cpp b/llvm/lib/Transforms/Utils/CodeLayout.cpp
index c47511f50b75a..27b13eeaf4d71 100644
--- a/llvm/lib/Transforms/Utils/CodeLayout.cpp
+++ b/llvm/lib/Transforms/Utils/CodeLayout.cpp
@@ -50,7 +50,6 @@
using namespace llvm;
using namespace llvm::codelayout;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "code-layout"
namespace llvm {
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
index 5c54839c4c42b..1a08a3d115d9e 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp
@@ -57,7 +57,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll-and-jam"
STATISTIC(NumUnrolledAndJammed, "Number of loops unroll and jammed");
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index cf2a5b8a13e17..68751cf95bc7a 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -44,7 +44,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-unroll"
STATISTIC(NumRuntimeUnrolled,
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 3ee461b588f31..7573467917c73 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -50,7 +50,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-utils"
static const char *LLVMLoopDisableNonforced = "llvm.loop.disable_nonforced";
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
index 8e08c8ba148aa..b90466a8c49cf 100644
--- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -32,7 +32,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-versioning"
static cl::opt<bool>
diff --git a/llvm/lib/Transforms/Utils/LowerAtomic.cpp b/llvm/lib/Transforms/Utils/LowerAtomic.cpp
index 53810bb715c1e..d4c0602f6ce52 100644
--- a/llvm/lib/Transforms/Utils/LowerAtomic.cpp
+++ b/llvm/lib/Transforms/Utils/LowerAtomic.cpp
@@ -17,7 +17,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loweratomic"
bool llvm::lowerAtomicCmpXchgInst(AtomicCmpXchgInst *CXI) {
diff --git a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
index 90cb5bf214044..d33025adb520c 100644
--- a/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
+++ b/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
@@ -29,7 +29,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-global-dtors"
namespace {
diff --git a/llvm/lib/Transforms/Utils/LowerInvoke.cpp b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
index d3aa60fab7ad1..488745886ec37 100644
--- a/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+++ b/llvm/lib/Transforms/Utils/LowerInvoke.cpp
@@ -22,7 +22,6 @@
#include "llvm/Transforms/Utils.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-invoke"
STATISTIC(NumInvokes, "Number of invokes replaced");
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
index fb53f7215f4f2..9313f313cb02d 100644
--- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
@@ -44,7 +44,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-switch"
namespace {
diff --git a/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp b/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
index 8b455feb01815..71c10f5b157c7 100644
--- a/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
+++ b/llvm/lib/Transforms/Utils/LowerVectorIntrinsics.cpp
@@ -9,7 +9,6 @@
#include "llvm/Transforms/Utils/LowerVectorIntrinsics.h"
#include "llvm/IR/IRBuilder.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-intrinsics"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Utils/Mem2Reg.cpp b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
index a1c1d170fb454..5ad7aeb463ecb 100644
--- a/llvm/lib/Transforms/Utils/Mem2Reg.cpp
+++ b/llvm/lib/Transforms/Utils/Mem2Reg.cpp
@@ -28,7 +28,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mem2reg"
STATISTIC(NumPromoted, "Number of alloca's promoted");
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 66a97e07e5a2f..63a234960a0ad 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -25,7 +25,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "moduleutils"
static void appendToGlobalArray(StringRef ArrayName, Module &M, Function *F,
diff --git a/llvm/lib/Transforms/Utils/MoveAutoInit.cpp b/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
index 0ed1fb8402015..9302d5e284fd3 100644
--- a/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
+++ b/llvm/lib/Transforms/Utils/MoveAutoInit.cpp
@@ -26,7 +26,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "move-auto-init"
STATISTIC(NumMoved, "Number of instructions moved");
diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
index 150f83ea99d0d..3d3c70522fb55 100644
--- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp
+++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp
@@ -26,7 +26,6 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugCounter.h"
#include "llvm/Support/FormattedStream.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "predicateinfo"
using namespace llvm;
using namespace PatternMatch;
diff --git a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
index ccf4697ceea75..ef668e575f3ea 100644
--- a/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
+++ b/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp
@@ -56,7 +56,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mem2reg"
STATISTIC(NumLocalPromoted, "Number of alloca's promoted within one block");
diff --git a/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp b/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
index ed7eda22a1b48..c5bd0567d8d66 100644
--- a/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
+++ b/llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp
@@ -21,7 +21,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "ssaupdaterbulk"
/// Helper function for finding a block which should have a value for the given
diff --git a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
index df67b8862df1c..3e40cced8771c 100644
--- a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
+++ b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
@@ -23,7 +23,6 @@
#include <unordered_set>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sample-profile-inference"
namespace {
diff --git a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
index dcf9bbd712fa0..9e0bbe9cf3b62 100644
--- a/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
@@ -31,7 +31,6 @@
using namespace llvm;
using namespace llvm::PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "indvars"
STATISTIC(NumElimIdentity, "Number of IV identities eliminated");
diff --git a/llvm/lib/Transforms/Utils/SplitModule.cpp b/llvm/lib/Transforms/Utils/SplitModule.cpp
index 3d9d8ac2058b4..c39771733ee0d 100644
--- a/llvm/lib/Transforms/Utils/SplitModule.cpp
+++ b/llvm/lib/Transforms/Utils/SplitModule.cpp
@@ -46,7 +46,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "split-module"
namespace {
diff --git a/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp b/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
index 9b4612e53ec02..77bac5c98478a 100644
--- a/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
+++ b/llvm/lib/Transforms/Utils/SplitModuleByCategory.cpp
@@ -24,7 +24,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "split-module-by-category"
namespace {
diff --git a/llvm/lib/Transforms/Utils/SymbolRewriter.cpp b/llvm/lib/Transforms/Utils/SymbolRewriter.cpp
index 4fb0366c868c5..6319fd524ff0f 100644
--- a/llvm/lib/Transforms/Utils/SymbolRewriter.cpp
+++ b/llvm/lib/Transforms/Utils/SymbolRewriter.cpp
@@ -83,7 +83,6 @@
using namespace llvm;
using namespace SymbolRewriter;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "symbol-rewriter"
static cl::list<std::string> RewriteMapFiles("rewrite-map-file",
diff --git a/llvm/lib/Transforms/Utils/VNCoercion.cpp b/llvm/lib/Transforms/Utils/VNCoercion.cpp
index 7828bec8307ad..0dabd065b6723 100644
--- a/llvm/lib/Transforms/Utils/VNCoercion.cpp
+++ b/llvm/lib/Transforms/Utils/VNCoercion.cpp
@@ -4,7 +4,6 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/IntrinsicInst.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vncoerce"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp
index bda33cf420c6a..6e36006890df4 100644
--- a/llvm/lib/Transforms/Utils/ValueMapper.cpp
+++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp
@@ -45,7 +45,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "value-mapper"
// Out of line method to get vtable etc for class.
diff --git a/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
index 1e6f10379a5fa..7cdb0763223df 100644
--- a/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopIdiomVectorize.cpp
@@ -80,7 +80,6 @@
using namespace llvm;
using namespace PatternMatch;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-idiom-vectorize"
static cl::opt<bool> DisableAll("disable-loop-idiom-vectorize-all", cl::Hidden,
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
index 6ec491706ae86..b3dd07b3c46e3 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
@@ -35,7 +35,6 @@ using namespace llvm;
using namespace PatternMatch;
#define LV_NAME "loop-vectorize"
-#undef DEBUG_TYPE
#define DEBUG_TYPE LV_NAME
static cl::opt<bool>
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 87f1356b07303..4748b880721fa 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -45,7 +45,6 @@ using namespace llvm::VPlanPatternMatch;
using VectorParts = SmallVector<Value *, 2>;
#define LV_NAME "loop-vectorize"
-#undef DEBUG_TYPE
#define DEBUG_TYPE LV_NAME
bool VPRecipeBase::mayWriteToMemory() const {
diff --git a/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp b/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp
index d1addb284315c..fb7e1dd5b1e4e 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanSLP.cpp
@@ -37,7 +37,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vplan-slp"
// Number of levels to look ahead when re-ordering multi node operands.
diff --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
index ec8f7c3e918e9..1dff1831c305c 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
@@ -22,7 +22,6 @@
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/TypeSwitch.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-vectorize"
using namespace llvm;
diff --git a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
index 9e6f64d22f2f1..136f4fe238b34 100644
--- a/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+++ b/llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -41,7 +41,6 @@
#include <queue>
#include <set>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-combine"
#include "llvm/Transforms/Utils/InstructionWorklist.h"
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 42634a6fc7f09..86ee350834b5c 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -50,7 +50,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "asm-writer-emitter"
namespace {
diff --git a/llvm/utils/TableGen/CTagsEmitter.cpp b/llvm/utils/TableGen/CTagsEmitter.cpp
index e637667d94dfb..413d8f5dbcff0 100644
--- a/llvm/utils/TableGen/CTagsEmitter.cpp
+++ b/llvm/utils/TableGen/CTagsEmitter.cpp
@@ -21,7 +21,6 @@
#include <vector>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "ctags-emitter"
namespace {
diff --git a/llvm/utils/TableGen/CompressInstEmitter.cpp b/llvm/utils/TableGen/CompressInstEmitter.cpp
index 6d14efb2a37fd..f118bd69c9737 100644
--- a/llvm/utils/TableGen/CompressInstEmitter.cpp
+++ b/llvm/utils/TableGen/CompressInstEmitter.cpp
@@ -81,7 +81,6 @@
#include <vector>
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "compress-inst-emitter"
namespace {
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index d598a15c0927d..eba4a95bd24ba 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -20,7 +20,6 @@
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dag-isel-emitter"
namespace {
diff --git a/llvm/utils/TableGen/DAGISelMatcherOpt.cpp b/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
index 89c5eb99007e1..2a7b834dea138 100644
--- a/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
+++ b/llvm/utils/TableGen/DAGISelMatcherOpt.cpp
@@ -18,7 +18,6 @@
#include "llvm/Support/raw_ostream.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "isel-opt"
/// ContractNodes - Turn multiple matcher node patterns like 'MoveChild+Record'
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index ae81e067b4853..664c3009ff504 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -56,7 +56,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "decoder-emitter"
extern cl::OptionCategory DisassemblerEmitterCat;
diff --git a/llvm/utils/TableGen/ExegesisEmitter.cpp b/llvm/utils/TableGen/ExegesisEmitter.cpp
index c5897af3a333f..bd69919bb462e 100644
--- a/llvm/utils/TableGen/ExegesisEmitter.cpp
+++ b/llvm/utils/TableGen/ExegesisEmitter.cpp
@@ -24,7 +24,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "exegesis-emitter"
namespace {
diff --git a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
index f4369ed6d4919..56b39fcd1cc9e 100644
--- a/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
@@ -59,7 +59,6 @@
using namespace llvm;
using namespace llvm::gi;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gicombiner-emitter"
static cl::OptionCategory
diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp
index ec94059fef5e9..15b5ae24bd5d1 100644
--- a/llvm/utils/TableGen/GlobalISelEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp
@@ -55,7 +55,6 @@ using namespace llvm::gi;
using action_iterator = RuleMatcher::action_iterator;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "gisel-emitter"
STATISTIC(NumPatternTotal, "Total number of patterns");
diff --git a/llvm/utils/TableGen/PseudoLoweringEmitter.cpp b/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
index cc5dd59eb45fb..76806c32033d5 100644
--- a/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
+++ b/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
@@ -19,7 +19,6 @@
#include "llvm/TableGen/TableGenBackend.h"
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pseudo-lowering"
namespace {
diff --git a/llvm/utils/TableGen/RegisterBankEmitter.cpp b/llvm/utils/TableGen/RegisterBankEmitter.cpp
index f3b55250bcf4a..c2cb06fe456c7 100644
--- a/llvm/utils/TableGen/RegisterBankEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterBankEmitter.cpp
@@ -23,7 +23,6 @@
#include "llvm/TableGen/TGTimer.h"
#include "llvm/TableGen/TableGenBackend.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "register-bank-emitter"
using namespace llvm;
diff --git a/llvm/utils/TableGen/SubtargetEmitter.cpp b/llvm/utils/TableGen/SubtargetEmitter.cpp
index af1d6a2146db8..c3a9d69d6ec3e 100644
--- a/llvm/utils/TableGen/SubtargetEmitter.cpp
+++ b/llvm/utils/TableGen/SubtargetEmitter.cpp
@@ -41,7 +41,6 @@
using namespace llvm;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "subtarget-emitter"
namespace {
diff --git a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
index 17a753fa695bb..fb5649e670656 100644
--- a/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/ConstantPropagationAnalysis.cpp
@@ -19,7 +19,6 @@
#include "llvm/Support/DebugLog.h"
#include <cassert>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "constant-propagation"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
index c65fdf675e039..936b0c678f20c 100644
--- a/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/DeadCodeAnalysis.cpp
@@ -29,7 +29,6 @@
#include <cassert>
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dead-code-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp b/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
index 8ee8a43895c34..22bc0b32a9bd1 100644
--- a/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/DenseAnalysis.cpp
@@ -24,7 +24,6 @@
using namespace mlir;
using namespace mlir::dataflow;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dense-analysis"
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
index 506a127b0d7ec..818450e2bc696 100644
--- a/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
@@ -36,7 +36,6 @@
#include <optional>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "int-range-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp b/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp
index 1b2db0b748120..4afc35d23fafa 100644
--- a/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/LivenessAnalysis.cpp
@@ -20,7 +20,6 @@
#include <mlir/Interfaces/SideEffectInterfaces.h>
#include <mlir/Support/LLVM.h>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "liveness-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp b/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp
index d5328d465b881..01c9dafaddf10 100644
--- a/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp
+++ b/mlir/lib/Analysis/DataFlow/StridedMetadataRangeAnalysis.cpp
@@ -22,7 +22,6 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugLog.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "strided-metadata-range-analysis"
using namespace mlir;
diff --git a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
index ea6d72173c1b0..0e0c5f2159382 100644
--- a/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
+++ b/mlir/lib/Analysis/FlatLinearValueConstraints.cpp
@@ -22,7 +22,6 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "flat-value-constraints"
using namespace mlir;
diff --git a/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp b/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
index a0aea824528b4..3b2aab6c9a824 100644
--- a/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
+++ b/mlir/lib/Conversion/MemRefToSPIRV/MemRefToSPIRV.cpp
@@ -25,7 +25,6 @@
#include <limits>
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memref-to-spirv-pattern"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp b/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
index 214ed453f0a0f..8bf773dd817f2 100644
--- a/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/AffineStructures.cpp
@@ -23,7 +23,6 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-structures"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
index 01dc6a6b53d10..166d39e88d41e 100644
--- a/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/LoopAnalysis.cpp
@@ -25,7 +25,6 @@
#include <numeric>
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-analysis"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Analysis/Utils.cpp b/mlir/lib/Dialect/Affine/Analysis/Utils.cpp
index 78ecae7c9acd9..ee893c14c9c6b 100644
--- a/mlir/lib/Dialect/Affine/Analysis/Utils.cpp
+++ b/mlir/lib/Dialect/Affine/Analysis/Utils.cpp
@@ -28,7 +28,6 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "analysis-utils"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
index 1ff2f7cb8d780..c8d8b8d62e59d 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
@@ -23,7 +23,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-licm"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
index 7e401d8a93b94..6175e52f96009 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineParallelize.cpp
@@ -31,7 +31,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-parallel"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
index 91b027ffda5de..92a4cf3c0ad76 100644
--- a/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/AffineScalarReplacement.cpp
@@ -25,7 +25,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-scalrep"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp b/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
index 7417f2fe6f029..11007a08f7edc 100644
--- a/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
@@ -22,7 +22,6 @@
using namespace mlir;
using namespace mlir::affine;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "decompose-affine-ops"
/// Count the number of loops surrounding `operand` such that operand could be
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
index 6a3c2fc4a0f5b..1ec5fbfef50c3 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopFusion.cpp
@@ -39,7 +39,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-fusion"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
index 8402b98fccac1..188db218a5220 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopTiling.cpp
@@ -34,7 +34,6 @@ namespace affine {
using namespace mlir;
using namespace mlir::affine;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-tile"
namespace {
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
index 562439db7c76e..837d4f714d25e 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnroll.cpp
@@ -25,7 +25,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-unroll"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
index b34c7f54c435e..f97174065a475 100644
--- a/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/LoopUnrollAndJam.cpp
@@ -49,7 +49,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-loop-unroll-jam"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp b/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
index 84f9426ff52ec..d84cb4f0cde5f 100644
--- a/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/PipelineDataTransfer.cpp
@@ -31,7 +31,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-pipeline-data-transfer"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp b/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
index 7a2fe77a1b391..29cc256cb90f9 100644
--- a/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/RaiseMemrefDialect.cpp
@@ -31,7 +31,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "raise-memref-to-affine"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp
index 8768b5841296a..ea7f3157c82ea 100644
--- a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineMinMax.cpp
@@ -22,7 +22,6 @@
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/InterleavedRange.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-min-max"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
index 914f3e9e04a66..c09afc03c5257 100644
--- a/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/SimplifyAffineStructures.cpp
@@ -26,7 +26,6 @@ namespace affine {
} // namespace affine
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "simplify-affine-structure"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
index eaa73902d4ea3..8f1249e3afaf0 100644
--- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
@@ -29,7 +29,6 @@
#include "llvm/Support/raw_ostream.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "loop-utils"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Affine/Utils/Utils.cpp b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
index 4b9a298f78645..7b976943e1bb7 100644
--- a/mlir/lib/Dialect/Affine/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/Utils.cpp
@@ -29,7 +29,6 @@
#include "llvm/ADT/SmallVectorExtras.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "affine-utils"
using namespace mlir;
diff --git a/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp b/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
index ae51e71071eb2..f1c36edac6094 100644
--- a/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
+++ b/mlir/lib/Dialect/ArmSME/Transforms/OuterProductFusion.cpp
@@ -19,7 +19,6 @@
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "llvm/ADT/TypeSwitch.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "arm-sme-outerproduct-fusion"
namespace mlir::arm_sme {
diff --git a/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp b/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
index beed448aa8522..6e2654ab468f9 100644
--- a/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
+++ b/mlir/lib/Dialect/ArmSME/Transforms/VectorLegalization.cpp
@@ -28,7 +28,6 @@
#include "mlir/Transforms/DialectConversion.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "arm-sme-vector-legalization"
namespace mlir::arm_sme {
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
index ac312382c0942..91e37dd9ac36e 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCounting.cpp
@@ -25,7 +25,6 @@ namespace mlir {
#include "mlir/Dialect/Async/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "async-runtime-ref-counting"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp
index 42529b8c30697..303bbcacb6f2f 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncRuntimeRefCountingOpt.cpp
@@ -21,7 +21,6 @@ namespace mlir {
#include "mlir/Dialect/Async/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "async-ref-counting"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
index aeb6e715dadbc..112d69ce87f7f 100644
--- a/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
+++ b/mlir/lib/Dialect/Async/Transforms/AsyncToAsyncRuntime.cpp
@@ -38,7 +38,6 @@ namespace mlir {
using namespace mlir;
using namespace mlir::async;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "async-to-async-runtime"
// Prefix for functions outlined from `async.execute` op regions.
static constexpr const char kAsyncFnPrefix[] = "async_execute_fn";
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp
index d01d5eed9919f..28ee5b8e32b99 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OptimizeAllocationLiveness.cpp
@@ -20,7 +20,6 @@
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "llvm/Support/DebugLog.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "optimize-allocation-liveness"
namespace mlir {
diff --git a/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp b/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
index d0321eb6549af..680fafcc099f2 100644
--- a/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
@@ -24,7 +24,6 @@
#include "llvm/Support/DebugLog.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "llvm-inliner"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
index 9a592de9d3419..c3dca148b7f94 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp
@@ -36,7 +36,6 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-drop-unit-dims"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp b/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
index 0b1490eed780d..0be128c3b5e87 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/FoldIntoElementwise.cpp
@@ -26,7 +26,6 @@ namespace mlir {
using namespace mlir;
using namespace mlir::linalg;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-fold-into-elementwise"
namespace {
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
index eefc3d0a3a5d0..f11f230a8909b 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
@@ -24,7 +24,6 @@
#include "llvm/ADT/SmallVectorExtras.h"
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-fusion"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
index 1454b6656cb15..35abdc027f194 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Generalization.cpp
@@ -25,7 +25,6 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-generalization"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
index 69d2fbec9ba93..867171583b010 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/HoistPadding.cpp
@@ -31,7 +31,6 @@
using llvm::dbgs;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "hoist-padding"
#define DBGS() (dbgs() << '[' << DEBUG_TYPE << "] ")
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
index 0572be1a43537..e1dc40d6d37d9 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Hoisting.cpp
@@ -27,7 +27,6 @@
using llvm::dbgs;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-hoisting"
#define DBGS() (dbgs() << '[' << DEBUG_TYPE << "] ")
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp b/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp
index be7953e1bd71c..1a293da883fd6 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Interchange.cpp
@@ -22,7 +22,6 @@
#include "mlir/Support/LLVM.h"
#include "llvm/ADT/ScopeExit.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-interchange"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp b/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
index c73d0a1375199..fee293647deda 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/MorphOps.cpp
@@ -24,7 +24,6 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-morphism"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp b/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
index 06095b0429d09..c9045566473cb 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/NamedToElementwise.cpp
@@ -23,7 +23,6 @@
using namespace mlir;
using namespace mlir::linalg;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-named-to-elementwise"
namespace {
diff --git a/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp b/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
index bd2b443d9f1a0..ab2629b41a463 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/PadTilingInterface.cpp
@@ -23,7 +23,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Casting.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "pad-tiling-interface"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp b/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp
index 876886aeed569..dd8437985197d 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Padding.cpp
@@ -15,7 +15,6 @@
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/Interfaces/ValueBoundsOpInterface.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-padding"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
index 959747f175ac8..6519c4f64dd05 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
@@ -34,7 +34,6 @@ using namespace mlir::scf;
using llvm::MapVector;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-promotion"
/// Alloc a new buffer of `size` * `width` i8; where `width` is given by the
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
index c65423b896b2b..60b18fb2e8d93 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp
@@ -26,7 +26,6 @@ namespace mlir {
#include "mlir/Dialect/Linalg/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-specialization"
#define REPLACE_BINARY_OP(NEWOP, OPERANDS_SWAP) \
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
index fc65bb8121099..39fdfa9cdbd47 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
@@ -38,7 +38,6 @@ using namespace mlir::affine;
using namespace mlir::linalg;
using namespace mlir::scf;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-tiling"
std::tuple<SmallVector<Range, 4>, LoopIndexToRangeIndexMap>
diff --git a/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp b/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
index 73bec7a9e1b1b..558ebdebd65c5 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
@@ -28,7 +28,6 @@
#include "llvm/Support/Debug.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-tiling-interface-impl"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
index 0e8ba2cbc7e31..260e36fb47f04 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
@@ -38,7 +38,6 @@
#include <type_traits>
#include <utility>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-transforms"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp b/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp
index aedf896425f84..2650488c17993 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/TransposeMatmul.cpp
@@ -12,7 +12,6 @@
#include "mlir/Dialect/Linalg/Transforms/Transforms.h"
#include "mlir/IR/PatternMatch.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-transpose-matmul"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
index d4d6ddd409b11..a7acdd2c018ea 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -49,7 +49,6 @@
using namespace mlir;
using namespace mlir::linalg;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "linalg-vectorization"
/// Try to vectorize `convOp` as a convolution.
diff --git a/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp b/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
index 9aabc40ce976d..ce45f847ccaed 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/MultiBuffer.cpp
@@ -26,7 +26,6 @@
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "memref-transforms"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
#define DBGSNL() (llvm::dbgs() << "\n")
diff --git a/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp b/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
index 7a39983f9c64b..fa7991e6c6a80 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
@@ -24,7 +24,6 @@ namespace memref {
} // namespace memref
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "normalize-memrefs"
using namespace mlir;
diff --git a/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp b/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp
index 6bf9054b9a4c7..d65825bbdf391 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/ReifyResultShapes.cpp
@@ -20,7 +20,6 @@
#include "mlir/Interfaces/InferTypeOpInterface.h"
#include "llvm/Support/InterleavedRange.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "reify-result-shapes"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp
index ece8947f87918..f815245882630 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCDeclareGPUModuleInsertion.cpp
@@ -64,7 +64,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-declare-gpu-module-insertion"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp
index 57d26560540ae..9095d7c915fa8 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCIfClauseLowering.cpp
@@ -74,7 +74,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-if-clause-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp
index 325597f065988..3b83a25429234 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitData.cpp
@@ -225,7 +225,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-implicit-data"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
index 339953dbf4da7..e99a27a7bb89a 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCImplicitDeclare.cpp
@@ -194,7 +194,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-implicit-declare"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp
index 4b8b803a6bdc8..f41ce276f994f 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCLegalizeSerial.cpp
@@ -41,7 +41,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-legalize-serial"
namespace {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp
index 9ab138200a180..495d0247d86d3 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCLoopTiling.cpp
@@ -73,7 +73,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-loop-tile"
namespace {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp
index 89440f0ba8d4b..b60103e9cd85f 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCRecipeMaterialization.cpp
@@ -67,7 +67,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-recipe-materialization"
namespace {
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp
index 029729c89e7dd..04b2260045838 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCRoutineLowering.cpp
@@ -54,7 +54,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-routine-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp b/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp
index f160f3d43aab4..633538069c268 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/ACCSpecializeForHost.cpp
@@ -97,7 +97,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "acc-specialize-for-host"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp b/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
index 729bf45705ee3..7dbde227b2fab 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/OffloadLiveInValueCanonicalization.cpp
@@ -91,7 +91,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "offload-livein-value-canonicalization"
using namespace mlir;
diff --git a/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp b/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp
index 1d7c3a349e4e9..91a7c7d6489a4 100644
--- a/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp
+++ b/mlir/lib/Dialect/OpenACC/Transforms/OffloadTargetVerifier.cpp
@@ -66,7 +66,6 @@ namespace acc {
} // namespace acc
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "offload-target-verifier"
using namespace mlir;
diff --git a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
index 7b33d5142c2ac..0f00806870d8a 100644
--- a/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/ParallelLoopCollapsing.cpp
@@ -19,7 +19,6 @@ namespace mlir {
#include "mlir/Dialect/SCF/Transforms/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "parallel-loop-collapsing"
using namespace mlir;
diff --git a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
index ba37f01201c27..963e2d6d4f37b 100644
--- a/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
+++ b/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
@@ -30,7 +30,6 @@
#include "llvm/Support/Debug.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "tile-using-interface"
using namespace mlir;
diff --git a/mlir/lib/Dialect/SCF/Utils/Utils.cpp b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
index 0b131e67dd3b1..bae6e68400e22 100644
--- a/mlir/lib/Dialect/SCF/Utils/Utils.cpp
+++ b/mlir/lib/Dialect/SCF/Utils/Utils.cpp
@@ -31,7 +31,6 @@
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "scf-utils"
SmallVector<scf::ForOp> mlir::replaceLoopNestWithNewYields(
diff --git a/mlir/lib/Dialect/Transform/IR/Utils.cpp b/mlir/lib/Dialect/Transform/IR/Utils.cpp
index 0d41af5d685fd..773eb138cdf62 100644
--- a/mlir/lib/Dialect/Transform/IR/Utils.cpp
+++ b/mlir/lib/Dialect/Transform/IR/Utils.cpp
@@ -15,7 +15,6 @@
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "transform-dialect-utils"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE << "]: ")
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
index eceafda76fecf..61d9357e19bb4 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorBroadcast.cpp
@@ -22,7 +22,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-broadcast-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
index 42261f2f6a75b..14fbdd2243676 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
@@ -23,7 +23,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-contract-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
index e37caee4fc374..7194d41d60df7 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorGather.cpp
@@ -26,7 +26,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-broadcast-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
index ce67a7a82af5f..13ad98de284e2 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorInterleave.cpp
@@ -18,7 +18,6 @@
#include "mlir/IR/PatternMatch.h"
#include "llvm/ADT/SmallVectorExtras.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-interleave-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
index 60f023a8761b2..7730c4e7c950a 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMask.cpp
@@ -19,7 +19,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-mask"
namespace mlir {
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp
index 7392c2bf17795..76599822fbfe4 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorMultiReduction.cpp
@@ -26,7 +26,6 @@ namespace vector {
} // namespace vector
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-multi-reduction"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
index 7620fb9d34416..0eba0b12259ac 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShapeCast.cpp
@@ -24,7 +24,6 @@
#include "llvm/ADT/STLExtras.h"
#include <numeric>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-shape-cast-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp
index 063cf766449fb..ef49c863683ad 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorShuffle.cpp
@@ -16,7 +16,6 @@
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
#include "mlir/IR/PatternMatch.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-shuffle-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp
index ee4ef92fa94d6..08e7c895831ce 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorStep.cpp
@@ -16,7 +16,6 @@
#include "mlir/Dialect/Vector/Transforms/LoweringPatterns.h"
#include "mlir/IR/PatternMatch.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-step-lowering"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp
index 7d3928fcee915..7521e2491335b 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorToFromElementsToShuffleTree.cpp
@@ -31,7 +31,6 @@ namespace vector {
} // namespace vector
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-to-from-elements-to-shuffle-tree"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp b/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
index 4ab711c77b889..c3f7de0ac3c4e 100644
--- a/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/LowerVectorTranspose.cpp
@@ -23,7 +23,6 @@
#include "mlir/IR/PatternMatch.h"
#include "mlir/IR/TypeUtilities.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "lower-vector-transpose"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
index 6bc18ef80c046..c53242b526cb6 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
@@ -42,7 +42,6 @@
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-narrow-type-emulation"
using VectorValue = TypedValue<VectorType>;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp
index c7a0cf059b7bf..19db8b3b48a25 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferOpTransforms.cpp
@@ -28,7 +28,6 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DebugLog.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-transfer-opt"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
index 21d697dd47755..bd14e43747f81 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransferSplitRewritePatterns.cpp
@@ -28,7 +28,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVectorExtras.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-transfer-split"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
index 529fd5558dd95..c694f4f58faa1 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp
@@ -36,7 +36,6 @@
#include <functional>
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-to-vector"
using namespace mlir;
diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
index 47569d0de2b6f..37a691c4fce7c 100644
--- a/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
+++ b/mlir/lib/Dialect/Vector/Transforms/VectorUnroll.cpp
@@ -21,7 +21,6 @@
#include "llvm/Support/InterleavedRange.h"
#include <optional>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "vector-unroll"
using namespace mlir;
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
index 1c21cabd5c3a9..0ece695aed512 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPeepHoleOptimizer.cpp
@@ -37,7 +37,6 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-optimize-peephole"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
index 047409c13d8d1..8675fe8b5cce1 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUPropagateLayout.cpp
@@ -46,7 +46,6 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-propagate-layout"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
index 6aa1ffc36834e..0961ddfb92040 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
@@ -39,7 +39,6 @@ namespace xegpu {
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-sg-to-wi-distribute-experimental"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
index 0241b706a2d30..69c2fb7493086 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
@@ -46,7 +46,6 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-subgroup-distribute"
#define DBGS() (llvm::dbgs() << "[" DEBUG_TYPE "]: ")
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
index 97f68e8880db9..d633c1531955d 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUUnroll.cpp
@@ -27,7 +27,6 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-unroll"
using namespace mlir;
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp
index 6f759037d0c82..e31c37a2459ad 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUVectorLinearize.cpp
@@ -29,7 +29,6 @@ namespace xegpu {
} // namespace xegpu
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "xegpu-vector-linearize"
using namespace mlir;
diff --git a/mlir/lib/IR/Dialect.cpp b/mlir/lib/IR/Dialect.cpp
index 0f429d90d3b9e..952619b4477a7 100644
--- a/mlir/lib/IR/Dialect.cpp
+++ b/mlir/lib/IR/Dialect.cpp
@@ -23,7 +23,6 @@
#include "llvm/Support/Regex.h"
#include <memory>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dialect"
using namespace mlir;
diff --git a/mlir/lib/Support/TypeID.cpp b/mlir/lib/Support/TypeID.cpp
index 6a71c03e47eb3..3526a0d49cc79 100644
--- a/mlir/lib/Support/TypeID.cpp
+++ b/mlir/lib/Support/TypeID.cpp
@@ -17,7 +17,6 @@
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "typeid"
//===----------------------------------------------------------------------===//
diff --git a/mlir/lib/TableGen/Pattern.cpp b/mlir/lib/TableGen/Pattern.cpp
index becc6b4fcaa23..ce09f5c3f5183 100644
--- a/mlir/lib/TableGen/Pattern.cpp
+++ b/mlir/lib/TableGen/Pattern.cpp
@@ -22,7 +22,6 @@
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "mlir-tblgen-pattern"
using namespace mlir;
diff --git a/mlir/lib/Transforms/RemoveDeadValues.cpp b/mlir/lib/Transforms/RemoveDeadValues.cpp
index 0ea22924b5481..ade7647890830 100644
--- a/mlir/lib/Transforms/RemoveDeadValues.cpp
+++ b/mlir/lib/Transforms/RemoveDeadValues.cpp
@@ -60,7 +60,6 @@
#include <optional>
#include <vector>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "remove-dead-values"
namespace mlir {
diff --git a/mlir/lib/Transforms/SROA.cpp b/mlir/lib/Transforms/SROA.cpp
index cac976bea7521..859c0302185e6 100644
--- a/mlir/lib/Transforms/SROA.cpp
+++ b/mlir/lib/Transforms/SROA.cpp
@@ -19,7 +19,6 @@ namespace mlir {
#include "mlir/Transforms/Passes.h.inc"
} // namespace mlir
-#undef DEBUG_TYPE
#define DEBUG_TYPE "sroa"
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index c35e009655560..cf59234ded233 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -31,7 +31,6 @@
using namespace mlir;
using namespace mlir::detail;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "dialect-conversion"
/// A utility function to log a successful result for the given reason.
diff --git a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
index f86a9f0aa3986..578e680535bed 100644
--- a/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
@@ -35,7 +35,6 @@
using namespace mlir;
-#undef DEBUG_TYPE
#define DEBUG_TYPE "greedy-rewriter"
namespace {
diff --git a/mlir/lib/Transforms/Utils/Inliner.cpp b/mlir/lib/Transforms/Utils/Inliner.cpp
index ff324b08821e4..40950312d566f 100644
--- a/mlir/lib/Transforms/Utils/Inliner.cpp
+++ b/mlir/lib/Transforms/Utils/Inliner.cpp
@@ -23,7 +23,6 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/DebugLog.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "inlining"
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp b/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
index 87a7f6a89a342..5f3b04a6d8bce 100644
--- a/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
+++ b/mlir/lib/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp
@@ -22,7 +22,6 @@
#include "llvm/Support/DebugLog.h"
#include <queue>
-#undef DEBUG_TYPE
#define DEBUG_TYPE "licm"
using namespace mlir;
diff --git a/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp b/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
index 945994cd7d425..1382550e0f7e6 100644
--- a/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
+++ b/mlir/lib/Transforms/Utils/WalkPatternRewriteDriver.cpp
@@ -23,7 +23,6 @@
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/ErrorHandling.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "walk-rewriter"
namespace mlir {
diff --git a/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
index 71f13046260a4..b3b9a590773b0 100644
--- a/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
+++ b/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
@@ -18,7 +18,6 @@
#include "mlir/Pass/Pass.h"
#include "llvm/Support/Debug.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "test-memref-dependence-check"
using namespace mlir;
diff --git a/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp b/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
index a00bb524d4259..bf11d94596fa7 100644
--- a/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
+++ b/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
@@ -18,7 +18,6 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Pass/Pass.h"
-#undef DEBUG_TYPE
#define DEBUG_TYPE "test-loop-fusion"
using namespace mlir;
>From 1c79145e03369721ba75a9e70179a0b71e35b6a4 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Wed, 18 Mar 2026 22:44:13 -0700
Subject: [PATCH 03/25] use `after`
---
llvm/CMakeLists.txt | 23 +++++++++++++++++++
.../IR/Detail/DimLvlMapParser.cpp | 1 +
.../SparseTensor/IR/Detail/LvlTypeParser.cpp | 2 ++
.../Transforms/Utils/SparseTensorIterator.cpp | 2 ++
4 files changed, 28 insertions(+)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 6dbe47600cb2f..334fd25c43608 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -1552,3 +1552,26 @@ if (XCODE)
set_target_properties(${target} PROPERTIES XCODE_GENERATE_SCHEME ON)
endforeach()
endif()
+
+function (_get_all_cmake_targets out_var current_dir)
+ get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS)
+ get_property(subdirs DIRECTORY ${current_dir} PROPERTY SUBDIRECTORIES)
+ foreach(subdir ${subdirs})
+ _get_all_cmake_targets(subdir_targets ${subdir})
+ list(APPEND targets ${subdir_targets})
+ endforeach()
+ set(${out_var} ${targets} PARENT_SCOPE)
+endfunction()
+
+# Run at end of top-level CMakeLists
+_get_all_cmake_targets(all_targets ${CMAKE_CURRENT_LIST_DIR})
+
+foreach(target ${all_targets})
+ set(after [[
+ #undef DEBUG_TYPE
+ #undef DBGS
+ ]])
+ set_target_properties(${target} PROPERTIES
+ UNITY_BUILD_CODE_AFTER_INCLUDE "${after}"
+ )
+endforeach()
diff --git a/mlir/lib/Dialect/SparseTensor/IR/Detail/DimLvlMapParser.cpp b/mlir/lib/Dialect/SparseTensor/IR/Detail/DimLvlMapParser.cpp
index 2963b3463f7e0..51d7dea661d4a 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/Detail/DimLvlMapParser.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/Detail/DimLvlMapParser.cpp
@@ -12,6 +12,7 @@ using namespace mlir;
using namespace mlir::sparse_tensor;
using namespace mlir::sparse_tensor::ir_detail;
+#undef FAILURE_IF_FAILED
#define FAILURE_IF_FAILED(RES) \
if (failed(RES)) { \
return failure(); \
diff --git a/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp b/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp
index bb6c65a6f6ca0..81c7bc44a648c 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/Detail/LvlTypeParser.cpp
@@ -14,12 +14,14 @@ using namespace mlir::sparse_tensor;
using namespace mlir::sparse_tensor::ir_detail;
//===----------------------------------------------------------------------===//
+#undef FAILURE_IF_FAILED
#define FAILURE_IF_FAILED(STMT) \
if (failed(STMT)) { \
return failure(); \
}
// NOTE: this macro assumes `AsmParser parser` and `SMLoc loc` are in scope.
+#undef ERROR_IF
#define ERROR_IF(COND, MSG) \
if (COND) { \
return parser.emitError(loc, MSG); \
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
index 61b5ad600a16e..6890dc94f7bdd 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/Utils/SparseTensorIterator.cpp
@@ -35,7 +35,9 @@ using ValueTuple = std::tuple<Value, Value, Value>;
#define SUBI(lhs, rhs) (arith::SubIOp::create(b, l, (lhs), (rhs)).getResult())
#define MULI(lhs, rhs) (arith::MulIOp::create(b, l, (lhs), (rhs)).getResult())
#define MINUI(lhs, rhs) (arith::MinUIOp::create(b, l, (lhs), (rhs)).getResult())
+#undef REMUI
#define REMUI(lhs, rhs) (arith::RemUIOp::create(b, l, (lhs), (rhs)).getResult())
+#undef DIVUI
#define DIVUI(lhs, rhs) (arith::DivUIOp::create(b, l, (lhs), (rhs)).getResult())
#define SELECT(c, lhs, rhs) \
(arith::SelectOp::create(b, l, (c), (lhs), (rhs)).getResult())
>From 70f97e290db735def9b99aa55d50c9dbba6e32b7 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 01:02:47 -0700
Subject: [PATCH 04/25] handle more projects
---
clang-tools-extra/clang-doc/CMakeLists.txt | 8 ++++
.../clang-doc/support/CMakeLists.txt | 7 ++++
clang-tools-extra/clang-tidy/CMakeLists.txt | 4 ++
clang-tools-extra/clangd/CMakeLists.txt | 8 ++++
.../clangd/refactor/tweaks/CMakeLists.txt | 9 +++++
clang-tools-extra/modularize/CMakeLists.txt | 7 ++++
clang/lib/APINotes/CMakeLists.txt | 11 ++++++
clang/lib/AST/CMakeLists.txt | 11 ++++++
.../Analysis/LifetimeSafety/CMakeLists.txt | 8 ++++
clang/lib/Basic/CMakeLists.txt | 22 +++++++++++
clang/lib/CodeGen/CMakeLists.txt | 38 +++++++++++++++++++
clang/lib/Driver/CMakeLists.txt | 5 +++
clang/lib/ExtractAPI/CMakeLists.txt | 7 ++++
clang/lib/Frontend/CMakeLists.txt | 8 ++++
clang/lib/Frontend/Rewrite/CMakeLists.txt | 8 ++++
clang/lib/Lex/CMakeLists.txt | 7 ++++
clang/lib/Sema/CMakeLists.txt | 7 ++++
clang/lib/Serialization/CMakeLists.txt | 7 ++++
clang/lib/Tooling/CMakeLists.txt | 10 +++++
clang/lib/Tooling/Transformer/CMakeLists.txt | 8 ++++
clang/tools/clang-installapi/CMakeLists.txt | 7 ++++
clang/tools/diagtool/CMakeLists.txt | 7 ++++
clang/tools/driver/CMakeLists.txt | 9 +++++
clang/utils/TableGen/CMakeLists.txt | 6 +++
lld/CMakeLists.txt | 4 ++
lldb/CMakeLists.txt | 5 +++
lldb/source/Host/macosx/objcxx/CMakeLists.txt | 4 ++
.../Platform/MacOSX/objcxx/CMakeLists.txt | 4 ++
llvm/lib/CAS/CMakeLists.txt | 4 ++
llvm/lib/DebugInfo/LogicalView/CMakeLists.txt | 4 ++
llvm/lib/ObjCopy/CMakeLists.txt | 9 +++++
llvm/tools/dsymutil/CMakeLists.txt | 8 ++++
llvm/tools/llvm-c-test/CMakeLists.txt | 10 +++++
llvm/tools/llvm-jitlink/CMakeLists.txt | 8 ++++
llvm/tools/llvm-objdump/CMakeLists.txt | 7 ++++
llvm/tools/llvm-pdbutil/CMakeLists.txt | 7 ++++
llvm/tools/llvm-readobj/CMakeLists.txt | 7 ++++
llvm/tools/llvm-reduce/CMakeLists.txt | 7 ++++
llvm/tools/llvm-remarkutil/CMakeLists.txt | 4 ++
llvm/tools/llvm-xray/CMakeLists.txt | 4 ++
polly/lib/CMakeLists.txt | 20 ++++++++++
polly/lib/External/CMakeLists.txt | 1 +
42 files changed, 346 insertions(+)
diff --git a/clang-tools-extra/clang-doc/CMakeLists.txt b/clang-tools-extra/clang-doc/CMakeLists.txt
index 22e2c8159e9f6..c5d082162acea 100644
--- a/clang-tools-extra/clang-doc/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/CMakeLists.txt
@@ -5,6 +5,14 @@ set(LLVM_LINK_COMPONENTS
)
add_subdirectory(support)
+# Representation.cpp and YAMLGenerator.cpp have conflicting static declarations
+# and CommentKind ambiguity when combined in unity builds.
+set_source_files_properties(
+ Representation.cpp
+ YAMLGenerator.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangDoc STATIC
BitcodeReader.cpp
BitcodeWriter.cpp
diff --git a/clang-tools-extra/clang-doc/support/CMakeLists.txt b/clang-tools-extra/clang-doc/support/CMakeLists.txt
index 8ac913ffbe998..d43163388973d 100644
--- a/clang-tools-extra/clang-doc/support/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/support/CMakeLists.txt
@@ -4,6 +4,13 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# Utils.cpp references ClangDocContext which is not visible when combined
+# with File.cpp in a unity build due to include ordering.
+set_source_files_properties(
+ Utils.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangDocSupport STATIC
File.cpp
Utils.cpp
diff --git a/clang-tools-extra/clang-tidy/CMakeLists.txt b/clang-tools-extra/clang-tidy/CMakeLists.txt
index 153356245cfd1..f34c6e37d7d0c 100644
--- a/clang-tools-extra/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/clang-tidy/CMakeLists.txt
@@ -3,6 +3,10 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# AST_MATCHER macros generate identically-named classes in anonymous
+# namespaces across 146+ check files, making unity builds infeasible.
+set(CMAKE_UNITY_BUILD OFF)
+
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/clang-tidy-config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/clang-tidy-config.h)
diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
index a0e8036038d30..c307bc97ac83e 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -61,6 +61,14 @@ endif()
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/../clang-tidy")
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/../include-cleaner/include")
+# clangd::Token conflicts with clang::Token, and InsertionPoint.cpp has
+# type conflicts when combined with other files in unity builds.
+set_source_files_properties(
+ SourceCode.cpp
+ refactor/InsertionPoint.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangDaemon STATIC
AST.cpp
ASTSignals.cpp
diff --git a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
index 1d6e38088ad67..b4715bdaf467d 100644
--- a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
+++ b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
@@ -11,6 +11,15 @@ set(LLVM_LINK_COMPONENTS
# To enable these tweaks in executables or shared libraries, add
# $<TARGET_OBJECTS:obj.clangDaemonTweaks> to a list of sources, see
# clangd/tool/CMakeLists.txt for an example.
+# DefineInline/DefineOutline share static getSelectedFunction;
+# RemoveUsingNamespace has clangd::Token vs clang::Token conflicts.
+set_source_files_properties(
+ DefineInline.cpp
+ DefineOutline.cpp
+ RemoveUsingNamespace.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangDaemonTweaks OBJECT
AddUsing.cpp
AnnotateHighlightings.cpp
diff --git a/clang-tools-extra/modularize/CMakeLists.txt b/clang-tools-extra/modularize/CMakeLists.txt
index a775b790a3147..e56b9cec594e0 100644
--- a/clang-tools-extra/modularize/CMakeLists.txt
+++ b/clang-tools-extra/modularize/CMakeLists.txt
@@ -4,6 +4,13 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# ModuleAssistant.cpp defines a local Module class that conflicts with
+# clang::Module when combined in unity builds.
+set_source_files_properties(
+ ModuleAssistant.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_tool(modularize
Modularize.cpp
ModuleAssistant.cpp
diff --git a/clang/lib/APINotes/CMakeLists.txt b/clang/lib/APINotes/CMakeLists.txt
index dc83edd911ce2..f2202d491364c 100644
--- a/clang/lib/APINotes/CMakeLists.txt
+++ b/clang/lib/APINotes/CMakeLists.txt
@@ -2,6 +2,17 @@ set(LLVM_LINK_COMPONENTS
BitReader
BitstreamReader
Support)
+# Reader and Writer define identically-named classes in anonymous namespaces
+# (IdentifierTableInfo, ContextIDTableInfo, etc.). Manager and YAMLCompiler
+# use "using namespace api_notes" which brings api_notes::Module into scope,
+# conflicting with clang::Module.
+set_source_files_properties(
+ APINotesReader.cpp
+ APINotesWriter.cpp
+ APINotesYAMLCompiler.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangAPINotes
APINotesManager.cpp
APINotesReader.cpp
diff --git a/clang/lib/AST/CMakeLists.txt b/clang/lib/AST/CMakeLists.txt
index e33250dc005e4..b61d921bda154 100644
--- a/clang/lib/AST/CMakeLists.txt
+++ b/clang/lib/AST/CMakeLists.txt
@@ -20,6 +20,17 @@ clang_tablegen(AttrDocTable.inc -gen-clang-attr-doc-table
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../../include/clang/Basic/Attr.td
TARGET ClangAttrDocTable)
+# CommentParser/CommentSema use "using namespace clang::comments" which
+# conflicts with clang::tok. MicrosoftMangle and ItaniumMangle define
+# functions with the same name that cause overload ambiguity.
+set_source_files_properties(
+ CommentParser.cpp
+ CommentSema.cpp
+ MicrosoftMangle.cpp
+ ItaniumMangle.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangAST
APValue.cpp
ASTConcept.cpp
diff --git a/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt b/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt
index 247377c7256d9..cf8a591b07502 100644
--- a/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt
+++ b/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt
@@ -1,3 +1,11 @@
+# Multiple files define identically-named struct Lattice and class AnalysisImpl
+# in anonymous namespaces, causing redefinition errors in unity builds.
+set_source_files_properties(
+ LoanPropagation.cpp
+ MovedLoans.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangAnalysisLifetimeSafety
Checker.cpp
Facts.cpp
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index adfc6ee326b5a..f31d0990b7d88 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -137,6 +137,28 @@ add_clang_library(clangBasic
target_parser_gen
)
+# Each Targets/*.cpp file defines static constexpr NumBuiltins, BuiltinInfos,
+# and BuiltinStrings which conflict in unity builds.
+set_source_files_properties(
+ Targets/AMDGPU.cpp
+ Targets/ARM.cpp
+ Targets/BPF.cpp
+ Targets/DirectX.cpp
+ Targets/Hexagon.cpp
+ Targets/LoongArch.cpp
+ Targets/Mips.cpp
+ Targets/NVPTX.cpp
+ Targets/PPC.cpp
+ Targets/RISCV.cpp
+ Targets/SPIR.cpp
+ Targets/SystemZ.cpp
+ Targets/VE.cpp
+ Targets/WebAssembly.cpp
+ Targets/X86.cpp
+ Targets/XCore.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
target_link_libraries(clangBasic
PRIVATE
${LLVM_ATOMIC_LIB}
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index 434781b3c4f02..0740c67424f80 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -55,6 +55,44 @@ if(MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES Clang
endif()
endif()
+# Many CodeGen files use "using namespace llvm" which brings llvm::Type,
+# llvm::VectorType, etc. into scope, conflicting with clang:: equivalents
+# used by other files in the same unity TU.
+set_source_files_properties(
+ BackendUtil.cpp
+ CGAtomic.cpp
+ CGBuiltin.cpp
+ CGCoroutine.cpp
+ CGExpr.cpp
+ CGHLSLBuiltins.cpp
+ CGHLSLRuntime.cpp
+ CGLoopInfo.cpp
+ CGNonTrivialStruct.cpp
+ CGOpenMPRuntime.cpp
+ CGOpenMPRuntimeGPU.cpp
+ CGStmtOpenMP.cpp
+ CodeGenAction.cpp
+ CodeGenFunction.cpp
+ CodeGenModule.cpp
+ CodeGenPGO.cpp
+ CoverageMappingGen.cpp
+ LinkInModulesPass.cpp
+ QualTypeMapper.cpp
+ TargetBuiltins/AMDGPU.cpp
+ TargetBuiltins/ARM.cpp
+ TargetBuiltins/DirectX.cpp
+ TargetBuiltins/Hexagon.cpp
+ TargetBuiltins/NVPTX.cpp
+ TargetBuiltins/PPC.cpp
+ TargetBuiltins/RISCV.cpp
+ TargetBuiltins/SPIR.cpp
+ TargetBuiltins/SystemZ.cpp
+ TargetBuiltins/WebAssembly.cpp
+ TargetBuiltins/X86.cpp
+ Targets/AArch64.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangCodeGen
ABIInfo.cpp
ABIInfoImpl.cpp
diff --git a/clang/lib/Driver/CMakeLists.txt b/clang/lib/Driver/CMakeLists.txt
index 8a2ffb303b4cb..904831486d26f 100644
--- a/clang/lib/Driver/CMakeLists.txt
+++ b/clang/lib/Driver/CMakeLists.txt
@@ -22,6 +22,11 @@ if(LLVM_PTHREAD_LIB)
list(APPEND system_libs ${LLVM_PTHREAD_LIB})
endif()
+# Multiple ToolChains/*.cpp files define static functions with the same name
+# (e.g. checkRemarksOptions, getOSLibDir) and use "using namespace driver"
+# which conflicts across translation units in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_clang_library(clangDriver
Action.cpp
Compilation.cpp
diff --git a/clang/lib/ExtractAPI/CMakeLists.txt b/clang/lib/ExtractAPI/CMakeLists.txt
index fbf2917e794d3..5cc74a2e156a1 100644
--- a/clang/lib/ExtractAPI/CMakeLists.txt
+++ b/clang/lib/ExtractAPI/CMakeLists.txt
@@ -3,6 +3,13 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# SymbolGraphSerializer.cpp uses "using namespace llvm" which brings types
+# that conflict with clang::extractapi types in unity builds.
+set_source_files_properties(
+ Serialization/SymbolGraphSerializer.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangExtractAPI
API.cpp
APIIgnoresList.cpp
diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt
index c40baa3657fe1..ee60df176cd29 100644
--- a/clang/lib/Frontend/CMakeLists.txt
+++ b/clang/lib/Frontend/CMakeLists.txt
@@ -10,6 +10,14 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# config.h uses a #include guard that errors on double-inclusion, which
+# breaks unity builds when multiple .cpp files include it.
+set_source_files_properties(
+ CompilerInstance.cpp
+ CompilerInvocation.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangFrontend
ASTConsumers.cpp
ASTMerge.cpp
diff --git a/clang/lib/Frontend/Rewrite/CMakeLists.txt b/clang/lib/Frontend/Rewrite/CMakeLists.txt
index 64aa651394dff..8a2dbbea2eede 100644
--- a/clang/lib/Frontend/Rewrite/CMakeLists.txt
+++ b/clang/lib/Frontend/Rewrite/CMakeLists.txt
@@ -2,6 +2,14 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# Both files include config.h which uses #error to prevent double-inclusion,
+# breaking unity builds when they end up in the same translation unit.
+set_source_files_properties(
+ RewriteModernObjC.cpp
+ RewriteObjC.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangRewriteFrontend
FixItRewriter.cpp
FrontendActions.cpp
diff --git a/clang/lib/Lex/CMakeLists.txt b/clang/lib/Lex/CMakeLists.txt
index f61737cd68021..f9960e1846f49 100644
--- a/clang/lib/Lex/CMakeLists.txt
+++ b/clang/lib/Lex/CMakeLists.txt
@@ -5,6 +5,13 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# "using namespace clang::dependency_directives_scan" at file scope brings
+# dependency_directives_scan::Token into scope, conflicting with clang::Token.
+set_source_files_properties(
+ DependencyDirectivesScanner.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangLex
DependencyDirectivesScanner.cpp
HeaderMap.cpp
diff --git a/clang/lib/Sema/CMakeLists.txt b/clang/lib/Sema/CMakeLists.txt
index 0ebf56ecffe69..43ba756bc819a 100644
--- a/clang/lib/Sema/CMakeLists.txt
+++ b/clang/lib/Sema/CMakeLists.txt
@@ -13,6 +13,13 @@ clang_tablegen(OpenCLBuiltins.inc -gen-clang-opencl-builtins
TARGET ClangOpenCLBuiltinsImpl
)
+# Both files define struct PartialSpecMatchResult in anonymous namespaces
+# with different member types, causing redefinition errors in unity builds.
+set_source_files_properties(
+ SemaTemplateInstantiate.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangSema
AnalysisBasedWarnings.cpp
CheckExprLifetime.cpp
diff --git a/clang/lib/Serialization/CMakeLists.txt b/clang/lib/Serialization/CMakeLists.txt
index c22987b2c78df..1dbf2e6440fd1 100644
--- a/clang/lib/Serialization/CMakeLists.txt
+++ b/clang/lib/Serialization/CMakeLists.txt
@@ -6,6 +6,13 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# ASTWriter.cpp defines HeaderFileInfoTrait and LazySpecializationInfoLookupTrait
+# in an anonymous namespace, conflicting with identically-named classes from
+# ASTReaderInternals.h included by other files in this directory.
+set_source_files_properties(
+ ASTWriter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
add_clang_library(clangSerialization
ASTCommon.cpp
diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt
index 0972ecb08437f..0cfcc6456beb9 100644
--- a/clang/lib/Tooling/CMakeLists.txt
+++ b/clang/lib/Tooling/CMakeLists.txt
@@ -12,6 +12,16 @@ add_subdirectory(ASTDiff)
add_subdirectory(Syntax)
add_subdirectory(Transformer)
+# CompilationDatabase.cpp and DependencyScanningTool.cpp reference
+# clang::driver which becomes ambiguous when combined with other files
+# in a unity build.
+set_source_files_properties(
+ CompilationDatabase.cpp
+ DependencyScanningTool.cpp
+ Tooling.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangTooling
AllTUsExecution.cpp
ArgumentsAdjusters.cpp
diff --git a/clang/lib/Tooling/Transformer/CMakeLists.txt b/clang/lib/Tooling/Transformer/CMakeLists.txt
index 4ab4bd6f08989..bcd292ef6302e 100644
--- a/clang/lib/Tooling/Transformer/CMakeLists.txt
+++ b/clang/lib/Tooling/Transformer/CMakeLists.txt
@@ -3,6 +3,14 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# Both files define a static getNode() helper in anonymous namespaces,
+# causing redefinition errors in unity builds.
+set_source_files_properties(
+ Stencil.cpp
+ RangeSelector.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_library(clangTransformer
Parsing.cpp
RangeSelector.cpp
diff --git a/clang/tools/clang-installapi/CMakeLists.txt b/clang/tools/clang-installapi/CMakeLists.txt
index 54bc80486472f..47678e3549022 100644
--- a/clang/tools/clang-installapi/CMakeLists.txt
+++ b/clang/tools/clang-installapi/CMakeLists.txt
@@ -11,6 +11,13 @@ set(LLVM_TARGET_DEFINITIONS InstallAPIOpts.td)
tablegen(LLVM InstallAPIOpts.inc -gen-opt-parser-defs)
add_public_tablegen_target(InstallAPIDriverOptions)
+# Options.cpp uses "using namespace llvm" which makes llvm::Value ambiguous
+# with other types when combined in unity builds.
+set_source_files_properties(
+ Options.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_tool(clang-installapi
ClangInstallAPI.cpp
Options.cpp
diff --git a/clang/tools/diagtool/CMakeLists.txt b/clang/tools/diagtool/CMakeLists.txt
index 09b2a81790f87..18cc716c00985 100644
--- a/clang/tools/diagtool/CMakeLists.txt
+++ b/clang/tools/diagtool/CMakeLists.txt
@@ -2,6 +2,13 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# TreeView.cpp defines printUsage which conflicts with identically-named
+# functions from other diagtool files in unity builds.
+set_source_files_properties(
+ TreeView.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_tool(diagtool
diagtool_main.cpp
DiagTool.cpp
diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt
index 002aaef005253..5e424eb6eab81 100644
--- a/clang/tools/driver/CMakeLists.txt
+++ b/clang/tools/driver/CMakeLists.txt
@@ -39,6 +39,15 @@ if (CLANG_BOLT AND NOT LLVM_BUILD_INSTRUMENTED)
endif()
endif()
+# cc1as_main.cpp and driver.cpp both define LLVMErrorHandler; cc1gen_reproducer
+# uses "driver" which is ambiguous with clang::driver in unity builds.
+set_source_files_properties(
+ cc1_main.cpp
+ cc1as_main.cpp
+ cc1gen_reproducer_main.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_clang_tool(clang
driver.cpp
cc1_main.cpp
diff --git a/clang/utils/TableGen/CMakeLists.txt b/clang/utils/TableGen/CMakeLists.txt
index 14f13824e9575..c66a5ec640607 100644
--- a/clang/utils/TableGen/CMakeLists.txt
+++ b/clang/utils/TableGen/CMakeLists.txt
@@ -28,4 +28,10 @@ add_tablegen(clang-tblgen CLANG
TableGen.cpp
)
+# MveEmitter.cpp and NeonEmitter.cpp define large anonymous-namespace classes
+# that conflict with each other in unity builds.
+set_source_files_properties(
+ NeonEmitter.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
target_link_libraries(clang-tblgen PRIVATE clangSupport_tablegen)
diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt
index 80e25204a65ee..05763ae7b5ca5 100644
--- a/lld/CMakeLists.txt
+++ b/lld/CMakeLists.txt
@@ -190,6 +190,10 @@ include_directories(BEFORE
add_subdirectory(Common)
add_subdirectory(tools/lld)
+# Multiple Arch/*.cpp files define static functions, enums, and types with
+# the same names, and "using namespace" brings conflicting symbols into scope.
+set(CMAKE_UNITY_BUILD OFF)
+
if (LLVM_INCLUDE_TESTS)
add_custom_target(LLDUnitTests)
set_target_properties(LLDUnitTests PROPERTIES FOLDER "LLD/Tests")
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 0a1ca5cf391ef..ff076da04c2e7 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -139,6 +139,11 @@ endif()
# TableGen
add_subdirectory(utils/TableGen)
+# Nearly every lldb source file uses "using namespace lldb" which pulls
+# lldb::pid_t and lldb::thread_t into scope, conflicting with POSIX/mach
+# system types when system headers are included in the same translation unit.
+set(CMAKE_UNITY_BUILD OFF)
+
add_subdirectory(source)
add_subdirectory(tools)
add_subdirectory(docs)
diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
index 1d7573335b8ec..ed1a24f3b42e7 100644
--- a/lldb/source/Host/macosx/objcxx/CMakeLists.txt
+++ b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
@@ -2,6 +2,10 @@
remove_module_flags()
include_directories(..)
+# ObjC++ (.mm) files cannot be unity-built because CMake generates .cxx
+# unity wrappers, causing them to be compiled as C++ instead of ObjC++.
+set(CMAKE_UNITY_BUILD OFF)
+
add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
Host.mm
HostInfoMacOSX.mm
diff --git a/lldb/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt b/lldb/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
index 8640aac0862b8..c2f6565210298 100644
--- a/lldb/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
+++ b/lldb/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -1,6 +1,10 @@
remove_module_flags()
include_directories(.)
+# ObjC++ (.mm) files cannot be unity-built because CMake generates .cxx
+# unity wrappers, causing them to be compiled as C++ instead of ObjC++.
+set(CMAKE_UNITY_BUILD OFF)
+
add_lldb_library(lldbPluginPlatformMacOSXObjCXX
PlatformiOSSimulatorCoreSimulatorSupport.mm
diff --git a/llvm/lib/CAS/CMakeLists.txt b/llvm/lib/CAS/CMakeLists.txt
index b17fa84558bab..2755400ca3448 100644
--- a/llvm/lib/CAS/CMakeLists.txt
+++ b/llvm/lib/CAS/CMakeLists.txt
@@ -2,6 +2,10 @@ if (UNIX AND "${CMAKE_SYSTEM_NAME}" MATCHES "AIX")
set(additional_libs bsd)
endif()
+# Multiple CAS implementations define ObjectHandle in different namespaces
+# that become ambiguous with "using namespace" in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_llvm_component_library(LLVMCAS
ActionCache.cpp
ActionCaches.cpp
diff --git a/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt b/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt
index 462857ef93063..5a31a124736d5 100644
--- a/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/LogicalView/CMakeLists.txt
@@ -34,6 +34,10 @@ list(APPEND LIBLV_ADDITIONAL_HEADER_DIRS
"${LLVM_MAIN_INCLUDE_DIR}/llvm/DebugInfo/LogicalView/Readers"
)
+# Multiple Core/*.cpp files define identically-named static variables
+# (KindUndefined, etc.) causing redefinition errors in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_llvm_component_library(LLVMDebugInfoLogicalView
${LV_IMPL_SOURCES}
diff --git a/llvm/lib/ObjCopy/CMakeLists.txt b/llvm/lib/ObjCopy/CMakeLists.txt
index 960f1d1fae2d0..d29780e84372f 100644
--- a/llvm/lib/ObjCopy/CMakeLists.txt
+++ b/llvm/lib/ObjCopy/CMakeLists.txt
@@ -41,6 +41,15 @@ source_group("Source Files\\DXContainer" REGULAR_EXPRESSION
DXContainer/.*[.]cpp
)
+# ELF, MachO, COFF, and wasm ObjCopy implementations define identically-named
+# types (Section, Object, SectionPred) in different namespaces that conflict
+# when combined via "using namespace" in unity builds.
+set_source_files_properties(
+ MachO/MachOObjcopy.cpp
+ MachO/MachOReader.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_component_library(LLVMObjCopy
Archive.cpp
DXContainer/DXContainerObjcopy.cpp
diff --git a/llvm/tools/dsymutil/CMakeLists.txt b/llvm/tools/dsymutil/CMakeLists.txt
index d3cdbe466de08..638e3772d54bb 100644
--- a/llvm/tools/dsymutil/CMakeLists.txt
+++ b/llvm/tools/dsymutil/CMakeLists.txt
@@ -25,6 +25,14 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# CFBundle.cpp includes ObjC headers that conflict with MachO headers
+# from other files in unity builds.
+set_source_files_properties(
+ CFBundle.cpp
+ RelocationMap.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(dsymutil
dsymutil.cpp
BinaryHolder.cpp
diff --git a/llvm/tools/llvm-c-test/CMakeLists.txt b/llvm/tools/llvm-c-test/CMakeLists.txt
index 939164e636216..a725ba912071b 100644
--- a/llvm/tools/llvm-c-test/CMakeLists.txt
+++ b/llvm/tools/llvm-c-test/CMakeLists.txt
@@ -39,6 +39,16 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wstrict-prototypes")
endif ()
+# calc.c and disassemble.c both define handle_line, causing
+# redefinition errors in unity builds.
+set_source_files_properties(
+ calc.c
+ disassemble.c
+ diagnostic.c
+ module.c
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(llvm-c-test
attributes.c
calc.c
diff --git a/llvm/tools/llvm-jitlink/CMakeLists.txt b/llvm/tools/llvm-jitlink/CMakeLists.txt
index 19e3edaf63d86..5288fb6cb4c76 100644
--- a/llvm/tools/llvm-jitlink/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/CMakeLists.txt
@@ -20,6 +20,14 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
+# ELF, MachO, and COFF jitlink files define identically-named static functions
+# (getFirstRelocationEdge, etc.) that conflict in unity builds.
+set_source_files_properties(
+ llvm-jitlink-elf.cpp
+ llvm-jitlink-macho.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(llvm-jitlink
llvm-jitlink.cpp
llvm-jitlink-coff.cpp
diff --git a/llvm/tools/llvm-objdump/CMakeLists.txt b/llvm/tools/llvm-objdump/CMakeLists.txt
index 8283f07da36ea..5ff869b50c60e 100644
--- a/llvm/tools/llvm-objdump/CMakeLists.txt
+++ b/llvm/tools/llvm-objdump/CMakeLists.txt
@@ -25,6 +25,13 @@ set(LLVM_TARGET_DEFINITIONS OtoolOpts.td)
tablegen(LLVM OtoolOpts.inc -gen-opt-parser-defs)
add_public_tablegen_target(OtoolOptsTableGen)
+# MachODump.cpp defines UnwindInfo that conflicts with other dump files'
+# types when combined in unity builds.
+set_source_files_properties(
+ MachODump.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(llvm-objdump
llvm-objdump.cpp
SourcePrinter.cpp
diff --git a/llvm/tools/llvm-pdbutil/CMakeLists.txt b/llvm/tools/llvm-pdbutil/CMakeLists.txt
index e834755bdf483..84d7a6dc5ede9 100644
--- a/llvm/tools/llvm-pdbutil/CMakeLists.txt
+++ b/llvm/tools/llvm-pdbutil/CMakeLists.txt
@@ -8,6 +8,13 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# DumpOutputStyle.cpp defines printHeader which conflicts with identically-named
+# functions from other output style files in unity builds.
+set_source_files_properties(
+ DumpOutputStyle.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(llvm-pdbutil
BytesOutputStyle.cpp
DumpOutputStyle.cpp
diff --git a/llvm/tools/llvm-readobj/CMakeLists.txt b/llvm/tools/llvm-readobj/CMakeLists.txt
index 0051f87b3c103..048f218bfba88 100644
--- a/llvm/tools/llvm-readobj/CMakeLists.txt
+++ b/llvm/tools/llvm-readobj/CMakeLists.txt
@@ -13,6 +13,13 @@ set(LLVM_TARGET_DEFINITIONS Opts.td)
tablegen(LLVM Opts.inc -gen-opt-parser-defs)
add_public_tablegen_target(ReadobjOptsTableGen)
+# ELFDumper.cpp defines createError and checkHashTable that conflict with
+# identically-named functions from other dumper files in unity builds.
+set_source_files_properties(
+ ELFDumper.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(llvm-readobj
ARMWinEHPrinter.cpp
COFFDumper.cpp
diff --git a/llvm/tools/llvm-reduce/CMakeLists.txt b/llvm/tools/llvm-reduce/CMakeLists.txt
index cf6701a3f0d5f..08b1176d48986 100644
--- a/llvm/tools/llvm-reduce/CMakeLists.txt
+++ b/llvm/tools/llvm-reduce/CMakeLists.txt
@@ -20,6 +20,13 @@ set(LLVM_LINK_COMPONENTS
TransformUtils
)
+# ReduceOperandsSkip.cpp defines shouldReduceOperand which conflicts with
+# identically-named functions from other delta files in unity builds.
+set_source_files_properties(
+ deltas/ReduceOperandsSkip.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_llvm_tool(llvm-reduce
DeltaManager.cpp
ReducerWorkItem.cpp
diff --git a/llvm/tools/llvm-remarkutil/CMakeLists.txt b/llvm/tools/llvm-remarkutil/CMakeLists.txt
index 3f0a4360266e1..09915955cb617 100644
--- a/llvm/tools/llvm-remarkutil/CMakeLists.txt
+++ b/llvm/tools/llvm-remarkutil/CMakeLists.txt
@@ -4,6 +4,10 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# Multiple files define the same cl::opt variables and include a shared
+# header with non-inline class definitions, causing redefinition errors.
+set(CMAKE_UNITY_BUILD OFF)
+
add_llvm_tool(llvm-remarkutil
RemarkConvert.cpp
RemarkCount.cpp
diff --git a/llvm/tools/llvm-xray/CMakeLists.txt b/llvm/tools/llvm-xray/CMakeLists.txt
index 4f2f0fdee2c63..6bb892d6eb9f4 100644
--- a/llvm/tools/llvm-xray/CMakeLists.txt
+++ b/llvm/tools/llvm-xray/CMakeLists.txt
@@ -5,6 +5,10 @@ set(LLVM_LINK_COMPONENTS
XRay
)
+# Multiple xray-*.cpp files define cl::opt variables with the same names
+# (Unused, Demangle, NoDemangle) causing redefinition errors in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_llvm_tool(llvm-xray
func-id-helper.cpp
llvm-xray.cpp
diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index 6f6e4d5782dfb..610170d61c568 100644
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -38,6 +38,26 @@ set(POLLY_COMPONENTS
Vectorize
)
+# ISLOStream.h has no include guard, so its inline operator<< definitions get
+# redefined when multiple .cpp files including it are in the same unity TU.
+# Several Analysis/ and CodeGen/ files also share STATISTIC variable names.
+set_source_files_properties(
+ Analysis/ScopDetection.cpp
+ Analysis/ScopInfo.cpp
+ Analysis/ScopBuilder.cpp
+ Analysis/PruneUnprofitable.cpp
+ CodeGen/IslAst.cpp
+ CodeGen/CodeGeneration.cpp
+ Transform/ScheduleOptimizer.cpp
+ Transform/FlattenSchedule.cpp
+ Transform/FlattenAlgo.cpp
+ Transform/ForwardOpTree.cpp
+ Transform/DeLICM.cpp
+ Transform/Simplify.cpp
+ Transform/MatmulOptimizer.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
# Use an object-library to add the same files to multiple libs without requiring
# the sources them to be recompiled for each of them.
add_llvm_pass_plugin(Polly
diff --git a/polly/lib/External/CMakeLists.txt b/polly/lib/External/CMakeLists.txt
index ab5cba93cdcfe..a3fb2ae51171e 100644
--- a/polly/lib/External/CMakeLists.txt
+++ b/polly/lib/External/CMakeLists.txt
@@ -286,6 +286,7 @@ if (POLLY_BUNDLED_ISL)
add_polly_library(PollyISL
${ISL_FILES}
)
+ set_target_properties(PollyISL PROPERTIES UNITY_BUILD OFF)
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
>From ad8b716499488174f33fe489b738c5f2456d6f36 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 01:22:37 -0700
Subject: [PATCH 05/25] fix macros in release mode
---
clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 1 +
clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp | 1 +
llvm/lib/LTO/CMakeLists.txt | 4 +++-
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp | 1 +
llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp | 1 +
llvm/tools/llvm-rc/ResourceScriptParser.cpp | 1 +
6 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 68369f8e81eb2..af4f1ce0bc8d6 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -4211,6 +4211,7 @@ bool ento::shouldRegisterDynamicMemoryModeling(const CheckerManager &mgr) {
return true;
}
+#undef REGISTER_CHECKER
#define REGISTER_CHECKER(NAME) \
void ento::register##NAME(CheckerManager &Mgr) { \
Mgr.getChecker<MallocChecker>()->NAME.enable(Mgr); \
diff --git a/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
index eeb6b720cce2a..f2be818d4f1e8 100644
--- a/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/NullabilityChecker.cpp
@@ -1394,6 +1394,7 @@ void NullabilityChecker::printState(raw_ostream &Out, ProgramStateRef State,
constexpr llvm::StringLiteral GroupName = "nullability";
constexpr llvm::StringLiteral GroupOptName = "NoDiagnoseCallsToSystemHeaders";
+#undef REGISTER_CHECKER
#define REGISTER_CHECKER(NAME, TRACKING_REQUIRED) \
void ento::register##NAME##Checker(CheckerManager &Mgr) { \
NullabilityChecker *Chk = Mgr.getChecker<NullabilityChecker>(); \
diff --git a/llvm/lib/LTO/CMakeLists.txt b/llvm/lib/LTO/CMakeLists.txt
index cf455ff04c112..0a31f882a0d59 100644
--- a/llvm/lib/LTO/CMakeLists.txt
+++ b/llvm/lib/LTO/CMakeLists.txt
@@ -1,10 +1,12 @@
add_llvm_component_library(LLVMLTO
- LTO.cpp
LTOBackend.cpp
LTOModule.cpp
LTOCodeGenerator.cpp
UpdateCompilerUsed.cpp
ThinLTOCodeGenerator.cpp
+ # warning: attribute declaration must precede definition [-Wignored-attributes]
+ # LLVM_ABI extern cl::opt<bool> EnableLTOInternalization
+ LTO.cpp
ADDITIONAL_HEADER_DIRS
${LLVM_MAIN_INCLUDE_DIR}/llvm/LTO
diff --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
index cd3dcfd0aaaf1..5fd1c48a4cb3a 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -28,6 +28,7 @@
using namespace llvm;
#define DEBUG_TYPE "riscv-isel"
+#undef PASS_NAME
#define PASS_NAME "RISC-V DAG->DAG Pattern Instruction Selection"
static cl::opt<bool> UsePseudoMovImm(
diff --git a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
index 817cc86a63cdf..e35af61c4d1a0 100644
--- a/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
+++ b/llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp
@@ -57,6 +57,7 @@
using namespace llvm;
+#undef PASS_KEY
#define PASS_KEY "x86-slh"
#define DEBUG_TYPE PASS_KEY
diff --git a/llvm/tools/llvm-rc/ResourceScriptParser.cpp b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
index e4efc83c933b4..fe86a7c3ad18a 100644
--- a/llvm/tools/llvm-rc/ResourceScriptParser.cpp
+++ b/llvm/tools/llvm-rc/ResourceScriptParser.cpp
@@ -18,6 +18,7 @@
#include "llvm/Support/Process.h"
// Take an expression returning llvm::Error and forward the error if it exists.
+#undef RETURN_IF_ERROR
#define RETURN_IF_ERROR(Expr) \
if (auto Err = (Expr)) \
return std::move(Err);
>From cf06153bdbad5ec36d89d149872f9ca2de315030 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 01:32:10 -0700
Subject: [PATCH 06/25] add comments
---
llvm/lib/CodeGen/CMakeLists.txt | 6 +++++
llvm/lib/CodeGen/GlobalISel/CMakeLists.txt | 1 +
llvm/lib/CodeGen/MIRParser/CMakeLists.txt | 1 +
llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt | 3 +++
.../ExecutionEngine/JITLink/CMakeLists.txt | 1 +
llvm/lib/ExecutionEngine/Orc/CMakeLists.txt | 1 +
.../RuntimeDyld/CMakeLists.txt | 1 +
llvm/lib/ObjectYAML/CMakeLists.txt | 2 ++
llvm/lib/ProfileData/CMakeLists.txt | 1 +
llvm/lib/Target/AArch64/CMakeLists.txt | 2 ++
llvm/lib/Target/AMDGPU/CMakeLists.txt | 2 ++
.../Target/ARM/MCTargetDesc/CMakeLists.txt | 1 +
llvm/lib/Target/Hexagon/CMakeLists.txt | 1 +
llvm/lib/Target/MSP430/CMakeLists.txt | 1 +
.../Target/NVPTX/MCTargetDesc/CMakeLists.txt | 1 +
llvm/lib/Target/RISCV/CMakeLists.txt | 3 +++
llvm/lib/Target/SPIRV/CMakeLists.txt | 1 +
.../Target/SPIRV/MCTargetDesc/CMakeLists.txt | 1 +
llvm/lib/Target/WebAssembly/CMakeLists.txt | 3 +++
llvm/lib/Target/X86/CMakeLists.txt | 3 +++
llvm/lib/Target/XCore/CMakeLists.txt | 2 ++
llvm/lib/Transforms/Coroutines/CMakeLists.txt | 1 +
.../Transforms/Instrumentation/CMakeLists.txt | 1 +
llvm/lib/Transforms/ObjCARC/CMakeLists.txt | 1 +
llvm/lib/Transforms/Scalar/CMakeLists.txt | 1 +
llvm/lib/Transforms/Utils/CMakeLists.txt | 2 ++
llvm/lib/Transforms/Vectorize/CMakeLists.txt | 26 +++++--------------
llvm/utils/TableGen/CMakeLists.txt | 1 +
mlir/lib/Conversion/LLVMCommon/CMakeLists.txt | 1 +
mlir/lib/Conversion/SCFToGPU/CMakeLists.txt | 1 +
.../Conversion/ShapeToStandard/CMakeLists.txt | 1 +
mlir/lib/Debug/CMakeLists.txt | 1 +
.../Dialect/Affine/Transforms/CMakeLists.txt | 1 +
.../Dialect/Arith/Transforms/CMakeLists.txt | 1 +
.../Bufferization/Transforms/CMakeLists.txt | 1 +
.../Dialect/Linalg/Transforms/CMakeLists.txt | 1 +
.../Dialect/MemRef/Transforms/CMakeLists.txt | 1 +
mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt | 1 +
mlir/lib/Dialect/Ptr/IR/CMakeLists.txt | 1 +
.../SparseTensor/Transforms/CMakeLists.txt | 1 +
.../Dialect/Vector/Transforms/CMakeLists.txt | 1 +
mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt | 1 +
mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt | 1 +
.../Tools/tblgen-lsp-server/CMakeLists.txt | 1 +
mlir/lib/Transforms/Utils/CMakeLists.txt | 1 +
mlir/test/lib/Analysis/CMakeLists.txt | 1 +
.../lib/Conversion/FuncToLLVM/CMakeLists.txt | 1 +
mlir/test/lib/Dialect/Affine/CMakeLists.txt | 3 +++
.../lib/Dialect/Bufferization/CMakeLists.txt | 1 +
mlir/test/lib/Dialect/SCF/CMakeLists.txt | 1 +
.../test/lib/Dialect/Transform/CMakeLists.txt | 1 +
mlir/test/lib/IR/CMakeLists.txt | 2 ++
mlir/test/lib/Pass/CMakeLists.txt | 1 +
mlir/test/lib/Transforms/CMakeLists.txt | 1 +
mlir/unittests/IR/CMakeLists.txt | 1 +
mlir/unittests/Pass/CMakeLists.txt | 1 +
56 files changed, 82 insertions(+), 20 deletions(-)
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 9bf93487af6ce..0a155f0e663f2 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -300,6 +300,8 @@ add_subdirectory(AsmPrinter)
add_subdirectory(MIRParser)
add_subdirectory(GlobalISel)
+# STATISTIC and static function redefinitions across register allocation
+# and scheduling files conflict in unity builds.
set_source_files_properties(
LiveIntervalCalc.cpp
MLRegAllocPriorityAdvisor.cpp
@@ -308,14 +310,18 @@ set_source_files_properties(
RegAllocPriorityAdvisor.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Conflicting STATISTIC variables and static functions with other
+# register allocation files.
set_source_files_properties(
MLRegAllocEvictAdvisor.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Conflicting static cl::opt variables with other CodeGen files.
set_source_files_properties(
ModuloSchedule.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Anonymous namespace struct redefinitions conflict in unity builds.
set_source_files_properties(
PatchableFunction.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
index 539a37ca64f38..e5cf27332a42c 100644
--- a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
+++ b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
@@ -48,6 +48,7 @@ add_llvm_component_library(LLVMGlobalISel
TransformUtils
)
+# Conflicting static helper functions and STATISTIC variables.
set_source_files_properties(
IRTranslator.cpp
LegacyLegalizerInfo.cpp
diff --git a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
index 2558efc86e8af..b9325a5cc4715 100644
--- a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
+++ b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
@@ -20,6 +20,7 @@ add_llvm_component_library(LLVMMIRParser
Target
)
+# Static functions and anonymous namespace classes conflict in unity builds.
set_source_files_properties(
MIParser.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
index c5709e388ffe4..150dd014944f8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
+++ b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
@@ -41,11 +41,14 @@ add_llvm_component_library(LLVMSelectionDAG
TransformUtils
)
+# STATISTIC variable redefinitions (NumBacktracks, NumUnfolds, etc.)
+# and static function conflicts.
set_source_files_properties(
ScheduleDAGRRList.cpp
SelectionDAG.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Large template instantiation code and static helper conflicts.
set_source_files_properties(
TargetLowering.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
index 68bb2c7188525..d6e779137a5fb 100644
--- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
@@ -76,6 +76,7 @@ target_link_libraries(LLVMJITLink
LLVMTargetParser
)
+# Anonymous namespace function redefinitions (buildTables_ELF_x86*).
set_source_files_properties(
ELF_x86.cpp
ELF_x86_64.cpp
diff --git a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
index 2906f44d31c3b..c1cb753c6af43 100644
--- a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
@@ -106,6 +106,7 @@ target_link_libraries(LLVMOrcJIT
LLVMPasses
)
+# Static function and class definition conflicts in unity builds.
set_source_files_properties(
ELFNixPlatform.cpp
RTDyldObjectLinkingLayer.cpp
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
index ecbd5a515d808..d07df782d33e2 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
@@ -20,6 +20,7 @@ add_llvm_component_library(LLVMRuntimeDyld
TargetParser
)
+# Static relocation helper functions (or32le, getBits, etc.) conflict.
set_source_files_properties(
RuntimeDyldELF.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ObjectYAML/CMakeLists.txt b/llvm/lib/ObjectYAML/CMakeLists.txt
index c502154acf5ef..51238cbe4fca2 100644
--- a/llvm/lib/ObjectYAML/CMakeLists.txt
+++ b/llvm/lib/ObjectYAML/CMakeLists.txt
@@ -41,6 +41,8 @@ add_llvm_component_library(LLVMObjectYAML
MC
)
+# Conflicting 'using namespace' declarations (llvm::codeview,
+# llvm::CodeViewYAML) cause ambiguity.
set_source_files_properties(
CodeViewYAMLTypes.cpp
MinidumpEmitter.cpp
diff --git a/llvm/lib/ProfileData/CMakeLists.txt b/llvm/lib/ProfileData/CMakeLists.txt
index 56fbc69c4f9e1..7b1524e080594 100644
--- a/llvm/lib/ProfileData/CMakeLists.txt
+++ b/llvm/lib/ProfileData/CMakeLists.txt
@@ -49,6 +49,7 @@ set_source_files_properties(
add_subdirectory(Coverage)
+# 'using namespace sampleprof' causes ambiguity with other files.
set_source_files_properties(
SampleProfReader.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt
index ac4d432eb0629..1f580e581a8a1 100644
--- a/llvm/lib/Target/AArch64/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/CMakeLists.txt
@@ -130,11 +130,13 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
+# Anonymous namespace classes and static function conflicts.
set_source_files_properties(
AArch64AdvSIMDScalarPass.cpp
SVEIntrinsicOpts.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Large ISel lowering file with extensive static helper conflicts.
set_source_files_properties(
AArch64ISelLowering.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/AMDGPU/CMakeLists.txt b/llvm/lib/Target/AMDGPU/CMakeLists.txt
index 4df71d1c9180f..738086187aa93 100644
--- a/llvm/lib/Target/AMDGPU/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/CMakeLists.txt
@@ -226,6 +226,7 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
+# Conflicting DAG patterns and static functions across AMDGPU files.
set_source_files_properties(
AMDGPUISelDAGToDAG.cpp
AMDGPUInstCombineIntrinsic.cpp
@@ -233,6 +234,7 @@ set_source_files_properties(
AMDGPUSwLowerLDS.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Generated GISel combiner code with conflicting rule symbols.
set_source_files_properties(
AMDGPUInstructionSelector.cpp
AMDGPUPostLegalizerCombiner.cpp
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
index 3c8d5f7f311c4..3dbc6263c7ad6 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
@@ -28,6 +28,7 @@ add_llvm_component_library(LLVMARMDesc
ARM
)
+# Static ELF relocation helper functions conflict in unity builds.
set_source_files_properties(
ARMELFObjectWriter.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/Hexagon/CMakeLists.txt b/llvm/lib/Target/Hexagon/CMakeLists.txt
index 0a894daff705f..0924fe0516e25 100644
--- a/llvm/lib/Target/Hexagon/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/CMakeLists.txt
@@ -105,6 +105,7 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
+# Static analysis functions conflict with other Hexagon pass files.
set_source_files_properties(
HexagonOptimizeSZextends.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/MSP430/CMakeLists.txt b/llvm/lib/Target/MSP430/CMakeLists.txt
index aa472942d1892..6eb6824d4b649 100644
--- a/llvm/lib/Target/MSP430/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/CMakeLists.txt
@@ -51,6 +51,7 @@ add_subdirectory(TargetInfo)
add_subdirectory(AsmParser)
add_subdirectory(Disassembler)
+# Static instruction lowering helpers conflict in unity builds.
set_source_files_properties(
MSP430MCInstLower.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
index 181b592639dd9..3aee4072af2cb 100644
--- a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
@@ -14,6 +14,7 @@ add_llvm_component_library(LLVMNVPTXDesc
NVPTX
)
+# Static table and helper function redefinitions.
set_source_files_properties(
NVPTXMCTargetDesc.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/RISCV/CMakeLists.txt b/llvm/lib/Target/RISCV/CMakeLists.txt
index a41486c9813c7..b770bcc74978b 100644
--- a/llvm/lib/Target/RISCV/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/CMakeLists.txt
@@ -113,14 +113,17 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(MCA)
add_subdirectory(TargetInfo)
+# Static analysis functions conflict across RISCV passes.
set_source_files_properties(
RISCVInsertWriteVXRM.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Generated combiner code with conflicting rule symbols.
set_source_files_properties(
RISCVO0PreLegalizerCombiner.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Generated GISel combiner code with overlapping rule identifiers.
set_source_files_properties(
GISel/RISCVO0PreLegalizerCombiner.cpp
GISel/RISCVPreLegalizerCombiner.cpp
diff --git a/llvm/lib/Target/SPIRV/CMakeLists.txt b/llvm/lib/Target/SPIRV/CMakeLists.txt
index 7fd89ba1a0ea5..a31719f4159d8 100644
--- a/llvm/lib/Target/SPIRV/CMakeLists.txt
+++ b/llvm/lib/Target/SPIRV/CMakeLists.txt
@@ -84,6 +84,7 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Analysis)
+# Conflicting intrinsic handling and static functions across SPIRV files.
set_source_files_properties(
SPIRVBuiltins.cpp
SPIRVEmitIntrinsics.cpp
diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
index 5b1361e8b37f4..7c829494fddda 100644
--- a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
@@ -18,6 +18,7 @@ add_llvm_component_library(LLVMSPIRVDesc
SPIRV
)
+# Static encoding tables and helper function redefinitions.
set_source_files_properties(
SPIRVBaseInfo.cpp
SPIRVMCCodeEmitter.cpp
diff --git a/llvm/lib/Target/WebAssembly/CMakeLists.txt b/llvm/lib/Target/WebAssembly/CMakeLists.txt
index 4582f6fc40791..bec3002e8d9cd 100644
--- a/llvm/lib/Target/WebAssembly/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/CMakeLists.txt
@@ -109,15 +109,18 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
+# Static CFG transformation functions conflict with other WebAssembly files.
set_source_files_properties(
WebAssemblyFixIrreducibleControlFlow.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Generated combiner code with conflicting rule symbols.
set_source_files_properties(
WebAssemblyPreLegalizerCombiner.cpp
WebAssemblyPostLegalizerCombiner.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Generated GISel combiner code with conflicting symbols.
set_source_files_properties(
GISel/WebAssemblyPreLegalizerCombiner.cpp
GISel/WebAssemblyPostLegalizerCombiner.cpp
diff --git a/llvm/lib/Target/X86/CMakeLists.txt b/llvm/lib/Target/X86/CMakeLists.txt
index 0e13d586e446a..52b0c0b9b1e90 100644
--- a/llvm/lib/Target/X86/CMakeLists.txt
+++ b/llvm/lib/Target/X86/CMakeLists.txt
@@ -131,6 +131,7 @@ add_subdirectory(MCA)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
+# Large ISel lowering and static helper function conflicts across X86 files.
set_source_files_properties(
X86FastTileConfig.cpp
X86FixupVectorConstants.cpp
@@ -141,10 +142,12 @@ set_source_files_properties(
X86WinEHState.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static instruction pattern matching and encoding table conflicts.
set_source_files_properties(
X86CompressEVEX.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Generated GISel combiner code with overlapping rule symbols.
set_source_files_properties(
GISel/X86PreLegalizerCombiner.cpp
GISel/X86PostLegalizerCombiner.cpp
diff --git a/llvm/lib/Target/XCore/CMakeLists.txt b/llvm/lib/Target/XCore/CMakeLists.txt
index ded6a197ee7b1..d2d13e97f267a 100644
--- a/llvm/lib/Target/XCore/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/CMakeLists.txt
@@ -52,10 +52,12 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
+# Static instruction information and helper function conflicts.
set_source_files_properties(
XCoreInstrInfo.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static register information and allocation helper conflicts.
set_source_files_properties(
XCoreRegisterInfo.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Coroutines/CMakeLists.txt b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
index c5fdbbe800387..ec707b6fd25c2 100644
--- a/llvm/lib/Transforms/Coroutines/CMakeLists.txt
+++ b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
@@ -28,6 +28,7 @@ add_llvm_component_library(LLVMCoroutines
TargetParser
)
+# Anonymous namespace Lowerer classes and static coroutine helpers conflict.
set_source_files_properties(
CoroEarly.cpp
CoroElide.cpp
diff --git a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
index 55b07b5b116c7..18e1d6c2a6d4e 100644
--- a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
+++ b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
@@ -45,6 +45,7 @@ add_llvm_component_library(LLVMInstrumentation
ProfileData
)
+# Static instrumentation functions and 'using namespace' cause ambiguity.
set_source_files_properties(
HWAddressSanitizer.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
index 9e46e0313fdd6..b6560f9afde82 100644
--- a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
+++ b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
@@ -25,6 +25,7 @@ add_llvm_component_library(LLVMObjCARCOpts
TransformUtils
)
+# Static optimization functions conflict with other ObjCARC files.
set_source_files_properties(
ObjCARCContract.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt
index 8ba505263a582..c7437ea6f5d2e 100644
--- a/llvm/lib/Transforms/Scalar/CMakeLists.txt
+++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt
@@ -101,6 +101,7 @@ add_llvm_component_library(LLVMScalarOpts
TransformUtils
)
+# STATISTIC variables and static analysis function redefinitions.
set_source_files_properties(
BDCE.cpp
ConstraintElimination.cpp
diff --git a/llvm/lib/Transforms/Utils/CMakeLists.txt b/llvm/lib/Transforms/Utils/CMakeLists.txt
index 09478a1da4377..d86085ef7d4b9 100644
--- a/llvm/lib/Transforms/Utils/CMakeLists.txt
+++ b/llvm/lib/Transforms/Utils/CMakeLists.txt
@@ -109,10 +109,12 @@ add_llvm_component_library(LLVMTransformUtils
TargetParser
)
+# Static lowering functions conflict with other Utils files.
set_source_files_properties(
LowerGlobalDtors.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static exception handling transformation functions conflict.
set_source_files_properties(
LowerInvoke.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Vectorize/CMakeLists.txt b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
index 612c2c26f1484..3af9702b99e36 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -49,31 +49,17 @@ add_llvm_component_library(LLVMVectorize
SandboxIR
)
+# VPlan files define conflicting STATISTIC variables, anonymous namespace
+# classes, and static pattern matching functions in unity builds.
set_source_files_properties(
+ LoopVectorize.cpp
VPlan.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
- LoopVectorize.cpp VPlanAnalysis.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
+ VPlanAnalysis.cpp
VPlanConstruction.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
VPlanPredicator.cpp
VPlanRecipes.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
VPlanTransforms.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
VPlanUnroll.cpp
+ VPlanUtils.cpp
+ VPlanVerifier.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(VPlanVerifier.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(VPlanUtils.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index e1c37c705f2e6..3446e95046783 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -109,6 +109,7 @@ set_source_files_properties(
X86MnemonicTables.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static DFA state tables and code generation helper conflicts.
set_source_files_properties(
DFAPacketizerEmitter.cpp
InstrInfoEmitter.cpp
diff --git a/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt b/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
index ca6a69fa1dafc..b21105779719a 100644
--- a/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
+++ b/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
@@ -18,6 +18,7 @@ add_mlir_conversion_library(MLIRLLVMCommonConversion
MLIRTransforms
)
+# 'using namespace mlir' causes Type and other core type ambiguity.
set_source_files_properties(
StructBuilder.cpp
TypeConverter.cpp
diff --git a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
index 582fb4e687847..f2c3127af0476 100644
--- a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
+++ b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
@@ -23,6 +23,7 @@ add_mlir_conversion_library(MLIRSCFToGPU
MLIRTransforms
)
+# Conversion patterns and static helpers conflict via 'using namespace mlir'.
set_source_files_properties(
SCFToGPUPass.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt b/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
index c8bc551242449..eefb6a6c96951 100644
--- a/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
+++ b/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
@@ -26,6 +26,7 @@ add_mlir_conversion_library(MLIRShapeToStandard
MLIRTransforms
)
+# Conflicting pattern rewriters and helper function redefinitions.
set_source_files_properties(
ShapeToStandard.cpp
ConvertShapeConstraints.cpp
diff --git a/mlir/lib/Debug/CMakeLists.txt b/mlir/lib/Debug/CMakeLists.txt
index 8025d6af69e14..2bf287cacdad4 100644
--- a/mlir/lib/Debug/CMakeLists.txt
+++ b/mlir/lib/Debug/CMakeLists.txt
@@ -18,6 +18,7 @@ add_mlir_library(MLIRDebug
)
+# Static hook registration and context handling code conflicts.
set_source_files_properties(
DebuggerExecutionContextHook.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
index 33de0690406fd..2679141a42208 100644
--- a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
@@ -47,6 +47,7 @@ add_mlir_dialect_library(MLIRAffineTransforms
)
+# Anonymous namespace struct redefinitions (LowerDelinearizeIndexOps, etc.).
set_source_files_properties(
AffineExpandIndexOpsAsAffine.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
index cd41efdc90c85..cbc8e9efc214e 100644
--- a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
@@ -38,6 +38,7 @@ add_mlir_dialect_library(MLIRArithTransforms
MLIRVectorDialect
)
+# Static interface implementations conflict via 'using namespace mlir'.
set_source_files_properties(
BufferizableOpInterfaceImpl.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
index 20281b51c49d8..b7e8c5d4ff28a 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
@@ -43,6 +43,7 @@ add_mlir_dialect_library(MLIRBufferizationTransforms
MLIRSupport
)
+# Conflicting analysis pattern definitions.
set_source_files_properties(
BufferViewFlowAnalysis.cpp
OwnershipBasedBufferDeallocation.cpp
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
index 5326297d477d0..4df1e22537edb 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
@@ -88,6 +88,7 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRVectorToSCF
)
+# Anonymous namespace pattern rewriter struct redefinitions.
set_source_files_properties(
DecomposeLinalgOps.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
index 47bd094fa954d..d53d15637f28a 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
@@ -45,6 +45,7 @@ add_mlir_dialect_library(MLIRMemRefTransforms
)
+# Static type emulation pattern and helper function conflicts.
set_source_files_properties(
EmulateNarrowType.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt b/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
index f297faaf65769..d36e3a77ff36c 100644
--- a/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
@@ -22,6 +22,7 @@ add_mlir_dialect_library(MLIROpenACCDialect
)
+# Static code generation and type conversion function conflicts.
set_source_files_properties(
OpenACCCG.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt b/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
index 42c167bd24ad5..566c30faaa53b 100644
--- a/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
@@ -38,6 +38,7 @@ add_mlir_dialect_library(
MLIRPtrMemorySpaceInterfaces
)
+# Static pointer type handling conflicts via 'using namespace mlir'.
set_source_files_properties(
PtrTypes.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
index d1db102598f4e..117e0cd54233b 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
@@ -54,6 +54,7 @@ add_mlir_dialect_library(MLIRSparseTensorTransforms
MLIRVectorDialect
)
+# Conflicting sparse tensor analysis and lowering pattern definitions.
set_source_files_properties(
SparseTensorConversion.cpp
Sparsification.cpp
diff --git a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
index ae41b614f0b44..93a276e9927df 100644
--- a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
@@ -56,6 +56,7 @@ add_mlir_dialect_library(MLIRVectorTransforms
MLIRVectorUtils
)
+# Anonymous namespace rewrite pattern redefinitions.
set_source_files_properties(
VectorInsertExtractStridedSliceRewritePatterns.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt b/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
index 48826f21191c1..1ce934b095ed2 100644
--- a/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
+++ b/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
@@ -9,6 +9,7 @@ add_mlir_library(MLIRPDLLCodeGen
MLIRSupport
)
+# Static PDLL code generation helpers and symbol registration conflicts.
set_source_files_properties(
MLIRGen.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt b/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
index 45df59513c07e..967ef96095535 100644
--- a/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
@@ -18,6 +18,7 @@ add_mlir_library(MLIRLspServerLib
MLIRParser
)
+# Static LSP protocol handler and request processing conflicts.
set_source_files_properties(
MLIRServer.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt b/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
index 02bd1cfcaa0e9..b25a461f07d23 100644
--- a/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
+++ b/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
@@ -20,6 +20,7 @@ llvm_add_library(TableGenLspServerLib
MLIRSupport
)
+# Static TableGen LSP handler conflicts.
set_source_files_properties(
TableGenServer.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt
index 766090ac874e0..23f37442fa0ad 100644
--- a/mlir/lib/Transforms/Utils/CMakeLists.txt
+++ b/mlir/lib/Transforms/Utils/CMakeLists.txt
@@ -25,6 +25,7 @@ add_mlir_library(MLIRTransformUtils
MLIRRewrite
)
+# Anonymous namespace debugging infrastructure and static helper conflicts.
set_source_files_properties(
GreedyPatternRewriteDriver.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Analysis/CMakeLists.txt b/mlir/test/lib/Analysis/CMakeLists.txt
index 1fa56d2b11c73..9ee060cc6e8ad 100644
--- a/mlir/test/lib/Analysis/CMakeLists.txt
+++ b/mlir/test/lib/Analysis/CMakeLists.txt
@@ -38,6 +38,7 @@ target_include_directories(MLIRTestAnalysis
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+# Static test infrastructure redefinitions across analysis test files.
set_source_files_properties(
TestMemRefDependenceCheck.cpp
TestSlice.cpp
diff --git a/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt b/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
index 911844de3c3df..7cc673e38b3f7 100644
--- a/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
+++ b/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
@@ -22,6 +22,7 @@ target_include_directories(MLIRTestFuncToLLVM
${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
)
+# Static test pass and conversion pattern conflicts.
set_source_files_properties(
TestConvertFuncOp.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Affine/CMakeLists.txt b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
index cd6dbb081cd0b..2626acc0ace9b 100644
--- a/mlir/test/lib/Dialect/Affine/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
@@ -43,14 +43,17 @@ target_include_directories(MLIRAffineTransformsTestPasses
)
+# Static vectorization test utility conflicts.
set_source_files_properties(
TestVectorizationUtils.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static value bound analysis test infrastructure conflicts.
set_source_files_properties(
TestReifyValueBounds.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static analysis test harness redefinitions.
set_source_files_properties(
TestAccessAnalysis.cpp
TestAffineLoopUnswitching.cpp
diff --git a/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt b/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
index 5d541019a9034..2c1a15bf90a54 100644
--- a/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
@@ -20,6 +20,7 @@ target_include_directories(MLIRBufferizationTestPasses
${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
)
+# Static test pattern implementation conflicts.
set_source_files_properties(
TestTensorLikeAndBufferLike.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/SCF/CMakeLists.txt b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
index bd39448bbd456..bd792d8e9709c 100644
--- a/mlir/test/lib/Dialect/SCF/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
@@ -19,6 +19,7 @@ mlir_target_link_libraries(MLIRSCFTestPasses PUBLIC
MLIRTransformUtils
)
+# Static loop unrolling test pattern conflicts.
set_source_files_properties(
TestParallelLoopUnrolling.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Transform/CMakeLists.txt b/mlir/test/lib/Dialect/Transform/CMakeLists.txt
index 5d53235cbaed1..3f2ee19333122 100644
--- a/mlir/test/lib/Dialect/Transform/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Transform/CMakeLists.txt
@@ -27,6 +27,7 @@ mlir_target_link_libraries(MLIRTestTransformDialect PUBLIC
MLIRTransformPDLExtension
)
+# Conflicting static test interpreter definitions.
set_source_files_properties(
TestTransformDialectInterpreter.cpp
TestTransformStateExtension.cpp
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index c060b7621a724..0549b785e71ad 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -45,6 +45,7 @@ target_include_directories(MLIRTestIR
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+# Static dominance analysis test infrastructure conflicts.
set_source_files_properties(
TestDominance.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
@@ -62,6 +63,7 @@ set_source_files_properties(
TestVisitorsGeneric.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+# Static interface testing utility conflicts.
set_source_files_properties(
TestInterfaces.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt
index 206add03e338c..10276fe07babc 100644
--- a/mlir/test/lib/Pass/CMakeLists.txt
+++ b/mlir/test/lib/Pass/CMakeLists.txt
@@ -29,6 +29,7 @@ target_include_directories(MLIRTestPass
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+# Static pass management test code conflicts.
set_source_files_properties(
TestPassManager.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 6c5b4b3c292b5..61ba12224f8c8 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -60,6 +60,7 @@ target_include_directories(MLIRTestTransforms
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
+# Static transform test utility redefinitions.
set_source_files_properties(
TestCommutativityUtils.cpp
TestDialectConversion.cpp
diff --git a/mlir/unittests/IR/CMakeLists.txt b/mlir/unittests/IR/CMakeLists.txt
index 6cc46fb645844..8f46ed3725c5c 100644
--- a/mlir/unittests/IR/CMakeLists.txt
+++ b/mlir/unittests/IR/CMakeLists.txt
@@ -34,6 +34,7 @@ target_link_libraries(MLIRIRTests PRIVATE MLIRBytecodeWriter)
target_link_libraries(MLIRIRTests PRIVATE MLIRTestDialect)
target_link_libraries(MLIRIRTests PRIVATE MLIRRemarkStreamer)
+# Static test helper function redefinitions across unit tests.
set_source_files_properties(
AffineMapTest.cpp
OpPropertiesTest.cpp
diff --git a/mlir/unittests/Pass/CMakeLists.txt b/mlir/unittests/Pass/CMakeLists.txt
index 6c49bc32833fe..8374efd31849f 100644
--- a/mlir/unittests/Pass/CMakeLists.txt
+++ b/mlir/unittests/Pass/CMakeLists.txt
@@ -9,6 +9,7 @@ mlir_target_link_libraries(MLIRPassTests
MLIRFuncDialect
MLIRPass)
+# Static pass management unit test infrastructure conflicts.
set_source_files_properties(
PassManagerTest.cpp
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
>From d18bcacc6da0d0029156081bac4ed24c7e1652fa Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 09:11:53 -0700
Subject: [PATCH 07/25] add benchmark script
---
benchmark_build.sh | 99 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 99 insertions(+)
create mode 100755 benchmark_build.sh
diff --git a/benchmark_build.sh b/benchmark_build.sh
new file mode 100755
index 0000000000000..09a3d8efa4bb4
--- /dev/null
+++ b/benchmark_build.sh
@@ -0,0 +1,99 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ITERATIONS=10
+TOOLS=("mlir-opt" "clang" "opt")
+BUILD_DIR=build
+
+print_stats() {
+ local label="$1"
+ shift
+ local times=("$@")
+
+ echo ""
+ echo "========== $label =========="
+ printf "Times: "
+ printf "%s " "${times[@]}"
+ echo ""
+
+ printf "%s\n" "${times[@]}" | awk '
+ {
+ vals[NR] = $1
+ sum += $1
+ sumsq += $1 * $1
+ n = NR
+ }
+ END {
+ mean = sum / n
+ var = sumsq / n - mean * mean
+
+ for (i = 1; i <= n; i++)
+ for (j = i + 1; j <= n; j++)
+ if (vals[i] > vals[j]) {
+ t = vals[i]; vals[i] = vals[j]; vals[j] = t
+ }
+
+ if (n % 2 == 1)
+ median = vals[int(n/2) + 1]
+ else
+ median = (vals[n/2] + vals[n/2 + 1]) / 2
+
+ printf "N: %d\n", n
+ printf "Mean: %.2fs\n", mean
+ printf "Median: %.2fs\n", median
+ printf "Var: %.2f\n", var
+ printf "StdDev: %.2fs\n", sqrt(var)
+ }
+ '
+}
+
+for build_type in Release Debug; do
+for unity_mode in off on; do
+ if [ "$unity_mode" = "off" ]; then
+ unity_flag=""
+ label_suffix="$build_type, no unity"
+ else
+ unity_flag="-DCMAKE_UNITY_BUILD=ON"
+ label_suffix="$build_type, with unity"
+ fi
+
+ declare -A all_times
+ for tool in "${TOOLS[@]}"; do
+ all_times[$tool]=""
+ done
+
+ for i in $(seq 1 $ITERATIONS); do
+ echo "========== [$label_suffix] Iteration $i / $ITERATIONS =========="
+
+ cmake -S llvm -B "$BUILD_DIR" \
+ -G Ninja \
+ -DCMAKE_BUILD_TYPE="$build_type" \
+ -DLLVM_ENABLE_PROJECTS="mlir;clang" \
+ $unity_flag > /dev/null
+
+ for tool in "${TOOLS[@]}"; do
+ start=$(date +%s.%N)
+ ninja -C "$BUILD_DIR" "$tool" > /dev/null
+ end=$(date +%s.%N)
+
+ elapsed=$(echo "$end - $start" | bc)
+ all_times[$tool]+="$elapsed "
+ echo ">>> $tool took ${elapsed}s"
+
+ # Clean build artifacts but keep the configured build dir
+ ninja -C "$BUILD_DIR" clean > /dev/null
+ done
+
+ rm -rf "$BUILD_DIR"
+ done
+
+ echo ""
+ echo "############################################"
+ echo "# Results: $label_suffix"
+ echo "############################################"
+ for tool in "${TOOLS[@]}"; do
+ read -ra times <<< "${all_times[$tool]}"
+ print_stats "$tool ($label_suffix)" "${times[@]}"
+ done
+done
+done
>From 655938da5d2050c51de2d9b26181d0f9c950fd03 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 18:56:31 -0700
Subject: [PATCH 08/25] Change iteration count from 10 to 2
---
benchmark_build.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/benchmark_build.sh b/benchmark_build.sh
index 09a3d8efa4bb4..2f7fd546fb79f 100755
--- a/benchmark_build.sh
+++ b/benchmark_build.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
-ITERATIONS=10
+ITERATIONS=2
TOOLS=("mlir-opt" "clang" "opt")
BUILD_DIR=build
>From ae1c229131ea55f90e370010c3258aa6efd4cfaf Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 22:47:43 -0700
Subject: [PATCH 09/25] fix debug for all targets
---
clang/lib/CIR/CodeGen/CMakeLists.txt | 19 +++++++++++++++++++
flang/lib/Evaluate/CMakeLists.txt | 14 ++++++++++++++
flang/lib/Lower/CMakeLists.txt | 5 +++++
flang/lib/Optimizer/Builder/CMakeLists.txt | 5 +++++
flang/lib/Optimizer/CodeGen/CMakeLists.txt | 7 +++++++
flang/tools/f18-parse-demo/CMakeLists.txt | 5 +++++
llvm/lib/IR/DebugInfo.cpp | 3 +++
llvm/lib/IR/Instructions.cpp | 3 +++
.../Passes/TransactionSave.cpp | 3 +++
.../SandboxVectorizer/SandboxVectorizer.cpp | 3 +++
mlir/examples/toy/Ch3/CMakeLists.txt | 6 ++++++
mlir/examples/toy/Ch4/CMakeLists.txt | 5 +++++
mlir/examples/toy/Ch5/CMakeLists.txt | 5 +++++
mlir/examples/toy/Ch6/CMakeLists.txt | 4 ++++
mlir/examples/toy/Ch7/CMakeLists.txt | 4 ++++
.../Affine/Transforms/DecomposeAffineOps.cpp | 16 +---------------
mlir/lib/Dialect/XeGPU/IR/CMakeLists.txt | 8 ++++++++
17 files changed, 100 insertions(+), 15 deletions(-)
diff --git a/clang/lib/CIR/CodeGen/CMakeLists.txt b/clang/lib/CIR/CodeGen/CMakeLists.txt
index 8548cc8424527..ff8f26d1c504b 100644
--- a/clang/lib/CIR/CodeGen/CMakeLists.txt
+++ b/clang/lib/CIR/CodeGen/CMakeLists.txt
@@ -67,3 +67,22 @@ add_clang_library(clangCIR
MLIRCIRInterfaces
MLIRTargetLLVMIRImport
)
+
+
+# CIRGenExprComplex.cpp references both cir::ComplexType/CastKind and
+# clang::ComplexType/CastKind which become ambiguous in unity builds.
+set_source_files_properties(CIRGenExprComplex.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# CIRGenOpenACCRecipe.h has no include guards and defines classes; including it
+# from both CIRGenOpenACCClause.cpp and CIRGenOpenACCRecipe.cpp in the same
+# unity TU causes redefinition errors.
+set_source_files_properties(
+ CIRGenOpenACCClause.cpp
+ CIRGenOpenACCRecipe.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# CIRGenTypes.cpp references cir::Type/RecordType which conflict with
+# clang::Type/RecordType from other files in the unity TU.
+set_source_files_properties(CIRGenTypes.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Evaluate/CMakeLists.txt b/flang/lib/Evaluate/CMakeLists.txt
index 472ecb6d8d079..73bc62e2fcb46 100644
--- a/flang/lib/Evaluate/CMakeLists.txt
+++ b/flang/lib/Evaluate/CMakeLists.txt
@@ -87,3 +87,17 @@ add_flang_library(FortranEvaluate
acc_gen
omp_gen
)
+
+# fold-implementation.h contains explicit instantiation definitions; merging
+# any two of these files in a unity TU produces duplicate instantiations.
+# formatting.cpp also has explicit instantiations that duplicate those.
+set_source_files_properties(
+ fold-character.cpp
+ fold-complex.cpp
+ fold-integer.cpp
+ fold-logical.cpp
+ fold-real.cpp
+ fold.cpp
+ intrinsics-library.cpp
+ formatting.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Lower/CMakeLists.txt b/flang/lib/Lower/CMakeLists.txt
index f5424c78b9a98..44fa0f4eeded9 100644
--- a/flang/lib/Lower/CMakeLists.txt
+++ b/flang/lib/Lower/CMakeLists.txt
@@ -90,3 +90,8 @@ add_flang_library(FortranLower
MLIRLLVMDialect
MLIRSCFToControlFlow
)
+
+# ConvertCall.cpp calls 'isInWhereMaskedExpression' which becomes ambiguous
+# with another overload brought in from other files in the unity TU.
+set_source_files_properties(ConvertCall.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Optimizer/Builder/CMakeLists.txt b/flang/lib/Optimizer/Builder/CMakeLists.txt
index 8e5b5deff47c1..7094aa48af707 100644
--- a/flang/lib/Optimizer/Builder/CMakeLists.txt
+++ b/flang/lib/Optimizer/Builder/CMakeLists.txt
@@ -65,3 +65,8 @@ add_flang_library(FIRBuilder
${dialect_libs}
${extension_libs}
)
+
+# Execute.cpp defines a static 'isAbsent' that conflicts with another
+# definition when merged in a unity TU.
+set_source_files_properties(Runtime/Execute.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Optimizer/CodeGen/CMakeLists.txt b/flang/lib/Optimizer/CodeGen/CMakeLists.txt
index 6977c737199e2..440829dbf6ca7 100644
--- a/flang/lib/Optimizer/CodeGen/CMakeLists.txt
+++ b/flang/lib/Optimizer/CodeGen/CMakeLists.txt
@@ -50,3 +50,10 @@ add_flang_library(FIRCodeGen
MLIRTargetLLVMIRExport
MLIRVectorToLLVM
)
+
+# FIROpPatterns.cpp and PreCGRewrite.cpp each redefine local helpers
+# (getTypeDescFieldId, DeclareOpConversion) that clash in unity builds.
+set_source_files_properties(
+ FIROpPatterns.cpp
+ PreCGRewrite.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/tools/f18-parse-demo/CMakeLists.txt b/flang/tools/f18-parse-demo/CMakeLists.txt
index 743a44017e8a5..1f3899a235b7c 100644
--- a/flang/tools/f18-parse-demo/CMakeLists.txt
+++ b/flang/tools/f18-parse-demo/CMakeLists.txt
@@ -14,3 +14,8 @@ target_link_libraries(f18-parse-demo
FortranSupport
FortranParser
)
+
+# stub-evaluate.cpp uses struct/class mismatches with other TU definitions
+# that trigger -Werror,-Wmismatched-tags in unity builds.
+set_source_files_properties(stub-evaluate.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index d27c3a9a1548a..7082efc99a3a1 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -41,6 +41,9 @@
#include <cassert>
#include <optional>
+#undef DEBUG_TYPE
+#define DEBUG_TYPE "debug-info"
+
using namespace llvm;
using namespace llvm::at;
using namespace llvm::dwarf;
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 8a220c48acac8..499790ad57e19 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -51,6 +51,9 @@
#include <optional>
#include <vector>
+#undef DEBUG_TYPE
+#define DEBUG_TYPE "instructions"
+
using namespace llvm;
static cl::opt<bool> DisableI2pP2iOpt(
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionSave.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionSave.cpp
index 8603caf7d02ea..7c03722bd0d1c 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionSave.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/TransactionSave.cpp
@@ -10,6 +10,9 @@
#include "llvm/Support/InstructionCost.h"
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h"
+#undef DEBUG_TYPE
+#define DEBUG_TYPE "transaction-save"
+
namespace llvm::sandboxir {
bool TransactionSave::runOnRegion(Region &Rgn, const Analyses &A) {
diff --git a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
index 2de692143c1b6..bc6456f7aa075 100644
--- a/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizer.cpp
@@ -15,6 +15,9 @@
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Debug.h"
#include "llvm/Transforms/Vectorize/SandboxVectorizer/SandboxVectorizerPassBuilder.h"
+#undef DEBUG_TYPE
+#define DEBUG_TYPE "sandbox-vectorizer"
+
using namespace llvm;
static cl::opt<bool>
diff --git a/mlir/examples/toy/Ch3/CMakeLists.txt b/mlir/examples/toy/Ch3/CMakeLists.txt
index 565f3c41c5b80..e889ec04b4320 100644
--- a/mlir/examples/toy/Ch3/CMakeLists.txt
+++ b/mlir/examples/toy/Ch3/CMakeLists.txt
@@ -24,6 +24,12 @@ add_toy_chapter(toyc-ch3
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
+
+# mlir/ToyCombine.cpp references toy:: names that become ambiguous when
+# combined with other mlir/ files in a unity translation unit.
+set_source_files_properties(mlir/ToyCombine.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
target_link_libraries(toyc-ch3
PRIVATE
MLIRAnalysis
diff --git a/mlir/examples/toy/Ch4/CMakeLists.txt b/mlir/examples/toy/Ch4/CMakeLists.txt
index 9d33b7db66b6e..9cf41e047d42f 100644
--- a/mlir/examples/toy/Ch4/CMakeLists.txt
+++ b/mlir/examples/toy/Ch4/CMakeLists.txt
@@ -10,6 +10,10 @@ set(LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
mlir_tablegen(ToyCombine.inc -gen-rewriters)
add_public_tablegen_target(ToyCh4CombineIncGen)
+# Most mlir/ files (Dialect.cpp, ShapeInferencePass.cpp, ToyCombine.cpp)
+# have ambiguous toy:: / mlir:: references in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_toy_chapter(toyc-ch4
toyc.cpp
parser/AST.cpp
@@ -26,6 +30,7 @@ add_toy_chapter(toyc-ch4
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
+
target_link_libraries(toyc-ch4
PRIVATE
MLIRAnalysis
diff --git a/mlir/examples/toy/Ch5/CMakeLists.txt b/mlir/examples/toy/Ch5/CMakeLists.txt
index 454ca56c2dd47..0cb21b39f34a8 100644
--- a/mlir/examples/toy/Ch5/CMakeLists.txt
+++ b/mlir/examples/toy/Ch5/CMakeLists.txt
@@ -10,6 +10,11 @@ set(LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
mlir_tablegen(ToyCombine.inc -gen-rewriters)
add_public_tablegen_target(ToyCh5CombineIncGen)
+# Multiple mlir/ files (Dialect.cpp, LowerToAffineLoops.cpp,
+# ShapeInferencePass.cpp, ToyCombine.cpp) have ambiguous toy::/mlir::
+# references in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_toy_chapter(toyc-ch5
toyc.cpp
parser/AST.cpp
diff --git a/mlir/examples/toy/Ch6/CMakeLists.txt b/mlir/examples/toy/Ch6/CMakeLists.txt
index 73df6028329d5..5b0f306f73802 100644
--- a/mlir/examples/toy/Ch6/CMakeLists.txt
+++ b/mlir/examples/toy/Ch6/CMakeLists.txt
@@ -19,6 +19,10 @@ set(LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
mlir_tablegen(ToyCombine.inc -gen-rewriters)
add_public_tablegen_target(ToyCh6CombineIncGen)
+# Multiple mlir/ files have ambiguous toy::/mlir:: references
+# (Location, OpAdaptor, toy namespace, etc.) in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_toy_chapter(toyc-ch6
toyc.cpp
parser/AST.cpp
diff --git a/mlir/examples/toy/Ch7/CMakeLists.txt b/mlir/examples/toy/Ch7/CMakeLists.txt
index a489ae5b2d368..9fa2a99109708 100644
--- a/mlir/examples/toy/Ch7/CMakeLists.txt
+++ b/mlir/examples/toy/Ch7/CMakeLists.txt
@@ -18,6 +18,10 @@ set(LLVM_TARGET_DEFINITIONS mlir/ToyCombine.td)
mlir_tablegen(ToyCombine.inc -gen-rewriters)
add_public_tablegen_target(ToyCh7CombineIncGen)
+# Multiple mlir/ files have ambiguous toy::/mlir:: references
+# (Location, OpAdaptor, toy namespace, etc.) in unity builds.
+set(CMAKE_UNITY_BUILD OFF)
+
add_toy_chapter(toyc-ch7
toyc.cpp
parser/AST.cpp
diff --git a/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp b/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
index 11007a08f7edc..d6c8a988f0b74 100644
--- a/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
+++ b/mlir/lib/Dialect/Affine/Transforms/DecomposeAffineOps.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "mlir/Dialect/Affine/IR/AffineOps.h"
+#include "mlir/Dialect/Affine/LoopUtils.h"
#include "mlir/Dialect/Affine/Transforms/Transforms.h"
#include "mlir/IR/PatternMatch.h"
#include "llvm/ADT/SmallVectorExtras.h"
@@ -24,21 +25,6 @@ using namespace mlir::affine;
#define DEBUG_TYPE "decompose-affine-ops"
-/// Count the number of loops surrounding `operand` such that operand could be
-/// hoisted above.
-/// Stop counting at the first loop over which the operand cannot be hoisted.
-static int64_t numEnclosingInvariantLoops(OpOperand &operand) {
- int64_t count = 0;
- Operation *currentOp = operand.getOwner();
- while (auto loopOp = currentOp->getParentOfType<LoopLikeOpInterface>()) {
- if (!loopOp.isDefinedOutsideOfLoop(operand.get()))
- break;
- currentOp = loopOp;
- count++;
- }
- return count;
-}
-
void mlir::affine::reorderOperandsByHoistability(RewriterBase &rewriter,
AffineApplyOp op) {
SmallVector<int64_t> numInvariant =
diff --git a/mlir/lib/Dialect/XeGPU/IR/CMakeLists.txt b/mlir/lib/Dialect/XeGPU/IR/CMakeLists.txt
index 7869a28dfed57..50d511738b6bf 100644
--- a/mlir/lib/Dialect/XeGPU/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/XeGPU/IR/CMakeLists.txt
@@ -23,3 +23,11 @@ add_mlir_dialect_library(MLIRXeGPUDialect
MLIRViewLikeInterface
MLIRVectorDialect
)
+
+# XeGPUOps.cpp transitively includes VersionTuple.h whose Minor/Subminor
+# members conflict with a function-like macro defined earlier in the unity TU.
+# set_source_files_properties doesn't propagate through llvm_add_library's
+# internal OBJECT library, so disable unity on the OBJECT target directly.
+if(TARGET obj.MLIRXeGPUDialect)
+ set_target_properties(obj.MLIRXeGPUDialect PROPERTIES UNITY_BUILD OFF)
+endif()
>From 8a64bf550aa2b7e990fc430821f5f75db91323a2 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 22:50:09 -0700
Subject: [PATCH 10/25] patch monolithic
---
.ci/monolithic-linux.sh | 90 ++++++++++++++++++++-------------------
.ci/monolithic-windows.sh | 26 +++++------
2 files changed, 60 insertions(+), 56 deletions(-)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 79fc891b729d7..935e0896a8262 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -41,7 +41,7 @@ export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
# It will not be built unless it is used.
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_PROJECTS="${projects}" \
- -D LLVM_ENABLE_RUNTIMES="${runtimes}" \
+ -D CMAKE_UNITY_BUILD=ON \
-G Ninja \
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
-D CMAKE_BUILD_TYPE=Release \
@@ -65,47 +65,49 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_WERROR=ON \
-D LLVM_BINUTILS_INCDIR=/usr
-start-group "ninja"
+ninja -C "${BUILD_DIR}"
-if [[ -n "${targets}" ]]; then
- # Targets are not escaped as they are passed as separate arguments.
- ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
- cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
-fi
-
-if [[ -n "${runtime_targets}" ]]; then
- start-group "ninja Runtimes"
-
- ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
- cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
-fi
-
-# Compiling runtimes with just-built Clang and running their tests
-# as an additional testing for Clang.
-if [[ -n "${runtime_targets_needs_reconfig}" ]]; then
- start-group "CMake Runtimes C++26"
-
- cmake \
- -D LIBCXX_TEST_PARAMS="std=c++26" \
- -D LIBCXXABI_TEST_PARAMS="std=c++26" \
- "${BUILD_DIR}"
-
- start-group "ninja Runtimes C++26"
-
- ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
- |& tee ninja_runtimes_needs_reconfig1.log
- cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconig.ninja_log
-
- start-group "CMake Runtimes Clang Modules"
-
- cmake \
- -D LIBCXX_TEST_PARAMS="enable_modules=clang" \
- -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
- "${BUILD_DIR}"
-
- start-group "ninja Runtimes Clang Modules"
-
- ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
- |& tee ninja_runtimes_needs_reconfig2.log
- cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconfig2.ninja_log
-fi
+#start-group "ninja"
+#
+#if [[ -n "${targets}" ]]; then
+# # Targets are not escaped as they are passed as separate arguments.
+# ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
+# cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
+#fi
+#
+#if [[ -n "${runtime_targets}" ]]; then
+# start-group "ninja Runtimes"
+#
+# ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
+# cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
+#fi
+#
+## Compiling runtimes with just-built Clang and running their tests
+## as an additional testing for Clang.
+#if [[ -n "${runtime_targets_needs_reconfig}" ]]; then
+# start-group "CMake Runtimes C++26"
+#
+# cmake \
+# -D LIBCXX_TEST_PARAMS="std=c++26" \
+# -D LIBCXXABI_TEST_PARAMS="std=c++26" \
+# "${BUILD_DIR}"
+#
+# start-group "ninja Runtimes C++26"
+#
+# ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
+# |& tee ninja_runtimes_needs_reconfig1.log
+# cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconig.ninja_log
+#
+# start-group "CMake Runtimes Clang Modules"
+#
+# cmake \
+# -D LIBCXX_TEST_PARAMS="enable_modules=clang" \
+# -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
+# "${BUILD_DIR}"
+#
+# start-group "ninja Runtimes Clang Modules"
+#
+# ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
+# |& tee ninja_runtimes_needs_reconfig2.log
+# cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconfig2.ninja_log
+#fi
diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh
index f35f17350022f..d13212ce03722 100755
--- a/.ci/monolithic-windows.sh
+++ b/.ci/monolithic-windows.sh
@@ -49,19 +49,21 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
- -D LLVM_ENABLE_RUNTIMES="${runtimes}"
+ -D CMAKE_UNITY_BUILD=ON
start-group "ninja"
-if [[ -n "${targets}" ]]; then
- # Targets are not escaped as they are passed as separate arguments.
- ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
- cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
-fi
+ninja -C "${BUILD_DIR}"
-if [[ -n "${runtimes_targets}" ]]; then
- start-group "ninja runtimes"
-
- ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
- cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
-fi
+#if [[ -n "${targets}" ]]; then
+# # Targets are not escaped as they are passed as separate arguments.
+# ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
+# cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
+#fi
+#
+#if [[ -n "${runtimes_targets}" ]]; then
+# start-group "ninja runtimes"
+#
+# ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
+# cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
+#fi
>From 24ca7f19032ce0ce418e984be7323bff52d634a6 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 23:02:56 -0700
Subject: [PATCH 11/25] LLVMFuzzerTestOneInput
---
clang-tools-extra/clangd/fuzzer/CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/clang-tools-extra/clangd/fuzzer/CMakeLists.txt b/clang-tools-extra/clangd/fuzzer/CMakeLists.txt
index 9cfaeca189777..f05ed02f064fb 100644
--- a/clang-tools-extra/clangd/fuzzer/CMakeLists.txt
+++ b/clang-tools-extra/clangd/fuzzer/CMakeLists.txt
@@ -3,6 +3,9 @@ set(LLVM_LINK_COMPONENTS
Support
)
+# error: conflicting types for 'LLVMFuzzerTestOneInput'
+set(CMAKE_UNITY_BUILD OFF)
+
# This fuzzer runs on oss-fuzz, so keep it around even if it looks unreferenced.
add_llvm_fuzzer(clangd-fuzzer
clangd-fuzzer.cpp
>From 3d779be760f51e864e77293570a98b9a5b3ee58d Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 23:16:43 -0700
Subject: [PATCH 12/25] use time
---
benchmark_build.sh | 39 +++++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 10 deletions(-)
diff --git a/benchmark_build.sh b/benchmark_build.sh
index 2f7fd546fb79f..1a69ba6294c4f 100755
--- a/benchmark_build.sh
+++ b/benchmark_build.sh
@@ -47,6 +47,16 @@ print_stats() {
'
}
+# Parse the output of `time` (real/user/sys lines) into seconds.
+# Handles both "0m1.234s" and "1m2.345s" formats.
+parse_time() {
+ local line="$1"
+ local mins secs
+ mins=$(echo "$line" | sed -E 's/.*[[:space:]]([0-9]+)m([0-9.]+)s/\1/')
+ secs=$(echo "$line" | sed -E 's/.*[[:space:]]([0-9]+)m([0-9.]+)s/\2/')
+ echo "$mins * 60 + $secs" | bc
+}
+
for build_type in Release Debug; do
for unity_mode in off on; do
if [ "$unity_mode" = "off" ]; then
@@ -57,9 +67,11 @@ for unity_mode in off on; do
label_suffix="$build_type, with unity"
fi
- declare -A all_times
+ declare -A all_real all_user all_sys
for tool in "${TOOLS[@]}"; do
- all_times[$tool]=""
+ all_real[$tool]=""
+ all_user[$tool]=""
+ all_sys[$tool]=""
done
for i in $(seq 1 $ITERATIONS); do
@@ -72,13 +84,16 @@ for unity_mode in off on; do
$unity_flag > /dev/null
for tool in "${TOOLS[@]}"; do
- start=$(date +%s.%N)
- ninja -C "$BUILD_DIR" "$tool" > /dev/null
- end=$(date +%s.%N)
+ time_output=$( { time ninja -C "$BUILD_DIR" "$tool" > /dev/null; } 2>&1 )
+
+ real=$(parse_time "$(echo "$time_output" | grep real)")
+ user=$(parse_time "$(echo "$time_output" | grep user)")
+ sys=$(parse_time "$(echo "$time_output" | grep sys)")
- elapsed=$(echo "$end - $start" | bc)
- all_times[$tool]+="$elapsed "
- echo ">>> $tool took ${elapsed}s"
+ all_real[$tool]+="$real "
+ all_user[$tool]+="$user "
+ all_sys[$tool]+="$sys "
+ echo ">>> $tool real=${real}s user=${user}s sys=${sys}s"
# Clean build artifacts but keep the configured build dir
ninja -C "$BUILD_DIR" clean > /dev/null
@@ -92,8 +107,12 @@ for unity_mode in off on; do
echo "# Results: $label_suffix"
echo "############################################"
for tool in "${TOOLS[@]}"; do
- read -ra times <<< "${all_times[$tool]}"
- print_stats "$tool ($label_suffix)" "${times[@]}"
+ read -ra times <<< "${all_real[$tool]}"
+ print_stats "$tool real ($label_suffix)" "${times[@]}"
+ read -ra times <<< "${all_user[$tool]}"
+ print_stats "$tool user ($label_suffix)" "${times[@]}"
+ read -ra times <<< "${all_sys[$tool]}"
+ print_stats "$tool sys ($label_suffix)" "${times[@]}"
done
done
done
>From bff4df4743f528e815dc673a2ce7151d2c42e8c0 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 23:31:04 -0700
Subject: [PATCH 13/25] measure memory too
---
benchmark_build.sh | 64 +++++++++++++++++++++++++++++++---------------
1 file changed, 44 insertions(+), 20 deletions(-)
diff --git a/benchmark_build.sh b/benchmark_build.sh
index 1a69ba6294c4f..7db29f9a0dfe6 100755
--- a/benchmark_build.sh
+++ b/benchmark_build.sh
@@ -7,16 +7,17 @@ BUILD_DIR=build
print_stats() {
local label="$1"
- shift
- local times=("$@")
+ local unit="$2"
+ shift 2
+ local vals=("$@")
echo ""
echo "========== $label =========="
- printf "Times: "
- printf "%s " "${times[@]}"
+ printf "Values: "
+ printf "%s " "${vals[@]}"
echo ""
- printf "%s\n" "${times[@]}" | awk '
+ printf "%s\n" "${vals[@]}" | awk -v unit="$unit" '
{
vals[NR] = $1
sum += $1
@@ -39,16 +40,15 @@ print_stats() {
median = (vals[n/2] + vals[n/2 + 1]) / 2
printf "N: %d\n", n
- printf "Mean: %.2fs\n", mean
- printf "Median: %.2fs\n", median
- printf "Var: %.2f\n", var
- printf "StdDev: %.2fs\n", sqrt(var)
+ printf "Mean: %.2f%s\n", mean, unit
+ printf "Median: %.2f%s\n", median, unit
+ printf "Var: %.4f\n", var
+ printf "StdDev: %.2f%s\n", sqrt(var), unit
}
'
}
-# Parse the output of `time` (real/user/sys lines) into seconds.
-# Handles both "0m1.234s" and "1m2.345s" formats.
+# Parse time output (e.g. "real 0m1.234s") into seconds.
parse_time() {
local line="$1"
local mins secs
@@ -57,6 +57,25 @@ parse_time() {
echo "$mins * 60 + $secs" | bc
}
+# Parse max RSS from /usr/bin/time output and convert to GB.
+# macOS `time -l`: bytes; GNU `time -v`: KB.
+parse_maxrss_gb() {
+ local output="$1"
+ if echo "$output" | grep -q "maximum resident set size"; then
+ # macOS: value in bytes
+ local bytes
+ bytes=$(echo "$output" | grep "maximum resident set size" | awk '{print $1}')
+ echo "scale=4; $bytes / 1073741824" | bc
+ elif echo "$output" | grep -q "Maximum resident set size"; then
+ # GNU time: value in KB
+ local kb
+ kb=$(echo "$output" | grep "Maximum resident set size" | awk '{print $NF}')
+ echo "scale=4; $kb / 1048576" | bc
+ else
+ echo "0"
+ fi
+}
+
for build_type in Release Debug; do
for unity_mode in off on; do
if [ "$unity_mode" = "off" ]; then
@@ -67,11 +86,12 @@ for unity_mode in off on; do
label_suffix="$build_type, with unity"
fi
- declare -A all_real all_user all_sys
+ declare -A all_real all_user all_sys all_mem
for tool in "${TOOLS[@]}"; do
all_real[$tool]=""
all_user[$tool]=""
all_sys[$tool]=""
+ all_mem[$tool]=""
done
for i in $(seq 1 $ITERATIONS); do
@@ -84,16 +104,18 @@ for unity_mode in off on; do
$unity_flag > /dev/null
for tool in "${TOOLS[@]}"; do
- time_output=$( { time ninja -C "$BUILD_DIR" "$tool" > /dev/null; } 2>&1 )
+ time_output=$( { /usr/bin/time -l ninja -C "$BUILD_DIR" "$tool" > /dev/null; } 2>&1 )
real=$(parse_time "$(echo "$time_output" | grep real)")
user=$(parse_time "$(echo "$time_output" | grep user)")
sys=$(parse_time "$(echo "$time_output" | grep sys)")
+ mem=$(parse_maxrss_gb "$time_output")
all_real[$tool]+="$real "
all_user[$tool]+="$user "
all_sys[$tool]+="$sys "
- echo ">>> $tool real=${real}s user=${user}s sys=${sys}s"
+ all_mem[$tool]+="$mem "
+ echo ">>> $tool real=${real}s user=${user}s sys=${sys}s maxrss=${mem}GB"
# Clean build artifacts but keep the configured build dir
ninja -C "$BUILD_DIR" clean > /dev/null
@@ -107,12 +129,14 @@ for unity_mode in off on; do
echo "# Results: $label_suffix"
echo "############################################"
for tool in "${TOOLS[@]}"; do
- read -ra times <<< "${all_real[$tool]}"
- print_stats "$tool real ($label_suffix)" "${times[@]}"
- read -ra times <<< "${all_user[$tool]}"
- print_stats "$tool user ($label_suffix)" "${times[@]}"
- read -ra times <<< "${all_sys[$tool]}"
- print_stats "$tool sys ($label_suffix)" "${times[@]}"
+ read -ra vals <<< "${all_real[$tool]}"
+ print_stats "$tool real ($label_suffix)" "s" "${vals[@]}"
+ read -ra vals <<< "${all_user[$tool]}"
+ print_stats "$tool user ($label_suffix)" "s" "${vals[@]}"
+ read -ra vals <<< "${all_sys[$tool]}"
+ print_stats "$tool sys ($label_suffix)" "s" "${vals[@]}"
+ read -ra vals <<< "${all_mem[$tool]}"
+ print_stats "$tool maxrss ($label_suffix)" "GB" "${vals[@]}"
done
done
done
>From 51cfa1947eb16644bcbcb029f4af278305345a9d Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Thu, 19 Mar 2026 23:43:04 -0700
Subject: [PATCH 14/25] measure memory too
---
benchmark_build.sh | 52 ++++++++++++----------------------------------
1 file changed, 13 insertions(+), 39 deletions(-)
diff --git a/benchmark_build.sh b/benchmark_build.sh
index 7db29f9a0dfe6..10bed433a0a73 100755
--- a/benchmark_build.sh
+++ b/benchmark_build.sh
@@ -1,9 +1,10 @@
-#!/usr/bin/env bash
+#!/usr/bin/env zsh
set -euo pipefail
ITERATIONS=2
TOOLS=("mlir-opt" "clang" "opt")
BUILD_DIR=build
+TIMEFMT='%*U %*S %*E %M'
print_stats() {
local label="$1"
@@ -48,34 +49,6 @@ print_stats() {
'
}
-# Parse time output (e.g. "real 0m1.234s") into seconds.
-parse_time() {
- local line="$1"
- local mins secs
- mins=$(echo "$line" | sed -E 's/.*[[:space:]]([0-9]+)m([0-9.]+)s/\1/')
- secs=$(echo "$line" | sed -E 's/.*[[:space:]]([0-9]+)m([0-9.]+)s/\2/')
- echo "$mins * 60 + $secs" | bc
-}
-
-# Parse max RSS from /usr/bin/time output and convert to GB.
-# macOS `time -l`: bytes; GNU `time -v`: KB.
-parse_maxrss_gb() {
- local output="$1"
- if echo "$output" | grep -q "maximum resident set size"; then
- # macOS: value in bytes
- local bytes
- bytes=$(echo "$output" | grep "maximum resident set size" | awk '{print $1}')
- echo "scale=4; $bytes / 1073741824" | bc
- elif echo "$output" | grep -q "Maximum resident set size"; then
- # GNU time: value in KB
- local kb
- kb=$(echo "$output" | grep "Maximum resident set size" | awk '{print $NF}')
- echo "scale=4; $kb / 1048576" | bc
- else
- echo "0"
- fi
-}
-
for build_type in Release Debug; do
for unity_mode in off on; do
if [ "$unity_mode" = "off" ]; then
@@ -86,7 +59,7 @@ for unity_mode in off on; do
label_suffix="$build_type, with unity"
fi
- declare -A all_real all_user all_sys all_mem
+ typeset -A all_real all_user all_sys all_mem
for tool in "${TOOLS[@]}"; do
all_real[$tool]=""
all_user[$tool]=""
@@ -104,12 +77,13 @@ for unity_mode in off on; do
$unity_flag > /dev/null
for tool in "${TOOLS[@]}"; do
- time_output=$( { /usr/bin/time -l ninja -C "$BUILD_DIR" "$tool" > /dev/null; } 2>&1 )
+ # TIMEFMT='%*U %*S %*E %M' outputs: user_s sys_s real_s maxrss_kb
+ time_output=$( { time ninja -C "$BUILD_DIR" "$tool" > /dev/null } 2>&1 )
- real=$(parse_time "$(echo "$time_output" | grep real)")
- user=$(parse_time "$(echo "$time_output" | grep user)")
- sys=$(parse_time "$(echo "$time_output" | grep sys)")
- mem=$(parse_maxrss_gb "$time_output")
+ user=$(echo "$time_output" | awk '{print $1}')
+ sys=$(echo "$time_output" | awk '{print $2}')
+ real=$(echo "$time_output" | awk '{print $3}')
+ mem=$(echo "$time_output" | awk '{printf "%.4f", $4 / 1048576}')
all_real[$tool]+="$real "
all_user[$tool]+="$user "
@@ -129,13 +103,13 @@ for unity_mode in off on; do
echo "# Results: $label_suffix"
echo "############################################"
for tool in "${TOOLS[@]}"; do
- read -ra vals <<< "${all_real[$tool]}"
+ read -rA vals <<< "${all_real[$tool]}"
print_stats "$tool real ($label_suffix)" "s" "${vals[@]}"
- read -ra vals <<< "${all_user[$tool]}"
+ read -rA vals <<< "${all_user[$tool]}"
print_stats "$tool user ($label_suffix)" "s" "${vals[@]}"
- read -ra vals <<< "${all_sys[$tool]}"
+ read -rA vals <<< "${all_sys[$tool]}"
print_stats "$tool sys ($label_suffix)" "s" "${vals[@]}"
- read -ra vals <<< "${all_mem[$tool]}"
+ read -rA vals <<< "${all_mem[$tool]}"
print_stats "$tool maxrss ($label_suffix)" "GB" "${vals[@]}"
done
done
>From 195900faff056e07a9e7aa73197bfd400e1012a8 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Fri, 20 Mar 2026 00:05:37 -0700
Subject: [PATCH 15/25] fix build errors
---
flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt | 10 ++++++++++
flang/lib/Optimizer/Transforms/CMakeLists.txt | 11 +++++++++++
2 files changed, 21 insertions(+)
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt b/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
index 5c24fe58b05c4..c7632181e9ce3 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
+++ b/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
@@ -1,5 +1,15 @@
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
+# ConvertToFIR.cpp redefines AssignOpConversion and NoReassocOpConversion,
+# ScheduleOrderedAssignments.cpp redefines isForallIndex, and
+# SimplifyHLFIRIntrinsics.cpp redefines CmpCharOpConversion/IndexOpConversion.
+set_source_files_properties(
+ ConvertToFIR.cpp
+ ScheduleOrderedAssignments.cpp
+ SimplifyHLFIRIntrinsics.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_flang_library(HLFIRTransforms
BufferizeHLFIR.cpp
ConvertToFIR.cpp
diff --git a/flang/lib/Optimizer/Transforms/CMakeLists.txt b/flang/lib/Optimizer/Transforms/CMakeLists.txt
index 5a3059ebbd97f..2c10fd6571d56 100644
--- a/flang/lib/Optimizer/Transforms/CMakeLists.txt
+++ b/flang/lib/Optimizer/Transforms/CMakeLists.txt
@@ -1,3 +1,14 @@
+# AnnotateConstant.cpp has 'impl' ambiguity from tablegen pass base classes.
+# LoopInvariantCodeMotion.cpp has fir::AliasAnalysis vs mlir::AliasAnalysis
+# ambiguity. CUFOpConversionLate.cpp redefines createConvertOp.
+set_source_files_properties(
+ AnnotateConstant.cpp
+ ConvertComplexPow.cpp
+ LoopInvariantCodeMotion.cpp
+ CUDA/CUFOpConversionLate.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
+)
+
add_flang_library(FIRTransforms
AbstractResult.cpp
AddAliasTags.cpp
>From fa2a0604a63fff1d29a7d0410b5779d702c7f5d0 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Sat, 21 Mar 2026 14:05:00 -0700
Subject: [PATCH 16/25] normalize script
---
benchmark_build.sh | 91 +++++-----------------------------------------
1 file changed, 10 insertions(+), 81 deletions(-)
diff --git a/benchmark_build.sh b/benchmark_build.sh
index 10bed433a0a73..5d82eb892c578 100755
--- a/benchmark_build.sh
+++ b/benchmark_build.sh
@@ -4,71 +4,22 @@ set -euo pipefail
ITERATIONS=2
TOOLS=("mlir-opt" "clang" "opt")
BUILD_DIR=build
-TIMEFMT='%*U %*S %*E %M'
-
-print_stats() {
- local label="$1"
- local unit="$2"
- shift 2
- local vals=("$@")
-
- echo ""
- echo "========== $label =========="
- printf "Values: "
- printf "%s " "${vals[@]}"
- echo ""
-
- printf "%s\n" "${vals[@]}" | awk -v unit="$unit" '
- {
- vals[NR] = $1
- sum += $1
- sumsq += $1 * $1
- n = NR
- }
- END {
- mean = sum / n
- var = sumsq / n - mean * mean
-
- for (i = 1; i <= n; i++)
- for (j = i + 1; j <= n; j++)
- if (vals[i] > vals[j]) {
- t = vals[i]; vals[i] = vals[j]; vals[j] = t
- }
-
- if (n % 2 == 1)
- median = vals[int(n/2) + 1]
- else
- median = (vals[n/2] + vals[n/2 + 1]) / 2
-
- printf "N: %d\n", n
- printf "Mean: %.2f%s\n", mean, unit
- printf "Median: %.2f%s\n", median, unit
- printf "Var: %.4f\n", var
- printf "StdDev: %.2f%s\n", sqrt(var), unit
- }
- '
-}
+TIMEFMT='user %U system %S cpu %P total %*E mem %M'
+for cores in 32 16 8 4 2; do
for build_type in Release Debug; do
for unity_mode in off on; do
if [ "$unity_mode" = "off" ]; then
unity_flag=""
- label_suffix="$build_type, no unity"
+ label_suffix="$build_type - no unity"
else
unity_flag="-DCMAKE_UNITY_BUILD=ON"
- label_suffix="$build_type, with unity"
+ label_suffix="$build_type - with unity"
fi
- typeset -A all_real all_user all_sys all_mem
- for tool in "${TOOLS[@]}"; do
- all_real[$tool]=""
- all_user[$tool]=""
- all_sys[$tool]=""
- all_mem[$tool]=""
- done
-
for i in $(seq 1 $ITERATIONS); do
- echo "========== [$label_suffix] Iteration $i / $ITERATIONS =========="
+
+ rm -rf "$BUILD_DIR"
cmake -S llvm -B "$BUILD_DIR" \
-G Ninja \
@@ -77,19 +28,10 @@ for unity_mode in off on; do
$unity_flag > /dev/null
for tool in "${TOOLS[@]}"; do
- # TIMEFMT='%*U %*S %*E %M' outputs: user_s sys_s real_s maxrss_kb
- time_output=$( { time ninja -C "$BUILD_DIR" "$tool" > /dev/null } 2>&1 )
- user=$(echo "$time_output" | awk '{print $1}')
- sys=$(echo "$time_output" | awk '{print $2}')
- real=$(echo "$time_output" | awk '{print $3}')
- mem=$(echo "$time_output" | awk '{printf "%.4f", $4 / 1048576}')
-
- all_real[$tool]+="$real "
- all_user[$tool]+="$user "
- all_sys[$tool]+="$sys "
- all_mem[$tool]+="$mem "
- echo ">>> $tool real=${real}s user=${user}s sys=${sys}s maxrss=${mem}GB"
+ echo "========== cores $cores - $tool - $label_suffix - $i / $ITERATIONS =========="
+ time_output=$( time ninja -j $cores -C "$BUILD_DIR" $tool 2>&1 > /dev/null )
+ # time_output=$( time sleep 1 2>&1 > /dev/null )
# Clean build artifacts but keep the configured build dir
ninja -C "$BUILD_DIR" clean > /dev/null
@@ -98,19 +40,6 @@ for unity_mode in off on; do
rm -rf "$BUILD_DIR"
done
- echo ""
- echo "############################################"
- echo "# Results: $label_suffix"
- echo "############################################"
- for tool in "${TOOLS[@]}"; do
- read -rA vals <<< "${all_real[$tool]}"
- print_stats "$tool real ($label_suffix)" "s" "${vals[@]}"
- read -rA vals <<< "${all_user[$tool]}"
- print_stats "$tool user ($label_suffix)" "s" "${vals[@]}"
- read -rA vals <<< "${all_sys[$tool]}"
- print_stats "$tool sys ($label_suffix)" "s" "${vals[@]}"
- read -rA vals <<< "${all_mem[$tool]}"
- print_stats "$tool maxrss ($label_suffix)" "GB" "${vals[@]}"
- done
+done
done
done
>From a4c25d70df3954ab3701a61370f43875e7011165 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Sun, 22 Mar 2026 12:37:19 -0400
Subject: [PATCH 17/25] fix AnalysisRegistry
---
.../lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt b/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
index 8c306163df1a7..f1c5be5b04aa5 100644
--- a/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
+++ b/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
@@ -33,3 +33,8 @@ add_clang_library(clangScalableStaticAnalysisFrameworkCore
DEPENDS
)
+
+# error: type alias redefinition with different types ('Registry<AnalysisBase>' vs 'Registry<SummaryDataBuilderBase>')
+set_source_files_properties(
+ WholeProgramAnalysis/AnalysisRegistry.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
>From 8cf29c2698c42bea3ef1857c277e66e3a9e38591 Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Sun, 22 Mar 2026 12:42:58 -0400
Subject: [PATCH 18/25] fix support on windows
---
llvm/lib/Support/CMakeLists.txt | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index a2c68233fd253..d70fffbccadb9 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -335,6 +335,15 @@ add_llvm_component_library(LLVMSupport
Demangle
)
+if(WIN32)
+ set_source_files_properties(
+ # error: expected unqualified-id 672 | while (const auto *IN = dyn_cast<RopePieceBTreeInterior>(N))
+ RewriteRope.cpp
+ # error: expected unqualified-id 511 | for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i)
+ ManagedStatic.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
# Link ICU library if it is an external library.
if(ICU_FOUND AND NOT HAVE_WINDOWS_ICU)
target_link_libraries(LLVMSupport
>From fdd7e8062cbcd289d57554be0e689c0b7a29da5f Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Mon, 23 Mar 2026 11:04:04 -0700
Subject: [PATCH 19/25] fix xegpu
---
.../Dialect/XeGPU/Transforms/Transforms.h | 15 +++++++++++++++
.../XeGPUSgToWiDistributeExperimental.cpp | 18 ++----------------
.../Transforms/XeGPUSubgroupDistribute.cpp | 19 ++-----------------
3 files changed, 19 insertions(+), 33 deletions(-)
diff --git a/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h b/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h
index fe989ebb17059..459ee42fe0c7f 100644
--- a/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h
+++ b/mlir/include/mlir/Dialect/XeGPU/Transforms/Transforms.h
@@ -101,6 +101,21 @@ void populateXeGPUSgToWiDistributeTypeConversionAndLegality(
void populateXeGPUUnrollPatterns(RewritePatternSet &patterns,
const UnrollOptions &options);
+/// Given a vector type and its distributed vector type, return the list of
+/// dimensions that are distributed.
+inline SmallVector<int64_t> getDistributedDims(VectorType originalType,
+ VectorType distributedType) {
+ assert(originalType.getRank() == distributedType.getRank() &&
+ "sequential and distributed vector types must have the same rank");
+ SmallVector<int64_t> distributedDims;
+ for (int64_t i = 0; i < originalType.getRank(); ++i) {
+ if (distributedType.getDimSize(i) != originalType.getDimSize(i)) {
+ distributedDims.push_back(i);
+ }
+ }
+ return distributedDims;
+}
+
} // namespace xegpu
} // namespace mlir
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
index 0961ddfb92040..dd2ef6d93c4ff 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSgToWiDistributeExperimental.cpp
@@ -122,20 +122,6 @@ static bool isReductionLaneLocal(vector::MultiDimReductionOp op) {
return resTy != resDistTypeOrFailure.value();
}
-/// Given a vector type and its distributed vector type, return the list of
-/// dimensions that are distributed.
-static SmallVector<int64_t> getDistributedDims(VectorType originalType,
- VectorType distributedType) {
- assert(originalType.getRank() == distributedType.getRank() &&
- "original and distributed vector types must have the same rank");
- SmallVector<int64_t> distributedDims;
- for (int64_t i = 0; i < originalType.getRank(); ++i) {
- if (distributedType.getDimSize(i) != originalType.getDimSize(i))
- distributedDims.push_back(i);
- }
- return distributedDims;
-}
-
/// Distributes a subgroup-level CreateNdDesc op to workitem-level CreateNdDesc
/// op. This simply drops the layout attribute from the tensor descriptor type.
struct SgToWiCreateNdDesc : public OpConversionPattern<xegpu::CreateNdDescOp> {
@@ -900,7 +886,7 @@ struct SgToWiVectorExtractStridedSlice
VectorType distResultTy = *distResultTyOrFailure;
SmallVector<int64_t> distributedDims =
- getDistributedDims(resultType, distResultTy);
+ xegpu::getDistributedDims(resultType, distResultTy);
// Collect updated sizes, offsets, strides. Pad to full source rank.
int64_t sourceRank = op.getSourceVectorType().getRank();
@@ -992,7 +978,7 @@ struct SgToWiVectorInsertStridedSlice
VectorType distDestTy = *distDestTyOrFailure;
SmallVector<int64_t> destDistributedDims =
- getDistributedDims(destType, distDestTy);
+ xegpu::getDistributedDims(destType, distDestTy);
SmallVector<Attribute> updatedOffsets = llvm::map_to_vector(
op.getOffsets(), [](Attribute attr) { return attr; });
diff --git a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
index 69c2fb7493086..7a84091f4ae37 100644
--- a/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
+++ b/mlir/lib/Dialect/XeGPU/Transforms/XeGPUSubgroupDistribute.cpp
@@ -105,21 +105,6 @@ static Value resolveDistributedTy(Value orig, T expected,
return orig;
}
-/// Given a vector type and its distributed vector type, return the list of
-/// dimensions that are distributed.
-static SmallVector<int64_t> getDistributedDims(VectorType originalType,
- VectorType distributedType) {
- assert(originalType.getRank() == distributedType.getRank() &&
- "sequential and distributed vector types must have the same rank");
- SmallVector<int64_t> distributedDims;
- for (int64_t i = 0; i < originalType.getRank(); ++i) {
- if (distributedType.getDimSize(i) != originalType.getDimSize(i)) {
- distributedDims.push_back(i);
- }
- }
- return distributedDims;
-}
-
/// Given a GPUFuncOp, this pattern creates a new GPUFuncOp and moves the body
/// of the original GPUFuncOp to the new GPUFuncOp such that entire body is
/// contained within a WarpExecuteOnLane0Op.
@@ -1655,7 +1640,7 @@ struct VectorExtractStridedSliceDistribution
// Find the distributed dimensions.
auto extractResultType = cast<VectorType>(operand->get().getType());
auto distributedDims =
- getDistributedDims(extractResultType, distributedType);
+ xegpu::getDistributedDims(extractResultType, distributedType);
// Collect updated source type, sizes and offsets. They may be adjusted
// later if the data is distributed to lanes (as opposed to being owned by
// all lanes uniformly).
@@ -1770,7 +1755,7 @@ struct VectorInsertStridedSliceDistribution
// Find the distributed dimensions of the dest vector.
auto insertResultType = cast<VectorType>(operand->get().getType());
auto destDistributedDims =
- getDistributedDims(insertResultType, distributedType);
+ xegpu::getDistributedDims(insertResultType, distributedType);
// Collect updated offsets, source type and dest type. They may be adjusted
// later if the data is distributed to lanes (as opposed to being owned by
// all lanes uniformly).
>From 314e6ca4f66fde58af36752079db600b30347453 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Mon, 23 Mar 2026 19:19:36 -0700
Subject: [PATCH 20/25] revert monolithic
---
.ci/monolithic-linux.sh | 91 +++++++++++++++++++--------------------
.ci/monolithic-windows.sh | 26 ++++++-----
2 files changed, 57 insertions(+), 60 deletions(-)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 935e0896a8262..60fb9e9c9a4f6 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -41,8 +41,9 @@ export LLVM_SYMBOLIZER_PATH=`which llvm-symbolizer`
# It will not be built unless it is used.
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_PROJECTS="${projects}" \
- -D CMAKE_UNITY_BUILD=ON \
+ -D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-G Ninja \
+ -D CMAKE_UNITY_BUILD=ON \
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
-D CMAKE_BUILD_TYPE=Release \
-D CLANG_ENABLE_CIR=${enable_cir} \
@@ -65,49 +66,47 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_WERROR=ON \
-D LLVM_BINUTILS_INCDIR=/usr
-ninja -C "${BUILD_DIR}"
+start-group "ninja"
-#start-group "ninja"
-#
-#if [[ -n "${targets}" ]]; then
-# # Targets are not escaped as they are passed as separate arguments.
-# ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
-# cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
-#fi
-#
-#if [[ -n "${runtime_targets}" ]]; then
-# start-group "ninja Runtimes"
-#
-# ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
-# cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
-#fi
-#
-## Compiling runtimes with just-built Clang and running their tests
-## as an additional testing for Clang.
-#if [[ -n "${runtime_targets_needs_reconfig}" ]]; then
-# start-group "CMake Runtimes C++26"
-#
-# cmake \
-# -D LIBCXX_TEST_PARAMS="std=c++26" \
-# -D LIBCXXABI_TEST_PARAMS="std=c++26" \
-# "${BUILD_DIR}"
-#
-# start-group "ninja Runtimes C++26"
-#
-# ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
-# |& tee ninja_runtimes_needs_reconfig1.log
-# cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconig.ninja_log
-#
-# start-group "CMake Runtimes Clang Modules"
-#
-# cmake \
-# -D LIBCXX_TEST_PARAMS="enable_modules=clang" \
-# -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
-# "${BUILD_DIR}"
-#
-# start-group "ninja Runtimes Clang Modules"
-#
-# ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
-# |& tee ninja_runtimes_needs_reconfig2.log
-# cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconfig2.ninja_log
-#fi
+if [[ -n "${targets}" ]]; then
+ # Targets are not escaped as they are passed as separate arguments.
+ ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
+ cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
+fi
+
+if [[ -n "${runtime_targets}" ]]; then
+ start-group "ninja Runtimes"
+
+ ninja -C "${BUILD_DIR}" ${runtime_targets} |& tee ninja_runtimes.log
+ cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
+fi
+
+# Compiling runtimes with just-built Clang and running their tests
+# as an additional testing for Clang.
+if [[ -n "${runtime_targets_needs_reconfig}" ]]; then
+ start-group "CMake Runtimes C++26"
+
+ cmake \
+ -D LIBCXX_TEST_PARAMS="std=c++26" \
+ -D LIBCXXABI_TEST_PARAMS="std=c++26" \
+ "${BUILD_DIR}"
+
+ start-group "ninja Runtimes C++26"
+
+ ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
+ |& tee ninja_runtimes_needs_reconfig1.log
+ cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconig.ninja_log
+
+ start-group "CMake Runtimes Clang Modules"
+
+ cmake \
+ -D LIBCXX_TEST_PARAMS="enable_modules=clang" \
+ -D LIBCXXABI_TEST_PARAMS="enable_modules=clang" \
+ "${BUILD_DIR}"
+
+ start-group "ninja Runtimes Clang Modules"
+
+ ninja -C "${BUILD_DIR}" ${runtime_targets_needs_reconfig} \
+ |& tee ninja_runtimes_needs_reconfig2.log
+ cp ${BUILD_DIR}/.ninja_log ninja_runtimes_needs_reconfig2.ninja_log
+fi
diff --git a/.ci/monolithic-windows.sh b/.ci/monolithic-windows.sh
index d13212ce03722..f35f17350022f 100755
--- a/.ci/monolithic-windows.sh
+++ b/.ci/monolithic-windows.sh
@@ -49,21 +49,19 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
- -D CMAKE_UNITY_BUILD=ON
+ -D LLVM_ENABLE_RUNTIMES="${runtimes}"
start-group "ninja"
-ninja -C "${BUILD_DIR}"
+if [[ -n "${targets}" ]]; then
+ # Targets are not escaped as they are passed as separate arguments.
+ ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
+ cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
+fi
-#if [[ -n "${targets}" ]]; then
-# # Targets are not escaped as they are passed as separate arguments.
-# ninja -C "${BUILD_DIR}" -k 0 ${targets} |& tee ninja.log
-# cp ${BUILD_DIR}/.ninja_log ninja.ninja_log
-#fi
-#
-#if [[ -n "${runtimes_targets}" ]]; then
-# start-group "ninja runtimes"
-#
-# ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
-# cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
-#fi
+if [[ -n "${runtimes_targets}" ]]; then
+ start-group "ninja runtimes"
+
+ ninja -C "${BUILD_DIR}" -k 0 ${runtimes_targets} |& tee ninja_runtimes.log
+ cp ${BUILD_DIR}/.ninja_log ninja_runtimes.ninja_log
+fi
>From b08525f78133b95d7125847fba0451daea778864 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Mon, 23 Mar 2026 22:58:44 -0700
Subject: [PATCH 21/25] fix more tarets
---
.../clangd/unittests/CMakeLists.txt | 14 ++++
.../include-cleaner/unittests/CMakeLists.txt | 4 ++
.../unittests/clang-tidy/CMakeLists.txt | 11 ++++
clang/unittests/CMakeLists.txt | 64 +++++++++++++++++++
clang/unittests/Format/CMakeLists.txt | 3 +
llvm/tools/gold/CMakeLists.txt | 6 +-
llvm/unittests/CMakeLists.txt | 2 +
7 files changed, 101 insertions(+), 3 deletions(-)
diff --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt b/clang-tools-extra/clangd/unittests/CMakeLists.txt
index 2b1b6e079be38..02ec1ab60764f 100644
--- a/clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -186,6 +186,20 @@ target_link_libraries(ClangdTests
clangdSupport
)
+# These files define symbols that clash in unity builds:
+# - PreambleTests.cpp defines MATCHER_P(Diag, ...) which conflicts with
+# clang::clangd::Diag when combined with RenameTests.cpp.
+# - HoverTests.cpp and IncludeCleanerTests.cpp both define guard().
+# - SymbolCollectorTests.cpp, SerializationTests.cpp, FileIndexTests.cpp,
+# BackgroundIndexTests.cpp, and FindSymbolsTests.cpp all define
+# MATCHER_P(qName, ...).
+set_source_files_properties(
+ PreambleTests.cpp
+ HoverTests.cpp
+ IncludeCleanerTests.cpp
+ SymbolCollectorTests.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
if (CLANGD_ENABLE_REMOTE)
target_link_libraries(ClangdTests
PRIVATE
diff --git a/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt b/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
index 416535649f622..0ee213ce7ed3d 100644
--- a/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
+++ b/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
@@ -38,3 +38,7 @@ target_link_libraries(ClangIncludeCleanerTests
LLVMTestingSupport
)
+# AnalysisTest.cpp and FindHeadersTest.cpp both define guard().
+set_source_files_properties(FindHeadersTest.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
diff --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
index 167f5d3def06b..cb5fceecfdcfd 100644
--- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
@@ -66,6 +66,17 @@ target_link_libraries(ClangTidyTests
LLVMTestingSupport
)
+# These files define symbols that clash in unity builds:
+# - ClangTidyOptionsTest.cpp and ClangTidyDiagnosticConsumerTest.cpp both
+# define TestCheck
+# - UsingInserterTest.cpp and NamespaceAliaserTest.cpp both define runChecker
+set_source_files_properties(
+ ClangTidyDiagnosticConsumerTest.cpp
+ ClangTidyOptionsTest.cpp
+ NamespaceAliaserTest.cpp
+ UsingInserterTest.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
if(CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS)
target_link_libraries(ClangTidyTests
PRIVATE
diff --git a/clang/unittests/CMakeLists.txt b/clang/unittests/CMakeLists.txt
index 2ae0906dd1571..1059ed54a5b95 100644
--- a/clang/unittests/CMakeLists.txt
+++ b/clang/unittests/CMakeLists.txt
@@ -1,6 +1,8 @@
add_custom_target(ClangUnitTests)
set_target_properties(ClangUnitTests PROPERTIES FOLDER "Clang/Tests")
+set(CMAKE_UNITY_BUILD OFF)
+
if(CLANG_BUILT_STANDALONE)
# LLVMTesting* libraries are needed for some of the unittests.
if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
@@ -128,6 +130,68 @@ add_distinct_clang_unittest(AllClangUnitTests
${LLVM_COMPONENTS}
)
+# Files that clash in unity builds of AllClangUnitTests due to shared headers
+# (ASTPrint.h, CheckerRegistration.h, CallbacksCommon.h, CFGBuildResult.h)
+# or duplicate symbols.
+set_source_files_properties(
+ Lex/LexerTest.cpp
+ Analysis/CFGBackEdgesTest.cpp
+ Analysis/CFGDominatorTree.cpp
+ Analysis/CFGTest.cpp
+ Analysis/IntervalPartitionTest.cpp
+ Analysis/UnsafeBufferUsageTest.cpp
+ Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
+ AST/ASTDumperTest.cpp
+ AST/ASTExprTest.cpp
+ AST/ASTImporterGenericRedeclTest.cpp
+ AST/ASTImporterODRStrategiesTest.cpp
+ AST/AttrTest.cpp
+ AST/ConceptPrinterTest.cpp
+ AST/DataCollectionTest.cpp
+ AST/DeclPrinterTest.cpp
+ AST/NamedDeclPrinterTest.cpp
+ AST/QualTypeNamesTest.cpp
+ AST/SizelessTypesTest.cpp
+ AST/StmtPrinterTest.cpp
+ AST/TemplateNameTest.cpp
+ AST/TypePrinterTest.cpp
+ CodeGen/TBAAMetadataTest.cpp
+ Driver/ToolChainTest.cpp
+ Interpreter/InterpreterTest.cpp
+ Lex/NoTrivialPPDirectiveTracerTest.cpp
+ Lex/PPConditionalDirectiveRecordTest.cpp
+ Lex/PPDependencyDirectivesTest.cpp
+ Lex/PPMemoryAllocationsTest.cpp
+ Lex/PPCallbacksTest.cpp
+ Lex/ModuleDeclStateTest.cpp
+ Parse/ParseHLSLRootSignatureTest.cpp
+ ScalableStaticAnalysisFramework/Registries/MockSerializationFormat.cpp
+ StaticAnalyzer/BlockEntranceCallbackTest.cpp
+ StaticAnalyzer/BugReportInterestingnessTest.cpp
+ StaticAnalyzer/CallDescriptionTest.cpp
+ StaticAnalyzer/CallEventTest.cpp
+ StaticAnalyzer/ConflictingEvalCallsTest.cpp
+ StaticAnalyzer/ExprEngineVisitTest.cpp
+ StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
+ StaticAnalyzer/MemRegionDescriptiveNameTest.cpp
+ StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
+ StaticAnalyzer/ObjcBug-124477.cpp
+ StaticAnalyzer/RegisterCustomCheckersTest.cpp
+ StaticAnalyzer/SValSimplifyerTest.cpp
+ StaticAnalyzer/SValTest.cpp
+ StaticAnalyzer/TestReturnValueUnderConstruction.cpp
+ StaticAnalyzer/UnsignedStatDemo.cpp
+ Tooling/DiagnosticsYamlTest.cpp
+ Tooling/RecursiveASTVisitorTests/CallbacksBinaryOperator.cpp
+ Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp
+ Tooling/RecursiveASTVisitorTests/CallbacksCompoundAssignOperator.cpp
+ Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp
+ Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp
+ Tooling/SourceCodeBuildersTest.cpp
+ Tooling/SourceCodeTest.cpp
+ Tooling/StencilTest.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
# The Tooling library has some internal headers. Make those work. If we like
# the merged clang unit test binary, we can update the include paths and make
# this the default.
diff --git a/clang/unittests/Format/CMakeLists.txt b/clang/unittests/Format/CMakeLists.txt
index 03fff988d4663..a073a0e82b802 100644
--- a/clang/unittests/Format/CMakeLists.txt
+++ b/clang/unittests/Format/CMakeLists.txt
@@ -46,3 +46,6 @@ add_distinct_clang_unittest(FormatTests
LLVM_COMPONENTS
Support
)
+
+set_source_files_properties(FormatTestJS.cpp
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/tools/gold/CMakeLists.txt b/llvm/tools/gold/CMakeLists.txt
index 5c78529e38f48..3cbaa603530e1 100644
--- a/llvm/tools/gold/CMakeLists.txt
+++ b/llvm/tools/gold/CMakeLists.txt
@@ -12,8 +12,8 @@ if( LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR )
TargetParser
)
- add_llvm_library(LLVMgold MODULE INSTALL_WITH_TOOLCHAIN
- gold-plugin.cpp
- )
+ # add_llvm_library(LLVMgold MODULE INSTALL_WITH_TOOLCHAIN
+ # gold-plugin.cpp
+ # )
endif()
diff --git a/llvm/unittests/CMakeLists.txt b/llvm/unittests/CMakeLists.txt
index d22613d12d6dc..8e66648121070 100644
--- a/llvm/unittests/CMakeLists.txt
+++ b/llvm/unittests/CMakeLists.txt
@@ -28,6 +28,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
list(APPEND LLVM_COMPILE_FLAGS "-Wno-dangling-else")
endif ()
+set(CMAKE_UNITY_BUILD OFF)
+
add_subdirectory(ADT)
add_subdirectory(Analysis)
add_subdirectory(AsmParser)
>From 010e8f968ffd09420356a991f885a04ec014818b Mon Sep 17 00:00:00 2001
From: Maksim Levental <maksim.levental at gmail.com>
Date: Tue, 24 Mar 2026 00:00:38 -0700
Subject: [PATCH 22/25] Disable unity build for CMake configuration
---
libclc/CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 1103711298ce3..560334a09358c 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -10,6 +10,8 @@ set(CMAKE_CXX_STANDARD 17)
# Add path for custom modules
list( INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" )
+set(CMAKE_UNITY_BUILD OFF)
+
enable_language( CLC )
include( AddLibclc )
>From 798e545edf153e4f597ddeae9ad9f3952aadd556 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Tue, 24 Mar 2026 20:31:26 -0700
Subject: [PATCH 23/25] works
---
clang-tools-extra/clang-doc/CMakeLists.txt | 8 -
.../clang-doc/support/CMakeLists.txt | 7 -
clang-tools-extra/clangd/CMakeLists.txt | 8 -
.../clangd/refactor/tweaks/CMakeLists.txt | 9 -
.../clangd/unittests/CMakeLists.txt | 14 -
.../include-cleaner/unittests/CMakeLists.txt | 4 -
clang-tools-extra/modularize/CMakeLists.txt | 7 -
.../unittests/clang-tidy/CMakeLists.txt | 11 -
clang/lib/APINotes/CMakeLists.txt | 11 -
clang/lib/AST/CMakeLists.txt | 11 -
.../Analysis/LifetimeSafety/CMakeLists.txt | 8 -
clang/lib/Basic/CMakeLists.txt | 22 -
clang/lib/CIR/CodeGen/CMakeLists.txt | 19 -
clang/lib/CodeGen/CMakeLists.txt | 38 -
clang/lib/ExtractAPI/CMakeLists.txt | 7 -
clang/lib/Frontend/CMakeLists.txt | 8 -
clang/lib/Frontend/Rewrite/CMakeLists.txt | 8 -
clang/lib/Lex/CMakeLists.txt | 7 -
.../Core/CMakeLists.txt | 5 -
clang/lib/Sema/CMakeLists.txt | 7 -
clang/lib/Serialization/CMakeLists.txt | 7 -
clang/lib/Tooling/CMakeLists.txt | 10 -
clang/lib/Tooling/Transformer/CMakeLists.txt | 8 -
clang/tools/clang-installapi/CMakeLists.txt | 7 -
clang/tools/diagtool/CMakeLists.txt | 7 -
clang/tools/driver/CMakeLists.txt | 9 -
clang/unittests/CMakeLists.txt | 62 -
clang/unittests/Format/CMakeLists.txt | 3 -
clang/utils/TableGen/CMakeLists.txt | 6 -
flang/lib/Evaluate/CMakeLists.txt | 14 -
flang/lib/Lower/CMakeLists.txt | 5 -
flang/lib/Optimizer/Builder/CMakeLists.txt | 5 -
flang/lib/Optimizer/CodeGen/CMakeLists.txt | 7 -
.../Optimizer/HLFIR/Transforms/CMakeLists.txt | 10 -
flang/lib/Optimizer/Transforms/CMakeLists.txt | 11 -
flang/tools/f18-parse-demo/CMakeLists.txt | 5 -
llvm/CMakeLists.txt | 9 +-
llvm/cmake/modules/UnityBuild.cmake | 1460 +++++++++++++++++
llvm/lib/Bitcode/Reader/CMakeLists.txt | 6 -
llvm/lib/CodeGen/CMakeLists.txt | 26 -
llvm/lib/CodeGen/GlobalISel/CMakeLists.txt | 6 -
llvm/lib/CodeGen/MIRParser/CMakeLists.txt | 5 -
llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt | 12 -
llvm/lib/DebugInfo/CodeView/CMakeLists.txt | 10 -
llvm/lib/DebugInfo/GSYM/CMakeLists.txt | 5 -
llvm/lib/Demangle/CMakeLists.txt | 11 -
.../ExecutionEngine/JITLink/CMakeLists.txt | 6 -
llvm/lib/ExecutionEngine/Orc/CMakeLists.txt | 6 -
.../RuntimeDyld/CMakeLists.txt | 5 -
llvm/lib/Frontend/HLSL/CMakeLists.txt | 7 -
llvm/lib/MC/CMakeLists.txt | 10 -
llvm/lib/ObjCopy/CMakeLists.txt | 9 -
llvm/lib/Object/CMakeLists.txt | 9 -
llvm/lib/ObjectYAML/CMakeLists.txt | 8 -
llvm/lib/ProfileData/CMakeLists.txt | 13 -
llvm/lib/Support/CMakeLists.txt | 9 -
llvm/lib/Target/AArch64/CMakeLists.txt | 23 -
llvm/lib/Target/AMDGPU/CMakeLists.txt | 16 -
.../Target/ARM/MCTargetDesc/CMakeLists.txt | 5 -
llvm/lib/Target/Hexagon/CMakeLists.txt | 5 -
llvm/lib/Target/MSP430/CMakeLists.txt | 5 -
.../Target/NVPTX/MCTargetDesc/CMakeLists.txt | 5 -
llvm/lib/Target/RISCV/CMakeLists.txt | 17 -
llvm/lib/Target/SPIRV/CMakeLists.txt | 10 -
.../Target/SPIRV/MCTargetDesc/CMakeLists.txt | 6 -
llvm/lib/Target/WebAssembly/CMakeLists.txt | 17 -
llvm/lib/Target/X86/CMakeLists.txt | 22 -
llvm/lib/Target/XCore/CMakeLists.txt | 10 -
llvm/lib/TargetParser/CMakeLists.txt | 10 -
llvm/lib/TextAPI/CMakeLists.txt | 5 -
llvm/lib/Transforms/Coroutines/CMakeLists.txt | 6 -
.../Transforms/Instrumentation/CMakeLists.txt | 5 -
llvm/lib/Transforms/ObjCARC/CMakeLists.txt | 5 -
llvm/lib/Transforms/Scalar/CMakeLists.txt | 8 -
llvm/lib/Transforms/Utils/CMakeLists.txt | 10 -
llvm/lib/Transforms/Vectorize/CMakeLists.txt | 15 -
llvm/tools/dsymutil/CMakeLists.txt | 8 -
llvm/tools/gold/CMakeLists.txt | 6 +-
llvm/tools/llvm-c-test/CMakeLists.txt | 10 -
llvm/tools/llvm-jitlink/CMakeLists.txt | 8 -
llvm/tools/llvm-objdump/CMakeLists.txt | 7 -
llvm/tools/llvm-pdbutil/CMakeLists.txt | 7 -
llvm/tools/llvm-readobj/CMakeLists.txt | 7 -
llvm/tools/llvm-reduce/CMakeLists.txt | 7 -
llvm/utils/TableGen/Basic/CMakeLists.txt | 15 -
llvm/utils/TableGen/CMakeLists.txt | 34 -
mlir/examples/toy/Ch3/CMakeLists.txt | 6 -
mlir/examples/toy/Ch4/CMakeLists.txt | 1 -
mlir/lib/Conversion/LLVMCommon/CMakeLists.txt | 6 -
mlir/lib/Conversion/SCFToGPU/CMakeLists.txt | 5 -
.../Conversion/ShapeToStandard/CMakeLists.txt | 6 -
mlir/lib/Debug/CMakeLists.txt | 5 -
.../Dialect/Affine/Transforms/CMakeLists.txt | 5 -
.../Dialect/Arith/Transforms/CMakeLists.txt | 5 -
.../Bufferization/Transforms/CMakeLists.txt | 6 -
.../Dialect/Linalg/Transforms/CMakeLists.txt | 5 -
.../Dialect/MemRef/Transforms/CMakeLists.txt | 5 -
mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt | 5 -
mlir/lib/Dialect/Ptr/IR/CMakeLists.txt | 5 -
mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt | 17 -
.../SparseTensor/Transforms/CMakeLists.txt | 6 -
.../Dialect/Vector/Transforms/CMakeLists.txt | 5 -
mlir/lib/IR/CMakeLists.txt | 6 -
mlir/lib/TableGen/CMakeLists.txt | 6 -
mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt | 5 -
mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt | 5 -
.../Tools/tblgen-lsp-server/CMakeLists.txt | 5 -
mlir/lib/Transforms/Utils/CMakeLists.txt | 5 -
mlir/test/lib/Analysis/CMakeLists.txt | 12 -
.../lib/Conversion/FuncToLLVM/CMakeLists.txt | 5 -
mlir/test/lib/Dialect/Affine/CMakeLists.txt | 19 -
.../lib/Dialect/Bufferization/CMakeLists.txt | 5 -
mlir/test/lib/Dialect/SCF/CMakeLists.txt | 5 -
mlir/test/lib/Dialect/Test/CMakeLists.txt | 13 -
.../test/lib/Dialect/Transform/CMakeLists.txt | 6 -
mlir/test/lib/IR/CMakeLists.txt | 23 -
mlir/test/lib/Pass/CMakeLists.txt | 5 -
mlir/test/lib/Transforms/CMakeLists.txt | 10 -
mlir/tools/mlir-tblgen/CMakeLists.txt | 23 -
mlir/unittests/ExecutionEngine/CMakeLists.txt | 8 -
mlir/unittests/IR/CMakeLists.txt | 8 -
mlir/unittests/Pass/CMakeLists.txt | 5 -
polly/lib/CMakeLists.txt | 20 -
123 files changed, 1470 insertions(+), 1163 deletions(-)
create mode 100644 llvm/cmake/modules/UnityBuild.cmake
diff --git a/clang-tools-extra/clang-doc/CMakeLists.txt b/clang-tools-extra/clang-doc/CMakeLists.txt
index c5d082162acea..22e2c8159e9f6 100644
--- a/clang-tools-extra/clang-doc/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/CMakeLists.txt
@@ -5,14 +5,6 @@ set(LLVM_LINK_COMPONENTS
)
add_subdirectory(support)
-# Representation.cpp and YAMLGenerator.cpp have conflicting static declarations
-# and CommentKind ambiguity when combined in unity builds.
-set_source_files_properties(
- Representation.cpp
- YAMLGenerator.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangDoc STATIC
BitcodeReader.cpp
BitcodeWriter.cpp
diff --git a/clang-tools-extra/clang-doc/support/CMakeLists.txt b/clang-tools-extra/clang-doc/support/CMakeLists.txt
index d43163388973d..8ac913ffbe998 100644
--- a/clang-tools-extra/clang-doc/support/CMakeLists.txt
+++ b/clang-tools-extra/clang-doc/support/CMakeLists.txt
@@ -4,13 +4,6 @@ set(LLVM_LINK_COMPONENTS
Support
)
-# Utils.cpp references ClangDocContext which is not visible when combined
-# with File.cpp in a unity build due to include ordering.
-set_source_files_properties(
- Utils.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangDocSupport STATIC
File.cpp
Utils.cpp
diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt
index c307bc97ac83e..a0e8036038d30 100644
--- a/clang-tools-extra/clangd/CMakeLists.txt
+++ b/clang-tools-extra/clangd/CMakeLists.txt
@@ -61,14 +61,6 @@ endif()
include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/../clang-tidy")
include_directories(BEFORE "${CMAKE_CURRENT_SOURCE_DIR}/../include-cleaner/include")
-# clangd::Token conflicts with clang::Token, and InsertionPoint.cpp has
-# type conflicts when combined with other files in unity builds.
-set_source_files_properties(
- SourceCode.cpp
- refactor/InsertionPoint.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangDaemon STATIC
AST.cpp
ASTSignals.cpp
diff --git a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
index b4715bdaf467d..1d6e38088ad67 100644
--- a/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
+++ b/clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt
@@ -11,15 +11,6 @@ set(LLVM_LINK_COMPONENTS
# To enable these tweaks in executables or shared libraries, add
# $<TARGET_OBJECTS:obj.clangDaemonTweaks> to a list of sources, see
# clangd/tool/CMakeLists.txt for an example.
-# DefineInline/DefineOutline share static getSelectedFunction;
-# RemoveUsingNamespace has clangd::Token vs clang::Token conflicts.
-set_source_files_properties(
- DefineInline.cpp
- DefineOutline.cpp
- RemoveUsingNamespace.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangDaemonTweaks OBJECT
AddUsing.cpp
AnnotateHighlightings.cpp
diff --git a/clang-tools-extra/clangd/unittests/CMakeLists.txt b/clang-tools-extra/clangd/unittests/CMakeLists.txt
index 02ec1ab60764f..2b1b6e079be38 100644
--- a/clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ b/clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -186,20 +186,6 @@ target_link_libraries(ClangdTests
clangdSupport
)
-# These files define symbols that clash in unity builds:
-# - PreambleTests.cpp defines MATCHER_P(Diag, ...) which conflicts with
-# clang::clangd::Diag when combined with RenameTests.cpp.
-# - HoverTests.cpp and IncludeCleanerTests.cpp both define guard().
-# - SymbolCollectorTests.cpp, SerializationTests.cpp, FileIndexTests.cpp,
-# BackgroundIndexTests.cpp, and FindSymbolsTests.cpp all define
-# MATCHER_P(qName, ...).
-set_source_files_properties(
- PreambleTests.cpp
- HoverTests.cpp
- IncludeCleanerTests.cpp
- SymbolCollectorTests.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
if (CLANGD_ENABLE_REMOTE)
target_link_libraries(ClangdTests
PRIVATE
diff --git a/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt b/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
index 0ee213ce7ed3d..416535649f622 100644
--- a/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
+++ b/clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
@@ -38,7 +38,3 @@ target_link_libraries(ClangIncludeCleanerTests
LLVMTestingSupport
)
-# AnalysisTest.cpp and FindHeadersTest.cpp both define guard().
-set_source_files_properties(FindHeadersTest.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
diff --git a/clang-tools-extra/modularize/CMakeLists.txt b/clang-tools-extra/modularize/CMakeLists.txt
index e56b9cec594e0..a775b790a3147 100644
--- a/clang-tools-extra/modularize/CMakeLists.txt
+++ b/clang-tools-extra/modularize/CMakeLists.txt
@@ -4,13 +4,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# ModuleAssistant.cpp defines a local Module class that conflicts with
-# clang::Module when combined in unity builds.
-set_source_files_properties(
- ModuleAssistant.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_tool(modularize
Modularize.cpp
ModuleAssistant.cpp
diff --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
index cb5fceecfdcfd..167f5d3def06b 100644
--- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
@@ -66,17 +66,6 @@ target_link_libraries(ClangTidyTests
LLVMTestingSupport
)
-# These files define symbols that clash in unity builds:
-# - ClangTidyOptionsTest.cpp and ClangTidyDiagnosticConsumerTest.cpp both
-# define TestCheck
-# - UsingInserterTest.cpp and NamespaceAliaserTest.cpp both define runChecker
-set_source_files_properties(
- ClangTidyDiagnosticConsumerTest.cpp
- ClangTidyOptionsTest.cpp
- NamespaceAliaserTest.cpp
- UsingInserterTest.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
if(CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS)
target_link_libraries(ClangTidyTests
PRIVATE
diff --git a/clang/lib/APINotes/CMakeLists.txt b/clang/lib/APINotes/CMakeLists.txt
index f2202d491364c..dc83edd911ce2 100644
--- a/clang/lib/APINotes/CMakeLists.txt
+++ b/clang/lib/APINotes/CMakeLists.txt
@@ -2,17 +2,6 @@ set(LLVM_LINK_COMPONENTS
BitReader
BitstreamReader
Support)
-# Reader and Writer define identically-named classes in anonymous namespaces
-# (IdentifierTableInfo, ContextIDTableInfo, etc.). Manager and YAMLCompiler
-# use "using namespace api_notes" which brings api_notes::Module into scope,
-# conflicting with clang::Module.
-set_source_files_properties(
- APINotesReader.cpp
- APINotesWriter.cpp
- APINotesYAMLCompiler.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangAPINotes
APINotesManager.cpp
APINotesReader.cpp
diff --git a/clang/lib/AST/CMakeLists.txt b/clang/lib/AST/CMakeLists.txt
index b61d921bda154..e33250dc005e4 100644
--- a/clang/lib/AST/CMakeLists.txt
+++ b/clang/lib/AST/CMakeLists.txt
@@ -20,17 +20,6 @@ clang_tablegen(AttrDocTable.inc -gen-clang-attr-doc-table
SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../../include/clang/Basic/Attr.td
TARGET ClangAttrDocTable)
-# CommentParser/CommentSema use "using namespace clang::comments" which
-# conflicts with clang::tok. MicrosoftMangle and ItaniumMangle define
-# functions with the same name that cause overload ambiguity.
-set_source_files_properties(
- CommentParser.cpp
- CommentSema.cpp
- MicrosoftMangle.cpp
- ItaniumMangle.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangAST
APValue.cpp
ASTConcept.cpp
diff --git a/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt b/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt
index cf8a591b07502..247377c7256d9 100644
--- a/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt
+++ b/clang/lib/Analysis/LifetimeSafety/CMakeLists.txt
@@ -1,11 +1,3 @@
-# Multiple files define identically-named struct Lattice and class AnalysisImpl
-# in anonymous namespaces, causing redefinition errors in unity builds.
-set_source_files_properties(
- LoanPropagation.cpp
- MovedLoans.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangAnalysisLifetimeSafety
Checker.cpp
Facts.cpp
diff --git a/clang/lib/Basic/CMakeLists.txt b/clang/lib/Basic/CMakeLists.txt
index f31d0990b7d88..adfc6ee326b5a 100644
--- a/clang/lib/Basic/CMakeLists.txt
+++ b/clang/lib/Basic/CMakeLists.txt
@@ -137,28 +137,6 @@ add_clang_library(clangBasic
target_parser_gen
)
-# Each Targets/*.cpp file defines static constexpr NumBuiltins, BuiltinInfos,
-# and BuiltinStrings which conflict in unity builds.
-set_source_files_properties(
- Targets/AMDGPU.cpp
- Targets/ARM.cpp
- Targets/BPF.cpp
- Targets/DirectX.cpp
- Targets/Hexagon.cpp
- Targets/LoongArch.cpp
- Targets/Mips.cpp
- Targets/NVPTX.cpp
- Targets/PPC.cpp
- Targets/RISCV.cpp
- Targets/SPIR.cpp
- Targets/SystemZ.cpp
- Targets/VE.cpp
- Targets/WebAssembly.cpp
- Targets/X86.cpp
- Targets/XCore.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
target_link_libraries(clangBasic
PRIVATE
${LLVM_ATOMIC_LIB}
diff --git a/clang/lib/CIR/CodeGen/CMakeLists.txt b/clang/lib/CIR/CodeGen/CMakeLists.txt
index ff8f26d1c504b..8548cc8424527 100644
--- a/clang/lib/CIR/CodeGen/CMakeLists.txt
+++ b/clang/lib/CIR/CodeGen/CMakeLists.txt
@@ -67,22 +67,3 @@ add_clang_library(clangCIR
MLIRCIRInterfaces
MLIRTargetLLVMIRImport
)
-
-
-# CIRGenExprComplex.cpp references both cir::ComplexType/CastKind and
-# clang::ComplexType/CastKind which become ambiguous in unity builds.
-set_source_files_properties(CIRGenExprComplex.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# CIRGenOpenACCRecipe.h has no include guards and defines classes; including it
-# from both CIRGenOpenACCClause.cpp and CIRGenOpenACCRecipe.cpp in the same
-# unity TU causes redefinition errors.
-set_source_files_properties(
- CIRGenOpenACCClause.cpp
- CIRGenOpenACCRecipe.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# CIRGenTypes.cpp references cir::Type/RecordType which conflict with
-# clang::Type/RecordType from other files in the unity TU.
-set_source_files_properties(CIRGenTypes.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt
index 0740c67424f80..434781b3c4f02 100644
--- a/clang/lib/CodeGen/CMakeLists.txt
+++ b/clang/lib/CodeGen/CMakeLists.txt
@@ -55,44 +55,6 @@ if(MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES Clang
endif()
endif()
-# Many CodeGen files use "using namespace llvm" which brings llvm::Type,
-# llvm::VectorType, etc. into scope, conflicting with clang:: equivalents
-# used by other files in the same unity TU.
-set_source_files_properties(
- BackendUtil.cpp
- CGAtomic.cpp
- CGBuiltin.cpp
- CGCoroutine.cpp
- CGExpr.cpp
- CGHLSLBuiltins.cpp
- CGHLSLRuntime.cpp
- CGLoopInfo.cpp
- CGNonTrivialStruct.cpp
- CGOpenMPRuntime.cpp
- CGOpenMPRuntimeGPU.cpp
- CGStmtOpenMP.cpp
- CodeGenAction.cpp
- CodeGenFunction.cpp
- CodeGenModule.cpp
- CodeGenPGO.cpp
- CoverageMappingGen.cpp
- LinkInModulesPass.cpp
- QualTypeMapper.cpp
- TargetBuiltins/AMDGPU.cpp
- TargetBuiltins/ARM.cpp
- TargetBuiltins/DirectX.cpp
- TargetBuiltins/Hexagon.cpp
- TargetBuiltins/NVPTX.cpp
- TargetBuiltins/PPC.cpp
- TargetBuiltins/RISCV.cpp
- TargetBuiltins/SPIR.cpp
- TargetBuiltins/SystemZ.cpp
- TargetBuiltins/WebAssembly.cpp
- TargetBuiltins/X86.cpp
- Targets/AArch64.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangCodeGen
ABIInfo.cpp
ABIInfoImpl.cpp
diff --git a/clang/lib/ExtractAPI/CMakeLists.txt b/clang/lib/ExtractAPI/CMakeLists.txt
index 5cc74a2e156a1..fbf2917e794d3 100644
--- a/clang/lib/ExtractAPI/CMakeLists.txt
+++ b/clang/lib/ExtractAPI/CMakeLists.txt
@@ -3,13 +3,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# SymbolGraphSerializer.cpp uses "using namespace llvm" which brings types
-# that conflict with clang::extractapi types in unity builds.
-set_source_files_properties(
- Serialization/SymbolGraphSerializer.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangExtractAPI
API.cpp
APIIgnoresList.cpp
diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt
index ee60df176cd29..c40baa3657fe1 100644
--- a/clang/lib/Frontend/CMakeLists.txt
+++ b/clang/lib/Frontend/CMakeLists.txt
@@ -10,14 +10,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# config.h uses a #include guard that errors on double-inclusion, which
-# breaks unity builds when multiple .cpp files include it.
-set_source_files_properties(
- CompilerInstance.cpp
- CompilerInvocation.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangFrontend
ASTConsumers.cpp
ASTMerge.cpp
diff --git a/clang/lib/Frontend/Rewrite/CMakeLists.txt b/clang/lib/Frontend/Rewrite/CMakeLists.txt
index 8a2dbbea2eede..64aa651394dff 100644
--- a/clang/lib/Frontend/Rewrite/CMakeLists.txt
+++ b/clang/lib/Frontend/Rewrite/CMakeLists.txt
@@ -2,14 +2,6 @@ set(LLVM_LINK_COMPONENTS
Support
)
-# Both files include config.h which uses #error to prevent double-inclusion,
-# breaking unity builds when they end up in the same translation unit.
-set_source_files_properties(
- RewriteModernObjC.cpp
- RewriteObjC.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangRewriteFrontend
FixItRewriter.cpp
FrontendActions.cpp
diff --git a/clang/lib/Lex/CMakeLists.txt b/clang/lib/Lex/CMakeLists.txt
index f9960e1846f49..f61737cd68021 100644
--- a/clang/lib/Lex/CMakeLists.txt
+++ b/clang/lib/Lex/CMakeLists.txt
@@ -5,13 +5,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# "using namespace clang::dependency_directives_scan" at file scope brings
-# dependency_directives_scan::Token into scope, conflicting with clang::Token.
-set_source_files_properties(
- DependencyDirectivesScanner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangLex
DependencyDirectivesScanner.cpp
HeaderMap.cpp
diff --git a/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt b/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
index f1c5be5b04aa5..8c306163df1a7 100644
--- a/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
+++ b/clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt
@@ -33,8 +33,3 @@ add_clang_library(clangScalableStaticAnalysisFrameworkCore
DEPENDS
)
-
-# error: type alias redefinition with different types ('Registry<AnalysisBase>' vs 'Registry<SummaryDataBuilderBase>')
-set_source_files_properties(
- WholeProgramAnalysis/AnalysisRegistry.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/clang/lib/Sema/CMakeLists.txt b/clang/lib/Sema/CMakeLists.txt
index 43ba756bc819a..0ebf56ecffe69 100644
--- a/clang/lib/Sema/CMakeLists.txt
+++ b/clang/lib/Sema/CMakeLists.txt
@@ -13,13 +13,6 @@ clang_tablegen(OpenCLBuiltins.inc -gen-clang-opencl-builtins
TARGET ClangOpenCLBuiltinsImpl
)
-# Both files define struct PartialSpecMatchResult in anonymous namespaces
-# with different member types, causing redefinition errors in unity builds.
-set_source_files_properties(
- SemaTemplateInstantiate.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangSema
AnalysisBasedWarnings.cpp
CheckExprLifetime.cpp
diff --git a/clang/lib/Serialization/CMakeLists.txt b/clang/lib/Serialization/CMakeLists.txt
index 1dbf2e6440fd1..c22987b2c78df 100644
--- a/clang/lib/Serialization/CMakeLists.txt
+++ b/clang/lib/Serialization/CMakeLists.txt
@@ -6,13 +6,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# ASTWriter.cpp defines HeaderFileInfoTrait and LazySpecializationInfoLookupTrait
-# in an anonymous namespace, conflicting with identically-named classes from
-# ASTReaderInternals.h included by other files in this directory.
-set_source_files_properties(
- ASTWriter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
add_clang_library(clangSerialization
ASTCommon.cpp
diff --git a/clang/lib/Tooling/CMakeLists.txt b/clang/lib/Tooling/CMakeLists.txt
index 0cfcc6456beb9..0972ecb08437f 100644
--- a/clang/lib/Tooling/CMakeLists.txt
+++ b/clang/lib/Tooling/CMakeLists.txt
@@ -12,16 +12,6 @@ add_subdirectory(ASTDiff)
add_subdirectory(Syntax)
add_subdirectory(Transformer)
-# CompilationDatabase.cpp and DependencyScanningTool.cpp reference
-# clang::driver which becomes ambiguous when combined with other files
-# in a unity build.
-set_source_files_properties(
- CompilationDatabase.cpp
- DependencyScanningTool.cpp
- Tooling.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangTooling
AllTUsExecution.cpp
ArgumentsAdjusters.cpp
diff --git a/clang/lib/Tooling/Transformer/CMakeLists.txt b/clang/lib/Tooling/Transformer/CMakeLists.txt
index bcd292ef6302e..4ab4bd6f08989 100644
--- a/clang/lib/Tooling/Transformer/CMakeLists.txt
+++ b/clang/lib/Tooling/Transformer/CMakeLists.txt
@@ -3,14 +3,6 @@ set(LLVM_LINK_COMPONENTS
Support
)
-# Both files define a static getNode() helper in anonymous namespaces,
-# causing redefinition errors in unity builds.
-set_source_files_properties(
- Stencil.cpp
- RangeSelector.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_library(clangTransformer
Parsing.cpp
RangeSelector.cpp
diff --git a/clang/tools/clang-installapi/CMakeLists.txt b/clang/tools/clang-installapi/CMakeLists.txt
index 47678e3549022..54bc80486472f 100644
--- a/clang/tools/clang-installapi/CMakeLists.txt
+++ b/clang/tools/clang-installapi/CMakeLists.txt
@@ -11,13 +11,6 @@ set(LLVM_TARGET_DEFINITIONS InstallAPIOpts.td)
tablegen(LLVM InstallAPIOpts.inc -gen-opt-parser-defs)
add_public_tablegen_target(InstallAPIDriverOptions)
-# Options.cpp uses "using namespace llvm" which makes llvm::Value ambiguous
-# with other types when combined in unity builds.
-set_source_files_properties(
- Options.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_tool(clang-installapi
ClangInstallAPI.cpp
Options.cpp
diff --git a/clang/tools/diagtool/CMakeLists.txt b/clang/tools/diagtool/CMakeLists.txt
index 18cc716c00985..09b2a81790f87 100644
--- a/clang/tools/diagtool/CMakeLists.txt
+++ b/clang/tools/diagtool/CMakeLists.txt
@@ -2,13 +2,6 @@ set(LLVM_LINK_COMPONENTS
Support
)
-# TreeView.cpp defines printUsage which conflicts with identically-named
-# functions from other diagtool files in unity builds.
-set_source_files_properties(
- TreeView.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_tool(diagtool
diagtool_main.cpp
DiagTool.cpp
diff --git a/clang/tools/driver/CMakeLists.txt b/clang/tools/driver/CMakeLists.txt
index 5e424eb6eab81..002aaef005253 100644
--- a/clang/tools/driver/CMakeLists.txt
+++ b/clang/tools/driver/CMakeLists.txt
@@ -39,15 +39,6 @@ if (CLANG_BOLT AND NOT LLVM_BUILD_INSTRUMENTED)
endif()
endif()
-# cc1as_main.cpp and driver.cpp both define LLVMErrorHandler; cc1gen_reproducer
-# uses "driver" which is ambiguous with clang::driver in unity builds.
-set_source_files_properties(
- cc1_main.cpp
- cc1as_main.cpp
- cc1gen_reproducer_main.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_clang_tool(clang
driver.cpp
cc1_main.cpp
diff --git a/clang/unittests/CMakeLists.txt b/clang/unittests/CMakeLists.txt
index 1059ed54a5b95..2163d190f5521 100644
--- a/clang/unittests/CMakeLists.txt
+++ b/clang/unittests/CMakeLists.txt
@@ -130,68 +130,6 @@ add_distinct_clang_unittest(AllClangUnitTests
${LLVM_COMPONENTS}
)
-# Files that clash in unity builds of AllClangUnitTests due to shared headers
-# (ASTPrint.h, CheckerRegistration.h, CallbacksCommon.h, CFGBuildResult.h)
-# or duplicate symbols.
-set_source_files_properties(
- Lex/LexerTest.cpp
- Analysis/CFGBackEdgesTest.cpp
- Analysis/CFGDominatorTree.cpp
- Analysis/CFGTest.cpp
- Analysis/IntervalPartitionTest.cpp
- Analysis/UnsafeBufferUsageTest.cpp
- Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
- AST/ASTDumperTest.cpp
- AST/ASTExprTest.cpp
- AST/ASTImporterGenericRedeclTest.cpp
- AST/ASTImporterODRStrategiesTest.cpp
- AST/AttrTest.cpp
- AST/ConceptPrinterTest.cpp
- AST/DataCollectionTest.cpp
- AST/DeclPrinterTest.cpp
- AST/NamedDeclPrinterTest.cpp
- AST/QualTypeNamesTest.cpp
- AST/SizelessTypesTest.cpp
- AST/StmtPrinterTest.cpp
- AST/TemplateNameTest.cpp
- AST/TypePrinterTest.cpp
- CodeGen/TBAAMetadataTest.cpp
- Driver/ToolChainTest.cpp
- Interpreter/InterpreterTest.cpp
- Lex/NoTrivialPPDirectiveTracerTest.cpp
- Lex/PPConditionalDirectiveRecordTest.cpp
- Lex/PPDependencyDirectivesTest.cpp
- Lex/PPMemoryAllocationsTest.cpp
- Lex/PPCallbacksTest.cpp
- Lex/ModuleDeclStateTest.cpp
- Parse/ParseHLSLRootSignatureTest.cpp
- ScalableStaticAnalysisFramework/Registries/MockSerializationFormat.cpp
- StaticAnalyzer/BlockEntranceCallbackTest.cpp
- StaticAnalyzer/BugReportInterestingnessTest.cpp
- StaticAnalyzer/CallDescriptionTest.cpp
- StaticAnalyzer/CallEventTest.cpp
- StaticAnalyzer/ConflictingEvalCallsTest.cpp
- StaticAnalyzer/ExprEngineVisitTest.cpp
- StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
- StaticAnalyzer/MemRegionDescriptiveNameTest.cpp
- StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
- StaticAnalyzer/ObjcBug-124477.cpp
- StaticAnalyzer/RegisterCustomCheckersTest.cpp
- StaticAnalyzer/SValSimplifyerTest.cpp
- StaticAnalyzer/SValTest.cpp
- StaticAnalyzer/TestReturnValueUnderConstruction.cpp
- StaticAnalyzer/UnsignedStatDemo.cpp
- Tooling/DiagnosticsYamlTest.cpp
- Tooling/RecursiveASTVisitorTests/CallbacksBinaryOperator.cpp
- Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp
- Tooling/RecursiveASTVisitorTests/CallbacksCompoundAssignOperator.cpp
- Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp
- Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp
- Tooling/SourceCodeBuildersTest.cpp
- Tooling/SourceCodeTest.cpp
- Tooling/StencilTest.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
# The Tooling library has some internal headers. Make those work. If we like
# the merged clang unit test binary, we can update the include paths and make
# this the default.
diff --git a/clang/unittests/Format/CMakeLists.txt b/clang/unittests/Format/CMakeLists.txt
index a073a0e82b802..03fff988d4663 100644
--- a/clang/unittests/Format/CMakeLists.txt
+++ b/clang/unittests/Format/CMakeLists.txt
@@ -46,6 +46,3 @@ add_distinct_clang_unittest(FormatTests
LLVM_COMPONENTS
Support
)
-
-set_source_files_properties(FormatTestJS.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/clang/utils/TableGen/CMakeLists.txt b/clang/utils/TableGen/CMakeLists.txt
index c66a5ec640607..14f13824e9575 100644
--- a/clang/utils/TableGen/CMakeLists.txt
+++ b/clang/utils/TableGen/CMakeLists.txt
@@ -28,10 +28,4 @@ add_tablegen(clang-tblgen CLANG
TableGen.cpp
)
-# MveEmitter.cpp and NeonEmitter.cpp define large anonymous-namespace classes
-# that conflict with each other in unity builds.
-set_source_files_properties(
- NeonEmitter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
target_link_libraries(clang-tblgen PRIVATE clangSupport_tablegen)
diff --git a/flang/lib/Evaluate/CMakeLists.txt b/flang/lib/Evaluate/CMakeLists.txt
index 73bc62e2fcb46..472ecb6d8d079 100644
--- a/flang/lib/Evaluate/CMakeLists.txt
+++ b/flang/lib/Evaluate/CMakeLists.txt
@@ -87,17 +87,3 @@ add_flang_library(FortranEvaluate
acc_gen
omp_gen
)
-
-# fold-implementation.h contains explicit instantiation definitions; merging
-# any two of these files in a unity TU produces duplicate instantiations.
-# formatting.cpp also has explicit instantiations that duplicate those.
-set_source_files_properties(
- fold-character.cpp
- fold-complex.cpp
- fold-integer.cpp
- fold-logical.cpp
- fold-real.cpp
- fold.cpp
- intrinsics-library.cpp
- formatting.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Lower/CMakeLists.txt b/flang/lib/Lower/CMakeLists.txt
index 44fa0f4eeded9..f5424c78b9a98 100644
--- a/flang/lib/Lower/CMakeLists.txt
+++ b/flang/lib/Lower/CMakeLists.txt
@@ -90,8 +90,3 @@ add_flang_library(FortranLower
MLIRLLVMDialect
MLIRSCFToControlFlow
)
-
-# ConvertCall.cpp calls 'isInWhereMaskedExpression' which becomes ambiguous
-# with another overload brought in from other files in the unity TU.
-set_source_files_properties(ConvertCall.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Optimizer/Builder/CMakeLists.txt b/flang/lib/Optimizer/Builder/CMakeLists.txt
index 7094aa48af707..8e5b5deff47c1 100644
--- a/flang/lib/Optimizer/Builder/CMakeLists.txt
+++ b/flang/lib/Optimizer/Builder/CMakeLists.txt
@@ -65,8 +65,3 @@ add_flang_library(FIRBuilder
${dialect_libs}
${extension_libs}
)
-
-# Execute.cpp defines a static 'isAbsent' that conflicts with another
-# definition when merged in a unity TU.
-set_source_files_properties(Runtime/Execute.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Optimizer/CodeGen/CMakeLists.txt b/flang/lib/Optimizer/CodeGen/CMakeLists.txt
index 440829dbf6ca7..6977c737199e2 100644
--- a/flang/lib/Optimizer/CodeGen/CMakeLists.txt
+++ b/flang/lib/Optimizer/CodeGen/CMakeLists.txt
@@ -50,10 +50,3 @@ add_flang_library(FIRCodeGen
MLIRTargetLLVMIRExport
MLIRVectorToLLVM
)
-
-# FIROpPatterns.cpp and PreCGRewrite.cpp each redefine local helpers
-# (getTypeDescFieldId, DeclareOpConversion) that clash in unity builds.
-set_source_files_properties(
- FIROpPatterns.cpp
- PreCGRewrite.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt b/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
index c7632181e9ce3..5c24fe58b05c4 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
+++ b/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
@@ -1,15 +1,5 @@
get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-# ConvertToFIR.cpp redefines AssignOpConversion and NoReassocOpConversion,
-# ScheduleOrderedAssignments.cpp redefines isForallIndex, and
-# SimplifyHLFIRIntrinsics.cpp redefines CmpCharOpConversion/IndexOpConversion.
-set_source_files_properties(
- ConvertToFIR.cpp
- ScheduleOrderedAssignments.cpp
- SimplifyHLFIRIntrinsics.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_flang_library(HLFIRTransforms
BufferizeHLFIR.cpp
ConvertToFIR.cpp
diff --git a/flang/lib/Optimizer/Transforms/CMakeLists.txt b/flang/lib/Optimizer/Transforms/CMakeLists.txt
index 2c10fd6571d56..5a3059ebbd97f 100644
--- a/flang/lib/Optimizer/Transforms/CMakeLists.txt
+++ b/flang/lib/Optimizer/Transforms/CMakeLists.txt
@@ -1,14 +1,3 @@
-# AnnotateConstant.cpp has 'impl' ambiguity from tablegen pass base classes.
-# LoopInvariantCodeMotion.cpp has fir::AliasAnalysis vs mlir::AliasAnalysis
-# ambiguity. CUFOpConversionLate.cpp redefines createConvertOp.
-set_source_files_properties(
- AnnotateConstant.cpp
- ConvertComplexPow.cpp
- LoopInvariantCodeMotion.cpp
- CUDA/CUFOpConversionLate.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_flang_library(FIRTransforms
AbstractResult.cpp
AddAliasTags.cpp
diff --git a/flang/tools/f18-parse-demo/CMakeLists.txt b/flang/tools/f18-parse-demo/CMakeLists.txt
index 1f3899a235b7c..743a44017e8a5 100644
--- a/flang/tools/f18-parse-demo/CMakeLists.txt
+++ b/flang/tools/f18-parse-demo/CMakeLists.txt
@@ -14,8 +14,3 @@ target_link_libraries(f18-parse-demo
FortranSupport
FortranParser
)
-
-# stub-evaluate.cpp uses struct/class mismatches with other TU definitions
-# that trigger -Werror,-Wmismatched-tags in unity builds.
-set_source_files_properties(stub-evaluate.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 334fd25c43608..35093fcdd7833 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -1553,12 +1553,17 @@ if (XCODE)
endforeach()
endif()
+set(LLVM_SRC_DIR "${CMAKE_SOURCE_DIR}")
+set(LLVM_REPO_DIR "${LLVM_SRC_DIR}/..")
+
+include(UnityBuild)
+
function (_get_all_cmake_targets out_var current_dir)
get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS)
get_property(subdirs DIRECTORY ${current_dir} PROPERTY SUBDIRECTORIES)
foreach(subdir ${subdirs})
- _get_all_cmake_targets(subdir_targets ${subdir})
- list(APPEND targets ${subdir_targets})
+ _get_all_cmake_targets(subdir_targets ${subdir})
+ list(APPEND targets ${subdir_targets})
endforeach()
set(${out_var} ${targets} PARENT_SCOPE)
endfunction()
diff --git a/llvm/cmake/modules/UnityBuild.cmake b/llvm/cmake/modules/UnityBuild.cmake
new file mode 100644
index 0000000000000..2f73da90196ee
--- /dev/null
+++ b/llvm/cmake/modules/UnityBuild.cmake
@@ -0,0 +1,1460 @@
+# Unity build exclusions.
+# This file centralizes all SKIP_UNITY_BUILD_INCLUSION properties
+# that were previously scattered across individual CMakeLists.txt files.
+#
+# Include this file from the top-level CMakeLists.txt after all targets
+# have been defined.
+
+# ======================================================================
+# clang-tools-extra
+# ======================================================================
+
+# From clang-tools-extra/clang-doc/CMakeLists.txt (target: clangDoc)
+# Representation.cpp and YAMLGenerator.cpp have conflicting static declarations
+# and CommentKind ambiguity when combined in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/Representation.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/YAMLGenerator.cpp
+ TARGET_DIRECTORY clangDoc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/clang-doc/support/CMakeLists.txt (target: clangDocSupport)
+# Utils.cpp references ClangDocContext which is not visible when combined
+# with File.cpp in a unity build due to include ordering.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/support/Utils.cpp
+ TARGET_DIRECTORY clangDocSupport
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/clangd/CMakeLists.txt (target: clangDaemon)
+# clangd::Token conflicts with clang::Token, and InsertionPoint.cpp has
+# type conflicts when combined with other files in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/SourceCode.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/InsertionPoint.cpp
+ TARGET_DIRECTORY clangDaemon
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt (target: clangDaemonTweaks)
+# DefineInline/DefineOutline share static getSelectedFunction;
+# RemoveUsingNamespace has clangd::Token vs clang::Token conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp
+ TARGET_DIRECTORY clangDaemonTweaks
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/clangd/unittests/CMakeLists.txt (target: ClangdTests)
+# These files define symbols that clash in unity builds:
+# - PreambleTests.cpp defines MATCHER_P(Diag, ...) which conflicts with
+# clang::clangd::Diag when combined with RenameTests.cpp.
+# - HoverTests.cpp and IncludeCleanerTests.cpp both define guard().
+# - SymbolCollectorTests.cpp, SerializationTests.cpp, FileIndexTests.cpp,
+# BackgroundIndexTests.cpp, and FindSymbolsTests.cpp all define
+# MATCHER_P(qName, ...).
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/PreambleTests.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/HoverTests.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
+ TARGET_DIRECTORY ClangdTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/include-cleaner/unittests/CMakeLists.txt (target: ClangIncludeCleanerTests)
+# AnalysisTest.cpp and FindHeadersTest.cpp both define guard().
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
+ TARGET_DIRECTORY ClangIncludeCleanerTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/modularize/CMakeLists.txt (target: modularize)
+# ModuleAssistant.cpp defines a local Module class that conflicts with
+# clang::Module when combined in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/modularize/ModuleAssistant.cpp
+ TARGET_DIRECTORY modularize
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang-tools-extra/unittests/clang-tidy/CMakeLists.txt (target: clang-tidy)
+# These files define symbols that clash in unity builds:
+# - ClangTidyOptionsTest.cpp and ClangTidyDiagnosticConsumerTest.cpp both
+# define TestCheck
+# - UsingInserterTest.cpp and NamespaceAliaserTest.cpp both define runChecker
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
+ TARGET_DIRECTORY clang-tidy
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+
+# ======================================================================
+# clang
+# ======================================================================
+
+# From clang/lib/APINotes/CMakeLists.txt (target: clangAPINotes)
+# Reader and Writer define identically-named classes in anonymous namespaces
+# (IdentifierTableInfo, ContextIDTableInfo, etc.). Manager and YAMLCompiler
+# use "using namespace api_notes" which brings api_notes::Module into scope,
+# conflicting with clang::Module.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesReader.cpp
+ ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesWriter.cpp
+ ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesYAMLCompiler.cpp
+ TARGET_DIRECTORY clangAPINotes
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/AST/CMakeLists.txt (target: clangAST)
+# CommentParser/CommentSema use "using namespace clang::comments" which
+# conflicts with clang::tok. MicrosoftMangle and ItaniumMangle define
+# functions with the same name that cause overload ambiguity.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/AST/CommentParser.cpp
+ ${LLVM_REPO_DIR}/clang/lib/AST/CommentSema.cpp
+ ${LLVM_REPO_DIR}/clang/lib/AST/MicrosoftMangle.cpp
+ ${LLVM_REPO_DIR}/clang/lib/AST/ItaniumMangle.cpp
+ TARGET_DIRECTORY clangAST
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Analysis/LifetimeSafety/CMakeLists.txt (target: clangAnalysisLifetimeSafety)
+# Multiple files define identically-named struct Lattice and class AnalysisImpl
+# in anonymous namespaces, causing redefinition errors in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Analysis/LifetimeSafety/MovedLoans.cpp
+ TARGET_DIRECTORY clangAnalysisLifetimeSafety
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Basic/CMakeLists.txt (target: clangBasic)
+# Each Targets/*.cpp file defines static constexpr NumBuiltins, BuiltinInfos,
+# and BuiltinStrings which conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/AMDGPU.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/ARM.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/BPF.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/DirectX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/Hexagon.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/LoongArch.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/Mips.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/NVPTX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/PPC.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/RISCV.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/SPIR.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/SystemZ.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/VE.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/WebAssembly.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/X86.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/XCore.cpp
+ TARGET_DIRECTORY clangBasic
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
+# CIRGenExprComplex.cpp references both cir::ComplexType/CastKind and
+# clang::ComplexType/CastKind which become ambiguous in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
+ TARGET_DIRECTORY clangCIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
+# CIRGenOpenACCRecipe.h has no include guards and defines classes; including it
+# from both CIRGenOpenACCClause.cpp and CIRGenOpenACCRecipe.cpp in the same
+# unity TU causes redefinition errors.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
+ TARGET_DIRECTORY clangCIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
+# CIRGenTypes.cpp references cir::Type/RecordType which conflict with
+# clang::Type/RecordType from other files in the unity TU.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
+ TARGET_DIRECTORY clangCIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/CodeGen/CMakeLists.txt (target: clangCodeGen)
+# Many CodeGen files use "using namespace llvm" which brings llvm::Type,
+# llvm::VectorType, etc. into scope, conflicting with clang:: equivalents
+# used by other files in the same unity TU.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/BackendUtil.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGAtomic.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGBuiltin.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGCoroutine.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGExpr.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGHLSLBuiltins.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGHLSLRuntime.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGLoopInfo.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGNonTrivialStruct.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGStmtOpenMP.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenAction.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenFunction.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenModule.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenPGO.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CoverageMappingGen.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/LinkInModulesPass.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/QualTypeMapper.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/DirectX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/Hexagon.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/NVPTX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/PPC.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/RISCV.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/SPIR.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/SystemZ.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/WebAssembly.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/X86.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/Targets/AArch64.cpp
+ TARGET_DIRECTORY clangCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/ExtractAPI/CMakeLists.txt (target: clangExtractAPI)
+# SymbolGraphSerializer.cpp uses "using namespace llvm" which brings types
+# that conflict with clang::extractapi types in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
+ TARGET_DIRECTORY clangExtractAPI
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Frontend/CMakeLists.txt (target: clangFrontend)
+# config.h uses a #include guard that errors on double-inclusion, which
+# breaks unity builds when multiple .cpp files include it.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/CompilerInstance.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/CompilerInvocation.cpp
+ TARGET_DIRECTORY clangFrontend
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Frontend/Rewrite/CMakeLists.txt (target: clangRewriteFrontend)
+# Both files include config.h which uses #error to prevent double-inclusion,
+# breaking unity builds when they end up in the same translation unit.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
+ TARGET_DIRECTORY clangRewriteFrontend
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Lex/CMakeLists.txt (target: clangLex)
+# "using namespace clang::dependency_directives_scan" at file scope brings
+# dependency_directives_scan::Token into scope, conflicting with clang::Token.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Lex/DependencyDirectivesScanner.cpp
+ TARGET_DIRECTORY clangLex
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt (target: clangScalableStaticAnalysisFrameworkCore)
+# error: type alias redefinition with different types ('Registry<AnalysisBase>' vs 'Registry<SummaryDataBuilderBase>')
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/ScalableStaticAnalysisFramework/Core/WholeProgramAnalysis/AnalysisRegistry.cpp
+ TARGET_DIRECTORY clangScalableStaticAnalysisFrameworkCore
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Sema/CMakeLists.txt (target: clangSema)
+# Both files define struct PartialSpecMatchResult in anonymous namespaces
+# with different member types, causing redefinition errors in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Sema/SemaTemplateInstantiate.cpp
+ TARGET_DIRECTORY clangSema
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Serialization/CMakeLists.txt (target: clangSerialization)
+# ASTWriter.cpp defines HeaderFileInfoTrait and LazySpecializationInfoLookupTrait
+# in an anonymous namespace, conflicting with identically-named classes from
+# ASTReaderInternals.h included by other files in this directory.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Serialization/ASTWriter.cpp
+ TARGET_DIRECTORY clangSerialization
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Tooling/CMakeLists.txt (target: clangTooling)
+# CompilationDatabase.cpp and DependencyScanningTool.cpp reference
+# clang::driver which becomes ambiguous when combined with other files
+# in a unity build.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/CompilationDatabase.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/DependencyScanningTool.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/Tooling.cpp
+ TARGET_DIRECTORY clangTooling
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/lib/Tooling/Transformer/CMakeLists.txt (target: clangTransformer)
+# Both files define a static getNode() helper in anonymous namespaces,
+# causing redefinition errors in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/Transformer/Stencil.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/Transformer/RangeSelector.cpp
+ TARGET_DIRECTORY clangTransformer
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/tools/clang-installapi/CMakeLists.txt (target: clang-installapi)
+# Options.cpp uses "using namespace llvm" which makes llvm::Value ambiguous
+# with other types when combined in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/tools/clang-installapi/Options.cpp
+ TARGET_DIRECTORY clang-installapi
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/tools/diagtool/CMakeLists.txt (target: diagtool)
+# TreeView.cpp defines printUsage which conflicts with identically-named
+# functions from other diagtool files in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/tools/diagtool/TreeView.cpp
+ TARGET_DIRECTORY diagtool
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/tools/driver/CMakeLists.txt (target: clang)
+# cc1as_main.cpp and driver.cpp both define LLVMErrorHandler; cc1gen_reproducer
+# uses "driver" which is ambiguous with clang::driver in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/tools/driver/cc1_main.cpp
+ ${LLVM_REPO_DIR}/clang/tools/driver/cc1as_main.cpp
+ ${LLVM_REPO_DIR}/clang/tools/driver/cc1gen_reproducer_main.cpp
+ TARGET_DIRECTORY clang
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/unittests/CMakeLists.txt (target: AllClangUnitTests)
+# Files that clash in unity builds of AllClangUnitTests due to shared headers
+# (ASTPrint.h, CheckerRegistration.h, CallbacksCommon.h, CFGBuildResult.h)
+# or duplicate symbols.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/LexerTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGBackEdgesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGDominatorTree.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/IntervalPartitionTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/UnsafeBufferUsageTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTDumperTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTExprTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTImporterGenericRedeclTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTImporterODRStrategiesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/AttrTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ConceptPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/DataCollectionTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/DeclPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/NamedDeclPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/QualTypeNamesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/SizelessTypesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/StmtPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/TemplateNameTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/TypePrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/CodeGen/TBAAMetadataTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Driver/ToolChainTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Interpreter/InterpreterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/NoTrivialPPDirectiveTracerTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPMemoryAllocationsTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPCallbacksTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/ModuleDeclStateTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/ScalableStaticAnalysisFramework/Registries/MockSerializationFormat.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/BugReportInterestingnessTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/CallEventTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ConflictingEvalCallsTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ExprEngineVisitTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/MemRegionDescriptiveNameTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ObjcBug-124477.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/SValSimplifyerTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/SValTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/TestReturnValueUnderConstruction.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/UnsignedStatDemo.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/DiagnosticsYamlTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksBinaryOperator.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCompoundAssignOperator.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/SourceCodeBuildersTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/SourceCodeTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/StencilTest.cpp
+ TARGET_DIRECTORY AllClangUnitTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/unittests/Format/CMakeLists.txt (target: FormatTests)
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/unittests/Format/FormatTestJS.cpp
+ TARGET_DIRECTORY FormatTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From clang/utils/TableGen/CMakeLists.txt (target: clang-tblgen)
+# MveEmitter.cpp and NeonEmitter.cpp define large anonymous-namespace classes
+# that conflict with each other in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/utils/TableGen/NeonEmitter.cpp
+ TARGET_DIRECTORY clang-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+
+# ======================================================================
+# flang
+# ======================================================================
+
+# From flang/lib/Evaluate/CMakeLists.txt (target: FortranEvaluate)
+# fold-implementation.h contains explicit instantiation definitions; merging
+# any two of these files in a unity TU produces duplicate instantiations.
+# formatting.cpp also has explicit instantiations that duplicate those.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-character.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-complex.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-integer.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-logical.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-real.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/intrinsics-library.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/formatting.cpp
+ TARGET_DIRECTORY FortranEvaluate
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From flang/lib/Lower/CMakeLists.txt (target: FortranLower)
+# ConvertCall.cpp calls 'isInWhereMaskedExpression' which becomes ambiguous
+# with another overload brought in from other files in the unity TU.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Lower/ConvertCall.cpp
+ TARGET_DIRECTORY FortranLower
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From flang/lib/Optimizer/Builder/CMakeLists.txt (target: FIRBuilder)
+# Execute.cpp defines a static 'isAbsent' that conflicts with another
+# definition when merged in a unity TU.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Builder/Runtime/Execute.cpp
+ TARGET_DIRECTORY FIRBuilder
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From flang/lib/Optimizer/CodeGen/CMakeLists.txt (target: FIRCodeGen)
+# FIROpPatterns.cpp and PreCGRewrite.cpp each redefine local helpers
+# (getTypeDescFieldId, DeclareOpConversion) that clash in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/CodeGen/FIROpPatterns.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
+ TARGET_DIRECTORY FIRCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt (target: HLFIRTransforms)
+# ConvertToFIR.cpp redefines AssignOpConversion and NoReassocOpConversion,
+# ScheduleOrderedAssignments.cpp redefines isForallIndex, and
+# SimplifyHLFIRIntrinsics.cpp redefines CmpCharOpConversion/IndexOpConversion.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
+ TARGET_DIRECTORY HLFIRTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From flang/lib/Optimizer/Transforms/CMakeLists.txt (target: FIRTransforms)
+# AnnotateConstant.cpp has 'impl' ambiguity from tablegen pass base classes.
+# LoopInvariantCodeMotion.cpp has fir::AliasAnalysis vs mlir::AliasAnalysis
+# ambiguity. CUFOpConversionLate.cpp redefines createConvertOp.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/AnnotateConstant.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/ConvertComplexPow.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/LoopInvariantCodeMotion.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/CUDA/CUFOpConversionLate.cpp
+ TARGET_DIRECTORY FIRTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From flang/tools/f18-parse-demo/CMakeLists.txt (target: f18-parse-demo)
+# stub-evaluate.cpp uses struct/class mismatches with other TU definitions
+# that trigger -Werror,-Wmismatched-tags in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/tools/f18-parse-demo/stub-evaluate.cpp
+ TARGET_DIRECTORY f18-parse-demo
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+
+# ======================================================================
+# llvm
+# ======================================================================
+
+# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+# STATISTIC and static function redefinitions across register allocation
+# and scheduling files conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/LiveIntervalCalc.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MachineOutliner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/PostRASchedulerList.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp
+ TARGET_DIRECTORY LLVMCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+# Conflicting STATISTIC variables and static functions with other
+# register allocation files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
+ TARGET_DIRECTORY LLVMCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+# Conflicting static cl::opt variables with other CodeGen files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/ModuloSchedule.cpp
+ TARGET_DIRECTORY LLVMCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+# Anonymous namespace struct redefinitions conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/PatchableFunction.cpp
+ TARGET_DIRECTORY LLVMCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/GlobalISel/CMakeLists.txt (target: LLVMGlobalISel)
+# Conflicting static helper functions and STATISTIC variables.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
+ TARGET_DIRECTORY LLVMGlobalISel
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/MIRParser/CMakeLists.txt (target: LLVMMIRParser)
+# Static functions and anonymous namespace classes conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+ TARGET_DIRECTORY LLVMMIRParser
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt (target: LLVMSelectionDAG)
+# STATISTIC variable redefinitions (NumBacktracks, NumUnfolds, etc.)
+# and static function conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+ TARGET_DIRECTORY LLVMSelectionDAG
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt (target: LLVMSelectionDAG)
+# Large template instantiation code and static helper conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+ TARGET_DIRECTORY LLVMSelectionDAG
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt (target: LLVMJITLink)
+# Anonymous namespace function redefinitions (buildTables_ELF_x86*).
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/JITLink/ELF_x86.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
+ TARGET_DIRECTORY LLVMJITLink
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ExecutionEngine/Orc/CMakeLists.txt (target: LLVMOrcJIT)
+# Static function and class definition conflicts in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
+ TARGET_DIRECTORY LLVMOrcJIT
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt (target: LLVMRuntimeDyld)
+# Static relocation helper functions (or32le, getBits, etc.) conflict.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+ TARGET_DIRECTORY LLVMRuntimeDyld
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ObjCopy/CMakeLists.txt (target: LLVMObjCopy)
+# ELF, MachO, COFF, and wasm ObjCopy implementations define identically-named
+# types (Section, Object, SectionPred) in different namespaces that conflict
+# when combined via "using namespace" in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ObjCopy/MachO/MachOReader.cpp
+ TARGET_DIRECTORY LLVMObjCopy
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ObjectYAML/CMakeLists.txt (target: LLVMObjectYAML)
+# Conflicting 'using namespace' declarations (llvm::codeview,
+# llvm::CodeViewYAML) cause ambiguity.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/MinidumpEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/MinidumpYAML.cpp
+ TARGET_DIRECTORY LLVMObjectYAML
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ProfileData/CMakeLists.txt (target: LLVMProfileData)
+# InstrProfReader.cpp and InstrProfWriter.cpp have ambiguous 'Summary' due
+# to namespace conflicts in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/InstrProfReader.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/InstrProfWriter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/SampleProf.cpp
+ TARGET_DIRECTORY LLVMProfileData
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/ProfileData/CMakeLists.txt (target: LLVMProfileData)
+# 'using namespace sampleprof' causes ambiguity with other files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/SampleProfReader.cpp
+ TARGET_DIRECTORY LLVMProfileData
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Support/CMakeLists.txt (target: LLVMSupport)
+# error: expected unqualified-id 672 | while (const auto *IN = dyn_cast<RopePieceBTreeInterior>(N))
+# error: expected unqualified-id 511 | for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i)
+if(WIN32)
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Support/RewriteRope.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Support/ManagedStatic.cpp
+ TARGET_DIRECTORY LLVMSupport
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+# From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
+# Anonymous namespace classes and static function conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
+ TARGET_DIRECTORY AArch64
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
+# Large ISel lowering file with extensive static helper conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+ TARGET_DIRECTORY AArch64
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/SMEABIPass.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
+ TARGET_DIRECTORY AArch64
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/AMDGPU/CMakeLists.txt (target: AMDGPU)
+# Conflicting DAG patterns and static functions across AMDGPU files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp
+ TARGET_DIRECTORY AMDGPU
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/AMDGPU/CMakeLists.txt (target: AMDGPU)
+# Generated GISel combiner code with conflicting rule symbols.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+ TARGET_DIRECTORY AMDGPU
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt (target: LLVMARMDesc)
+# Static ELF relocation helper functions conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
+ TARGET_DIRECTORY LLVMARMDesc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/Hexagon/CMakeLists.txt (target: Hexagon)
+# Static analysis functions conflict with other Hexagon pass files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp
+ TARGET_DIRECTORY Hexagon
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/MSP430/CMakeLists.txt (target: MSP430)
+# Static instruction lowering helpers conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp
+ TARGET_DIRECTORY MSP430
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt (target: LLVMNVPTXDesc)
+# Static table and helper function redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp
+ TARGET_DIRECTORY LLVMNVPTXDesc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
+# Static analysis functions conflict across RISCV passes.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp
+ TARGET_DIRECTORY RISCV
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
+# Generated combiner code with conflicting rule symbols.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/RISCVO0PreLegalizerCombiner.cpp
+ TARGET_DIRECTORY RISCV
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
+# Generated GISel combiner code with overlapping rule identifiers.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVO0PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVPostLegalizerCombiner.cpp
+ TARGET_DIRECTORY RISCV
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/SPIRV/CMakeLists.txt (target: SPIRV)
+# Conflicting intrinsic handling and static functions across SPIRV files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVRegisterInfo.cpp
+ TARGET_DIRECTORY SPIRV
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt (target: LLVMSPIRVDesc)
+# Static encoding tables and helper function redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCCodeEmitter.cpp
+ TARGET_DIRECTORY LLVMSPIRVDesc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
+# Static CFG transformation functions conflict with other WebAssembly files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
+ TARGET_DIRECTORY WebAssembly
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
+# Generated combiner code with conflicting rule symbols.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyPostLegalizerCombiner.cpp
+ TARGET_DIRECTORY WebAssembly
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
+# Generated GISel combiner code with conflicting symbols.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/GISel/WebAssemblyPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/GISel/WebAssemblyPostLegalizerCombiner.cpp
+ TARGET_DIRECTORY WebAssembly
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
+# Large ISel lowering and static helper function conflicts across X86 files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86FastTileConfig.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86FixupVectorConstants.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86ISelLowering.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86SpeculativeExecutionSideEffectSuppression.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86WinEHState.cpp
+ TARGET_DIRECTORY X86
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
+# Static instruction pattern matching and encoding table conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86CompressEVEX.cpp
+ TARGET_DIRECTORY X86
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
+# Generated GISel combiner code with overlapping rule symbols.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/GISel/X86PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/GISel/X86PostLegalizerCombiner.cpp
+ TARGET_DIRECTORY X86
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/XCore/CMakeLists.txt (target: XCore)
+# Static instruction information and helper function conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/XCore/XCoreInstrInfo.cpp
+ TARGET_DIRECTORY XCore
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Target/XCore/CMakeLists.txt (target: XCore)
+# Static register information and allocation helper conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp
+ TARGET_DIRECTORY XCore
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/Coroutines/CMakeLists.txt (target: LLVMCoroutines)
+# Anonymous namespace Lowerer classes and static coroutine helpers conflict.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Coroutines/CoroElide.cpp
+ TARGET_DIRECTORY LLVMCoroutines
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/Instrumentation/CMakeLists.txt (target: LLVMInstrumentation)
+# Static instrumentation functions and 'using namespace' cause ambiguity.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+ TARGET_DIRECTORY LLVMInstrumentation
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/ObjCARC/CMakeLists.txt (target: LLVMObjCARCOpts)
+# Static optimization functions conflict with other ObjCARC files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
+ TARGET_DIRECTORY LLVMObjCARCOpts
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/Scalar/CMakeLists.txt (target: LLVMScalarOpts)
+# STATISTIC variables and static analysis function redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/BDCE.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/GVNSink.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+ TARGET_DIRECTORY LLVMScalarOpts
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/Utils/CMakeLists.txt (target: LLVMTransformUtils)
+# Static lowering functions conflict with other Utils files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
+ TARGET_DIRECTORY LLVMTransformUtils
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/Utils/CMakeLists.txt (target: LLVMTransformUtils)
+# Static exception handling transformation functions conflict.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+ TARGET_DIRECTORY LLVMTransformUtils
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Transforms/Vectorize/CMakeLists.txt (target: LLVMVectorize)
+# VPlan files define conflicting STATISTIC variables, anonymous namespace
+# classes, and static pattern matching functions in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlan.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+ TARGET_DIRECTORY LLVMVectorize
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/dsymutil/CMakeLists.txt (target: dsymutil)
+# CFBundle.cpp includes ObjC headers that conflict with MachO headers
+# from other files in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/dsymutil/CFBundle.cpp
+ ${LLVM_REPO_DIR}/llvm/tools/dsymutil/RelocationMap.cpp
+ TARGET_DIRECTORY dsymutil
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/llvm-c-test/CMakeLists.txt (target: llvm-c-test)
+# calc.c and disassemble.c both define handle_line, causing
+# redefinition errors in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/calc.c
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/disassemble.c
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/diagnostic.c
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/module.c
+ TARGET_DIRECTORY llvm-c-test
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/llvm-jitlink/CMakeLists.txt (target: llvm-jitlink)
+# ELF, MachO, and COFF jitlink files define identically-named static functions
+# (getFirstRelocationEdge, etc.) that conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
+ TARGET_DIRECTORY llvm-jitlink
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/llvm-objdump/CMakeLists.txt (target: llvm-objdump)
+# MachODump.cpp defines UnwindInfo that conflicts with other dump files'
+# types when combined in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-objdump/MachODump.cpp
+ TARGET_DIRECTORY llvm-objdump
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/llvm-pdbutil/CMakeLists.txt (target: llvm-pdbutil)
+# DumpOutputStyle.cpp defines printHeader which conflicts with identically-named
+# functions from other output style files in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
+ TARGET_DIRECTORY llvm-pdbutil
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/llvm-readobj/CMakeLists.txt (target: llvm-readobj)
+# ELFDumper.cpp defines createError and checkHashTable that conflict with
+# identically-named functions from other dumper files in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-readobj/ELFDumper.cpp
+ TARGET_DIRECTORY llvm-readobj
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/tools/llvm-reduce/CMakeLists.txt (target: llvm-reduce)
+# ReduceOperandsSkip.cpp defines shouldReduceOperand which conflicts with
+# identically-named functions from other delta files in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-reduce/deltas/ReduceOperandsSkip.cpp
+ TARGET_DIRECTORY llvm-reduce
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/utils/TableGen/CMakeLists.txt (target: llvm-min-tblgen)
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/AsmWriterEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CTagsEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CallingConvEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CodeEmitterGen.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CompressInstEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DAGISelEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DXILEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DisassemblerEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/ExegesisEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/FastISelEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/GlobalISelEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/InstrDocsEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/OptionParserEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/OptionRSTEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/RegisterBankEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/SearchableTableEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/SubtargetEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86InstrMappingEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86MnemonicTables.cpp
+ TARGET_DIRECTORY llvm-min-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/utils/TableGen/CMakeLists.txt (target: llvm-min-tblgen)
+# Static DFA state tables and code generation helper conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DFAPacketizerEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/InstrInfoEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/SDNodeInfoEmitter.cpp
+ TARGET_DIRECTORY llvm-min-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Bitcode/Reader/CMakeLists.txt (target: LLVMBitReader)
+# Both files define a static 'error' function that conflicts in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+ TARGET_DIRECTORY LLVMBitReader
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/DebugInfo/CodeView/CMakeLists.txt (target: LLVMDebugInfoCodeView)
+# These files define static functions/arrays with identical names (stabilize,
+# LeafTypeNames, getLeafTypeName) that conflict in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/AppendingTypeTableBuilder.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
+ TARGET_DIRECTORY LLVMDebugInfoCodeView
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/DebugInfo/GSYM/CMakeLists.txt (target: LLVMDebugInfoGSYM)
+# FunctionInfo.cpp defines an enum value 'InlineInfo' that conflicts with
+# the struct InlineInfo in InlineInfo.cpp in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp
+ TARGET_DIRECTORY LLVMDebugInfoGSYM
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Demangle/CMakeLists.txt (target: LLVMDemangle)
+# These demangler files each define classes/type aliases named 'Demangler' and
+# use "using namespace" directives that bring conflicting symbols (Node,
+# Qualifiers, etc.) into scope from different namespaces, which cannot coexist
+# in a single translation unit.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/ItaniumDemangle.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/MicrosoftDemangle.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/RustDemangle.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/DLangDemangle.cpp
+ TARGET_DIRECTORY LLVMDemangle
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Frontend/HLSL/CMakeLists.txt (target: LLVMFrontendHLSL)
+# RootSignatureMetadata.cpp redefines 'OverloadedVisit' from
+# HLSLRootSignature.cpp in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Frontend/HLSL/HLSLRootSignature.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Frontend/HLSL/RootSignatureMetadata.cpp
+ TARGET_DIRECTORY LLVMFrontendHLSL
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/MC/CMakeLists.txt (target: LLVMMC)
+# These object writer files each define 'isDwoSection' in anonymous namespaces,
+# which conflicts in unity builds. MCAsmInfoELF/Wasm both define 'printName'.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/MC/ELFObjectWriter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/MCAsmInfoELF.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/MCAsmInfoWasm.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/WasmObjectWriter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/WinCOFFObjectWriter.cpp
+ TARGET_DIRECTORY LLVMMC
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/Object/CMakeLists.txt (target: LLVMObject)
+# MachOUniversal.cpp/MachOObjectFile.cpp: ambiguous 'malformedError'
+# ModuleSymbolTable.cpp: 'Module' conflicts with llvm::minidump::Module
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Object/MachOObjectFile.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Object/MachOUniversal.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Object/ModuleSymbolTable.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Object/OffloadBinary.cpp
+ TARGET_DIRECTORY LLVMObject
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/TargetParser/CMakeLists.txt (target: LLVMTargetParser)
+# Unity build conflicts:
+# - CSKYTargetParser.cpp: redefines 'stripNegationPrefix' from ARMTargetParser
+# - X86TargetParser.cpp: 'FeatureBitset' ambiguous due to namespace conflicts
+# - RISCVTargetParser.cpp: incomplete type 'CPUInfo[]' due to include ordering
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/TargetParser/CSKYTargetParser.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/TargetParser/RISCVTargetParser.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/TargetParser/X86TargetParser.cpp
+ TARGET_DIRECTORY LLVMTargetParser
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/lib/TextAPI/CMakeLists.txt (target: LLVMTextAPI)
+# RecordsSlice.cpp has ambiguous 'Target' due to namespace conflicts in
+# unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/TextAPI/RecordsSlice.cpp
+ TARGET_DIRECTORY LLVMTextAPI
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From llvm/utils/TableGen/Basic/CMakeLists.txt (target: LLVMTableGenBasic)
+# These emitter files each define a static TableGen::Emitter::Opt[Class]
+# variable named 'X' (and sometimes 'Y') at file scope for self-registration,
+# which conflicts in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/Attributes.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/TargetFeaturesEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/VTEmitter.cpp
+ TARGET_DIRECTORY LLVMTableGenBasic
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+
+# ======================================================================
+# mlir
+# ======================================================================
+
+# From mlir/examples/toy/Ch3/CMakeLists.txt (target: toyc-ch3)
+# mlir/ToyCombine.cpp references toy:: names that become ambiguous when
+# combined with other mlir/ files in a unity translation unit.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
+ TARGET_DIRECTORY toyc-ch3
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Conversion/SCFToGPU/CMakeLists.txt (target: MLIRSCFToGPU)
+# Conversion patterns and static helpers conflict via 'using namespace mlir'.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp
+ TARGET_DIRECTORY MLIRSCFToGPU
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Debug/CMakeLists.txt (target: MLIRDebug)
+# Static hook registration and context handling code conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Debug/DebuggerExecutionContextHook.cpp
+ TARGET_DIRECTORY MLIRDebug
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt (target: MLIRAffineTransforms)
+# Anonymous namespace struct redefinitions (LowerDelinearizeIndexOps, etc.).
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Affine/Transforms/AffineExpandIndexOpsAsAffine.cpp
+ TARGET_DIRECTORY MLIRAffineTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt (target: MLIRArithTransforms)
+# Static interface implementations conflict via 'using namespace mlir'.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.cpp
+ TARGET_DIRECTORY MLIRArithTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt (target: MLIRBufferizationTransforms)
+# Conflicting analysis pattern definitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
+ TARGET_DIRECTORY MLIRBufferizationTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt (target: MLIRLinalgTransforms)
+# Anonymous namespace pattern rewriter struct redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp
+ TARGET_DIRECTORY MLIRLinalgTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt (target: MLIRMemRefTransforms)
+# Static type emulation pattern and helper function conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
+ TARGET_DIRECTORY MLIRMemRefTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt (target: MLIROpenACCDialect)
+# Static code generation and type conversion function conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/OpenACC/IR/OpenACCCG.cpp
+ TARGET_DIRECTORY MLIROpenACCDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/Ptr/IR/CMakeLists.txt (target: MLIRPtrDialect)
+# Static pointer type handling conflicts via 'using namespace mlir'.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Ptr/IR/PtrTypes.cpp
+ TARGET_DIRECTORY MLIRPtrDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt (target: MLIRSparseTensorTransforms)
+# Conflicting sparse tensor analysis and lowering pattern definitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
+ TARGET_DIRECTORY MLIRSparseTensorTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt (target: MLIRVectorTransforms)
+# Anonymous namespace rewrite pattern redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp
+ TARGET_DIRECTORY MLIRVectorTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt (target: MLIRPDLLCodeGen)
+# Static PDLL code generation helpers and symbol registration conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
+ TARGET_DIRECTORY MLIRPDLLCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt (target: MLIRLspServerLib)
+# Static LSP protocol handler and request processing conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
+ TARGET_DIRECTORY MLIRLspServerLib
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt (target: TableGenLspServerLib)
+# Static TableGen LSP handler conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
+ TARGET_DIRECTORY TableGenLspServerLib
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Transforms/Utils/CMakeLists.txt (target: MLIRTransformUtils)
+# Anonymous namespace debugging infrastructure and static helper conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+ TARGET_DIRECTORY MLIRTransformUtils
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Analysis/CMakeLists.txt (target: MLIRTestAnalysis)
+# Static test infrastructure redefinitions across analysis test files.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/TestSlice.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDeadCodeAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDenseBackwardDataFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDenseForwardDataFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestSparseBackwardDataFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestStridedMetadataRangeAnalysis.cpp
+ TARGET_DIRECTORY MLIRTestAnalysis
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt (target: MLIRTestFuncToLLVM)
+# Static test pass and conversion pattern conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Conversion/FuncToLLVM/TestConvertFuncOp.cpp
+ TARGET_DIRECTORY MLIRTestFuncToLLVM
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
+# Static vectorization test utility conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
+ TARGET_DIRECTORY MLIRAffineTransformsTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
+# Static value bound analysis test infrastructure conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestReifyValueBounds.cpp
+ TARGET_DIRECTORY MLIRAffineTransformsTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
+# Static analysis test harness redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestAccessAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestDecomposeAffineOps.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp
+ TARGET_DIRECTORY MLIRAffineTransformsTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/Bufferization/CMakeLists.txt (target: MLIRBufferizationTestPasses)
+# Static test pattern implementation conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Bufferization/TestTensorLikeAndBufferLike.cpp
+ TARGET_DIRECTORY MLIRBufferizationTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/SCF/CMakeLists.txt (target: MLIRSCFTestPasses)
+# Static loop unrolling test pattern conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/SCF/TestParallelLoopUnrolling.cpp
+ TARGET_DIRECTORY MLIRSCFTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/Transform/CMakeLists.txt (target: MLIRTestTransformDialect)
+# Conflicting static test interpreter definitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Transform/TestTransformDialectInterpreter.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.cpp
+ TARGET_DIRECTORY MLIRTestTransformDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
+# Static dominance analysis test infrastructure conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestDominance.cpp
+ TARGET_DIRECTORY MLIRTestIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBuiltinAttributeInterfaces.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBuiltinDistinctAttributes.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBytecodeRoundtrip.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestClone.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestLazyLoading.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestRegions.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestSideEffects.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestSymbolUses.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestTypes.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestVisitorsGeneric.cpp
+ TARGET_DIRECTORY MLIRTestIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
+# Static interface testing utility conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestInterfaces.cpp
+ TARGET_DIRECTORY MLIRTestIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Pass/CMakeLists.txt (target: MLIRTestPass)
+# Static pass management test code conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Pass/TestPassManager.cpp
+ TARGET_DIRECTORY MLIRTestPass
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Transforms/CMakeLists.txt (target: MLIRTestTransforms)
+# Static transform test utility redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestCommutativityUtils.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestDialectConversion.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestInlining.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestInliningCallback.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestMakeIsolatedFromAbove.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestTransformDialectExtension.cpp
+ TARGET_DIRECTORY MLIRTestTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/unittests/Pass/CMakeLists.txt (target: MLIRPassTests)
+# Static pass management unit test infrastructure conflicts.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/unittests/Pass/PassManagerTest.cpp
+ TARGET_DIRECTORY MLIRPassTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Conversion/LLVMCommon/CMakeLists.txt (target: MLIRLLVMCommonConversion)
+# 'using namespace mlir' causes Type and other core type ambiguity.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/LLVMCommon/StructBuilder.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
+ TARGET_DIRECTORY MLIRLLVMCommonConversion
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt (target: MLIRShapeToStandard)
+# Conflicting pattern rewriters and helper function redefinitions.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp
+ TARGET_DIRECTORY MLIRShapeToStandard
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt (target: MLIRSPIRVDialect)
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/ArmGraphOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/AtomicOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/CastOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/ControlFlowOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/CooperativeMatrixOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/DotProductOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/GroupOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/MemoryOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVGLCanonicalization.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVOpDefinition.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVParsingUtils.cpp
+ TARGET_DIRECTORY MLIRSPIRVDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/IR/CMakeLists.txt (target: MLIRIR)
+# SymbolTable.cpp has ambiguous 'function_ref', 'SetVector', 'detail', 'impl'
+# due to 'using namespace llvm;' from other files in the unity batch.
+# Types.cpp has ambiguous 'Type' (mlir::Type vs llvm::Type).
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/IR/SymbolTable.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/IR/TypeRange.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/IR/TypeUtilities.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/IR/Types.cpp
+ TARGET_DIRECTORY MLIRIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/lib/TableGen/CMakeLists.txt (target: MLIRTableGen)
+# CodeGenHelpers.cpp has "using namespace llvm;" which makes DenseMapInfo
+# ambiguous in Constraint.cpp's DenseMapInfo<Constraint> implementations
+# when compiled together in a unity build.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/TableGen/Constraint.cpp
+ TARGET_DIRECTORY MLIRTableGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/test/lib/Dialect/Test/CMakeLists.txt (target: MLIRTestDialect)
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestAttributes.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestDialect.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestInterfaces.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOps.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestTraits.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestTypes.cpp
+ TARGET_DIRECTORY MLIRTestDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/tools/mlir-tblgen/CMakeLists.txt (target: mlir-tblgen)
+# Unity build conflicts:
+# - BytecodeDialectGen.cpp/DialectGen.cpp: both define static 'dialectGenCat'
+# - PassGen.cpp/PassCAPIGen.cpp: both define 'passGenCat', 'groupName',
+# 'passGroupRegistrationCode', 'fileHeader'
+# - SPIRVUtilsGen.cpp/TosaUtilsGen.cpp: both define 'Availability' class and
+# related functions in anonymous namespaces
+# - LLVMIRIntrinsicGen.cpp, OpDocGen.cpp, OpPythonBindingGen.cpp, RewriterGen.cpp:
+# 'using namespace llvm;' from other files makes DenseMap, Type, StringSwitch,
+# SetVector ambiguous with mlir::tblgen equivalents
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/BytecodeDialectGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/DialectGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpDocGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/PassCAPIGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/PassGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/RewriterGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/TosaUtilsGen.cpp
+ TARGET_DIRECTORY mlir-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/unittests/ExecutionEngine/CMakeLists.txt (target: MLIRExecutionEngineTests)
+# These files include CRunnerUtils.h/RunnerUtils.h which defines
+# UnrankedMemRefType that conflicts with mlir::UnrankedMemRefType in unity builds.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/DynamicMemRef.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/StridedMemRef.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/Invoke.cpp
+ TARGET_DIRECTORY MLIRExecutionEngineTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+# From mlir/unittests/IR/CMakeLists.txt (target: MLIRIRTests)
+# Static test helper function redefinitions across unit tests.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/AffineMapTest.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/OpPropertiesTest.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/TypeAttrNamesTest.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/ValueTest.cpp
+ TARGET_DIRECTORY MLIRIRTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+
+# ======================================================================
+# polly
+# ======================================================================
+
+# From polly/lib/CMakeLists.txt (target: Polly)
+# ISLOStream.h has no include guard, so its inline operator<< definitions get
+# redefined when multiple .cpp files including it are in the same unity TU.
+# Several Analysis/ and CodeGen/ files also share STATISTIC variable names.
+set_source_files_properties(
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopDetection.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopInfo.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopBuilder.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/PruneUnprofitable.cpp
+ ${LLVM_REPO_DIR}/polly/lib/CodeGen/IslAst.cpp
+ ${LLVM_REPO_DIR}/polly/lib/CodeGen/CodeGeneration.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/ScheduleOptimizer.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/FlattenSchedule.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/FlattenAlgo.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/ForwardOpTree.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/DeLICM.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/Simplify.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/MatmulOptimizer.cpp
+ TARGET_DIRECTORY Polly
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
diff --git a/llvm/lib/Bitcode/Reader/CMakeLists.txt b/llvm/lib/Bitcode/Reader/CMakeLists.txt
index c86804c079677..7a385613105ac 100644
--- a/llvm/lib/Bitcode/Reader/CMakeLists.txt
+++ b/llvm/lib/Bitcode/Reader/CMakeLists.txt
@@ -17,9 +17,3 @@ add_llvm_component_library(LLVMBitReader
Support
TargetParser
)
-
-# Both files define a static 'error' function that conflicts in unity builds.
-set_source_files_properties(
- BitcodeReader.cpp
- MetadataLoader.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 0a155f0e663f2..7620d546091c8 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -299,29 +299,3 @@ add_subdirectory(SelectionDAG)
add_subdirectory(AsmPrinter)
add_subdirectory(MIRParser)
add_subdirectory(GlobalISel)
-
-# STATISTIC and static function redefinitions across register allocation
-# and scheduling files conflict in unity builds.
-set_source_files_properties(
- LiveIntervalCalc.cpp
- MLRegAllocPriorityAdvisor.cpp
- MachineOutliner.cpp
- PostRASchedulerList.cpp
- RegAllocPriorityAdvisor.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Conflicting STATISTIC variables and static functions with other
-# register allocation files.
-set_source_files_properties(
- MLRegAllocEvictAdvisor.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Conflicting static cl::opt variables with other CodeGen files.
-set_source_files_properties(
- ModuloSchedule.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Anonymous namespace struct redefinitions conflict in unity builds.
-set_source_files_properties(
- PatchableFunction.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
index e5cf27332a42c..27b6ea745921a 100644
--- a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
+++ b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
@@ -47,9 +47,3 @@ add_llvm_component_library(LLVMGlobalISel
Target
TransformUtils
)
-
-# Conflicting static helper functions and STATISTIC variables.
-set_source_files_properties(
- IRTranslator.cpp
- LegacyLegalizerInfo.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
index b9325a5cc4715..8e85c0476c7ad 100644
--- a/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
+++ b/llvm/lib/CodeGen/MIRParser/CMakeLists.txt
@@ -19,8 +19,3 @@ add_llvm_component_library(LLVMMIRParser
Support
Target
)
-
-# Static functions and anonymous namespace classes conflict in unity builds.
-set_source_files_properties(
- MIParser.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
index 150dd014944f8..93a742a19aa79 100644
--- a/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
+++ b/llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt
@@ -40,15 +40,3 @@ add_llvm_component_library(LLVMSelectionDAG
TargetParser
TransformUtils
)
-
-# STATISTIC variable redefinitions (NumBacktracks, NumUnfolds, etc.)
-# and static function conflicts.
-set_source_files_properties(
- ScheduleDAGRRList.cpp
- SelectionDAG.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Large template instantiation code and static helper conflicts.
-set_source_files_properties(
- TargetLowering.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/DebugInfo/CodeView/CMakeLists.txt b/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
index e5b14f29999d7..48cbad0f6751a 100644
--- a/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/CodeView/CMakeLists.txt
@@ -46,13 +46,3 @@ add_llvm_component_library(LLVMDebugInfoCodeView
LINK_COMPONENTS
Support
)
-
-# These files define static functions/arrays with identical names (stabilize,
-# LeafTypeNames, getLeafTypeName) that conflict in unity builds.
-set_source_files_properties(
- AppendingTypeTableBuilder.cpp
- GlobalTypeTableBuilder.cpp
- MergingTypeTableBuilder.cpp
- TypeDumpVisitor.cpp
- TypeRecordMapping.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
index 7c4a07bd2683c..eb610a6b34f51 100644
--- a/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
+++ b/llvm/lib/DebugInfo/GSYM/CMakeLists.txt
@@ -31,8 +31,3 @@ add_llvm_component_library(LLVMDebugInfoGSYM
TargetParser
DebugInfoDWARF
)
-
-# FunctionInfo.cpp defines an enum value 'InlineInfo' that conflicts with
-# the struct InlineInfo in InlineInfo.cpp in unity builds.
-set_source_files_properties(FunctionInfo.cpp InlineInfo.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Demangle/CMakeLists.txt b/llvm/lib/Demangle/CMakeLists.txt
index 9b971dd69e195..eb7d212a02449 100644
--- a/llvm/lib/Demangle/CMakeLists.txt
+++ b/llvm/lib/Demangle/CMakeLists.txt
@@ -10,14 +10,3 @@ add_llvm_component_library(LLVMDemangle
"${LLVM_MAIN_INCLUDE_DIR}/llvm/Demangle"
)
-
-# These demangler files each define classes/type aliases named 'Demangler' and
-# use "using namespace" directives that bring conflicting symbols (Node,
-# Qualifiers, etc.) into scope from different namespaces, which cannot coexist
-# in a single translation unit.
-set_source_files_properties(
- ItaniumDemangle.cpp
- MicrosoftDemangle.cpp
- RustDemangle.cpp
- DLangDemangle.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
index d6e779137a5fb..0b530fb1bc478 100644
--- a/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt
@@ -75,9 +75,3 @@ target_link_libraries(LLVMJITLink
LLVMSupport
LLVMTargetParser
)
-
-# Anonymous namespace function redefinitions (buildTables_ELF_x86*).
-set_source_files_properties(
- ELF_x86.cpp
- ELF_x86_64.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
index c1cb753c6af43..8c78c0250cfb8 100644
--- a/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/Orc/CMakeLists.txt
@@ -105,9 +105,3 @@ target_link_libraries(LLVMOrcJIT
LLVMBitWriter
LLVMPasses
)
-
-# Static function and class definition conflicts in unity builds.
-set_source_files_properties(
- ELFNixPlatform.cpp
- RTDyldObjectLinkingLayer.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
index d07df782d33e2..1278e2f43c3bc 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt
@@ -19,8 +19,3 @@ add_llvm_component_library(LLVMRuntimeDyld
Support
TargetParser
)
-
-# Static relocation helper functions (or32le, getBits, etc.) conflict.
-set_source_files_properties(
- RuntimeDyldELF.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Frontend/HLSL/CMakeLists.txt b/llvm/lib/Frontend/HLSL/CMakeLists.txt
index 0c0ea29a9a5d8..3d225770e8d5b 100644
--- a/llvm/lib/Frontend/HLSL/CMakeLists.txt
+++ b/llvm/lib/Frontend/HLSL/CMakeLists.txt
@@ -18,10 +18,3 @@ add_llvm_component_library(LLVMFrontendHLSL
Core
Support
)
-
-# RootSignatureMetadata.cpp redefines 'OverloadedVisit' from
-# HLSLRootSignature.cpp in unity builds.
-set_source_files_properties(
- HLSLRootSignature.cpp
- RootSignatureMetadata.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/MC/CMakeLists.txt b/llvm/lib/MC/CMakeLists.txt
index b398c53e1e0da..7a9e26af415c6 100644
--- a/llvm/lib/MC/CMakeLists.txt
+++ b/llvm/lib/MC/CMakeLists.txt
@@ -87,13 +87,3 @@ add_llvm_component_library(LLVMMC
add_subdirectory(MCParser)
add_subdirectory(MCDisassembler)
-
-# These object writer files each define 'isDwoSection' in anonymous namespaces,
-# which conflicts in unity builds. MCAsmInfoELF/Wasm both define 'printName'.
-set_source_files_properties(
- ELFObjectWriter.cpp
- MCAsmInfoELF.cpp
- MCAsmInfoWasm.cpp
- WasmObjectWriter.cpp
- WinCOFFObjectWriter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ObjCopy/CMakeLists.txt b/llvm/lib/ObjCopy/CMakeLists.txt
index d29780e84372f..960f1d1fae2d0 100644
--- a/llvm/lib/ObjCopy/CMakeLists.txt
+++ b/llvm/lib/ObjCopy/CMakeLists.txt
@@ -41,15 +41,6 @@ source_group("Source Files\\DXContainer" REGULAR_EXPRESSION
DXContainer/.*[.]cpp
)
-# ELF, MachO, COFF, and wasm ObjCopy implementations define identically-named
-# types (Section, Object, SectionPred) in different namespaces that conflict
-# when combined via "using namespace" in unity builds.
-set_source_files_properties(
- MachO/MachOObjcopy.cpp
- MachO/MachOReader.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_component_library(LLVMObjCopy
Archive.cpp
DXContainer/DXContainerObjcopy.cpp
diff --git a/llvm/lib/Object/CMakeLists.txt b/llvm/lib/Object/CMakeLists.txt
index 17e68c01f42e2..0f6d2f7c59a5c 100644
--- a/llvm/lib/Object/CMakeLists.txt
+++ b/llvm/lib/Object/CMakeLists.txt
@@ -54,12 +54,3 @@ add_llvm_component_library(LLVMObject
TargetParser
TextAPI
)
-
-# MachOUniversal.cpp/MachOObjectFile.cpp: ambiguous 'malformedError'
-# ModuleSymbolTable.cpp: 'Module' conflicts with llvm::minidump::Module
-set_source_files_properties(
- MachOObjectFile.cpp
- MachOUniversal.cpp
- ModuleSymbolTable.cpp
- OffloadBinary.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ObjectYAML/CMakeLists.txt b/llvm/lib/ObjectYAML/CMakeLists.txt
index 51238cbe4fca2..b36974d47d9f8 100644
--- a/llvm/lib/ObjectYAML/CMakeLists.txt
+++ b/llvm/lib/ObjectYAML/CMakeLists.txt
@@ -40,11 +40,3 @@ add_llvm_component_library(LLVMObjectYAML
DebugInfoCodeView
MC
)
-
-# Conflicting 'using namespace' declarations (llvm::codeview,
-# llvm::CodeViewYAML) cause ambiguity.
-set_source_files_properties(
- CodeViewYAMLTypes.cpp
- MinidumpEmitter.cpp
- MinidumpYAML.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/ProfileData/CMakeLists.txt b/llvm/lib/ProfileData/CMakeLists.txt
index 7b1524e080594..c2366dc0ae03e 100644
--- a/llvm/lib/ProfileData/CMakeLists.txt
+++ b/llvm/lib/ProfileData/CMakeLists.txt
@@ -39,17 +39,4 @@ add_llvm_component_library(LLVMProfileData
TargetParser
)
-# InstrProfReader.cpp and InstrProfWriter.cpp have ambiguous 'Summary' due
-# to namespace conflicts in unity builds.
-set_source_files_properties(
- InstrProfReader.cpp
- InstrProfWriter.cpp
- SampleProf.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
add_subdirectory(Coverage)
-
-# 'using namespace sampleprof' causes ambiguity with other files.
-set_source_files_properties(
- SampleProfReader.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt
index d70fffbccadb9..a2c68233fd253 100644
--- a/llvm/lib/Support/CMakeLists.txt
+++ b/llvm/lib/Support/CMakeLists.txt
@@ -335,15 +335,6 @@ add_llvm_component_library(LLVMSupport
Demangle
)
-if(WIN32)
- set_source_files_properties(
- # error: expected unqualified-id 672 | while (const auto *IN = dyn_cast<RopePieceBTreeInterior>(N))
- RewriteRope.cpp
- # error: expected unqualified-id 511 | for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i)
- ManagedStatic.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-endif()
-
# Link ICU library if it is an external library.
if(ICU_FOUND AND NOT HAVE_WINDOWS_ICU)
target_link_libraries(LLVMSupport
diff --git a/llvm/lib/Target/AArch64/CMakeLists.txt b/llvm/lib/Target/AArch64/CMakeLists.txt
index 1f580e581a8a1..2fe554217c1ba 100644
--- a/llvm/lib/Target/AArch64/CMakeLists.txt
+++ b/llvm/lib/Target/AArch64/CMakeLists.txt
@@ -129,26 +129,3 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
-
-# Anonymous namespace classes and static function conflicts.
-set_source_files_properties(
- AArch64AdvSIMDScalarPass.cpp
- SVEIntrinsicOpts.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Large ISel lowering file with extensive static helper conflicts.
-set_source_files_properties(
- AArch64ISelLowering.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
- SMEABIPass.cpp
- GISel/AArch64CallLowering.cpp
- GISel/AArch64InstructionSelector.cpp
- GISel/AArch64LegalizerInfo.cpp
- GISel/AArch64O0PreLegalizerCombiner.cpp
- GISel/AArch64PostLegalizerCombiner.cpp
- GISel/AArch64PostLegalizerLowering.cpp
- GISel/AArch64PreLegalizerCombiner.cpp
- GISel/AArch64RegisterBankInfo.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/AMDGPU/CMakeLists.txt b/llvm/lib/Target/AMDGPU/CMakeLists.txt
index 738086187aa93..cda288e012925 100644
--- a/llvm/lib/Target/AMDGPU/CMakeLists.txt
+++ b/llvm/lib/Target/AMDGPU/CMakeLists.txt
@@ -225,19 +225,3 @@ add_subdirectory(MCA)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
-
-# Conflicting DAG patterns and static functions across AMDGPU files.
-set_source_files_properties(
- AMDGPUISelDAGToDAG.cpp
- AMDGPUInstCombineIntrinsic.cpp
- AMDGPURegisterBankInfo.cpp
- AMDGPUSwLowerLDS.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Generated GISel combiner code with conflicting rule symbols.
-set_source_files_properties(
- AMDGPUInstructionSelector.cpp
- AMDGPUPostLegalizerCombiner.cpp
- AMDGPUPreLegalizerCombiner.cpp
- AMDGPURegBankCombiner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
index 3dbc6263c7ad6..977f8bf5548fd 100644
--- a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt
@@ -27,8 +27,3 @@ add_llvm_component_library(LLVMARMDesc
ADD_TO_COMPONENT
ARM
)
-
-# Static ELF relocation helper functions conflict in unity builds.
-set_source_files_properties(
- ARMELFObjectWriter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/Hexagon/CMakeLists.txt b/llvm/lib/Target/Hexagon/CMakeLists.txt
index 0924fe0516e25..b4716693c3dc9 100644
--- a/llvm/lib/Target/Hexagon/CMakeLists.txt
+++ b/llvm/lib/Target/Hexagon/CMakeLists.txt
@@ -104,8 +104,3 @@ add_subdirectory(AsmParser)
add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
-
-# Static analysis functions conflict with other Hexagon pass files.
-set_source_files_properties(
- HexagonOptimizeSZextends.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/MSP430/CMakeLists.txt b/llvm/lib/Target/MSP430/CMakeLists.txt
index 6eb6824d4b649..bcf9fd288dbd1 100644
--- a/llvm/lib/Target/MSP430/CMakeLists.txt
+++ b/llvm/lib/Target/MSP430/CMakeLists.txt
@@ -50,8 +50,3 @@ add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(AsmParser)
add_subdirectory(Disassembler)
-
-# Static instruction lowering helpers conflict in unity builds.
-set_source_files_properties(
- MSP430MCInstLower.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
index 3aee4072af2cb..1255be2dbf1c2 100644
--- a/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt
@@ -13,8 +13,3 @@ add_llvm_component_library(LLVMNVPTXDesc
ADD_TO_COMPONENT
NVPTX
)
-
-# Static table and helper function redefinitions.
-set_source_files_properties(
- NVPTXMCTargetDesc.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/RISCV/CMakeLists.txt b/llvm/lib/Target/RISCV/CMakeLists.txt
index b770bcc74978b..3b529c1471d54 100644
--- a/llvm/lib/Target/RISCV/CMakeLists.txt
+++ b/llvm/lib/Target/RISCV/CMakeLists.txt
@@ -112,20 +112,3 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(MCA)
add_subdirectory(TargetInfo)
-
-# Static analysis functions conflict across RISCV passes.
-set_source_files_properties(
- RISCVInsertWriteVXRM.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Generated combiner code with conflicting rule symbols.
-set_source_files_properties(
- RISCVO0PreLegalizerCombiner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Generated GISel combiner code with overlapping rule identifiers.
-set_source_files_properties(
- GISel/RISCVO0PreLegalizerCombiner.cpp
- GISel/RISCVPreLegalizerCombiner.cpp
- GISel/RISCVPostLegalizerCombiner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/SPIRV/CMakeLists.txt b/llvm/lib/Target/SPIRV/CMakeLists.txt
index a31719f4159d8..58989237ad3ea 100644
--- a/llvm/lib/Target/SPIRV/CMakeLists.txt
+++ b/llvm/lib/Target/SPIRV/CMakeLists.txt
@@ -83,13 +83,3 @@ add_llvm_target(SPIRVCodeGen
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Analysis)
-
-# Conflicting intrinsic handling and static functions across SPIRV files.
-set_source_files_properties(
- SPIRVBuiltins.cpp
- SPIRVEmitIntrinsics.cpp
- SPIRVModuleAnalysis.cpp
- SPIRVPreLegalizerCombiner.cpp
- SPIRVRegisterBankInfo.cpp
- SPIRVRegisterInfo.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
index 7c829494fddda..7cfd30b876563 100644
--- a/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
+++ b/llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt
@@ -17,9 +17,3 @@ add_llvm_component_library(LLVMSPIRVDesc
ADD_TO_COMPONENT
SPIRV
)
-
-# Static encoding tables and helper function redefinitions.
-set_source_files_properties(
- SPIRVBaseInfo.cpp
- SPIRVMCCodeEmitter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/WebAssembly/CMakeLists.txt b/llvm/lib/Target/WebAssembly/CMakeLists.txt
index bec3002e8d9cd..39ee5e86f0191 100644
--- a/llvm/lib/Target/WebAssembly/CMakeLists.txt
+++ b/llvm/lib/Target/WebAssembly/CMakeLists.txt
@@ -108,20 +108,3 @@ add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
add_subdirectory(Utils)
-
-# Static CFG transformation functions conflict with other WebAssembly files.
-set_source_files_properties(
- WebAssemblyFixIrreducibleControlFlow.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Generated combiner code with conflicting rule symbols.
-set_source_files_properties(
- WebAssemblyPreLegalizerCombiner.cpp
- WebAssemblyPostLegalizerCombiner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Generated GISel combiner code with conflicting symbols.
-set_source_files_properties(
- GISel/WebAssemblyPreLegalizerCombiner.cpp
- GISel/WebAssemblyPostLegalizerCombiner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/X86/CMakeLists.txt b/llvm/lib/Target/X86/CMakeLists.txt
index 52b0c0b9b1e90..c2dd34efb844d 100644
--- a/llvm/lib/Target/X86/CMakeLists.txt
+++ b/llvm/lib/Target/X86/CMakeLists.txt
@@ -130,25 +130,3 @@ add_subdirectory(Disassembler)
add_subdirectory(MCA)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
-
-# Large ISel lowering and static helper function conflicts across X86 files.
-set_source_files_properties(
- X86FastTileConfig.cpp
- X86FixupVectorConstants.cpp
- X86ISelLowering.cpp
- X86LoadValueInjectionRetHardening.cpp
- X86LowerAMXIntrinsics.cpp
- X86SpeculativeExecutionSideEffectSuppression.cpp
- X86WinEHState.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static instruction pattern matching and encoding table conflicts.
-set_source_files_properties(
- X86CompressEVEX.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Generated GISel combiner code with overlapping rule symbols.
-set_source_files_properties(
- GISel/X86PreLegalizerCombiner.cpp
- GISel/X86PostLegalizerCombiner.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Target/XCore/CMakeLists.txt b/llvm/lib/Target/XCore/CMakeLists.txt
index d2d13e97f267a..f411c658b43b0 100644
--- a/llvm/lib/Target/XCore/CMakeLists.txt
+++ b/llvm/lib/Target/XCore/CMakeLists.txt
@@ -51,13 +51,3 @@ add_llvm_target(XCoreCodeGen
add_subdirectory(Disassembler)
add_subdirectory(MCTargetDesc)
add_subdirectory(TargetInfo)
-
-# Static instruction information and helper function conflicts.
-set_source_files_properties(
- XCoreInstrInfo.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static register information and allocation helper conflicts.
-set_source_files_properties(
- XCoreRegisterInfo.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/TargetParser/CMakeLists.txt b/llvm/lib/TargetParser/CMakeLists.txt
index 0a4f76e8a318a..8d474497f5308 100644
--- a/llvm/lib/TargetParser/CMakeLists.txt
+++ b/llvm/lib/TargetParser/CMakeLists.txt
@@ -44,13 +44,3 @@ add_llvm_component_library(LLVMTargetParser
DEPENDS
target_parser_gen
)
-
-# Unity build conflicts:
-# - CSKYTargetParser.cpp: redefines 'stripNegationPrefix' from ARMTargetParser
-# - X86TargetParser.cpp: 'FeatureBitset' ambiguous due to namespace conflicts
-# - RISCVTargetParser.cpp: incomplete type 'CPUInfo[]' due to include ordering
-set_source_files_properties(
- CSKYTargetParser.cpp
- RISCVTargetParser.cpp
- X86TargetParser.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/TextAPI/CMakeLists.txt b/llvm/lib/TextAPI/CMakeLists.txt
index 805b0507bde8e..29533756e41ae 100644
--- a/llvm/lib/TextAPI/CMakeLists.txt
+++ b/llvm/lib/TextAPI/CMakeLists.txt
@@ -24,9 +24,4 @@ add_llvm_component_library(LLVMTextAPI
TargetParser
)
-# RecordsSlice.cpp has ambiguous 'Target' due to namespace conflicts in
-# unity builds.
-set_source_files_properties(RecordsSlice.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
add_subdirectory(BinaryReader)
diff --git a/llvm/lib/Transforms/Coroutines/CMakeLists.txt b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
index ec707b6fd25c2..46ef5cd4e8cfe 100644
--- a/llvm/lib/Transforms/Coroutines/CMakeLists.txt
+++ b/llvm/lib/Transforms/Coroutines/CMakeLists.txt
@@ -27,9 +27,3 @@ add_llvm_component_library(LLVMCoroutines
TransformUtils
TargetParser
)
-
-# Anonymous namespace Lowerer classes and static coroutine helpers conflict.
-set_source_files_properties(
- CoroEarly.cpp
- CoroElide.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
index 18e1d6c2a6d4e..80576c61fd80c 100644
--- a/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
+++ b/llvm/lib/Transforms/Instrumentation/CMakeLists.txt
@@ -44,8 +44,3 @@ add_llvm_component_library(LLVMInstrumentation
TransformUtils
ProfileData
)
-
-# Static instrumentation functions and 'using namespace' cause ambiguity.
-set_source_files_properties(
- HWAddressSanitizer.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
index b6560f9afde82..4274667a2c2b7 100644
--- a/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
+++ b/llvm/lib/Transforms/ObjCARC/CMakeLists.txt
@@ -24,8 +24,3 @@ add_llvm_component_library(LLVMObjCARCOpts
TargetParser
TransformUtils
)
-
-# Static optimization functions conflict with other ObjCARC files.
-set_source_files_properties(
- ObjCARCContract.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Scalar/CMakeLists.txt b/llvm/lib/Transforms/Scalar/CMakeLists.txt
index c7437ea6f5d2e..37dbb34605646 100644
--- a/llvm/lib/Transforms/Scalar/CMakeLists.txt
+++ b/llvm/lib/Transforms/Scalar/CMakeLists.txt
@@ -100,11 +100,3 @@ add_llvm_component_library(LLVMScalarOpts
Support
TransformUtils
)
-
-# STATISTIC variables and static analysis function redefinitions.
-set_source_files_properties(
- BDCE.cpp
- ConstraintElimination.cpp
- GVNSink.cpp
- LoopInterchange.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Utils/CMakeLists.txt b/llvm/lib/Transforms/Utils/CMakeLists.txt
index d86085ef7d4b9..2b5f5cf344e60 100644
--- a/llvm/lib/Transforms/Utils/CMakeLists.txt
+++ b/llvm/lib/Transforms/Utils/CMakeLists.txt
@@ -108,13 +108,3 @@ add_llvm_component_library(LLVMTransformUtils
Support
TargetParser
)
-
-# Static lowering functions conflict with other Utils files.
-set_source_files_properties(
- LowerGlobalDtors.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static exception handling transformation functions conflict.
-set_source_files_properties(
- LowerInvoke.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/lib/Transforms/Vectorize/CMakeLists.txt b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
index 3af9702b99e36..9f4a242214471 100644
--- a/llvm/lib/Transforms/Vectorize/CMakeLists.txt
+++ b/llvm/lib/Transforms/Vectorize/CMakeLists.txt
@@ -48,18 +48,3 @@ add_llvm_component_library(LLVMVectorize
TransformUtils
SandboxIR
)
-
-# VPlan files define conflicting STATISTIC variables, anonymous namespace
-# classes, and static pattern matching functions in unity builds.
-set_source_files_properties(
- LoopVectorize.cpp
- VPlan.cpp
- VPlanAnalysis.cpp
- VPlanConstruction.cpp
- VPlanPredicator.cpp
- VPlanRecipes.cpp
- VPlanTransforms.cpp
- VPlanUnroll.cpp
- VPlanUtils.cpp
- VPlanVerifier.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/llvm/tools/dsymutil/CMakeLists.txt b/llvm/tools/dsymutil/CMakeLists.txt
index 638e3772d54bb..d3cdbe466de08 100644
--- a/llvm/tools/dsymutil/CMakeLists.txt
+++ b/llvm/tools/dsymutil/CMakeLists.txt
@@ -25,14 +25,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# CFBundle.cpp includes ObjC headers that conflict with MachO headers
-# from other files in unity builds.
-set_source_files_properties(
- CFBundle.cpp
- RelocationMap.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(dsymutil
dsymutil.cpp
BinaryHolder.cpp
diff --git a/llvm/tools/gold/CMakeLists.txt b/llvm/tools/gold/CMakeLists.txt
index 3cbaa603530e1..5c78529e38f48 100644
--- a/llvm/tools/gold/CMakeLists.txt
+++ b/llvm/tools/gold/CMakeLists.txt
@@ -12,8 +12,8 @@ if( LLVM_ENABLE_PIC AND LLVM_BINUTILS_INCDIR )
TargetParser
)
- # add_llvm_library(LLVMgold MODULE INSTALL_WITH_TOOLCHAIN
- # gold-plugin.cpp
- # )
+ add_llvm_library(LLVMgold MODULE INSTALL_WITH_TOOLCHAIN
+ gold-plugin.cpp
+ )
endif()
diff --git a/llvm/tools/llvm-c-test/CMakeLists.txt b/llvm/tools/llvm-c-test/CMakeLists.txt
index a725ba912071b..939164e636216 100644
--- a/llvm/tools/llvm-c-test/CMakeLists.txt
+++ b/llvm/tools/llvm-c-test/CMakeLists.txt
@@ -39,16 +39,6 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wstrict-prototypes")
endif ()
-# calc.c and disassemble.c both define handle_line, causing
-# redefinition errors in unity builds.
-set_source_files_properties(
- calc.c
- disassemble.c
- diagnostic.c
- module.c
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(llvm-c-test
attributes.c
calc.c
diff --git a/llvm/tools/llvm-jitlink/CMakeLists.txt b/llvm/tools/llvm-jitlink/CMakeLists.txt
index 5288fb6cb4c76..19e3edaf63d86 100644
--- a/llvm/tools/llvm-jitlink/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/CMakeLists.txt
@@ -20,14 +20,6 @@ set(LLVM_LINK_COMPONENTS
TargetParser
)
-# ELF, MachO, and COFF jitlink files define identically-named static functions
-# (getFirstRelocationEdge, etc.) that conflict in unity builds.
-set_source_files_properties(
- llvm-jitlink-elf.cpp
- llvm-jitlink-macho.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(llvm-jitlink
llvm-jitlink.cpp
llvm-jitlink-coff.cpp
diff --git a/llvm/tools/llvm-objdump/CMakeLists.txt b/llvm/tools/llvm-objdump/CMakeLists.txt
index 5ff869b50c60e..8283f07da36ea 100644
--- a/llvm/tools/llvm-objdump/CMakeLists.txt
+++ b/llvm/tools/llvm-objdump/CMakeLists.txt
@@ -25,13 +25,6 @@ set(LLVM_TARGET_DEFINITIONS OtoolOpts.td)
tablegen(LLVM OtoolOpts.inc -gen-opt-parser-defs)
add_public_tablegen_target(OtoolOptsTableGen)
-# MachODump.cpp defines UnwindInfo that conflicts with other dump files'
-# types when combined in unity builds.
-set_source_files_properties(
- MachODump.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(llvm-objdump
llvm-objdump.cpp
SourcePrinter.cpp
diff --git a/llvm/tools/llvm-pdbutil/CMakeLists.txt b/llvm/tools/llvm-pdbutil/CMakeLists.txt
index 84d7a6dc5ede9..e834755bdf483 100644
--- a/llvm/tools/llvm-pdbutil/CMakeLists.txt
+++ b/llvm/tools/llvm-pdbutil/CMakeLists.txt
@@ -8,13 +8,6 @@ set(LLVM_LINK_COMPONENTS
Support
)
-# DumpOutputStyle.cpp defines printHeader which conflicts with identically-named
-# functions from other output style files in unity builds.
-set_source_files_properties(
- DumpOutputStyle.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(llvm-pdbutil
BytesOutputStyle.cpp
DumpOutputStyle.cpp
diff --git a/llvm/tools/llvm-readobj/CMakeLists.txt b/llvm/tools/llvm-readobj/CMakeLists.txt
index 048f218bfba88..0051f87b3c103 100644
--- a/llvm/tools/llvm-readobj/CMakeLists.txt
+++ b/llvm/tools/llvm-readobj/CMakeLists.txt
@@ -13,13 +13,6 @@ set(LLVM_TARGET_DEFINITIONS Opts.td)
tablegen(LLVM Opts.inc -gen-opt-parser-defs)
add_public_tablegen_target(ReadobjOptsTableGen)
-# ELFDumper.cpp defines createError and checkHashTable that conflict with
-# identically-named functions from other dumper files in unity builds.
-set_source_files_properties(
- ELFDumper.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(llvm-readobj
ARMWinEHPrinter.cpp
COFFDumper.cpp
diff --git a/llvm/tools/llvm-reduce/CMakeLists.txt b/llvm/tools/llvm-reduce/CMakeLists.txt
index 08b1176d48986..cf6701a3f0d5f 100644
--- a/llvm/tools/llvm-reduce/CMakeLists.txt
+++ b/llvm/tools/llvm-reduce/CMakeLists.txt
@@ -20,13 +20,6 @@ set(LLVM_LINK_COMPONENTS
TransformUtils
)
-# ReduceOperandsSkip.cpp defines shouldReduceOperand which conflicts with
-# identically-named functions from other delta files in unity builds.
-set_source_files_properties(
- deltas/ReduceOperandsSkip.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
add_llvm_tool(llvm-reduce
DeltaManager.cpp
ReducerWorkItem.cpp
diff --git a/llvm/utils/TableGen/Basic/CMakeLists.txt b/llvm/utils/TableGen/Basic/CMakeLists.txt
index f7347f4646505..01ab8a0ef2250 100644
--- a/llvm/utils/TableGen/Basic/CMakeLists.txt
+++ b/llvm/utils/TableGen/Basic/CMakeLists.txt
@@ -24,21 +24,6 @@ add_llvm_library(LLVMTableGenBasic OBJECT EXCLUDE_FROM_ALL DISABLE_LLVM_LINK_LLV
VTEmitter.cpp
)
-# These emitter files each define a static TableGen::Emitter::Opt[Class]
-# variable named 'X' (and sometimes 'Y') at file scope for self-registration,
-# which conflicts in unity builds.
-set_source_files_properties(
- ARMTargetDefEmitter.cpp
- Attributes.cpp
- DirectiveEmitter.cpp
- IntrinsicEmitter.cpp
- RISCVTargetDefEmitter.cpp
- RuntimeLibcallsEmitter.cpp
- TargetFeaturesEmitter.cpp
- TargetLibraryInfoEmitter.cpp
- VTEmitter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
# Users may include its headers as "Basic/*.h"
target_include_directories(LLVMTableGenBasic
INTERFACE
diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt
index 3446e95046783..e18279cffa74c 100644
--- a/llvm/utils/TableGen/CMakeLists.txt
+++ b/llvm/utils/TableGen/CMakeLists.txt
@@ -81,37 +81,3 @@ add_tablegen(llvm-tblgen LLVM
DEPENDS
intrinsics_gen # via llvm-min-tablegen
)
-
-set_source_files_properties(
- AsmWriterEmitter.cpp
- CTagsEmitter.cpp
- CallingConvEmitter.cpp
- CodeEmitterGen.cpp
- CompressInstEmitter.cpp
- DAGISelEmitter.cpp
- DXILEmitter.cpp
- DisassemblerEmitter.cpp
- ExegesisEmitter.cpp
- FastISelEmitter.cpp
- GlobalISelCombinerEmitter.cpp
- GlobalISelEmitter.cpp
- InstrDocsEmitter.cpp
- MacroFusionPredicatorEmitter.cpp
- OptionParserEmitter.cpp
- OptionRSTEmitter.cpp
- PseudoLoweringEmitter.cpp
- RegisterBankEmitter.cpp
- RegisterInfoEmitter.cpp
- SearchableTableEmitter.cpp
- SubtargetEmitter.cpp
- X86FoldTablesEmitter.cpp
- X86InstrMappingEmitter.cpp
- X86MnemonicTables.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static DFA state tables and code generation helper conflicts.
-set_source_files_properties(
- DFAPacketizerEmitter.cpp
- InstrInfoEmitter.cpp
- SDNodeInfoEmitter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/examples/toy/Ch3/CMakeLists.txt b/mlir/examples/toy/Ch3/CMakeLists.txt
index e889ec04b4320..565f3c41c5b80 100644
--- a/mlir/examples/toy/Ch3/CMakeLists.txt
+++ b/mlir/examples/toy/Ch3/CMakeLists.txt
@@ -24,12 +24,6 @@ add_toy_chapter(toyc-ch3
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
-
-# mlir/ToyCombine.cpp references toy:: names that become ambiguous when
-# combined with other mlir/ files in a unity translation unit.
-set_source_files_properties(mlir/ToyCombine.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
target_link_libraries(toyc-ch3
PRIVATE
MLIRAnalysis
diff --git a/mlir/examples/toy/Ch4/CMakeLists.txt b/mlir/examples/toy/Ch4/CMakeLists.txt
index 9cf41e047d42f..9fd38e6dd8f2e 100644
--- a/mlir/examples/toy/Ch4/CMakeLists.txt
+++ b/mlir/examples/toy/Ch4/CMakeLists.txt
@@ -30,7 +30,6 @@ add_toy_chapter(toyc-ch4
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
-
target_link_libraries(toyc-ch4
PRIVATE
MLIRAnalysis
diff --git a/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt b/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
index b21105779719a..568d9339aaabc 100644
--- a/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
+++ b/mlir/lib/Conversion/LLVMCommon/CMakeLists.txt
@@ -17,9 +17,3 @@ add_mlir_conversion_library(MLIRLLVMCommonConversion
MLIRSupport
MLIRTransforms
)
-
-# 'using namespace mlir' causes Type and other core type ambiguity.
-set_source_files_properties(
- StructBuilder.cpp
- TypeConverter.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
index f2c3127af0476..b7853634bc44e 100644
--- a/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
+++ b/mlir/lib/Conversion/SCFToGPU/CMakeLists.txt
@@ -22,8 +22,3 @@ add_mlir_conversion_library(MLIRSCFToGPU
MLIRSideEffectInterfaces
MLIRTransforms
)
-
-# Conversion patterns and static helpers conflict via 'using namespace mlir'.
-set_source_files_properties(
- SCFToGPUPass.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt b/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
index eefb6a6c96951..246f10b389911 100644
--- a/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
+++ b/mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt
@@ -25,9 +25,3 @@ add_mlir_conversion_library(MLIRShapeToStandard
MLIRSCFDialect
MLIRTransforms
)
-
-# Conflicting pattern rewriters and helper function redefinitions.
-set_source_files_properties(
- ShapeToStandard.cpp
- ConvertShapeConstraints.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Debug/CMakeLists.txt b/mlir/lib/Debug/CMakeLists.txt
index 2bf287cacdad4..d270eb2e7534f 100644
--- a/mlir/lib/Debug/CMakeLists.txt
+++ b/mlir/lib/Debug/CMakeLists.txt
@@ -17,8 +17,3 @@ add_mlir_library(MLIRDebug
MLIRObservers
)
-
-# Static hook registration and context handling code conflicts.
-set_source_files_properties(
- DebuggerExecutionContextHook.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
index 2679141a42208..7bce124817032 100644
--- a/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
@@ -46,8 +46,3 @@ add_mlir_dialect_library(MLIRAffineTransforms
MLIRVectorUtils
)
-
-# Anonymous namespace struct redefinitions (LowerDelinearizeIndexOps, etc.).
-set_source_files_properties(
- AffineExpandIndexOpsAsAffine.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
index cbc8e9efc214e..637e16a3963d6 100644
--- a/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt
@@ -37,8 +37,3 @@ add_mlir_dialect_library(MLIRArithTransforms
MLIRValueBoundsOpInterface
MLIRVectorDialect
)
-
-# Static interface implementations conflict via 'using namespace mlir'.
-set_source_files_properties(
- BufferizableOpInterfaceImpl.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
index b7e8c5d4ff28a..7c38621be1bb5 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt
@@ -42,9 +42,3 @@ add_mlir_dialect_library(MLIRBufferizationTransforms
MLIRViewLikeInterface
MLIRSupport
)
-
-# Conflicting analysis pattern definitions.
-set_source_files_properties(
- BufferViewFlowAnalysis.cpp
- OwnershipBasedBufferDeallocation.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
index 4df1e22537edb..a2149478e4c2d 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt
@@ -87,8 +87,3 @@ add_mlir_dialect_library(MLIRLinalgTransforms
MLIRVectorUtils
MLIRVectorToSCF
)
-
-# Anonymous namespace pattern rewriter struct redefinitions.
-set_source_files_properties(
- DecomposeLinalgOps.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
index d53d15637f28a..1c5e07f89b338 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt
@@ -44,8 +44,3 @@ add_mlir_dialect_library(MLIRMemRefTransforms
MLIRVectorDialect
)
-
-# Static type emulation pattern and helper function conflicts.
-set_source_files_properties(
- EmulateNarrowType.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt b/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
index d36e3a77ff36c..2ba1778532860 100644
--- a/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt
@@ -21,8 +21,3 @@ add_mlir_dialect_library(MLIROpenACCDialect
MLIROpenACCMPCommon
)
-
-# Static code generation and type conversion function conflicts.
-set_source_files_properties(
- OpenACCCG.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt b/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
index 566c30faaa53b..a6b0d416a4165 100644
--- a/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/Ptr/IR/CMakeLists.txt
@@ -37,8 +37,3 @@ add_mlir_dialect_library(
MLIRViewLikeInterface
MLIRPtrMemorySpaceInterfaces
)
-
-# Static pointer type handling conflicts via 'using namespace mlir'.
-set_source_files_properties(
- PtrTypes.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt b/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
index bbbe2b4805142..f05f596aa9f23 100644
--- a/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
+++ b/mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt
@@ -51,20 +51,3 @@ add_mlir_dialect_library(MLIRSPIRVDialect
MLIRTransforms
MLIRUBDialect
)
-
-set_source_files_properties(
- ArmGraphOps.cpp
- AtomicOps.cpp
- CastOps.cpp
- ControlFlowOps.cpp
- CooperativeMatrixOps.cpp
- DotProductOps.cpp
- GroupOps.cpp
- MemoryOps.cpp
- SPIRVCanonicalization.cpp
- SPIRVDialect.cpp
- SPIRVGLCanonicalization.cpp
- SPIRVOpDefinition.cpp
- SPIRVOps.cpp
- SPIRVParsingUtils.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
index 117e0cd54233b..43e5c3251c525 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt
@@ -53,9 +53,3 @@ add_mlir_dialect_library(MLIRSparseTensorTransforms
MLIRTransforms
MLIRVectorDialect
)
-
-# Conflicting sparse tensor analysis and lowering pattern definitions.
-set_source_files_properties(
- SparseTensorConversion.cpp
- Sparsification.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
index 93a276e9927df..4e0f07af95984 100644
--- a/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
+++ b/mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt
@@ -55,8 +55,3 @@ add_mlir_dialect_library(MLIRVectorTransforms
MLIRVectorInterfaces
MLIRVectorUtils
)
-
-# Anonymous namespace rewrite pattern redefinitions.
-set_source_files_properties(
- VectorInsertExtractStridedSliceRewritePatterns.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/IR/CMakeLists.txt b/mlir/lib/IR/CMakeLists.txt
index d5c728210d109..6cadc3131ccd4 100644
--- a/mlir/lib/IR/CMakeLists.txt
+++ b/mlir/lib/IR/CMakeLists.txt
@@ -75,9 +75,3 @@ add_mlir_library(MLIRIR
LINK_LIBS PUBLIC
MLIRSupport
)
-
-# SymbolTable.cpp has ambiguous 'function_ref', 'SetVector', 'detail', 'impl'
-# due to 'using namespace llvm;' from other files in the unity batch.
-# Types.cpp has ambiguous 'Type' (mlir::Type vs llvm::Type).
-set_source_files_properties(SymbolTable.cpp TypeRange.cpp TypeUtilities.cpp Types.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/TableGen/CMakeLists.txt b/mlir/lib/TableGen/CMakeLists.txt
index d874640c9516b..a90c55847718e 100644
--- a/mlir/lib/TableGen/CMakeLists.txt
+++ b/mlir/lib/TableGen/CMakeLists.txt
@@ -41,12 +41,6 @@ llvm_add_library(MLIRTableGen STATIC
${MLIR_MAIN_INCLUDE_DIR}/mlir/TableGen
${MLIR_MAIN_INCLUDE_DIR}/mlir/Support
)
-
-# CodeGenHelpers.cpp has "using namespace llvm;" which makes DenseMapInfo
-# ambiguous in Constraint.cpp's DenseMapInfo<Constraint> implementations
-# when compiled together in a unity build.
-set_source_files_properties(Constraint.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
set_target_properties(MLIRTableGen PROPERTIES FOLDER "MLIR/Tablegenning")
mlir_check_all_link_libraries(MLIRTableGen)
diff --git a/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt b/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
index 1ce934b095ed2..f378a28af2db9 100644
--- a/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
+++ b/mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt
@@ -8,8 +8,3 @@ add_mlir_library(MLIRPDLLCodeGen
MLIRPDLDialect
MLIRSupport
)
-
-# Static PDLL code generation helpers and symbol registration conflicts.
-set_source_files_properties(
- MLIRGen.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt b/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
index 967ef96095535..e2acba54e5624 100644
--- a/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
+++ b/mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt
@@ -17,8 +17,3 @@ add_mlir_library(MLIRLspServerLib
MLIRLspServerSupportLib
MLIRParser
)
-
-# Static LSP protocol handler and request processing conflicts.
-set_source_files_properties(
- MLIRServer.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt b/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
index b25a461f07d23..b21650ed03b6f 100644
--- a/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
+++ b/mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt
@@ -19,8 +19,3 @@ llvm_add_library(TableGenLspServerLib
MLIRLspServerSupportLib
MLIRSupport
)
-
-# Static TableGen LSP handler conflicts.
-set_source_files_properties(
- TableGenServer.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/lib/Transforms/Utils/CMakeLists.txt b/mlir/lib/Transforms/Utils/CMakeLists.txt
index 23f37442fa0ad..3ca16239ba33c 100644
--- a/mlir/lib/Transforms/Utils/CMakeLists.txt
+++ b/mlir/lib/Transforms/Utils/CMakeLists.txt
@@ -24,8 +24,3 @@ add_mlir_library(MLIRTransformUtils
MLIRSubsetOpInterface
MLIRRewrite
)
-
-# Anonymous namespace debugging infrastructure and static helper conflicts.
-set_source_files_properties(
- GreedyPatternRewriteDriver.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Analysis/CMakeLists.txt b/mlir/test/lib/Analysis/CMakeLists.txt
index 9ee060cc6e8ad..c37671ade37b3 100644
--- a/mlir/test/lib/Analysis/CMakeLists.txt
+++ b/mlir/test/lib/Analysis/CMakeLists.txt
@@ -37,15 +37,3 @@ target_include_directories(MLIRTestAnalysis
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
-
-# Static test infrastructure redefinitions across analysis test files.
-set_source_files_properties(
- TestMemRefDependenceCheck.cpp
- TestSlice.cpp
- DataFlow/TestDeadCodeAnalysis.cpp
- DataFlow/TestDenseBackwardDataFlowAnalysis.cpp
- DataFlow/TestDenseForwardDataFlowAnalysis.cpp
- DataFlow/TestLivenessAnalysis.cpp
- DataFlow/TestSparseBackwardDataFlowAnalysis.cpp
- DataFlow/TestStridedMetadataRangeAnalysis.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt b/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
index 7cc673e38b3f7..f190b2da5a190 100644
--- a/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
+++ b/mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt
@@ -21,8 +21,3 @@ target_include_directories(MLIRTestFuncToLLVM
${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
)
-
-# Static test pass and conversion pattern conflicts.
-set_source_files_properties(
- TestConvertFuncOp.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Affine/CMakeLists.txt b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
index 2626acc0ace9b..885bc9b4c3afc 100644
--- a/mlir/test/lib/Dialect/Affine/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Affine/CMakeLists.txt
@@ -42,22 +42,3 @@ target_include_directories(MLIRAffineTransformsTestPasses
${CMAKE_CURRENT_BINARY_DIR}/../Test
)
-
-# Static vectorization test utility conflicts.
-set_source_files_properties(
- TestVectorizationUtils.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static value bound analysis test infrastructure conflicts.
-set_source_files_properties(
- TestReifyValueBounds.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static analysis test harness redefinitions.
-set_source_files_properties(
- TestAccessAnalysis.cpp
- TestAffineLoopUnswitching.cpp
- TestDecomposeAffineOps.cpp
- TestLoopFusion.cpp
- TestLoopPermutation.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt b/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
index 2c1a15bf90a54..2ee3222160d91 100644
--- a/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Bufferization/CMakeLists.txt
@@ -19,8 +19,3 @@ target_include_directories(MLIRBufferizationTestPasses
${CMAKE_CURRENT_SOURCE_DIR}/../../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../../Dialect/Test
)
-
-# Static test pattern implementation conflicts.
-set_source_files_properties(
- TestTensorLikeAndBufferLike.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/SCF/CMakeLists.txt b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
index bd792d8e9709c..d2f97e816cc14 100644
--- a/mlir/test/lib/Dialect/SCF/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/SCF/CMakeLists.txt
@@ -18,8 +18,3 @@ mlir_target_link_libraries(MLIRSCFTestPasses PUBLIC
MLIRSCFUtils
MLIRTransformUtils
)
-
-# Static loop unrolling test pattern conflicts.
-set_source_files_properties(
- TestParallelLoopUnrolling.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Test/CMakeLists.txt b/mlir/test/lib/Dialect/Test/CMakeLists.txt
index 97e820de0e64a..9354a85d984c9 100644
--- a/mlir/test/lib/Dialect/Test/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Test/CMakeLists.txt
@@ -130,16 +130,3 @@ add_mlir_translation_library(MLIRTestToLLVMIRTranslation
MLIRBuiltinToLLVMIRTranslation
MLIRLLVMToLLVMIRTranslation
)
-
-set_source_files_properties(
- TestAttributes.cpp
- TestDialect.cpp
- TestDialectInterfaces.cpp
- TestInterfaces.cpp
- TestOpDefs.cpp
- TestOps.cpp
- TestOpsSyntax.cpp
- TestPatterns.cpp
- TestTraits.cpp
- TestTypes.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Dialect/Transform/CMakeLists.txt b/mlir/test/lib/Dialect/Transform/CMakeLists.txt
index 3f2ee19333122..512a0a89bfea9 100644
--- a/mlir/test/lib/Dialect/Transform/CMakeLists.txt
+++ b/mlir/test/lib/Dialect/Transform/CMakeLists.txt
@@ -26,9 +26,3 @@ mlir_target_link_libraries(MLIRTestTransformDialect PUBLIC
MLIRTransformLoopExtension
MLIRTransformPDLExtension
)
-
-# Conflicting static test interpreter definitions.
-set_source_files_properties(
- TestTransformDialectInterpreter.cpp
- TestTransformStateExtension.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/IR/CMakeLists.txt b/mlir/test/lib/IR/CMakeLists.txt
index 0549b785e71ad..1abcfc77d2d9b 100644
--- a/mlir/test/lib/IR/CMakeLists.txt
+++ b/mlir/test/lib/IR/CMakeLists.txt
@@ -44,26 +44,3 @@ target_include_directories(MLIRTestIR
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
-
-# Static dominance analysis test infrastructure conflicts.
-set_source_files_properties(
- TestDominance.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-set_source_files_properties(
- TestBuiltinAttributeInterfaces.cpp
- TestBuiltinDistinctAttributes.cpp
- TestBytecodeRoundtrip.cpp
- TestClone.cpp
- TestLazyLoading.cpp
- TestRegions.cpp
- TestSideEffects.cpp
- TestSymbolUses.cpp
- TestTypes.cpp
- TestVisitorsGeneric.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# Static interface testing utility conflicts.
-set_source_files_properties(
- TestInterfaces.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Pass/CMakeLists.txt b/mlir/test/lib/Pass/CMakeLists.txt
index 10276fe07babc..04c91635def85 100644
--- a/mlir/test/lib/Pass/CMakeLists.txt
+++ b/mlir/test/lib/Pass/CMakeLists.txt
@@ -28,8 +28,3 @@ target_include_directories(MLIRTestPass
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
-
-# Static pass management test code conflicts.
-set_source_files_properties(
- TestPassManager.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/test/lib/Transforms/CMakeLists.txt b/mlir/test/lib/Transforms/CMakeLists.txt
index 61ba12224f8c8..ddc0a779e8f69 100644
--- a/mlir/test/lib/Transforms/CMakeLists.txt
+++ b/mlir/test/lib/Transforms/CMakeLists.txt
@@ -59,13 +59,3 @@ target_include_directories(MLIRTestTransforms
${CMAKE_CURRENT_SOURCE_DIR}/../Dialect/Test
${CMAKE_CURRENT_BINARY_DIR}/../Dialect/Test
)
-
-# Static transform test utility redefinitions.
-set_source_files_properties(
- TestCommutativityUtils.cpp
- TestDialectConversion.cpp
- TestInlining.cpp
- TestInliningCallback.cpp
- TestMakeIsolatedFromAbove.cpp
- TestTransformDialectExtension.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/tools/mlir-tblgen/CMakeLists.txt b/mlir/tools/mlir-tblgen/CMakeLists.txt
index e081590ac871a..d7087cba3c874 100644
--- a/mlir/tools/mlir-tblgen/CMakeLists.txt
+++ b/mlir/tools/mlir-tblgen/CMakeLists.txt
@@ -37,29 +37,6 @@ add_tablegen(mlir-tblgen MLIR
CppGenUtilities.cpp
)
-# Unity build conflicts:
-# - BytecodeDialectGen.cpp/DialectGen.cpp: both define static 'dialectGenCat'
-# - PassGen.cpp/PassCAPIGen.cpp: both define 'passGenCat', 'groupName',
-# 'passGroupRegistrationCode', 'fileHeader'
-# - SPIRVUtilsGen.cpp/TosaUtilsGen.cpp: both define 'Availability' class and
-# related functions in anonymous namespaces
-# - LLVMIRIntrinsicGen.cpp, OpDocGen.cpp, OpPythonBindingGen.cpp, RewriterGen.cpp:
-# 'using namespace llvm;' from other files makes DenseMap, Type, StringSwitch,
-# SetVector ambiguous with mlir::tblgen equivalents
-set_source_files_properties(
- BytecodeDialectGen.cpp
- DialectGen.cpp
- LLVMIRIntrinsicGen.cpp
- OpDocGen.cpp
- OpFormatGen.cpp
- OpPythonBindingGen.cpp
- PassCAPIGen.cpp
- PassGen.cpp
- RewriterGen.cpp
- SPIRVUtilsGen.cpp
- TosaUtilsGen.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
target_link_libraries(mlir-tblgen
PRIVATE
MLIRTblgenLib)
diff --git a/mlir/unittests/ExecutionEngine/CMakeLists.txt b/mlir/unittests/ExecutionEngine/CMakeLists.txt
index da9f31ce7fa85..b83163e39c014 100644
--- a/mlir/unittests/ExecutionEngine/CMakeLists.txt
+++ b/mlir/unittests/ExecutionEngine/CMakeLists.txt
@@ -22,11 +22,3 @@ target_link_libraries(MLIRExecutionEngineTests
PRIVATE
MLIRExecutionEngine
)
-
-# These files include CRunnerUtils.h/RunnerUtils.h which defines
-# UnrankedMemRefType that conflicts with mlir::UnrankedMemRefType in unity builds.
-set_source_files_properties(
- DynamicMemRef.cpp
- StridedMemRef.cpp
- Invoke.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/unittests/IR/CMakeLists.txt b/mlir/unittests/IR/CMakeLists.txt
index 8f46ed3725c5c..f5b522bb5cf22 100644
--- a/mlir/unittests/IR/CMakeLists.txt
+++ b/mlir/unittests/IR/CMakeLists.txt
@@ -33,11 +33,3 @@ mlir_target_link_libraries(MLIRIRTests PRIVATE MLIRIR)
target_link_libraries(MLIRIRTests PRIVATE MLIRBytecodeWriter)
target_link_libraries(MLIRIRTests PRIVATE MLIRTestDialect)
target_link_libraries(MLIRIRTests PRIVATE MLIRRemarkStreamer)
-
-# Static test helper function redefinitions across unit tests.
-set_source_files_properties(
- AffineMapTest.cpp
- OpPropertiesTest.cpp
- TypeAttrNamesTest.cpp
- ValueTest.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/mlir/unittests/Pass/CMakeLists.txt b/mlir/unittests/Pass/CMakeLists.txt
index 8374efd31849f..a47d2eead6180 100644
--- a/mlir/unittests/Pass/CMakeLists.txt
+++ b/mlir/unittests/Pass/CMakeLists.txt
@@ -8,8 +8,3 @@ mlir_target_link_libraries(MLIRPassTests
MLIRDebug
MLIRFuncDialect
MLIRPass)
-
-# Static pass management unit test infrastructure conflicts.
-set_source_files_properties(
- PassManagerTest.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index 610170d61c568..6f6e4d5782dfb 100644
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -38,26 +38,6 @@ set(POLLY_COMPONENTS
Vectorize
)
-# ISLOStream.h has no include guard, so its inline operator<< definitions get
-# redefined when multiple .cpp files including it are in the same unity TU.
-# Several Analysis/ and CodeGen/ files also share STATISTIC variable names.
-set_source_files_properties(
- Analysis/ScopDetection.cpp
- Analysis/ScopInfo.cpp
- Analysis/ScopBuilder.cpp
- Analysis/PruneUnprofitable.cpp
- CodeGen/IslAst.cpp
- CodeGen/CodeGeneration.cpp
- Transform/ScheduleOptimizer.cpp
- Transform/FlattenSchedule.cpp
- Transform/FlattenAlgo.cpp
- Transform/ForwardOpTree.cpp
- Transform/DeLICM.cpp
- Transform/Simplify.cpp
- Transform/MatmulOptimizer.cpp
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON
-)
-
# Use an object-library to add the same files to multiple libs without requiring
# the sources them to be recompiled for each of them.
add_llvm_pass_plugin(Polly
>From 98742dc5c6f207b4604d40e018f7914b5004e638 Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Tue, 24 Mar 2026 21:09:17 -0700
Subject: [PATCH 24/25] refactor UnityBuild.cmake
---
.ci/monolithic-linux.sh | 2 +-
llvm/CMakeLists.txt | 55 +-
llvm/cmake/modules/UnityBuild.cmake | 2978 ++++++++++++++-------------
3 files changed, 1591 insertions(+), 1444 deletions(-)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 60fb9e9c9a4f6..510b2c4d301ab 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -43,7 +43,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
-D LLVM_ENABLE_PROJECTS="${projects}" \
-D LLVM_ENABLE_RUNTIMES="${runtimes}" \
-G Ninja \
- -D CMAKE_UNITY_BUILD=ON \
+ -D LLVM_UNITY_BUILD=ON \
-D CMAKE_PREFIX_PATH="${HOME}/.local" \
-D CMAKE_BUILD_TYPE=Release \
-D CLANG_ENABLE_CIR=${enable_cir} \
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 35093fcdd7833..9f05d686740e6 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -7,6 +7,11 @@ set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
NO_POLICY_SCOPE)
+option(LLVM_UNITY_BUILD "UNITY_BUILD for LLVM" OFF)
+if(LLVM_UNITY_BUILD)
+ set(CMAKE_UNITY_BUILD ON)
+endif()
+
# Builds with custom install names and installation rpath setups may not work
# in the build tree. Allow these cases to use CMake's default build tree
# behavior by setting `LLVM_NO_INSTALL_NAME_DIR_FOR_BUILD_TREE` to do this.
@@ -1553,30 +1558,32 @@ if (XCODE)
endforeach()
endif()
-set(LLVM_SRC_DIR "${CMAKE_SOURCE_DIR}")
-set(LLVM_REPO_DIR "${LLVM_SRC_DIR}/..")
+if(LLVM_UNITY_BUILD)
+ set(LLVM_SRC_DIR "${CMAKE_SOURCE_DIR}")
+ set(LLVM_REPO_DIR "${LLVM_SRC_DIR}/..")
-include(UnityBuild)
+ include(UnityBuild)
-function (_get_all_cmake_targets out_var current_dir)
- get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS)
- get_property(subdirs DIRECTORY ${current_dir} PROPERTY SUBDIRECTORIES)
- foreach(subdir ${subdirs})
- _get_all_cmake_targets(subdir_targets ${subdir})
- list(APPEND targets ${subdir_targets})
+ function (_get_all_cmake_targets out_var current_dir)
+ get_property(targets DIRECTORY ${current_dir} PROPERTY BUILDSYSTEM_TARGETS)
+ get_property(subdirs DIRECTORY ${current_dir} PROPERTY SUBDIRECTORIES)
+ foreach(subdir ${subdirs})
+ _get_all_cmake_targets(subdir_targets ${subdir})
+ list(APPEND targets ${subdir_targets})
+ endforeach()
+ set(${out_var} ${targets} PARENT_SCOPE)
+ endfunction()
+
+ # Run at end of top-level CMakeLists
+ _get_all_cmake_targets(all_targets ${CMAKE_CURRENT_LIST_DIR})
+
+ foreach(target ${all_targets})
+ set(after [[
+ #undef DEBUG_TYPE
+ #undef DBGS
+ ]])
+ set_target_properties(${target} PROPERTIES
+ UNITY_BUILD_CODE_AFTER_INCLUDE "${after}"
+ )
endforeach()
- set(${out_var} ${targets} PARENT_SCOPE)
-endfunction()
-
-# Run at end of top-level CMakeLists
-_get_all_cmake_targets(all_targets ${CMAKE_CURRENT_LIST_DIR})
-
-foreach(target ${all_targets})
- set(after [[
- #undef DEBUG_TYPE
- #undef DBGS
- ]])
- set_target_properties(${target} PROPERTIES
- UNITY_BUILD_CODE_AFTER_INCLUDE "${after}"
- )
-endforeach()
+endif()
diff --git a/llvm/cmake/modules/UnityBuild.cmake b/llvm/cmake/modules/UnityBuild.cmake
index 2f73da90196ee..58c0eb6bad9dc 100644
--- a/llvm/cmake/modules/UnityBuild.cmake
+++ b/llvm/cmake/modules/UnityBuild.cmake
@@ -9,1452 +9,1592 @@
# clang-tools-extra
# ======================================================================
-# From clang-tools-extra/clang-doc/CMakeLists.txt (target: clangDoc)
-# Representation.cpp and YAMLGenerator.cpp have conflicting static declarations
-# and CommentKind ambiguity when combined in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/Representation.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/YAMLGenerator.cpp
- TARGET_DIRECTORY clangDoc
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/clang-doc/support/CMakeLists.txt (target: clangDocSupport)
-# Utils.cpp references ClangDocContext which is not visible when combined
-# with File.cpp in a unity build due to include ordering.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/support/Utils.cpp
- TARGET_DIRECTORY clangDocSupport
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/clangd/CMakeLists.txt (target: clangDaemon)
-# clangd::Token conflicts with clang::Token, and InsertionPoint.cpp has
-# type conflicts when combined with other files in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/SourceCode.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/InsertionPoint.cpp
- TARGET_DIRECTORY clangDaemon
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt (target: clangDaemonTweaks)
-# DefineInline/DefineOutline share static getSelectedFunction;
-# RemoveUsingNamespace has clangd::Token vs clang::Token conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp
- TARGET_DIRECTORY clangDaemonTweaks
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/clangd/unittests/CMakeLists.txt (target: ClangdTests)
-# These files define symbols that clash in unity builds:
-# - PreambleTests.cpp defines MATCHER_P(Diag, ...) which conflicts with
-# clang::clangd::Diag when combined with RenameTests.cpp.
-# - HoverTests.cpp and IncludeCleanerTests.cpp both define guard().
-# - SymbolCollectorTests.cpp, SerializationTests.cpp, FileIndexTests.cpp,
-# BackgroundIndexTests.cpp, and FindSymbolsTests.cpp all define
-# MATCHER_P(qName, ...).
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/PreambleTests.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/HoverTests.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
- TARGET_DIRECTORY ClangdTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/include-cleaner/unittests/CMakeLists.txt (target: ClangIncludeCleanerTests)
-# AnalysisTest.cpp and FindHeadersTest.cpp both define guard().
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
- TARGET_DIRECTORY ClangIncludeCleanerTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/modularize/CMakeLists.txt (target: modularize)
-# ModuleAssistant.cpp defines a local Module class that conflicts with
-# clang::Module when combined in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/modularize/ModuleAssistant.cpp
- TARGET_DIRECTORY modularize
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang-tools-extra/unittests/clang-tidy/CMakeLists.txt (target: clang-tidy)
-# These files define symbols that clash in unity builds:
-# - ClangTidyOptionsTest.cpp and ClangTidyDiagnosticConsumerTest.cpp both
-# define TestCheck
-# - UsingInserterTest.cpp and NamespaceAliaserTest.cpp both define runChecker
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
- ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
- TARGET_DIRECTORY clang-tidy
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+if(TARGET clangDoc)
+ # From clang-tools-extra/clang-doc/CMakeLists.txt (target: clangDoc)
+ # Representation.cpp and YAMLGenerator.cpp have conflicting static declarations
+ # and CommentKind ambiguity when combined in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/Representation.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/YAMLGenerator.cpp
+ TARGET_DIRECTORY clangDoc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangDocSupport)
+ # From clang-tools-extra/clang-doc/support/CMakeLists.txt (target: clangDocSupport)
+ # Utils.cpp references ClangDocContext which is not visible when combined
+ # with File.cpp in a unity build due to include ordering.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clang-doc/support/Utils.cpp
+ TARGET_DIRECTORY clangDocSupport
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangDaemon)
+ # From clang-tools-extra/clangd/CMakeLists.txt (target: clangDaemon)
+ # clangd::Token conflicts with clang::Token, and InsertionPoint.cpp has
+ # type conflicts when combined with other files in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/SourceCode.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/InsertionPoint.cpp
+ TARGET_DIRECTORY clangDaemon
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangDaemonTweaks)
+ # From clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt (target: clangDaemonTweaks)
+ # DefineInline/DefineOutline share static getSelectedFunction;
+ # RemoveUsingNamespace has clangd::Token vs clang::Token conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/refactor/tweaks/RemoveUsingNamespace.cpp
+ TARGET_DIRECTORY clangDaemonTweaks
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+if(TARGET ClangdTests)
+ # From clang-tools-extra/clangd/unittests/CMakeLists.txt (target: ClangdTests)
+ # These files define symbols that clash in unity builds:
+ # - PreambleTests.cpp defines MATCHER_P(Diag, ...) which conflicts with
+ # clang::clangd::Diag when combined with RenameTests.cpp.
+ # - HoverTests.cpp and IncludeCleanerTests.cpp both define guard().
+ # - SymbolCollectorTests.cpp, SerializationTests.cpp, FileIndexTests.cpp,
+ # BackgroundIndexTests.cpp, and FindSymbolsTests.cpp all define
+ # MATCHER_P(qName, ...).
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/PreambleTests.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/HoverTests.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/IncludeCleanerTests.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
+ TARGET_DIRECTORY ClangdTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET ClangIncludeCleanerTests)
+ # From clang-tools-extra/include-cleaner/unittests/CMakeLists.txt (target: ClangIncludeCleanerTests)
+ # AnalysisTest.cpp and FindHeadersTest.cpp both define guard().
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
+ TARGET_DIRECTORY ClangIncludeCleanerTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET modularize)
+ # From clang-tools-extra/modularize/CMakeLists.txt (target: modularize)
+ # ModuleAssistant.cpp defines a local Module class that conflicts with
+ # clang::Module when combined in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/modularize/ModuleAssistant.cpp
+ TARGET_DIRECTORY modularize
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clang-tidy)
+ # From clang-tools-extra/unittests/clang-tidy/CMakeLists.txt (target: clang-tidy)
+ # These files define symbols that clash in unity builds:
+ # - ClangTidyOptionsTest.cpp and ClangTidyDiagnosticConsumerTest.cpp both
+ # define TestCheck
+ # - UsingInserterTest.cpp and NamespaceAliaserTest.cpp both define runChecker
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyDiagnosticConsumerTest.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
+ ${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
+ TARGET_DIRECTORY clang-tidy
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
# ======================================================================
# clang
# ======================================================================
-# From clang/lib/APINotes/CMakeLists.txt (target: clangAPINotes)
-# Reader and Writer define identically-named classes in anonymous namespaces
-# (IdentifierTableInfo, ContextIDTableInfo, etc.). Manager and YAMLCompiler
-# use "using namespace api_notes" which brings api_notes::Module into scope,
-# conflicting with clang::Module.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesReader.cpp
- ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesWriter.cpp
- ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesYAMLCompiler.cpp
- TARGET_DIRECTORY clangAPINotes
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/AST/CMakeLists.txt (target: clangAST)
-# CommentParser/CommentSema use "using namespace clang::comments" which
-# conflicts with clang::tok. MicrosoftMangle and ItaniumMangle define
-# functions with the same name that cause overload ambiguity.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/AST/CommentParser.cpp
- ${LLVM_REPO_DIR}/clang/lib/AST/CommentSema.cpp
- ${LLVM_REPO_DIR}/clang/lib/AST/MicrosoftMangle.cpp
- ${LLVM_REPO_DIR}/clang/lib/AST/ItaniumMangle.cpp
- TARGET_DIRECTORY clangAST
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Analysis/LifetimeSafety/CMakeLists.txt (target: clangAnalysisLifetimeSafety)
-# Multiple files define identically-named struct Lattice and class AnalysisImpl
-# in anonymous namespaces, causing redefinition errors in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
- ${LLVM_REPO_DIR}/clang/lib/Analysis/LifetimeSafety/MovedLoans.cpp
- TARGET_DIRECTORY clangAnalysisLifetimeSafety
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Basic/CMakeLists.txt (target: clangBasic)
-# Each Targets/*.cpp file defines static constexpr NumBuiltins, BuiltinInfos,
-# and BuiltinStrings which conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/AMDGPU.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/ARM.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/BPF.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/DirectX.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/Hexagon.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/LoongArch.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/Mips.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/NVPTX.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/PPC.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/RISCV.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/SPIR.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/SystemZ.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/VE.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/WebAssembly.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/X86.cpp
- ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/XCore.cpp
- TARGET_DIRECTORY clangBasic
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
-# CIRGenExprComplex.cpp references both cir::ComplexType/CastKind and
-# clang::ComplexType/CastKind which become ambiguous in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
- TARGET_DIRECTORY clangCIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
-# CIRGenOpenACCRecipe.h has no include guards and defines classes; including it
-# from both CIRGenOpenACCClause.cpp and CIRGenOpenACCRecipe.cpp in the same
-# unity TU causes redefinition errors.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
- ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
- TARGET_DIRECTORY clangCIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
-# CIRGenTypes.cpp references cir::Type/RecordType which conflict with
-# clang::Type/RecordType from other files in the unity TU.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
- TARGET_DIRECTORY clangCIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/CodeGen/CMakeLists.txt (target: clangCodeGen)
-# Many CodeGen files use "using namespace llvm" which brings llvm::Type,
-# llvm::VectorType, etc. into scope, conflicting with clang:: equivalents
-# used by other files in the same unity TU.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/BackendUtil.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGAtomic.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGBuiltin.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGCoroutine.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGExpr.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGHLSLBuiltins.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGHLSLRuntime.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGLoopInfo.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGNonTrivialStruct.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGOpenMPRuntime.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGStmtOpenMP.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenAction.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenFunction.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenModule.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenPGO.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/CoverageMappingGen.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/LinkInModulesPass.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/QualTypeMapper.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/ARM.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/DirectX.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/Hexagon.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/NVPTX.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/PPC.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/RISCV.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/SPIR.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/SystemZ.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/WebAssembly.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/X86.cpp
- ${LLVM_REPO_DIR}/clang/lib/CodeGen/Targets/AArch64.cpp
- TARGET_DIRECTORY clangCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/ExtractAPI/CMakeLists.txt (target: clangExtractAPI)
-# SymbolGraphSerializer.cpp uses "using namespace llvm" which brings types
-# that conflict with clang::extractapi types in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
- TARGET_DIRECTORY clangExtractAPI
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Frontend/CMakeLists.txt (target: clangFrontend)
-# config.h uses a #include guard that errors on double-inclusion, which
-# breaks unity builds when multiple .cpp files include it.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Frontend/CompilerInstance.cpp
- ${LLVM_REPO_DIR}/clang/lib/Frontend/CompilerInvocation.cpp
- TARGET_DIRECTORY clangFrontend
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Frontend/Rewrite/CMakeLists.txt (target: clangRewriteFrontend)
-# Both files include config.h which uses #error to prevent double-inclusion,
-# breaking unity builds when they end up in the same translation unit.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
- ${LLVM_REPO_DIR}/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
- TARGET_DIRECTORY clangRewriteFrontend
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Lex/CMakeLists.txt (target: clangLex)
-# "using namespace clang::dependency_directives_scan" at file scope brings
-# dependency_directives_scan::Token into scope, conflicting with clang::Token.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Lex/DependencyDirectivesScanner.cpp
- TARGET_DIRECTORY clangLex
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt (target: clangScalableStaticAnalysisFrameworkCore)
-# error: type alias redefinition with different types ('Registry<AnalysisBase>' vs 'Registry<SummaryDataBuilderBase>')
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/ScalableStaticAnalysisFramework/Core/WholeProgramAnalysis/AnalysisRegistry.cpp
- TARGET_DIRECTORY clangScalableStaticAnalysisFrameworkCore
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Sema/CMakeLists.txt (target: clangSema)
-# Both files define struct PartialSpecMatchResult in anonymous namespaces
-# with different member types, causing redefinition errors in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Sema/SemaTemplateInstantiate.cpp
- TARGET_DIRECTORY clangSema
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Serialization/CMakeLists.txt (target: clangSerialization)
-# ASTWriter.cpp defines HeaderFileInfoTrait and LazySpecializationInfoLookupTrait
-# in an anonymous namespace, conflicting with identically-named classes from
-# ASTReaderInternals.h included by other files in this directory.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Serialization/ASTWriter.cpp
- TARGET_DIRECTORY clangSerialization
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Tooling/CMakeLists.txt (target: clangTooling)
-# CompilationDatabase.cpp and DependencyScanningTool.cpp reference
-# clang::driver which becomes ambiguous when combined with other files
-# in a unity build.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Tooling/CompilationDatabase.cpp
- ${LLVM_REPO_DIR}/clang/lib/Tooling/DependencyScanningTool.cpp
- ${LLVM_REPO_DIR}/clang/lib/Tooling/Tooling.cpp
- TARGET_DIRECTORY clangTooling
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/lib/Tooling/Transformer/CMakeLists.txt (target: clangTransformer)
-# Both files define a static getNode() helper in anonymous namespaces,
-# causing redefinition errors in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/lib/Tooling/Transformer/Stencil.cpp
- ${LLVM_REPO_DIR}/clang/lib/Tooling/Transformer/RangeSelector.cpp
- TARGET_DIRECTORY clangTransformer
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/tools/clang-installapi/CMakeLists.txt (target: clang-installapi)
-# Options.cpp uses "using namespace llvm" which makes llvm::Value ambiguous
-# with other types when combined in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/tools/clang-installapi/Options.cpp
- TARGET_DIRECTORY clang-installapi
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/tools/diagtool/CMakeLists.txt (target: diagtool)
-# TreeView.cpp defines printUsage which conflicts with identically-named
-# functions from other diagtool files in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/tools/diagtool/TreeView.cpp
- TARGET_DIRECTORY diagtool
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/tools/driver/CMakeLists.txt (target: clang)
-# cc1as_main.cpp and driver.cpp both define LLVMErrorHandler; cc1gen_reproducer
-# uses "driver" which is ambiguous with clang::driver in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/tools/driver/cc1_main.cpp
- ${LLVM_REPO_DIR}/clang/tools/driver/cc1as_main.cpp
- ${LLVM_REPO_DIR}/clang/tools/driver/cc1gen_reproducer_main.cpp
- TARGET_DIRECTORY clang
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/unittests/CMakeLists.txt (target: AllClangUnitTests)
-# Files that clash in unity builds of AllClangUnitTests due to shared headers
-# (ASTPrint.h, CheckerRegistration.h, CallbacksCommon.h, CFGBuildResult.h)
-# or duplicate symbols.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/unittests/Lex/LexerTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGBackEdgesTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGDominatorTree.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Analysis/IntervalPartitionTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Analysis/UnsafeBufferUsageTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/ASTDumperTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/ASTExprTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/ASTImporterGenericRedeclTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/ASTImporterODRStrategiesTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/AttrTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/ConceptPrinterTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/DataCollectionTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/DeclPrinterTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/NamedDeclPrinterTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/QualTypeNamesTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/SizelessTypesTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/StmtPrinterTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/TemplateNameTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/AST/TypePrinterTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/CodeGen/TBAAMetadataTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Driver/ToolChainTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Interpreter/InterpreterTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Lex/NoTrivialPPDirectiveTracerTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Lex/PPMemoryAllocationsTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Lex/PPCallbacksTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Lex/ModuleDeclStateTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/ScalableStaticAnalysisFramework/Registries/MockSerializationFormat.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/BugReportInterestingnessTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/CallEventTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ConflictingEvalCallsTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ExprEngineVisitTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/MemRegionDescriptiveNameTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ObjcBug-124477.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/SValSimplifyerTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/SValTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/TestReturnValueUnderConstruction.cpp
- ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/UnsignedStatDemo.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/DiagnosticsYamlTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksBinaryOperator.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCompoundAssignOperator.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/SourceCodeBuildersTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/SourceCodeTest.cpp
- ${LLVM_REPO_DIR}/clang/unittests/Tooling/StencilTest.cpp
- TARGET_DIRECTORY AllClangUnitTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/unittests/Format/CMakeLists.txt (target: FormatTests)
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/unittests/Format/FormatTestJS.cpp
- TARGET_DIRECTORY FormatTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From clang/utils/TableGen/CMakeLists.txt (target: clang-tblgen)
-# MveEmitter.cpp and NeonEmitter.cpp define large anonymous-namespace classes
-# that conflict with each other in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/clang/utils/TableGen/NeonEmitter.cpp
- TARGET_DIRECTORY clang-tblgen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+if(TARGET clangAPINotes)
+ # From clang/lib/APINotes/CMakeLists.txt (target: clangAPINotes)
+ # Reader and Writer define identically-named classes in anonymous namespaces
+ # (IdentifierTableInfo, ContextIDTableInfo, etc.). Manager and YAMLCompiler
+ # use "using namespace api_notes" which brings api_notes::Module into scope,
+ # conflicting with clang::Module.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesReader.cpp
+ ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesWriter.cpp
+ ${LLVM_REPO_DIR}/clang/lib/APINotes/APINotesYAMLCompiler.cpp
+ TARGET_DIRECTORY clangAPINotes
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangAST)
+ # From clang/lib/AST/CMakeLists.txt (target: clangAST)
+ # CommentParser/CommentSema use "using namespace clang::comments" which
+ # conflicts with clang::tok. MicrosoftMangle and ItaniumMangle define
+ # functions with the same name that cause overload ambiguity.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/AST/CommentParser.cpp
+ ${LLVM_REPO_DIR}/clang/lib/AST/CommentSema.cpp
+ ${LLVM_REPO_DIR}/clang/lib/AST/MicrosoftMangle.cpp
+ ${LLVM_REPO_DIR}/clang/lib/AST/ItaniumMangle.cpp
+ TARGET_DIRECTORY clangAST
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangAnalysisLifetimeSafety)
+ # From clang/lib/Analysis/LifetimeSafety/CMakeLists.txt (target: clangAnalysisLifetimeSafety)
+ # Multiple files define identically-named struct Lattice and class AnalysisImpl
+ # in anonymous namespaces, causing redefinition errors in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Analysis/LifetimeSafety/MovedLoans.cpp
+ TARGET_DIRECTORY clangAnalysisLifetimeSafety
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangBasic)
+ # From clang/lib/Basic/CMakeLists.txt (target: clangBasic)
+ # Each Targets/*.cpp file defines static constexpr NumBuiltins, BuiltinInfos,
+ # and BuiltinStrings which conflict in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/AMDGPU.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/ARM.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/BPF.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/DirectX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/Hexagon.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/LoongArch.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/Mips.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/NVPTX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/PPC.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/RISCV.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/SPIR.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/SystemZ.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/VE.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/WebAssembly.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/X86.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Basic/Targets/XCore.cpp
+ TARGET_DIRECTORY clangBasic
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangCIR)
+ set_source_files_properties(
+ # From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
+ # CIRGenExprComplex.cpp references both cir::ComplexType/CastKind and
+ # clang::ComplexType/CastKind which become ambiguous in unity builds.
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenExprComplex.cpp
+ # From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
+ # CIRGenOpenACCRecipe.h has no include guards and defines classes; including it
+ # from both CIRGenOpenACCClause.cpp and CIRGenOpenACCRecipe.cpp in the same
+ # unity TU causes redefinition errors.
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenOpenACCRecipe.cpp
+ # From clang/lib/CIR/CodeGen/CMakeLists.txt (target: clangCIR)
+ # CIRGenTypes.cpp references cir::Type/RecordType which conflict with
+ # clang::Type/RecordType from other files in the unity TU.
+ ${LLVM_REPO_DIR}/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
+ TARGET_DIRECTORY clangCIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangCodeGen)
+ # From clang/lib/CodeGen/CMakeLists.txt (target: clangCodeGen)
+ # Many CodeGen files use "using namespace llvm" which brings llvm::Type,
+ # llvm::VectorType, etc. into scope, conflicting with clang:: equivalents
+ # used by other files in the same unity TU.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/BackendUtil.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGAtomic.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGBuiltin.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGCoroutine.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGExpr.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGHLSLBuiltins.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGHLSLRuntime.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGLoopInfo.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGNonTrivialStruct.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CGStmtOpenMP.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenAction.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenFunction.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenModule.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CodeGenPGO.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/CoverageMappingGen.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/LinkInModulesPass.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/QualTypeMapper.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/DirectX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/Hexagon.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/NVPTX.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/PPC.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/RISCV.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/SPIR.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/SystemZ.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/WebAssembly.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/TargetBuiltins/X86.cpp
+ ${LLVM_REPO_DIR}/clang/lib/CodeGen/Targets/AArch64.cpp
+ TARGET_DIRECTORY clangCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangExtractAPI)
+ # From clang/lib/ExtractAPI/CMakeLists.txt (target: clangExtractAPI)
+ # SymbolGraphSerializer.cpp uses "using namespace llvm" which brings types
+ # that conflict with clang::extractapi types in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
+ TARGET_DIRECTORY clangExtractAPI
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangFrontend)
+ # From clang/lib/Frontend/CMakeLists.txt (target: clangFrontend)
+ # config.h uses a #include guard that errors on double-inclusion, which
+ # breaks unity builds when multiple .cpp files include it.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/CompilerInstance.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/CompilerInvocation.cpp
+ TARGET_DIRECTORY clangFrontend
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangRewriteFrontend)
+ # From clang/lib/Frontend/Rewrite/CMakeLists.txt (target: clangRewriteFrontend)
+ # Both files include config.h which uses #error to prevent double-inclusion,
+ # breaking unity builds when they end up in the same translation unit.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Frontend/Rewrite/RewriteObjC.cpp
+ TARGET_DIRECTORY clangRewriteFrontend
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangLex)
+ # From clang/lib/Lex/CMakeLists.txt (target: clangLex)
+ # "using namespace clang::dependency_directives_scan" at file scope brings
+ # dependency_directives_scan::Token into scope, conflicting with clang::Token.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Lex/DependencyDirectivesScanner.cpp
+ TARGET_DIRECTORY clangLex
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangScalableStaticAnalysisFrameworkCore)
+ # From clang/lib/ScalableStaticAnalysisFramework/Core/CMakeLists.txt (target: clangScalableStaticAnalysisFrameworkCore)
+ # error: type alias redefinition with different types ('Registry<AnalysisBase>' vs 'Registry<SummaryDataBuilderBase>')
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/ScalableStaticAnalysisFramework/Core/WholeProgramAnalysis/AnalysisRegistry.cpp
+ TARGET_DIRECTORY clangScalableStaticAnalysisFrameworkCore
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangSema)
+ # From clang/lib/Sema/CMakeLists.txt (target: clangSema)
+ # Both files define struct PartialSpecMatchResult in anonymous namespaces
+ # with different member types, causing redefinition errors in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Sema/SemaTemplateInstantiate.cpp
+ TARGET_DIRECTORY clangSema
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangSerialization)
+ # From clang/lib/Serialization/CMakeLists.txt (target: clangSerialization)
+ # ASTWriter.cpp defines HeaderFileInfoTrait and LazySpecializationInfoLookupTrait
+ # in an anonymous namespace, conflicting with identically-named classes from
+ # ASTReaderInternals.h included by other files in this directory.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Serialization/ASTWriter.cpp
+ TARGET_DIRECTORY clangSerialization
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangTooling)
+ # From clang/lib/Tooling/CMakeLists.txt (target: clangTooling)
+ # CompilationDatabase.cpp and DependencyScanningTool.cpp reference
+ # clang::driver which becomes ambiguous when combined with other files
+ # in a unity build.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/CompilationDatabase.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/DependencyScanningTool.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/Tooling.cpp
+ TARGET_DIRECTORY clangTooling
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clangTransformer)
+ # From clang/lib/Tooling/Transformer/CMakeLists.txt (target: clangTransformer)
+ # Both files define a static getNode() helper in anonymous namespaces,
+ # causing redefinition errors in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/Transformer/Stencil.cpp
+ ${LLVM_REPO_DIR}/clang/lib/Tooling/Transformer/RangeSelector.cpp
+ TARGET_DIRECTORY clangTransformer
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+if(TARGET clang-installapi)
+ # From clang/tools/clang-installapi/CMakeLists.txt (target: clang-installapi)
+ # Options.cpp uses "using namespace llvm" which makes llvm::Value ambiguous
+ # with other types when combined in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/tools/clang-installapi/Options.cpp
+ TARGET_DIRECTORY clang-installapi
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET diagtool)
+ # From clang/tools/diagtool/CMakeLists.txt (target: diagtool)
+ # TreeView.cpp defines printUsage which conflicts with identically-named
+ # functions from other diagtool files in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/tools/diagtool/TreeView.cpp
+ TARGET_DIRECTORY diagtool
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clang)
+ # From clang/tools/driver/CMakeLists.txt (target: clang)
+ # cc1as_main.cpp and driver.cpp both define LLVMErrorHandler; cc1gen_reproducer
+ # uses "driver" which is ambiguous with clang::driver in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/tools/driver/cc1_main.cpp
+ ${LLVM_REPO_DIR}/clang/tools/driver/cc1as_main.cpp
+ ${LLVM_REPO_DIR}/clang/tools/driver/cc1gen_reproducer_main.cpp
+ TARGET_DIRECTORY clang
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET AllClangUnitTests)
+ # From clang/unittests/CMakeLists.txt (target: AllClangUnitTests)
+ # Files that clash in unity builds of AllClangUnitTests due to shared headers
+ # (ASTPrint.h, CheckerRegistration.h, CallbacksCommon.h, CFGBuildResult.h)
+ # or duplicate symbols.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/LexerTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGBackEdgesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGDominatorTree.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/CFGTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/IntervalPartitionTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/UnsafeBufferUsageTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTDumperTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTExprTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTImporterGenericRedeclTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ASTImporterODRStrategiesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/AttrTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/ConceptPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/DataCollectionTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/DeclPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/NamedDeclPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/QualTypeNamesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/SizelessTypesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/StmtPrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/TemplateNameTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/AST/TypePrinterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/CodeGen/TBAAMetadataTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Driver/ToolChainTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Interpreter/InterpreterTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/NoTrivialPPDirectiveTracerTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPConditionalDirectiveRecordTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPDependencyDirectivesTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPMemoryAllocationsTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/PPCallbacksTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Lex/ModuleDeclStateTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/ScalableStaticAnalysisFramework/Registries/MockSerializationFormat.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/BlockEntranceCallbackTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/BugReportInterestingnessTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/CallEventTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ConflictingEvalCallsTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ExprEngineVisitTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/FalsePositiveRefutationBRVisitorTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/MemRegionDescriptiveNameTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/NoStateChangeFuncVisitorTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/ObjcBug-124477.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/RegisterCustomCheckersTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/SValSimplifyerTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/SValTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/TestReturnValueUnderConstruction.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/StaticAnalyzer/UnsignedStatDemo.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/DiagnosticsYamlTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksBinaryOperator.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCallExpr.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksCompoundAssignOperator.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksLeaf.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/RecursiveASTVisitorTests/CallbacksUnaryOperator.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/SourceCodeBuildersTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/SourceCodeTest.cpp
+ ${LLVM_REPO_DIR}/clang/unittests/Tooling/StencilTest.cpp
+ TARGET_DIRECTORY AllClangUnitTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET FormatTests)
+ # From clang/unittests/Format/CMakeLists.txt (target: FormatTests)
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/unittests/Format/FormatTestJS.cpp
+ TARGET_DIRECTORY FormatTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET clang-tblgen)
+ # From clang/utils/TableGen/CMakeLists.txt (target: clang-tblgen)
+ # MveEmitter.cpp and NeonEmitter.cpp define large anonymous-namespace classes
+ # that conflict with each other in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/clang/utils/TableGen/NeonEmitter.cpp
+ TARGET_DIRECTORY clang-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
# ======================================================================
# flang
# ======================================================================
-# From flang/lib/Evaluate/CMakeLists.txt (target: FortranEvaluate)
-# fold-implementation.h contains explicit instantiation definitions; merging
-# any two of these files in a unity TU produces duplicate instantiations.
-# formatting.cpp also has explicit instantiations that duplicate those.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-character.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-complex.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-integer.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-logical.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-real.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/intrinsics-library.cpp
- ${LLVM_REPO_DIR}/flang/lib/Evaluate/formatting.cpp
- TARGET_DIRECTORY FortranEvaluate
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From flang/lib/Lower/CMakeLists.txt (target: FortranLower)
-# ConvertCall.cpp calls 'isInWhereMaskedExpression' which becomes ambiguous
-# with another overload brought in from other files in the unity TU.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/lib/Lower/ConvertCall.cpp
- TARGET_DIRECTORY FortranLower
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From flang/lib/Optimizer/Builder/CMakeLists.txt (target: FIRBuilder)
-# Execute.cpp defines a static 'isAbsent' that conflicts with another
-# definition when merged in a unity TU.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/Builder/Runtime/Execute.cpp
- TARGET_DIRECTORY FIRBuilder
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From flang/lib/Optimizer/CodeGen/CMakeLists.txt (target: FIRCodeGen)
-# FIROpPatterns.cpp and PreCGRewrite.cpp each redefine local helpers
-# (getTypeDescFieldId, DeclareOpConversion) that clash in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/CodeGen/FIROpPatterns.cpp
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
- TARGET_DIRECTORY FIRCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt (target: HLFIRTransforms)
-# ConvertToFIR.cpp redefines AssignOpConversion and NoReassocOpConversion,
-# ScheduleOrderedAssignments.cpp redefines isForallIndex, and
-# SimplifyHLFIRIntrinsics.cpp redefines CmpCharOpConversion/IndexOpConversion.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
- TARGET_DIRECTORY HLFIRTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From flang/lib/Optimizer/Transforms/CMakeLists.txt (target: FIRTransforms)
-# AnnotateConstant.cpp has 'impl' ambiguity from tablegen pass base classes.
-# LoopInvariantCodeMotion.cpp has fir::AliasAnalysis vs mlir::AliasAnalysis
-# ambiguity. CUFOpConversionLate.cpp redefines createConvertOp.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/AnnotateConstant.cpp
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/ConvertComplexPow.cpp
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/LoopInvariantCodeMotion.cpp
- ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/CUDA/CUFOpConversionLate.cpp
- TARGET_DIRECTORY FIRTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From flang/tools/f18-parse-demo/CMakeLists.txt (target: f18-parse-demo)
-# stub-evaluate.cpp uses struct/class mismatches with other TU definitions
-# that trigger -Werror,-Wmismatched-tags in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/flang/tools/f18-parse-demo/stub-evaluate.cpp
- TARGET_DIRECTORY f18-parse-demo
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+if(TARGET FortranEvaluate)
+ # From flang/lib/Evaluate/CMakeLists.txt (target: FortranEvaluate)
+ # fold-implementation.h contains explicit instantiation definitions; merging
+ # any two of these files in a unity TU produces duplicate instantiations.
+ # formatting.cpp also has explicit instantiations that duplicate those.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-character.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-complex.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-integer.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-logical.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold-real.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/fold.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/intrinsics-library.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Evaluate/formatting.cpp
+ TARGET_DIRECTORY FortranEvaluate
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET FortranLower)
+ # From flang/lib/Lower/CMakeLists.txt (target: FortranLower)
+ # ConvertCall.cpp calls 'isInWhereMaskedExpression' which becomes ambiguous
+ # with another overload brought in from other files in the unity TU.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Lower/ConvertCall.cpp
+ TARGET_DIRECTORY FortranLower
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+if(TARGET FIRBuilder)
+ # From flang/lib/Optimizer/Builder/CMakeLists.txt (target: FIRBuilder)
+ # Execute.cpp defines a static 'isAbsent' that conflicts with another
+ # definition when merged in a unity TU.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Builder/Runtime/Execute.cpp
+ TARGET_DIRECTORY FIRBuilder
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET FIRCodeGen)
+ # From flang/lib/Optimizer/CodeGen/CMakeLists.txt (target: FIRCodeGen)
+ # FIROpPatterns.cpp and PreCGRewrite.cpp each redefine local helpers
+ # (getTypeDescFieldId, DeclareOpConversion) that clash in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/CodeGen/FIROpPatterns.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
+ TARGET_DIRECTORY FIRCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET HLFIRTransforms)
+ # From flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt (target: HLFIRTransforms)
+ # ConvertToFIR.cpp redefines AssignOpConversion and NoReassocOpConversion,
+ # ScheduleOrderedAssignments.cpp redefines isForallIndex, and
+ # SimplifyHLFIRIntrinsics.cpp redefines CmpCharOpConversion/IndexOpConversion.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/HLFIR/Transforms/SimplifyHLFIRIntrinsics.cpp
+ TARGET_DIRECTORY HLFIRTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET FIRTransforms)
+ # From flang/lib/Optimizer/Transforms/CMakeLists.txt (target: FIRTransforms)
+ # AnnotateConstant.cpp has 'impl' ambiguity from tablegen pass base classes.
+ # LoopInvariantCodeMotion.cpp has fir::AliasAnalysis vs mlir::AliasAnalysis
+ # ambiguity. CUFOpConversionLate.cpp redefines createConvertOp.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/AnnotateConstant.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/ConvertComplexPow.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/LoopInvariantCodeMotion.cpp
+ ${LLVM_REPO_DIR}/flang/lib/Optimizer/Transforms/CUDA/CUFOpConversionLate.cpp
+ TARGET_DIRECTORY FIRTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET f18-parse-demo)
+ # From flang/tools/f18-parse-demo/CMakeLists.txt (target: f18-parse-demo)
+ # stub-evaluate.cpp uses struct/class mismatches with other TU definitions
+ # that trigger -Werror,-Wmismatched-tags in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/flang/tools/f18-parse-demo/stub-evaluate.cpp
+ TARGET_DIRECTORY f18-parse-demo
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
# ======================================================================
# llvm
# ======================================================================
-# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
-# STATISTIC and static function redefinitions across register allocation
-# and scheduling files conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/LiveIntervalCalc.cpp
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MachineOutliner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/PostRASchedulerList.cpp
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp
- TARGET_DIRECTORY LLVMCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
-# Conflicting STATISTIC variables and static functions with other
-# register allocation files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
- TARGET_DIRECTORY LLVMCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
-# Conflicting static cl::opt variables with other CodeGen files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/ModuloSchedule.cpp
- TARGET_DIRECTORY LLVMCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
-# Anonymous namespace struct redefinitions conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/PatchableFunction.cpp
- TARGET_DIRECTORY LLVMCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/GlobalISel/CMakeLists.txt (target: LLVMGlobalISel)
-# Conflicting static helper functions and STATISTIC variables.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
- TARGET_DIRECTORY LLVMGlobalISel
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/MIRParser/CMakeLists.txt (target: LLVMMIRParser)
-# Static functions and anonymous namespace classes conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MIRParser/MIParser.cpp
- TARGET_DIRECTORY LLVMMIRParser
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt (target: LLVMSelectionDAG)
-# STATISTIC variable redefinitions (NumBacktracks, NumUnfolds, etc.)
-# and static function conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
- TARGET_DIRECTORY LLVMSelectionDAG
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt (target: LLVMSelectionDAG)
-# Large template instantiation code and static helper conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
- TARGET_DIRECTORY LLVMSelectionDAG
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt (target: LLVMJITLink)
-# Anonymous namespace function redefinitions (buildTables_ELF_x86*).
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/JITLink/ELF_x86.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
- TARGET_DIRECTORY LLVMJITLink
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ExecutionEngine/Orc/CMakeLists.txt (target: LLVMOrcJIT)
-# Static function and class definition conflicts in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
- TARGET_DIRECTORY LLVMOrcJIT
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt (target: LLVMRuntimeDyld)
-# Static relocation helper functions (or32le, getBits, etc.) conflict.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
- TARGET_DIRECTORY LLVMRuntimeDyld
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ObjCopy/CMakeLists.txt (target: LLVMObjCopy)
-# ELF, MachO, COFF, and wasm ObjCopy implementations define identically-named
-# types (Section, Object, SectionPred) in different namespaces that conflict
-# when combined via "using namespace" in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ObjCopy/MachO/MachOReader.cpp
- TARGET_DIRECTORY LLVMObjCopy
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ObjectYAML/CMakeLists.txt (target: LLVMObjectYAML)
-# Conflicting 'using namespace' declarations (llvm::codeview,
-# llvm::CodeViewYAML) cause ambiguity.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/MinidumpEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/MinidumpYAML.cpp
- TARGET_DIRECTORY LLVMObjectYAML
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ProfileData/CMakeLists.txt (target: LLVMProfileData)
-# InstrProfReader.cpp and InstrProfWriter.cpp have ambiguous 'Summary' due
-# to namespace conflicts in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ProfileData/InstrProfReader.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ProfileData/InstrProfWriter.cpp
- ${LLVM_REPO_DIR}/llvm/lib/ProfileData/SampleProf.cpp
- TARGET_DIRECTORY LLVMProfileData
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/ProfileData/CMakeLists.txt (target: LLVMProfileData)
-# 'using namespace sampleprof' causes ambiguity with other files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/ProfileData/SampleProfReader.cpp
- TARGET_DIRECTORY LLVMProfileData
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Support/CMakeLists.txt (target: LLVMSupport)
-# error: expected unqualified-id 672 | while (const auto *IN = dyn_cast<RopePieceBTreeInterior>(N))
-# error: expected unqualified-id 511 | for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i)
-if(WIN32)
- set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Support/RewriteRope.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Support/ManagedStatic.cpp
- TARGET_DIRECTORY LLVMSupport
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-endif()
-
-# From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
-# Anonymous namespace classes and static function conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
- TARGET_DIRECTORY AArch64
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
-# Large ISel lowering file with extensive static helper conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
- TARGET_DIRECTORY AArch64
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/SMEABIPass.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
- TARGET_DIRECTORY AArch64
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/AMDGPU/CMakeLists.txt (target: AMDGPU)
-# Conflicting DAG patterns and static functions across AMDGPU files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp
- TARGET_DIRECTORY AMDGPU
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/AMDGPU/CMakeLists.txt (target: AMDGPU)
-# Generated GISel combiner code with conflicting rule symbols.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
- TARGET_DIRECTORY AMDGPU
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt (target: LLVMARMDesc)
-# Static ELF relocation helper functions conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
- TARGET_DIRECTORY LLVMARMDesc
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/Hexagon/CMakeLists.txt (target: Hexagon)
-# Static analysis functions conflict with other Hexagon pass files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp
- TARGET_DIRECTORY Hexagon
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/MSP430/CMakeLists.txt (target: MSP430)
-# Static instruction lowering helpers conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp
- TARGET_DIRECTORY MSP430
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt (target: LLVMNVPTXDesc)
-# Static table and helper function redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp
- TARGET_DIRECTORY LLVMNVPTXDesc
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
-# Static analysis functions conflict across RISCV passes.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp
- TARGET_DIRECTORY RISCV
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
-# Generated combiner code with conflicting rule symbols.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/RISCVO0PreLegalizerCombiner.cpp
- TARGET_DIRECTORY RISCV
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
-# Generated GISel combiner code with overlapping rule identifiers.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVO0PreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVPreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVPostLegalizerCombiner.cpp
- TARGET_DIRECTORY RISCV
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/SPIRV/CMakeLists.txt (target: SPIRV)
-# Conflicting intrinsic handling and static functions across SPIRV files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVRegisterInfo.cpp
- TARGET_DIRECTORY SPIRV
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt (target: LLVMSPIRVDesc)
-# Static encoding tables and helper function redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCCodeEmitter.cpp
- TARGET_DIRECTORY LLVMSPIRVDesc
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
-# Static CFG transformation functions conflict with other WebAssembly files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
- TARGET_DIRECTORY WebAssembly
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
-# Generated combiner code with conflicting rule symbols.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyPreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyPostLegalizerCombiner.cpp
- TARGET_DIRECTORY WebAssembly
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
-# Generated GISel combiner code with conflicting symbols.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/GISel/WebAssemblyPreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/GISel/WebAssemblyPostLegalizerCombiner.cpp
- TARGET_DIRECTORY WebAssembly
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
-# Large ISel lowering and static helper function conflicts across X86 files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86FastTileConfig.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86FixupVectorConstants.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86ISelLowering.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86SpeculativeExecutionSideEffectSuppression.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86WinEHState.cpp
- TARGET_DIRECTORY X86
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
-# Static instruction pattern matching and encoding table conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86CompressEVEX.cpp
- TARGET_DIRECTORY X86
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
-# Generated GISel combiner code with overlapping rule symbols.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/GISel/X86PreLegalizerCombiner.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Target/X86/GISel/X86PostLegalizerCombiner.cpp
- TARGET_DIRECTORY X86
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/XCore/CMakeLists.txt (target: XCore)
-# Static instruction information and helper function conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/XCore/XCoreInstrInfo.cpp
- TARGET_DIRECTORY XCore
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Target/XCore/CMakeLists.txt (target: XCore)
-# Static register information and allocation helper conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp
- TARGET_DIRECTORY XCore
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/Coroutines/CMakeLists.txt (target: LLVMCoroutines)
-# Anonymous namespace Lowerer classes and static coroutine helpers conflict.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Coroutines/CoroElide.cpp
- TARGET_DIRECTORY LLVMCoroutines
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/Instrumentation/CMakeLists.txt (target: LLVMInstrumentation)
-# Static instrumentation functions and 'using namespace' cause ambiguity.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
- TARGET_DIRECTORY LLVMInstrumentation
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/ObjCARC/CMakeLists.txt (target: LLVMObjCARCOpts)
-# Static optimization functions conflict with other ObjCARC files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
- TARGET_DIRECTORY LLVMObjCARCOpts
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/Scalar/CMakeLists.txt (target: LLVMScalarOpts)
-# STATISTIC variables and static analysis function redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/BDCE.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/GVNSink.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
- TARGET_DIRECTORY LLVMScalarOpts
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/Utils/CMakeLists.txt (target: LLVMTransformUtils)
-# Static lowering functions conflict with other Utils files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
- TARGET_DIRECTORY LLVMTransformUtils
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/Utils/CMakeLists.txt (target: LLVMTransformUtils)
-# Static exception handling transformation functions conflict.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Utils/LowerInvoke.cpp
- TARGET_DIRECTORY LLVMTransformUtils
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Transforms/Vectorize/CMakeLists.txt (target: LLVMVectorize)
-# VPlan files define conflicting STATISTIC variables, anonymous namespace
-# classes, and static pattern matching functions in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlan.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
- TARGET_DIRECTORY LLVMVectorize
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/dsymutil/CMakeLists.txt (target: dsymutil)
-# CFBundle.cpp includes ObjC headers that conflict with MachO headers
-# from other files in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/dsymutil/CFBundle.cpp
- ${LLVM_REPO_DIR}/llvm/tools/dsymutil/RelocationMap.cpp
- TARGET_DIRECTORY dsymutil
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/llvm-c-test/CMakeLists.txt (target: llvm-c-test)
-# calc.c and disassemble.c both define handle_line, causing
-# redefinition errors in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/calc.c
- ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/disassemble.c
- ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/diagnostic.c
- ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/module.c
- TARGET_DIRECTORY llvm-c-test
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/llvm-jitlink/CMakeLists.txt (target: llvm-jitlink)
-# ELF, MachO, and COFF jitlink files define identically-named static functions
-# (getFirstRelocationEdge, etc.) that conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
- ${LLVM_REPO_DIR}/llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
- TARGET_DIRECTORY llvm-jitlink
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/llvm-objdump/CMakeLists.txt (target: llvm-objdump)
-# MachODump.cpp defines UnwindInfo that conflicts with other dump files'
-# types when combined in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/llvm-objdump/MachODump.cpp
- TARGET_DIRECTORY llvm-objdump
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/llvm-pdbutil/CMakeLists.txt (target: llvm-pdbutil)
-# DumpOutputStyle.cpp defines printHeader which conflicts with identically-named
-# functions from other output style files in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
- TARGET_DIRECTORY llvm-pdbutil
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/llvm-readobj/CMakeLists.txt (target: llvm-readobj)
-# ELFDumper.cpp defines createError and checkHashTable that conflict with
-# identically-named functions from other dumper files in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/llvm-readobj/ELFDumper.cpp
- TARGET_DIRECTORY llvm-readobj
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/tools/llvm-reduce/CMakeLists.txt (target: llvm-reduce)
-# ReduceOperandsSkip.cpp defines shouldReduceOperand which conflicts with
-# identically-named functions from other delta files in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/tools/llvm-reduce/deltas/ReduceOperandsSkip.cpp
- TARGET_DIRECTORY llvm-reduce
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/utils/TableGen/CMakeLists.txt (target: llvm-min-tblgen)
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/AsmWriterEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/CTagsEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/CallingConvEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/CodeEmitterGen.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/CompressInstEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/DAGISelEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/DXILEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/DisassemblerEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/ExegesisEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/FastISelEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/GlobalISelEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/InstrDocsEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/OptionParserEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/OptionRSTEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/RegisterBankEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/RegisterInfoEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/SearchableTableEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/SubtargetEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86InstrMappingEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86MnemonicTables.cpp
- TARGET_DIRECTORY llvm-min-tblgen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/utils/TableGen/CMakeLists.txt (target: llvm-min-tblgen)
-# Static DFA state tables and code generation helper conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/DFAPacketizerEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/InstrInfoEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/SDNodeInfoEmitter.cpp
- TARGET_DIRECTORY llvm-min-tblgen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Bitcode/Reader/CMakeLists.txt (target: LLVMBitReader)
-# Both files define a static 'error' function that conflicts in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
- TARGET_DIRECTORY LLVMBitReader
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/DebugInfo/CodeView/CMakeLists.txt (target: LLVMDebugInfoCodeView)
-# These files define static functions/arrays with identical names (stabilize,
-# LeafTypeNames, getLeafTypeName) that conflict in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/AppendingTypeTableBuilder.cpp
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
- TARGET_DIRECTORY LLVMDebugInfoCodeView
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/DebugInfo/GSYM/CMakeLists.txt (target: LLVMDebugInfoGSYM)
-# FunctionInfo.cpp defines an enum value 'InlineInfo' that conflicts with
-# the struct InlineInfo in InlineInfo.cpp in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
- ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp
- TARGET_DIRECTORY LLVMDebugInfoGSYM
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Demangle/CMakeLists.txt (target: LLVMDemangle)
-# These demangler files each define classes/type aliases named 'Demangler' and
-# use "using namespace" directives that bring conflicting symbols (Node,
-# Qualifiers, etc.) into scope from different namespaces, which cannot coexist
-# in a single translation unit.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Demangle/ItaniumDemangle.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Demangle/MicrosoftDemangle.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Demangle/RustDemangle.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Demangle/DLangDemangle.cpp
- TARGET_DIRECTORY LLVMDemangle
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Frontend/HLSL/CMakeLists.txt (target: LLVMFrontendHLSL)
-# RootSignatureMetadata.cpp redefines 'OverloadedVisit' from
-# HLSLRootSignature.cpp in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Frontend/HLSL/HLSLRootSignature.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Frontend/HLSL/RootSignatureMetadata.cpp
- TARGET_DIRECTORY LLVMFrontendHLSL
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/MC/CMakeLists.txt (target: LLVMMC)
-# These object writer files each define 'isDwoSection' in anonymous namespaces,
-# which conflicts in unity builds. MCAsmInfoELF/Wasm both define 'printName'.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/MC/ELFObjectWriter.cpp
- ${LLVM_REPO_DIR}/llvm/lib/MC/MCAsmInfoELF.cpp
- ${LLVM_REPO_DIR}/llvm/lib/MC/MCAsmInfoWasm.cpp
- ${LLVM_REPO_DIR}/llvm/lib/MC/WasmObjectWriter.cpp
- ${LLVM_REPO_DIR}/llvm/lib/MC/WinCOFFObjectWriter.cpp
- TARGET_DIRECTORY LLVMMC
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/Object/CMakeLists.txt (target: LLVMObject)
-# MachOUniversal.cpp/MachOObjectFile.cpp: ambiguous 'malformedError'
-# ModuleSymbolTable.cpp: 'Module' conflicts with llvm::minidump::Module
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/Object/MachOObjectFile.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Object/MachOUniversal.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Object/ModuleSymbolTable.cpp
- ${LLVM_REPO_DIR}/llvm/lib/Object/OffloadBinary.cpp
- TARGET_DIRECTORY LLVMObject
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/TargetParser/CMakeLists.txt (target: LLVMTargetParser)
-# Unity build conflicts:
-# - CSKYTargetParser.cpp: redefines 'stripNegationPrefix' from ARMTargetParser
-# - X86TargetParser.cpp: 'FeatureBitset' ambiguous due to namespace conflicts
-# - RISCVTargetParser.cpp: incomplete type 'CPUInfo[]' due to include ordering
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/TargetParser/CSKYTargetParser.cpp
- ${LLVM_REPO_DIR}/llvm/lib/TargetParser/RISCVTargetParser.cpp
- ${LLVM_REPO_DIR}/llvm/lib/TargetParser/X86TargetParser.cpp
- TARGET_DIRECTORY LLVMTargetParser
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/lib/TextAPI/CMakeLists.txt (target: LLVMTextAPI)
-# RecordsSlice.cpp has ambiguous 'Target' due to namespace conflicts in
-# unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/lib/TextAPI/RecordsSlice.cpp
- TARGET_DIRECTORY LLVMTextAPI
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From llvm/utils/TableGen/Basic/CMakeLists.txt (target: LLVMTableGenBasic)
-# These emitter files each define a static TableGen::Emitter::Opt[Class]
-# variable named 'X' (and sometimes 'Y') at file scope for self-registration,
-# which conflicts in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/Attributes.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/TargetFeaturesEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp
- ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/VTEmitter.cpp
- TARGET_DIRECTORY LLVMTableGenBasic
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+if(TARGET LLVMCodeGen)
+ set_source_files_properties(
+ # From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+ # STATISTIC and static function redefinitions across register allocation
+ # and scheduling files conflict in unity builds.
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/LiveIntervalCalc.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MachineOutliner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/PostRASchedulerList.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp
+ # From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+ # Conflicting STATISTIC variables and static functions with other
+ # register allocation files.
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp
+ # From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+ # Conflicting static cl::opt variables with other CodeGen files.
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/ModuloSchedule.cpp
+ # From llvm/lib/CodeGen/CMakeLists.txt (target: LLVMCodeGen)
+ # Anonymous namespace struct redefinitions conflict in unity builds.
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/PatchableFunction.cpp
+ TARGET_DIRECTORY LLVMCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMGlobalISel)
+ # From llvm/lib/CodeGen/GlobalISel/CMakeLists.txt (target: LLVMGlobalISel)
+ # Conflicting static helper functions and STATISTIC variables.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp
+ TARGET_DIRECTORY LLVMGlobalISel
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMMIRParser)
+ # From llvm/lib/CodeGen/MIRParser/CMakeLists.txt (target: LLVMMIRParser)
+ # Static functions and anonymous namespace classes conflict in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+ TARGET_DIRECTORY LLVMMIRParser
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMSelectionDAG)
+ set_source_files_properties(
+ # From llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt (target: LLVMSelectionDAG)
+ # STATISTIC variable redefinitions (NumBacktracks, NumUnfolds, etc.)
+ # and static function conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+ # From llvm/lib/CodeGen/SelectionDAG/CMakeLists.txt (target: LLVMSelectionDAG)
+ # Large template instantiation code and static helper conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+ TARGET_DIRECTORY LLVMSelectionDAG
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMJITLink)
+ # From llvm/lib/ExecutionEngine/JITLink/CMakeLists.txt (target: LLVMJITLink)
+ # Anonymous namespace function redefinitions (buildTables_ELF_x86*).
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/JITLink/ELF_x86.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp
+ TARGET_DIRECTORY LLVMJITLink
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMOrcJIT)
+ # From llvm/lib/ExecutionEngine/Orc/CMakeLists.txt (target: LLVMOrcJIT)
+ # Static function and class definition conflicts in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp
+ TARGET_DIRECTORY LLVMOrcJIT
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMRuntimeDyld)
+ # From llvm/lib/ExecutionEngine/RuntimeDyld/CMakeLists.txt (target: LLVMRuntimeDyld)
+ # Static relocation helper functions (or32le, getBits, etc.) conflict.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
+ TARGET_DIRECTORY LLVMRuntimeDyld
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMObjCopy)
+ # From llvm/lib/ObjCopy/CMakeLists.txt (target: LLVMObjCopy)
+ # ELF, MachO, COFF, and wasm ObjCopy implementations define identically-named
+ # types (Section, Object, SectionPred) in different namespaces that conflict
+ # when combined via "using namespace" in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ObjCopy/MachO/MachOObjcopy.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ObjCopy/MachO/MachOReader.cpp
+ TARGET_DIRECTORY LLVMObjCopy
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMObjectYAML)
+ # From llvm/lib/ObjectYAML/CMakeLists.txt (target: LLVMObjectYAML)
+ # Conflicting 'using namespace' declarations (llvm::codeview,
+ # llvm::CodeViewYAML) cause ambiguity.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/CodeViewYAMLTypes.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/MinidumpEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ObjectYAML/MinidumpYAML.cpp
+ TARGET_DIRECTORY LLVMObjectYAML
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMProfileData)
+ set_source_files_properties(
+ # From llvm/lib/ProfileData/CMakeLists.txt (target: LLVMProfileData)
+ # InstrProfReader.cpp and InstrProfWriter.cpp have ambiguous 'Summary' due
+ # to namespace conflicts in unity builds.
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/InstrProfReader.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/InstrProfWriter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/SampleProf.cpp
+ # From llvm/lib/ProfileData/CMakeLists.txt (target: LLVMProfileData)
+ # 'using namespace sampleprof' causes ambiguity with other files.
+ ${LLVM_REPO_DIR}/llvm/lib/ProfileData/SampleProfReader.cpp
+ TARGET_DIRECTORY LLVMProfileData
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMSupport)
+ # From llvm/lib/Support/CMakeLists.txt (target: LLVMSupport)
+ # error: expected unqualified-id 672 | while (const auto *IN = dyn_cast<RopePieceBTreeInterior>(N))
+ # error: expected unqualified-id 511 | for (unsigned i = 0, e = std::min(ThisWords, RHSWords); i != e; ++i)
+ if(WIN32)
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Support/RewriteRope.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Support/ManagedStatic.cpp
+ TARGET_DIRECTORY LLVMSupport
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+ endif()
+endif()
+
+if(TARGET AArch64)
+ set_source_files_properties(
+ # From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
+ # Anonymous namespace classes and static function conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp
+ # From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
+ # Large ISel lowering file with extensive static helper conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+ # From llvm/lib/Target/AArch64/CMakeLists.txt (target: AArch64)
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/SMEABIPass.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp
+ TARGET_DIRECTORY AArch64
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET AMDGPU)
+ set_source_files_properties(
+ # From llvm/lib/Target/AMDGPU/CMakeLists.txt (target: AMDGPU)
+ # Conflicting DAG patterns and static functions across AMDGPU files.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUSwLowerLDS.cpp
+ # From llvm/lib/Target/AMDGPU/CMakeLists.txt (target: AMDGPU)
+ # Generated GISel combiner code with conflicting rule symbols.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUPostLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPUPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+ TARGET_DIRECTORY AMDGPU
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMARMDesc)
+ # From llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt (target: LLVMARMDesc)
+ # Static ELF relocation helper functions conflict in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
+ TARGET_DIRECTORY LLVMARMDesc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET Hexagon)
+ # From llvm/lib/Target/Hexagon/CMakeLists.txt (target: Hexagon)
+ # Static analysis functions conflict with other Hexagon pass files.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp
+ TARGET_DIRECTORY Hexagon
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MSP430)
+ # From llvm/lib/Target/MSP430/CMakeLists.txt (target: MSP430)
+ # Static instruction lowering helpers conflict in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp
+ TARGET_DIRECTORY MSP430
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMNVPTXDesc)
+ # From llvm/lib/Target/NVPTX/MCTargetDesc/CMakeLists.txt (target: LLVMNVPTXDesc)
+ # Static table and helper function redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp
+ TARGET_DIRECTORY LLVMNVPTXDesc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET RISCV)
+ set_source_files_properties(
+ # From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
+ # Static analysis functions conflict across RISCV passes.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/RISCVInsertWriteVXRM.cpp
+ # From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
+ # Generated combiner code with conflicting rule symbols.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/RISCVO0PreLegalizerCombiner.cpp
+ # From llvm/lib/Target/RISCV/CMakeLists.txt (target: RISCV)
+ # Generated GISel combiner code with overlapping rule identifiers.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVO0PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/RISCV/GISel/RISCVPostLegalizerCombiner.cpp
+ TARGET_DIRECTORY RISCV
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET SPIRV)
+ # From llvm/lib/Target/SPIRV/CMakeLists.txt (target: SPIRV)
+ # Conflicting intrinsic handling and static functions across SPIRV files.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/SPIRVRegisterInfo.cpp
+ TARGET_DIRECTORY SPIRV
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMSPIRVDesc)
+ # From llvm/lib/Target/SPIRV/MCTargetDesc/CMakeLists.txt (target: LLVMSPIRVDesc)
+ # Static encoding tables and helper function redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVMCCodeEmitter.cpp
+ TARGET_DIRECTORY LLVMSPIRVDesc
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET WebAssembly)
+ set_source_files_properties(
+ # From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
+ # Static CFG transformation functions conflict with other WebAssembly files.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
+ # From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
+ # Generated combiner code with conflicting rule symbols.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/WebAssemblyPostLegalizerCombiner.cpp
+ # From llvm/lib/Target/WebAssembly/CMakeLists.txt (target: WebAssembly)
+ # Generated GISel combiner code with conflicting symbols.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/GISel/WebAssemblyPreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/WebAssembly/GISel/WebAssemblyPostLegalizerCombiner.cpp
+ TARGET_DIRECTORY WebAssembly
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET X86)
+ set_source_files_properties(
+ # From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
+ # Large ISel lowering and static helper function conflicts across X86 files.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86FastTileConfig.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86FixupVectorConstants.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86ISelLowering.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86SpeculativeExecutionSideEffectSuppression.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86WinEHState.cpp
+ # From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
+ # Static instruction pattern matching and encoding table conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/X86CompressEVEX.cpp
+ # From llvm/lib/Target/X86/CMakeLists.txt (target: X86)
+ # Generated GISel combiner code with overlapping rule symbols.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/GISel/X86PreLegalizerCombiner.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Target/X86/GISel/X86PostLegalizerCombiner.cpp
+ TARGET_DIRECTORY X86
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET XCore)
+ set_source_files_properties(
+ # From llvm/lib/Target/XCore/CMakeLists.txt (target: XCore)
+ # Static instruction information and helper function conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/XCore/XCoreInstrInfo.cpp
+ # From llvm/lib/Target/XCore/CMakeLists.txt (target: XCore)
+ # Static register information and allocation helper conflicts.
+ ${LLVM_REPO_DIR}/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp
+ TARGET_DIRECTORY XCore
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMCoroutines)
+ # From llvm/lib/Transforms/Coroutines/CMakeLists.txt (target: LLVMCoroutines)
+ # Anonymous namespace Lowerer classes and static coroutine helpers conflict.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Coroutines/CoroEarly.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Coroutines/CoroElide.cpp
+ TARGET_DIRECTORY LLVMCoroutines
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMInstrumentation)
+ # From llvm/lib/Transforms/Instrumentation/CMakeLists.txt (target: LLVMInstrumentation)
+ # Static instrumentation functions and 'using namespace' cause ambiguity.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+ TARGET_DIRECTORY LLVMInstrumentation
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMObjCARCOpts)
+ # From llvm/lib/Transforms/ObjCARC/CMakeLists.txt (target: LLVMObjCARCOpts)
+ # Static optimization functions conflict with other ObjCARC files.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp
+ TARGET_DIRECTORY LLVMObjCARCOpts
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMScalarOpts)
+ # From llvm/lib/Transforms/Scalar/CMakeLists.txt (target: LLVMScalarOpts)
+ # STATISTIC variables and static analysis function redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/BDCE.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/GVNSink.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+ TARGET_DIRECTORY LLVMScalarOpts
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMTransformUtils)
+ set_source_files_properties(
+ # From llvm/lib/Transforms/Utils/CMakeLists.txt (target: LLVMTransformUtils)
+ # Static lowering functions conflict with other Utils files.
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp
+ # From llvm/lib/Transforms/Utils/CMakeLists.txt (target: LLVMTransformUtils)
+ # Static exception handling transformation functions conflict.
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Utils/LowerInvoke.cpp
+ TARGET_DIRECTORY LLVMTransformUtils
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMVectorize)
+ # From llvm/lib/Transforms/Vectorize/CMakeLists.txt (target: LLVMVectorize)
+ # VPlan files define conflicting STATISTIC variables, anonymous namespace
+ # classes, and static pattern matching functions in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlan.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp
+ TARGET_DIRECTORY LLVMVectorize
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET dsymutil)
+ # From llvm/tools/dsymutil/CMakeLists.txt (target: dsymutil)
+ # CFBundle.cpp includes ObjC headers that conflict with MachO headers
+ # from other files in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/dsymutil/CFBundle.cpp
+ ${LLVM_REPO_DIR}/llvm/tools/dsymutil/RelocationMap.cpp
+ TARGET_DIRECTORY dsymutil
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-c-test)
+ # From llvm/tools/llvm-c-test/CMakeLists.txt (target: llvm-c-test)
+ # calc.c and disassemble.c both define handle_line, causing
+ # redefinition errors in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/calc.c
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/disassemble.c
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/diagnostic.c
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-c-test/module.c
+ TARGET_DIRECTORY llvm-c-test
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-jitlink)
+ # From llvm/tools/llvm-jitlink/CMakeLists.txt (target: llvm-jitlink)
+ # ELF, MachO, and COFF jitlink files define identically-named static functions
+ # (getFirstRelocationEdge, etc.) that conflict in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-jitlink/llvm-jitlink-elf.cpp
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-jitlink/llvm-jitlink-macho.cpp
+ TARGET_DIRECTORY llvm-jitlink
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-objdump)
+ # From llvm/tools/llvm-objdump/CMakeLists.txt (target: llvm-objdump)
+ # MachODump.cpp defines UnwindInfo that conflicts with other dump files'
+ # types when combined in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-objdump/MachODump.cpp
+ TARGET_DIRECTORY llvm-objdump
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-pdbutil)
+ # From llvm/tools/llvm-pdbutil/CMakeLists.txt (target: llvm-pdbutil)
+ # DumpOutputStyle.cpp defines printHeader which conflicts with identically-named
+ # functions from other output style files in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp
+ TARGET_DIRECTORY llvm-pdbutil
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-readobj)
+ # From llvm/tools/llvm-readobj/CMakeLists.txt (target: llvm-readobj)
+ # ELFDumper.cpp defines createError and checkHashTable that conflict with
+ # identically-named functions from other dumper files in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-readobj/ELFDumper.cpp
+ TARGET_DIRECTORY llvm-readobj
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-reduce)
+ # From llvm/tools/llvm-reduce/CMakeLists.txt (target: llvm-reduce)
+ # ReduceOperandsSkip.cpp defines shouldReduceOperand which conflicts with
+ # identically-named functions from other delta files in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/tools/llvm-reduce/deltas/ReduceOperandsSkip.cpp
+ TARGET_DIRECTORY llvm-reduce
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET llvm-min-tblgen)
+ set_source_files_properties(
+ # From llvm/utils/TableGen/CMakeLists.txt (target: llvm-min-tblgen)
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/AsmWriterEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CTagsEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CallingConvEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CodeEmitterGen.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/CompressInstEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DAGISelEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DXILEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DisassemblerEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/ExegesisEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/FastISelEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/GlobalISelCombinerEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/GlobalISelEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/InstrDocsEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/MacroFusionPredicatorEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/OptionParserEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/OptionRSTEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/PseudoLoweringEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/RegisterBankEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/SearchableTableEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/SubtargetEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86InstrMappingEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/X86MnemonicTables.cpp
+ # From llvm/utils/TableGen/CMakeLists.txt (target: llvm-min-tblgen)
+ # Static DFA state tables and code generation helper conflicts.
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/DFAPacketizerEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/InstrInfoEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/SDNodeInfoEmitter.cpp
+ TARGET_DIRECTORY llvm-min-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMBitReader)
+ # From llvm/lib/Bitcode/Reader/CMakeLists.txt (target: LLVMBitReader)
+ # Both files define a static 'error' function that conflicts in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Bitcode/Reader/MetadataLoader.cpp
+ TARGET_DIRECTORY LLVMBitReader
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMDebugInfoCodeView)
+ # From llvm/lib/DebugInfo/CodeView/CMakeLists.txt (target: LLVMDebugInfoCodeView)
+ # These files define static functions/arrays with identical names (stabilize,
+ # LeafTypeNames, getLeafTypeName) that conflict in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/AppendingTypeTableBuilder.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/MergingTypeTableBuilder.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/TypeDumpVisitor.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp
+ TARGET_DIRECTORY LLVMDebugInfoCodeView
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMDebugInfoGSYM)
+ # From llvm/lib/DebugInfo/GSYM/CMakeLists.txt (target: LLVMDebugInfoGSYM)
+ # FunctionInfo.cpp defines an enum value 'InlineInfo' that conflicts with
+ # the struct InlineInfo in InlineInfo.cpp in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/GSYM/FunctionInfo.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/DebugInfo/GSYM/InlineInfo.cpp
+ TARGET_DIRECTORY LLVMDebugInfoGSYM
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMDemangle)
+ # From llvm/lib/Demangle/CMakeLists.txt (target: LLVMDemangle)
+ # These demangler files each define classes/type aliases named 'Demangler' and
+ # use "using namespace" directives that bring conflicting symbols (Node,
+ # Qualifiers, etc.) into scope from different namespaces, which cannot coexist
+ # in a single translation unit.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/ItaniumDemangle.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/MicrosoftDemangle.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/RustDemangle.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Demangle/DLangDemangle.cpp
+ TARGET_DIRECTORY LLVMDemangle
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMFrontendHLSL)
+ # From llvm/lib/Frontend/HLSL/CMakeLists.txt (target: LLVMFrontendHLSL)
+ # RootSignatureMetadata.cpp redefines 'OverloadedVisit' from
+ # HLSLRootSignature.cpp in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Frontend/HLSL/HLSLRootSignature.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Frontend/HLSL/RootSignatureMetadata.cpp
+ TARGET_DIRECTORY LLVMFrontendHLSL
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMMC)
+ # From llvm/lib/MC/CMakeLists.txt (target: LLVMMC)
+ # These object writer files each define 'isDwoSection' in anonymous namespaces,
+ # which conflicts in unity builds. MCAsmInfoELF/Wasm both define 'printName'.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/MC/ELFObjectWriter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/MCAsmInfoELF.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/MCAsmInfoWasm.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/WasmObjectWriter.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/MC/WinCOFFObjectWriter.cpp
+ TARGET_DIRECTORY LLVMMC
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMObject)
+ # From llvm/lib/Object/CMakeLists.txt (target: LLVMObject)
+ # MachOUniversal.cpp/MachOObjectFile.cpp: ambiguous 'malformedError'
+ # ModuleSymbolTable.cpp: 'Module' conflicts with llvm::minidump::Module
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/Object/MachOObjectFile.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Object/MachOUniversal.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Object/ModuleSymbolTable.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/Object/OffloadBinary.cpp
+ TARGET_DIRECTORY LLVMObject
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMTargetParser)
+ # From llvm/lib/TargetParser/CMakeLists.txt (target: LLVMTargetParser)
+ # Unity build conflicts:
+ # - CSKYTargetParser.cpp: redefines 'stripNegationPrefix' from ARMTargetParser
+ # - X86TargetParser.cpp: 'FeatureBitset' ambiguous due to namespace conflicts
+ # - RISCVTargetParser.cpp: incomplete type 'CPUInfo[]' due to include ordering
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/TargetParser/CSKYTargetParser.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/TargetParser/RISCVTargetParser.cpp
+ ${LLVM_REPO_DIR}/llvm/lib/TargetParser/X86TargetParser.cpp
+ TARGET_DIRECTORY LLVMTargetParser
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET LLVMTextAPI)
+ # From llvm/lib/TextAPI/CMakeLists.txt (target: LLVMTextAPI)
+ # RecordsSlice.cpp has ambiguous 'Target' due to namespace conflicts in
+ # unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/lib/TextAPI/RecordsSlice.cpp
+ TARGET_DIRECTORY LLVMTextAPI
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+if(TARGET LLVMTableGenBasic)
+ # From llvm/utils/TableGen/Basic/CMakeLists.txt (target: LLVMTableGenBasic)
+ # These emitter files each define a static TableGen::Emitter::Opt[Class]
+ # variable named 'X' (and sometimes 'Y') at file scope for self-registration,
+ # which conflicts in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/ARMTargetDefEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/Attributes.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/DirectiveEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/IntrinsicEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/RISCVTargetDefEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/TargetFeaturesEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/TargetLibraryInfoEmitter.cpp
+ ${LLVM_REPO_DIR}/llvm/utils/TableGen/Basic/VTEmitter.cpp
+ TARGET_DIRECTORY LLVMTableGenBasic
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
# ======================================================================
# mlir
# ======================================================================
-# From mlir/examples/toy/Ch3/CMakeLists.txt (target: toyc-ch3)
-# mlir/ToyCombine.cpp references toy:: names that become ambiguous when
-# combined with other mlir/ files in a unity translation unit.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
- TARGET_DIRECTORY toyc-ch3
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Conversion/SCFToGPU/CMakeLists.txt (target: MLIRSCFToGPU)
-# Conversion patterns and static helpers conflict via 'using namespace mlir'.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp
- TARGET_DIRECTORY MLIRSCFToGPU
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Debug/CMakeLists.txt (target: MLIRDebug)
-# Static hook registration and context handling code conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Debug/DebuggerExecutionContextHook.cpp
- TARGET_DIRECTORY MLIRDebug
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt (target: MLIRAffineTransforms)
-# Anonymous namespace struct redefinitions (LowerDelinearizeIndexOps, etc.).
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Affine/Transforms/AffineExpandIndexOpsAsAffine.cpp
- TARGET_DIRECTORY MLIRAffineTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt (target: MLIRArithTransforms)
-# Static interface implementations conflict via 'using namespace mlir'.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.cpp
- TARGET_DIRECTORY MLIRArithTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt (target: MLIRBufferizationTransforms)
-# Conflicting analysis pattern definitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
- TARGET_DIRECTORY MLIRBufferizationTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt (target: MLIRLinalgTransforms)
-# Anonymous namespace pattern rewriter struct redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp
- TARGET_DIRECTORY MLIRLinalgTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt (target: MLIRMemRefTransforms)
-# Static type emulation pattern and helper function conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
- TARGET_DIRECTORY MLIRMemRefTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt (target: MLIROpenACCDialect)
-# Static code generation and type conversion function conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/OpenACC/IR/OpenACCCG.cpp
- TARGET_DIRECTORY MLIROpenACCDialect
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/Ptr/IR/CMakeLists.txt (target: MLIRPtrDialect)
-# Static pointer type handling conflicts via 'using namespace mlir'.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Ptr/IR/PtrTypes.cpp
- TARGET_DIRECTORY MLIRPtrDialect
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt (target: MLIRSparseTensorTransforms)
-# Conflicting sparse tensor analysis and lowering pattern definitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
- TARGET_DIRECTORY MLIRSparseTensorTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt (target: MLIRVectorTransforms)
-# Anonymous namespace rewrite pattern redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp
- TARGET_DIRECTORY MLIRVectorTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt (target: MLIRPDLLCodeGen)
-# Static PDLL code generation helpers and symbol registration conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
- TARGET_DIRECTORY MLIRPDLLCodeGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt (target: MLIRLspServerLib)
-# Static LSP protocol handler and request processing conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
- TARGET_DIRECTORY MLIRLspServerLib
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt (target: TableGenLspServerLib)
-# Static TableGen LSP handler conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
- TARGET_DIRECTORY TableGenLspServerLib
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Transforms/Utils/CMakeLists.txt (target: MLIRTransformUtils)
-# Anonymous namespace debugging infrastructure and static helper conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
- TARGET_DIRECTORY MLIRTransformUtils
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Analysis/CMakeLists.txt (target: MLIRTestAnalysis)
-# Static test infrastructure redefinitions across analysis test files.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/TestSlice.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDeadCodeAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDenseBackwardDataFlowAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDenseForwardDataFlowAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestSparseBackwardDataFlowAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestStridedMetadataRangeAnalysis.cpp
- TARGET_DIRECTORY MLIRTestAnalysis
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt (target: MLIRTestFuncToLLVM)
-# Static test pass and conversion pattern conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Conversion/FuncToLLVM/TestConvertFuncOp.cpp
- TARGET_DIRECTORY MLIRTestFuncToLLVM
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
-# Static vectorization test utility conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
- TARGET_DIRECTORY MLIRAffineTransformsTestPasses
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
-# Static value bound analysis test infrastructure conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestReifyValueBounds.cpp
- TARGET_DIRECTORY MLIRAffineTransformsTestPasses
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
-# Static analysis test harness redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestAccessAnalysis.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestDecomposeAffineOps.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp
- TARGET_DIRECTORY MLIRAffineTransformsTestPasses
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/Bufferization/CMakeLists.txt (target: MLIRBufferizationTestPasses)
-# Static test pattern implementation conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Bufferization/TestTensorLikeAndBufferLike.cpp
- TARGET_DIRECTORY MLIRBufferizationTestPasses
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/SCF/CMakeLists.txt (target: MLIRSCFTestPasses)
-# Static loop unrolling test pattern conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/SCF/TestParallelLoopUnrolling.cpp
- TARGET_DIRECTORY MLIRSCFTestPasses
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/Transform/CMakeLists.txt (target: MLIRTestTransformDialect)
-# Conflicting static test interpreter definitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Transform/TestTransformDialectInterpreter.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.cpp
- TARGET_DIRECTORY MLIRTestTransformDialect
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
-# Static dominance analysis test infrastructure conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestDominance.cpp
- TARGET_DIRECTORY MLIRTestIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBuiltinAttributeInterfaces.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBuiltinDistinctAttributes.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBytecodeRoundtrip.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestClone.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestLazyLoading.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestRegions.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestSideEffects.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestSymbolUses.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestTypes.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestVisitorsGeneric.cpp
- TARGET_DIRECTORY MLIRTestIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
-# Static interface testing utility conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestInterfaces.cpp
- TARGET_DIRECTORY MLIRTestIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Pass/CMakeLists.txt (target: MLIRTestPass)
-# Static pass management test code conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Pass/TestPassManager.cpp
- TARGET_DIRECTORY MLIRTestPass
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Transforms/CMakeLists.txt (target: MLIRTestTransforms)
-# Static transform test utility redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestCommutativityUtils.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestDialectConversion.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestInlining.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestInliningCallback.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestMakeIsolatedFromAbove.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestTransformDialectExtension.cpp
- TARGET_DIRECTORY MLIRTestTransforms
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/unittests/Pass/CMakeLists.txt (target: MLIRPassTests)
-# Static pass management unit test infrastructure conflicts.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/unittests/Pass/PassManagerTest.cpp
- TARGET_DIRECTORY MLIRPassTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Conversion/LLVMCommon/CMakeLists.txt (target: MLIRLLVMCommonConversion)
-# 'using namespace mlir' causes Type and other core type ambiguity.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Conversion/LLVMCommon/StructBuilder.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
- TARGET_DIRECTORY MLIRLLVMCommonConversion
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt (target: MLIRShapeToStandard)
-# Conflicting pattern rewriters and helper function redefinitions.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp
- TARGET_DIRECTORY MLIRShapeToStandard
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt (target: MLIRSPIRVDialect)
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/ArmGraphOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/AtomicOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/CastOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/ControlFlowOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/CooperativeMatrixOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/DotProductOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/GroupOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/MemoryOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVGLCanonicalization.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVOpDefinition.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
- ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVParsingUtils.cpp
- TARGET_DIRECTORY MLIRSPIRVDialect
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/IR/CMakeLists.txt (target: MLIRIR)
-# SymbolTable.cpp has ambiguous 'function_ref', 'SetVector', 'detail', 'impl'
-# due to 'using namespace llvm;' from other files in the unity batch.
-# Types.cpp has ambiguous 'Type' (mlir::Type vs llvm::Type).
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/IR/SymbolTable.cpp
- ${LLVM_REPO_DIR}/mlir/lib/IR/TypeRange.cpp
- ${LLVM_REPO_DIR}/mlir/lib/IR/TypeUtilities.cpp
- ${LLVM_REPO_DIR}/mlir/lib/IR/Types.cpp
- TARGET_DIRECTORY MLIRIR
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/lib/TableGen/CMakeLists.txt (target: MLIRTableGen)
-# CodeGenHelpers.cpp has "using namespace llvm;" which makes DenseMapInfo
-# ambiguous in Constraint.cpp's DenseMapInfo<Constraint> implementations
-# when compiled together in a unity build.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/lib/TableGen/Constraint.cpp
- TARGET_DIRECTORY MLIRTableGen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/test/lib/Dialect/Test/CMakeLists.txt (target: MLIRTestDialect)
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestAttributes.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestDialect.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestInterfaces.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOps.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestPatterns.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestTraits.cpp
- ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestTypes.cpp
- TARGET_DIRECTORY MLIRTestDialect
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/tools/mlir-tblgen/CMakeLists.txt (target: mlir-tblgen)
-# Unity build conflicts:
-# - BytecodeDialectGen.cpp/DialectGen.cpp: both define static 'dialectGenCat'
-# - PassGen.cpp/PassCAPIGen.cpp: both define 'passGenCat', 'groupName',
-# 'passGroupRegistrationCode', 'fileHeader'
-# - SPIRVUtilsGen.cpp/TosaUtilsGen.cpp: both define 'Availability' class and
-# related functions in anonymous namespaces
-# - LLVMIRIntrinsicGen.cpp, OpDocGen.cpp, OpPythonBindingGen.cpp, RewriterGen.cpp:
-# 'using namespace llvm;' from other files makes DenseMap, Type, StringSwitch,
-# SetVector ambiguous with mlir::tblgen equivalents
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/BytecodeDialectGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/DialectGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpDocGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpFormatGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/PassCAPIGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/PassGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/RewriterGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
- ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/TosaUtilsGen.cpp
- TARGET_DIRECTORY mlir-tblgen
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/unittests/ExecutionEngine/CMakeLists.txt (target: MLIRExecutionEngineTests)
-# These files include CRunnerUtils.h/RunnerUtils.h which defines
-# UnrankedMemRefType that conflicts with mlir::UnrankedMemRefType in unity builds.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/DynamicMemRef.cpp
- ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/StridedMemRef.cpp
- ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/Invoke.cpp
- TARGET_DIRECTORY MLIRExecutionEngineTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
-# From mlir/unittests/IR/CMakeLists.txt (target: MLIRIRTests)
-# Static test helper function redefinitions across unit tests.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/mlir/unittests/IR/AffineMapTest.cpp
- ${LLVM_REPO_DIR}/mlir/unittests/IR/OpPropertiesTest.cpp
- ${LLVM_REPO_DIR}/mlir/unittests/IR/TypeAttrNamesTest.cpp
- ${LLVM_REPO_DIR}/mlir/unittests/IR/ValueTest.cpp
- TARGET_DIRECTORY MLIRIRTests
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+if(TARGET toyc-ch3)
+ # From mlir/examples/toy/Ch3/CMakeLists.txt (target: toyc-ch3)
+ # mlir/ToyCombine.cpp references toy:: names that become ambiguous when
+ # combined with other mlir/ files in a unity translation unit.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/examples/toy/Ch3/mlir/ToyCombine.cpp
+ TARGET_DIRECTORY toyc-ch3
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRSCFToGPU)
+ # From mlir/lib/Conversion/SCFToGPU/CMakeLists.txt (target: MLIRSCFToGPU)
+ # Conversion patterns and static helpers conflict via 'using namespace mlir'.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/SCFToGPU/SCFToGPUPass.cpp
+ TARGET_DIRECTORY MLIRSCFToGPU
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRDebug)
+ # From mlir/lib/Debug/CMakeLists.txt (target: MLIRDebug)
+ # Static hook registration and context handling code conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Debug/DebuggerExecutionContextHook.cpp
+ TARGET_DIRECTORY MLIRDebug
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRAffineTransforms)
+ # From mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt (target: MLIRAffineTransforms)
+ # Anonymous namespace struct redefinitions (LowerDelinearizeIndexOps, etc.).
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Affine/Transforms/AffineExpandIndexOpsAsAffine.cpp
+ TARGET_DIRECTORY MLIRAffineTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRArithTransforms)
+ # From mlir/lib/Dialect/Arith/Transforms/CMakeLists.txt (target: MLIRArithTransforms)
+ # Static interface implementations conflict via 'using namespace mlir'.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Arith/Transforms/BufferizableOpInterfaceImpl.cpp
+ TARGET_DIRECTORY MLIRArithTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRBufferizationTransforms)
+ # From mlir/lib/Dialect/Bufferization/Transforms/CMakeLists.txt (target: MLIRBufferizationTransforms)
+ # Conflicting analysis pattern definitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp
+ TARGET_DIRECTORY MLIRBufferizationTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRLinalgTransforms)
+ # From mlir/lib/Dialect/Linalg/Transforms/CMakeLists.txt (target: MLIRLinalgTransforms)
+ # Anonymous namespace pattern rewriter struct redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp
+ TARGET_DIRECTORY MLIRLinalgTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRMemRefTransforms)
+ # From mlir/lib/Dialect/MemRef/Transforms/CMakeLists.txt (target: MLIRMemRefTransforms)
+ # Static type emulation pattern and helper function conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
+ TARGET_DIRECTORY MLIRMemRefTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIROpenACCDialect)
+ # From mlir/lib/Dialect/OpenACC/IR/CMakeLists.txt (target: MLIROpenACCDialect)
+ # Static code generation and type conversion function conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/OpenACC/IR/OpenACCCG.cpp
+ TARGET_DIRECTORY MLIROpenACCDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRPtrDialect)
+ # From mlir/lib/Dialect/Ptr/IR/CMakeLists.txt (target: MLIRPtrDialect)
+ # Static pointer type handling conflicts via 'using namespace mlir'.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Ptr/IR/PtrTypes.cpp
+ TARGET_DIRECTORY MLIRPtrDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRSparseTensorTransforms)
+ # From mlir/lib/Dialect/SparseTensor/Transforms/CMakeLists.txt (target: MLIRSparseTensorTransforms)
+ # Conflicting sparse tensor analysis and lowering pattern definitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
+ TARGET_DIRECTORY MLIRSparseTensorTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRVectorTransforms)
+ # From mlir/lib/Dialect/Vector/Transforms/CMakeLists.txt (target: MLIRVectorTransforms)
+ # Anonymous namespace rewrite pattern redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/Vector/Transforms/VectorInsertExtractStridedSliceRewritePatterns.cpp
+ TARGET_DIRECTORY MLIRVectorTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRPDLLCodeGen)
+ # From mlir/lib/Tools/PDLL/CodeGen/CMakeLists.txt (target: MLIRPDLLCodeGen)
+ # Static PDLL code generation helpers and symbol registration conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
+ TARGET_DIRECTORY MLIRPDLLCodeGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRLspServerLib)
+ # From mlir/lib/Tools/mlir-lsp-server/CMakeLists.txt (target: MLIRLspServerLib)
+ # Static LSP protocol handler and request processing conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Tools/mlir-lsp-server/MLIRServer.cpp
+ TARGET_DIRECTORY MLIRLspServerLib
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET TableGenLspServerLib)
+ # From mlir/lib/Tools/tblgen-lsp-server/CMakeLists.txt (target: TableGenLspServerLib)
+ # Static TableGen LSP handler conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Tools/tblgen-lsp-server/TableGenServer.cpp
+ TARGET_DIRECTORY TableGenLspServerLib
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTransformUtils)
+ # From mlir/lib/Transforms/Utils/CMakeLists.txt (target: MLIRTransformUtils)
+ # Anonymous namespace debugging infrastructure and static helper conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
+ TARGET_DIRECTORY MLIRTransformUtils
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestAnalysis)
+ # From mlir/test/lib/Analysis/CMakeLists.txt (target: MLIRTestAnalysis)
+ # Static test infrastructure redefinitions across analysis test files.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/TestMemRefDependenceCheck.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/TestSlice.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDeadCodeAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDenseBackwardDataFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestDenseForwardDataFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestLivenessAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestSparseBackwardDataFlowAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Analysis/DataFlow/TestStridedMetadataRangeAnalysis.cpp
+ TARGET_DIRECTORY MLIRTestAnalysis
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestFuncToLLVM)
+ # From mlir/test/lib/Conversion/FuncToLLVM/CMakeLists.txt (target: MLIRTestFuncToLLVM)
+ # Static test pass and conversion pattern conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Conversion/FuncToLLVM/TestConvertFuncOp.cpp
+ TARGET_DIRECTORY MLIRTestFuncToLLVM
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRAffineTransformsTestPasses)
+ set_source_files_properties(
+ # From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
+ # Static vectorization test utility conflicts.
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
+ # From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
+ # Static value bound analysis test infrastructure conflicts.
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestReifyValueBounds.cpp
+ # From mlir/test/lib/Dialect/Affine/CMakeLists.txt (target: MLIRAffineTransformsTestPasses)
+ # Static analysis test harness redefinitions.
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestAccessAnalysis.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestAffineLoopUnswitching.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestDecomposeAffineOps.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestLoopFusion.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Affine/TestLoopPermutation.cpp
+ TARGET_DIRECTORY MLIRAffineTransformsTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRBufferizationTestPasses)
+ # From mlir/test/lib/Dialect/Bufferization/CMakeLists.txt (target: MLIRBufferizationTestPasses)
+ # Static test pattern implementation conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Bufferization/TestTensorLikeAndBufferLike.cpp
+ TARGET_DIRECTORY MLIRBufferizationTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRSCFTestPasses)
+ # From mlir/test/lib/Dialect/SCF/CMakeLists.txt (target: MLIRSCFTestPasses)
+ # Static loop unrolling test pattern conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/SCF/TestParallelLoopUnrolling.cpp
+ TARGET_DIRECTORY MLIRSCFTestPasses
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestTransformDialect)
+ # From mlir/test/lib/Dialect/Transform/CMakeLists.txt (target: MLIRTestTransformDialect)
+ # Conflicting static test interpreter definitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Transform/TestTransformDialectInterpreter.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Transform/TestTransformStateExtension.cpp
+ TARGET_DIRECTORY MLIRTestTransformDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestIR)
+ set_source_files_properties(
+ # From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
+ # Static dominance analysis test infrastructure conflicts.
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestDominance.cpp
+ # From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBuiltinAttributeInterfaces.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBuiltinDistinctAttributes.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestBytecodeRoundtrip.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestClone.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestLazyLoading.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestRegions.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestSideEffects.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestSymbolUses.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestTypes.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestVisitorsGeneric.cpp
+ # From mlir/test/lib/IR/CMakeLists.txt (target: MLIRTestIR)
+ # Static interface testing utility conflicts.
+ ${LLVM_REPO_DIR}/mlir/test/lib/IR/TestInterfaces.cpp
+ TARGET_DIRECTORY MLIRTestIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestPass)
+ # From mlir/test/lib/Pass/CMakeLists.txt (target: MLIRTestPass)
+ # Static pass management test code conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Pass/TestPassManager.cpp
+ TARGET_DIRECTORY MLIRTestPass
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestTransforms)
+ # From mlir/test/lib/Transforms/CMakeLists.txt (target: MLIRTestTransforms)
+ # Static transform test utility redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestCommutativityUtils.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestDialectConversion.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestInlining.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestInliningCallback.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestMakeIsolatedFromAbove.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Transforms/TestTransformDialectExtension.cpp
+ TARGET_DIRECTORY MLIRTestTransforms
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRPassTests)
+ # From mlir/unittests/Pass/CMakeLists.txt (target: MLIRPassTests)
+ # Static pass management unit test infrastructure conflicts.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/unittests/Pass/PassManagerTest.cpp
+ TARGET_DIRECTORY MLIRPassTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRLLVMCommonConversion)
+ # From mlir/lib/Conversion/LLVMCommon/CMakeLists.txt (target: MLIRLLVMCommonConversion)
+ # 'using namespace mlir' causes Type and other core type ambiguity.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/LLVMCommon/StructBuilder.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/LLVMCommon/TypeConverter.cpp
+ TARGET_DIRECTORY MLIRLLVMCommonConversion
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRShapeToStandard)
+ # From mlir/lib/Conversion/ShapeToStandard/CMakeLists.txt (target: MLIRShapeToStandard)
+ # Conflicting pattern rewriters and helper function redefinitions.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/ShapeToStandard/ShapeToStandard.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Conversion/ShapeToStandard/ConvertShapeConstraints.cpp
+ TARGET_DIRECTORY MLIRShapeToStandard
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRSPIRVDialect)
+ # From mlir/lib/Dialect/SPIRV/IR/CMakeLists.txt (target: MLIRSPIRVDialect)
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/ArmGraphOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/AtomicOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/CastOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/ControlFlowOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/CooperativeMatrixOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/DotProductOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/GroupOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/MemoryOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVGLCanonicalization.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVOpDefinition.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/Dialect/SPIRV/IR/SPIRVParsingUtils.cpp
+ TARGET_DIRECTORY MLIRSPIRVDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+if(TARGET MLIRIR)
+ # From mlir/lib/IR/CMakeLists.txt (target: MLIRIR)
+ # SymbolTable.cpp has ambiguous 'function_ref', 'SetVector', 'detail', 'impl'
+ # due to 'using namespace llvm;' from other files in the unity batch.
+ # Types.cpp has ambiguous 'Type' (mlir::Type vs llvm::Type).
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/IR/SymbolTable.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/IR/TypeRange.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/IR/TypeUtilities.cpp
+ ${LLVM_REPO_DIR}/mlir/lib/IR/Types.cpp
+ TARGET_DIRECTORY MLIRIR
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTableGen)
+ # From mlir/lib/TableGen/CMakeLists.txt (target: MLIRTableGen)
+ # CodeGenHelpers.cpp has "using namespace llvm;" which makes DenseMapInfo
+ # ambiguous in Constraint.cpp's DenseMapInfo<Constraint> implementations
+ # when compiled together in a unity build.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/lib/TableGen/Constraint.cpp
+ TARGET_DIRECTORY MLIRTableGen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRTestDialect)
+ # From mlir/test/lib/Dialect/Test/CMakeLists.txt (target: MLIRTestDialect)
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestAttributes.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestDialect.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestDialectInterfaces.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestInterfaces.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOpDefs.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOps.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestOpsSyntax.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestPatterns.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestTraits.cpp
+ ${LLVM_REPO_DIR}/mlir/test/lib/Dialect/Test/TestTypes.cpp
+ TARGET_DIRECTORY MLIRTestDialect
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET mlir-tblgen)
+ # From mlir/tools/mlir-tblgen/CMakeLists.txt (target: mlir-tblgen)
+ # Unity build conflicts:
+ # - BytecodeDialectGen.cpp/DialectGen.cpp: both define static 'dialectGenCat'
+ # - PassGen.cpp/PassCAPIGen.cpp: both define 'passGenCat', 'groupName',
+ # 'passGroupRegistrationCode', 'fileHeader'
+ # - SPIRVUtilsGen.cpp/TosaUtilsGen.cpp: both define 'Availability' class and
+ # related functions in anonymous namespaces
+ # - LLVMIRIntrinsicGen.cpp, OpDocGen.cpp, OpPythonBindingGen.cpp, RewriterGen.cpp:
+ # 'using namespace llvm;' from other files makes DenseMap, Type, StringSwitch,
+ # SetVector ambiguous with mlir::tblgen equivalents
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/BytecodeDialectGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/DialectGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpDocGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpFormatGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/OpPythonBindingGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/PassCAPIGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/PassGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/RewriterGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
+ ${LLVM_REPO_DIR}/mlir/tools/mlir-tblgen/TosaUtilsGen.cpp
+ TARGET_DIRECTORY mlir-tblgen
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRExecutionEngineTests)
+ # From mlir/unittests/ExecutionEngine/CMakeLists.txt (target: MLIRExecutionEngineTests)
+ # These files include CRunnerUtils.h/RunnerUtils.h which defines
+ # UnrankedMemRefType that conflicts with mlir::UnrankedMemRefType in unity builds.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/DynamicMemRef.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/StridedMemRef.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/ExecutionEngine/Invoke.cpp
+ TARGET_DIRECTORY MLIRExecutionEngineTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
+
+if(TARGET MLIRIRTests)
+ # From mlir/unittests/IR/CMakeLists.txt (target: MLIRIRTests)
+ # Static test helper function redefinitions across unit tests.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/AffineMapTest.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/OpPropertiesTest.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/TypeAttrNamesTest.cpp
+ ${LLVM_REPO_DIR}/mlir/unittests/IR/ValueTest.cpp
+ TARGET_DIRECTORY MLIRIRTests
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
# ======================================================================
# polly
# ======================================================================
-# From polly/lib/CMakeLists.txt (target: Polly)
-# ISLOStream.h has no include guard, so its inline operator<< definitions get
-# redefined when multiple .cpp files including it are in the same unity TU.
-# Several Analysis/ and CodeGen/ files also share STATISTIC variable names.
-set_source_files_properties(
- ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopDetection.cpp
- ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopInfo.cpp
- ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopBuilder.cpp
- ${LLVM_REPO_DIR}/polly/lib/Analysis/PruneUnprofitable.cpp
- ${LLVM_REPO_DIR}/polly/lib/CodeGen/IslAst.cpp
- ${LLVM_REPO_DIR}/polly/lib/CodeGen/CodeGeneration.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/ScheduleOptimizer.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/FlattenSchedule.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/FlattenAlgo.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/ForwardOpTree.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/DeLICM.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/Simplify.cpp
- ${LLVM_REPO_DIR}/polly/lib/Transform/MatmulOptimizer.cpp
- TARGET_DIRECTORY Polly
- PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
-
+if(TARGET Polly)
+ # From polly/lib/CMakeLists.txt (target: Polly)
+ # ISLOStream.h has no include guard, so its inline operator<< definitions get
+ # redefined when multiple .cpp files including it are in the same unity TU.
+ # Several Analysis/ and CodeGen/ files also share STATISTIC variable names.
+ set_source_files_properties(
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopDetection.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopInfo.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/ScopBuilder.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Analysis/PruneUnprofitable.cpp
+ ${LLVM_REPO_DIR}/polly/lib/CodeGen/IslAst.cpp
+ ${LLVM_REPO_DIR}/polly/lib/CodeGen/CodeGeneration.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/ScheduleOptimizer.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/FlattenSchedule.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/FlattenAlgo.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/ForwardOpTree.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/DeLICM.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/Simplify.cpp
+ ${LLVM_REPO_DIR}/polly/lib/Transform/MatmulOptimizer.cpp
+ TARGET_DIRECTORY Polly
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+endif()
>From 483d8b6d5da731d9b76ad650bf1e915d02797d5d Mon Sep 17 00:00:00 2001
From: makslevental <maksim.levental at gmail.com>
Date: Tue, 24 Mar 2026 21:49:55 -0700
Subject: [PATCH 25/25] use the right target ClangTidyTests
---
llvm/cmake/modules/UnityBuild.cmake | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/cmake/modules/UnityBuild.cmake b/llvm/cmake/modules/UnityBuild.cmake
index 58c0eb6bad9dc..d15376b74ecfc 100644
--- a/llvm/cmake/modules/UnityBuild.cmake
+++ b/llvm/cmake/modules/UnityBuild.cmake
@@ -90,7 +90,7 @@ if(TARGET modularize)
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
endif()
-if(TARGET clang-tidy)
+if(TARGET ClangTidyTests)
# From clang-tools-extra/unittests/clang-tidy/CMakeLists.txt (target: clang-tidy)
# These files define symbols that clash in unity builds:
# - ClangTidyOptionsTest.cpp and ClangTidyDiagnosticConsumerTest.cpp both
@@ -101,7 +101,7 @@ if(TARGET clang-tidy)
${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
${LLVM_REPO_DIR}/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
- TARGET_DIRECTORY clang-tidy
+ TARGET_DIRECTORY ClangTidyTests
PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
endif()
More information about the cfe-commits
mailing list