diff --git a/include/llvm/Analysis/TargetTransformInfo.h b/include/llvm/Analysis/TargetTransformInfo.h index ba8b7754e85..89c7c979262 100644 --- a/include/llvm/Analysis/TargetTransformInfo.h +++ b/include/llvm/Analysis/TargetTransformInfo.h @@ -21,11 +21,6 @@ #ifndef LLVM_ANALYSIS_TARGETTRANSFORMINFO_H #define LLVM_ANALYSIS_TARGETTRANSFORMINFO_H -#include "llvm/ADT/Optional.h" -#include "llvm/Analysis/AssumptionCache.h" -#include "llvm/Analysis/LoopInfo.h" -#include "llvm/Analysis/ScalarEvolution.h" -#include "llvm/IR/Dominators.h" #include "llvm/IR/Operator.h" #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" @@ -41,6 +36,7 @@ typedef unsigned ID; class AssumptionCache; class BlockFrequencyInfo; +class DominatorTree; class BranchInst; class Function; class GlobalValue; @@ -48,6 +44,7 @@ class IntrinsicInst; class LoadInst; class LoopAccessInfo; class Loop; +class LoopInfo; class ProfileSummaryInfo; class SCEV; class ScalarEvolution; @@ -57,6 +54,7 @@ class TargetLibraryInfo; class Type; class User; class Value; +template class Optional; /// Information about a load/store intrinsic defined by the target. struct MemIntrinsicInfo { @@ -835,10 +833,10 @@ public: }; /// \return The size of the cache level in bytes, if available. - llvm::Optional getCacheSize(CacheLevel Level) const; + Optional getCacheSize(CacheLevel Level) const; /// \return The associativity of the cache level, if available. - llvm::Optional getCacheAssociativity(CacheLevel Level) const; + Optional getCacheAssociativity(CacheLevel Level) const; /// \return How much before a load we should place the prefetch /// instruction. This is currently measured in number of @@ -1301,9 +1299,8 @@ public: virtual bool shouldConsiderAddressTypePromotion( const Instruction &I, bool &AllowPromotionWithoutCommonHeader) = 0; virtual unsigned getCacheLineSize() const = 0; - virtual llvm::Optional getCacheSize(CacheLevel Level) const = 0; - virtual llvm::Optional - getCacheAssociativity(CacheLevel Level) const = 0; + virtual Optional getCacheSize(CacheLevel Level) const = 0; + virtual Optional getCacheAssociativity(CacheLevel Level) const = 0; /// \return How much before a load we should place the prefetch /// instruction. This is currently measured in number of @@ -1679,11 +1676,10 @@ public: I, AllowPromotionWithoutCommonHeader); } unsigned getCacheLineSize() const override { return Impl.getCacheLineSize(); } - llvm::Optional getCacheSize(CacheLevel Level) const override { + Optional getCacheSize(CacheLevel Level) const override { return Impl.getCacheSize(Level); } - llvm::Optional - getCacheAssociativity(CacheLevel Level) const override { + Optional getCacheAssociativity(CacheLevel Level) const override { return Impl.getCacheAssociativity(Level); } diff --git a/include/llvm/Transforms/Utils/LoopUtils.h b/include/llvm/Transforms/Utils/LoopUtils.h index ba06d635ac2..e1b541f624e 100644 --- a/include/llvm/Transforms/Utils/LoopUtils.h +++ b/include/llvm/Transforms/Utils/LoopUtils.h @@ -21,6 +21,8 @@ namespace llvm { +template class DomTreeNodeBase; +using DomTreeNode = DomTreeNodeBase; class AliasSet; class AliasSetTracker; class BasicBlock; diff --git a/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp b/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp index e8c32cb346e..fef649f6b3f 100644 --- a/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp +++ b/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp @@ -28,6 +28,7 @@ #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Dominators.h" #include "llvm/IR/Function.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/InstVisitor.h" @@ -40,10 +41,10 @@ #include "llvm/IR/Operator.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/Transforms/Utils/IntegerDivision.h" #include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include "llvm/Support/Casting.h" +#include "llvm/Transforms/Utils/IntegerDivision.h" #include #include diff --git a/lib/Target/ARM/MVEGatherScatterLowering.cpp b/lib/Target/ARM/MVEGatherScatterLowering.cpp index e4f6d1200a8..580b5d5881f 100644 --- a/lib/Target/ARM/MVEGatherScatterLowering.cpp +++ b/lib/Target/ARM/MVEGatherScatterLowering.cpp @@ -15,26 +15,27 @@ #include "ARM.h" #include "ARMBaseInstrInfo.h" #include "ARMSubtarget.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" -#include "llvm/InitializePasses.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" +#include "llvm/IR/IRBuilder.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/IntrinsicsARM.h" -#include "llvm/IR/IRBuilder.h" #include "llvm/IR/PatternMatch.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" +#include "llvm/InitializePasses.h" #include "llvm/Pass.h" #include "llvm/Support/Casting.h" #include "llvm/Transforms/Utils/Local.h" diff --git a/lib/Transforms/IPO/AttributorAttributes.cpp b/lib/Transforms/IPO/AttributorAttributes.cpp index fb9a3e2e6f9..ee91aff67ee 100644 --- a/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/lib/Transforms/IPO/AttributorAttributes.cpp @@ -18,6 +18,7 @@ #include "llvm/Analysis/CaptureTracking.h" #include "llvm/Analysis/LazyValueInfo.h" #include "llvm/Analysis/MemoryBuiltins.h" +#include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/IntrinsicInst.h" diff --git a/lib/Transforms/Scalar/WarnMissedTransforms.cpp b/lib/Transforms/Scalar/WarnMissedTransforms.cpp index c8461fdc160..7c81e6352de 100644 --- a/lib/Transforms/Scalar/WarnMissedTransforms.cpp +++ b/lib/Transforms/Scalar/WarnMissedTransforms.cpp @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Scalar/WarnMissedTransforms.h" +#include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/OptimizationRemarkEmitter.h" #include "llvm/InitializePasses.h" #include "llvm/Transforms/Utils/LoopUtils.h" diff --git a/unittests/Transforms/Utils/LoopUtilsTest.cpp b/unittests/Transforms/Utils/LoopUtilsTest.cpp index 35fd97a50d0..847049d8c29 100644 --- a/unittests/Transforms/Utils/LoopUtilsTest.cpp +++ b/unittests/Transforms/Utils/LoopUtilsTest.cpp @@ -7,7 +7,10 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/LoopUtils.h" +#include "llvm/Analysis/AssumptionCache.h" +#include "llvm/Analysis/ScalarEvolution.h" #include "llvm/AsmParser/Parser.h" +#include "llvm/IR/Dominators.h" #include "llvm/Support/SourceMgr.h" #include "gtest/gtest.h"