diff --git a/clang/lib/CodeGen/CMakeLists.txt b/clang/lib/CodeGen/CMakeLists.txt --- a/clang/lib/CodeGen/CMakeLists.txt +++ b/clang/lib/CodeGen/CMakeLists.txt @@ -3,6 +3,7 @@ Analysis BitReader BitWriter + CodeGen Core Coroutines Coverage diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -26,6 +26,7 @@ #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Analysis/TargetTransformInfoImpl.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/ValueTypes.h" @@ -44,7 +45,6 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" diff --git a/llvm/include/llvm/CodeGen/CostTable.h b/llvm/include/llvm/CodeGen/CostTable.h --- a/llvm/include/llvm/CodeGen/CostTable.h +++ b/llvm/include/llvm/CodeGen/CostTable.h @@ -16,7 +16,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" -#include "llvm/Support/MachineValueType.h" +#include "llvm/CodeGen/MachineValueType.h" namespace llvm { diff --git a/llvm/include/llvm/CodeGen/FastISel.h b/llvm/include/llvm/CodeGen/FastISel.h --- a/llvm/include/llvm/CodeGen/FastISel.h +++ b/llvm/include/llvm/CodeGen/FastISel.h @@ -19,13 +19,13 @@ #include "llvm/ADT/StringRef.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineInstrBuilder.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DebugLoc.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/InstrTypes.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h --- a/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h @@ -17,14 +17,14 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/CallingConvLower.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetCallingConv.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h --- a/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h @@ -19,8 +19,8 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/Register.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/IR/InstrTypes.h" #include diff --git a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h --- a/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h @@ -18,9 +18,9 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/GlobalISel/Utils.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/IR/Function.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include #include #include diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h --- a/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h @@ -16,8 +16,8 @@ #define LLVM_CODEGEN_GLOBALISEL_LEGACYLEGALIZERINFO_H #include "llvm/ADT/DenseMap.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/TargetOpcodes.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include namespace llvm { diff --git a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h --- a/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h @@ -17,12 +17,12 @@ #include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include #include #include diff --git a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h --- a/llvm/include/llvm/CodeGen/GlobalISel/Utils.h +++ b/llvm/include/llvm/CodeGen/GlobalISel/Utils.h @@ -17,11 +17,11 @@ #include "GISelWorkList.h" #include "llvm/ADT/APFloat.h" #include "llvm/ADT/StringRef.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/Register.h" #include "llvm/IR/DebugLoc.h" #include "llvm/Support/Alignment.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include namespace llvm { diff --git a/llvm/include/llvm/CodeGen/LowLevelType.h b/llvm/include/llvm/CodeGen/LowLevelType.h --- a/llvm/include/llvm/CodeGen/LowLevelType.h +++ b/llvm/include/llvm/CodeGen/LowLevelType.h @@ -9,21 +9,425 @@ /// Implement a low-level type suitable for MachineInstr level instruction /// selection. /// -/// This provides the CodeGen aspects of LowLevelType, such as Type conversion. +/// For a type attached to a MachineInstr, we only care about 2 details: total +/// size and the number of vector lanes (if any). Accordingly, there are 4 +/// possible valid type-kinds: +/// +/// * `sN` for scalars and aggregates +/// * `` for vectors, which must have at least 2 elements. +/// * `pN` for pointers +/// +/// Other information required for correct selection is expected to be carried +/// by the opcode, or non-type flags. For example the distinction between G_ADD +/// and G_FADD for int/float or fast-math flags. /// //===----------------------------------------------------------------------===// #ifndef LLVM_CODEGEN_LOWLEVELTYPE_H #define LLVM_CODEGEN_LOWLEVELTYPE_H +#include "llvm/ADT/DenseMapInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/ValueTypes.h" -#include "llvm/Support/LowLevelTypeImpl.h" +#include "llvm/Support/Debug.h" +#include namespace llvm { class DataLayout; class Type; struct fltSemantics; +class raw_ostream; + +class LLT { +public: + /// Get a low-level scalar or aggregate "bag of bits". + static constexpr LLT scalar(unsigned SizeInBits) { + return LLT{/*isPointer=*/false, /*isVector=*/false, /*isScalar=*/true, + ElementCount::getFixed(0), SizeInBits, + /*AddressSpace=*/0}; + } + + /// Get a low-level pointer in the given address space. + static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits) { + assert(SizeInBits > 0 && "invalid pointer size"); + return LLT{/*isPointer=*/true, /*isVector=*/false, /*isScalar=*/false, + ElementCount::getFixed(0), SizeInBits, AddressSpace}; + } + + /// Get a low-level vector of some number of elements and element width. + static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits) { + assert(!EC.isScalar() && "invalid number of vector elements"); + return LLT{/*isPointer=*/false, /*isVector=*/true, /*isScalar=*/false, + EC, ScalarSizeInBits, /*AddressSpace=*/0}; + } + + /// Get a low-level vector of some number of elements and element type. + static constexpr LLT vector(ElementCount EC, LLT ScalarTy) { + assert(!EC.isScalar() && "invalid number of vector elements"); + assert(!ScalarTy.isVector() && "invalid vector element type"); + return LLT{ScalarTy.isPointer(), + /*isVector=*/true, + /*isScalar=*/false, + EC, + ScalarTy.getSizeInBits().getFixedValue(), + ScalarTy.isPointer() ? ScalarTy.getAddressSpace() : 0}; + } + + /// Get a low-level fixed-width vector of some number of elements and element + /// width. + static constexpr LLT fixed_vector(unsigned NumElements, + unsigned ScalarSizeInBits) { + return vector(ElementCount::getFixed(NumElements), ScalarSizeInBits); + } + + /// Get a low-level fixed-width vector of some number of elements and element + /// type. + static constexpr LLT fixed_vector(unsigned NumElements, LLT ScalarTy) { + return vector(ElementCount::getFixed(NumElements), ScalarTy); + } + + /// Get a low-level scalable vector of some number of elements and element + /// width. + static constexpr LLT scalable_vector(unsigned MinNumElements, + unsigned ScalarSizeInBits) { + return vector(ElementCount::getScalable(MinNumElements), ScalarSizeInBits); + } + + /// Get a low-level scalable vector of some number of elements and element + /// type. + static constexpr LLT scalable_vector(unsigned MinNumElements, LLT ScalarTy) { + return vector(ElementCount::getScalable(MinNumElements), ScalarTy); + } + + static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy) { + return EC.isScalar() ? ScalarTy : LLT::vector(EC, ScalarTy); + } + + static constexpr LLT scalarOrVector(ElementCount EC, uint64_t ScalarSize) { + assert(ScalarSize <= std::numeric_limits::max() && + "Not enough bits in LLT to represent size"); + return scalarOrVector(EC, LLT::scalar(static_cast(ScalarSize))); + } + + explicit constexpr LLT(bool isPointer, bool isVector, bool isScalar, + ElementCount EC, uint64_t SizeInBits, + unsigned AddressSpace) + : LLT() { + init(isPointer, isVector, isScalar, EC, SizeInBits, AddressSpace); + } + explicit constexpr LLT() + : IsScalar(false), IsPointer(false), IsVector(false), RawData(0) {} + + explicit LLT(MVT VT); + + constexpr bool isValid() const { return IsScalar || RawData != 0; } + + constexpr bool isScalar() const { return IsScalar; } + + constexpr bool isPointer() const { + return isValid() && IsPointer && !IsVector; + } + + constexpr bool isVector() const { return isValid() && IsVector; } + + /// Returns the number of elements in a vector LLT. Must only be called on + /// vector types. + constexpr uint16_t getNumElements() const { + if (isScalable()) + llvm::reportInvalidSizeRequest( + "Possible incorrect use of LLT::getNumElements() for " + "scalable vector. Scalable flag may be dropped, use " + "LLT::getElementCount() instead"); + return getElementCount().getKnownMinValue(); + } + + /// Returns true if the LLT is a scalable vector. Must only be called on + /// vector types. + constexpr bool isScalable() const { + assert(isVector() && "Expected a vector type"); + return IsPointer ? getFieldValue(PointerVectorScalableFieldInfo) + : getFieldValue(VectorScalableFieldInfo); + } + + constexpr ElementCount getElementCount() const { + assert(IsVector && "cannot get number of elements on scalar/aggregate"); + return ElementCount::get(IsPointer + ? getFieldValue(PointerVectorElementsFieldInfo) + : getFieldValue(VectorElementsFieldInfo), + isScalable()); + } + + /// Returns the total size of the type. Must only be called on sized types. + constexpr TypeSize getSizeInBits() const { + if (isPointer() || isScalar()) + return TypeSize::Fixed(getScalarSizeInBits()); + auto EC = getElementCount(); + return TypeSize(getScalarSizeInBits() * EC.getKnownMinValue(), + EC.isScalable()); + } + + /// Returns the total size of the type in bytes, i.e. number of whole bytes + /// needed to represent the size in bits. Must only be called on sized types. + constexpr TypeSize getSizeInBytes() const { + TypeSize BaseSize = getSizeInBits(); + return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()}; + } + + constexpr LLT getScalarType() const { + return isVector() ? getElementType() : *this; + } + + /// If this type is a vector, return a vector with the same number of elements + /// but the new element type. Otherwise, return the new element type. + constexpr LLT changeElementType(LLT NewEltTy) const { + return isVector() ? LLT::vector(getElementCount(), NewEltTy) : NewEltTy; + } + + /// If this type is a vector, return a vector with the same number of elements + /// but the new element size. Otherwise, return the new element type. Invalid + /// for pointer types. For pointer types, use changeElementType. + constexpr LLT changeElementSize(unsigned NewEltSize) const { + assert(!getScalarType().isPointer() && + "invalid to directly change element size for pointers"); + return isVector() ? LLT::vector(getElementCount(), NewEltSize) + : LLT::scalar(NewEltSize); + } + + /// Return a vector or scalar with the same element type and the new element + /// count. + constexpr LLT changeElementCount(ElementCount EC) const { + return LLT::scalarOrVector(EC, getScalarType()); + } + + /// Return a type that is \p Factor times smaller. Reduces the number of + /// elements if this is a vector, or the bitwidth for scalar/pointers. Does + /// not attempt to handle cases that aren't evenly divisible. + constexpr LLT divide(int Factor) const { + assert(Factor != 1); + assert((!isScalar() || getScalarSizeInBits() != 0) && + "cannot divide scalar of size zero"); + if (isVector()) { + assert(getElementCount().isKnownMultipleOf(Factor)); + return scalarOrVector(getElementCount().divideCoefficientBy(Factor), + getElementType()); + } + + assert(getScalarSizeInBits() % Factor == 0); + return scalar(getScalarSizeInBits() / Factor); + } + + /// Produce a vector type that is \p Factor times bigger, preserving the + /// element type. For a scalar or pointer, this will produce a new vector with + /// \p Factor elements. + constexpr LLT multiplyElements(int Factor) const { + if (isVector()) { + return scalarOrVector(getElementCount().multiplyCoefficientBy(Factor), + getElementType()); + } + + return fixed_vector(Factor, *this); + } + + constexpr bool isByteSized() const { + return getSizeInBits().isKnownMultipleOf(8); + } + + constexpr unsigned getScalarSizeInBits() const { + if (IsScalar) + return getFieldValue(ScalarSizeFieldInfo); + if (IsVector) { + if (!IsPointer) + return getFieldValue(VectorSizeFieldInfo); + else + return getFieldValue(PointerVectorSizeFieldInfo); + } else if (IsPointer) + return getFieldValue(PointerSizeFieldInfo); + else + llvm_unreachable("unexpected LLT"); + } + + constexpr unsigned getAddressSpace() const { + assert(RawData != 0 && "Invalid Type"); + assert(IsPointer && "cannot get address space of non-pointer type"); + if (!IsVector) + return getFieldValue(PointerAddressSpaceFieldInfo); + else + return getFieldValue(PointerVectorAddressSpaceFieldInfo); + } + + /// Returns the vector's element type. Only valid for vector types. + constexpr LLT getElementType() const { + assert(isVector() && "cannot get element type of scalar/aggregate"); + if (IsPointer) + return pointer(getAddressSpace(), getScalarSizeInBits()); + else + return scalar(getScalarSizeInBits()); + } + + void print(raw_ostream &OS) const; + +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) + LLVM_DUMP_METHOD void dump() const { + print(dbgs()); + dbgs() << '\n'; + } +#endif + + constexpr bool operator==(const LLT &RHS) const { + return IsPointer == RHS.IsPointer && IsVector == RHS.IsVector && + IsScalar == RHS.IsScalar && RHS.RawData == RawData; + } + + constexpr bool operator!=(const LLT &RHS) const { return !(*this == RHS); } + + friend struct DenseMapInfo; + friend class GISelInstProfileBuilder; + +private: + /// LLT is packed into 64 bits as follows: + /// isScalar : 1 + /// isPointer : 1 + /// isVector : 1 + /// with 61 bits remaining for Kind-specific data, packed in bitfields + /// as described below. As there isn't a simple portable way to pack bits + /// into bitfields, here the different fields in the packed structure is + /// described in static const *Field variables. Each of these variables + /// is a 2-element array, with the first element describing the bitfield size + /// and the second element describing the bitfield offset. + typedef int BitFieldInfo[2]; + /// + /// This is how the bitfields are packed per Kind: + /// * Invalid: + /// gets encoded as RawData == 0, as that is an invalid encoding, since for + /// valid encodings, SizeInBits/SizeOfElement must be larger than 0. + /// * Non-pointer scalar (isPointer == 0 && isVector == 0): + /// SizeInBits: 32; + static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 0}; + /// * Pointer (isPointer == 1 && isVector == 0): + /// SizeInBits: 16; + /// AddressSpace: 24; + static const constexpr BitFieldInfo PointerSizeFieldInfo{16, 0}; + static const constexpr BitFieldInfo PointerAddressSpaceFieldInfo{ + 24, PointerSizeFieldInfo[0] + PointerSizeFieldInfo[1]}; + static_assert((PointerAddressSpaceFieldInfo[0] + + PointerAddressSpaceFieldInfo[1]) <= 61, + "Insufficient bits to encode all data"); + /// * Vector-of-non-pointer (isPointer == 0 && isVector == 1): + /// NumElements: 16; + /// SizeOfElement: 32; + /// Scalable: 1; + static const constexpr BitFieldInfo VectorElementsFieldInfo{16, 0}; + static const constexpr BitFieldInfo VectorSizeFieldInfo{ + 32, VectorElementsFieldInfo[0] + VectorElementsFieldInfo[1]}; + static const constexpr BitFieldInfo VectorScalableFieldInfo{ + 1, VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]}; + static_assert((VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]) <= 61, + "Insufficient bits to encode all data"); + /// * Vector-of-pointer (isPointer == 1 && isVector == 1): + /// NumElements: 16; + /// SizeOfElement: 16; + /// AddressSpace: 24; + /// Scalable: 1; + static const constexpr BitFieldInfo PointerVectorElementsFieldInfo{16, 0}; + static const constexpr BitFieldInfo PointerVectorSizeFieldInfo{ + 16, + PointerVectorElementsFieldInfo[1] + PointerVectorElementsFieldInfo[0]}; + static const constexpr BitFieldInfo PointerVectorAddressSpaceFieldInfo{ + 24, PointerVectorSizeFieldInfo[1] + PointerVectorSizeFieldInfo[0]}; + static const constexpr BitFieldInfo PointerVectorScalableFieldInfo{ + 1, PointerVectorAddressSpaceFieldInfo[0] + + PointerVectorAddressSpaceFieldInfo[1]}; + static_assert((PointerVectorAddressSpaceFieldInfo[0] + + PointerVectorAddressSpaceFieldInfo[1]) <= 61, + "Insufficient bits to encode all data"); + + uint64_t IsScalar : 1; + uint64_t IsPointer : 1; + uint64_t IsVector : 1; + uint64_t RawData : 61; + + static constexpr uint64_t getMask(const BitFieldInfo FieldInfo) { + const int FieldSizeInBits = FieldInfo[0]; + return (((uint64_t)1) << FieldSizeInBits) - 1; + } + static constexpr uint64_t maskAndShift(uint64_t Val, uint64_t Mask, + uint8_t Shift) { + assert(Val <= Mask && "Value too large for field"); + return (Val & Mask) << Shift; + } + static constexpr uint64_t maskAndShift(uint64_t Val, + const BitFieldInfo FieldInfo) { + return maskAndShift(Val, getMask(FieldInfo), FieldInfo[1]); + } + + constexpr uint64_t getFieldValue(const BitFieldInfo FieldInfo) const { + return getMask(FieldInfo) & (RawData >> FieldInfo[1]); + } + + constexpr void init(bool IsPointer, bool IsVector, bool IsScalar, + ElementCount EC, uint64_t SizeInBits, + unsigned AddressSpace) { + assert(SizeInBits <= std::numeric_limits::max() && + "Not enough bits in LLT to represent size"); + this->IsPointer = IsPointer; + this->IsVector = IsVector; + this->IsScalar = IsScalar; + if (IsScalar) + RawData = maskAndShift(SizeInBits, ScalarSizeFieldInfo); + else if (IsVector) { + assert(EC.isVector() && "invalid number of vector elements"); + if (!IsPointer) + RawData = + maskAndShift(EC.getKnownMinValue(), VectorElementsFieldInfo) | + maskAndShift(SizeInBits, VectorSizeFieldInfo) | + maskAndShift(EC.isScalable() ? 1 : 0, VectorScalableFieldInfo); + else + RawData = + maskAndShift(EC.getKnownMinValue(), + PointerVectorElementsFieldInfo) | + maskAndShift(SizeInBits, PointerVectorSizeFieldInfo) | + maskAndShift(AddressSpace, PointerVectorAddressSpaceFieldInfo) | + maskAndShift(EC.isScalable() ? 1 : 0, + PointerVectorScalableFieldInfo); + } else if (IsPointer) + RawData = maskAndShift(SizeInBits, PointerSizeFieldInfo) | + maskAndShift(AddressSpace, PointerAddressSpaceFieldInfo); + else + llvm_unreachable("unexpected LLT configuration"); + } + +public: + constexpr uint64_t getUniqueRAWLLTData() const { + return ((uint64_t)RawData) << 3 | ((uint64_t)IsScalar) << 2 | + ((uint64_t)IsPointer) << 1 | ((uint64_t)IsVector); + } +}; + +inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) { + Ty.print(OS); + return OS; +} + +template<> struct DenseMapInfo { + static inline LLT getEmptyKey() { + LLT Invalid; + Invalid.IsPointer = true; + return Invalid; + } + static inline LLT getTombstoneKey() { + LLT Invalid; + Invalid.IsVector = true; + return Invalid; + } + static inline unsigned getHashValue(const LLT &Ty) { + uint64_t Val = Ty.getUniqueRAWLLTData(); + return DenseMapInfo::getHashValue(Val); + } + static bool isEqual(const LLT &LHS, const LLT &RHS) { + return LHS == RHS; + } +}; /// Construct a low-level type based on an LLVM type. LLT getLLTForType(Type &Ty, const DataLayout &DL); diff --git a/llvm/include/llvm/CodeGen/MachineMemOperand.h b/llvm/include/llvm/CodeGen/MachineMemOperand.h --- a/llvm/include/llvm/CodeGen/MachineMemOperand.h +++ b/llvm/include/llvm/CodeGen/MachineMemOperand.h @@ -17,12 +17,12 @@ #include "llvm/ADT/BitmaskEnum.h" #include "llvm/ADT/PointerUnion.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/PseudoSourceValue.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Value.h" // PointerLikeTypeTraits #include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/DataTypes.h" -#include "llvm/Support/LowLevelTypeImpl.h" namespace llvm { diff --git a/llvm/include/llvm/Support/MachineValueType.h b/llvm/include/llvm/CodeGen/MachineValueType.h rename from llvm/include/llvm/Support/MachineValueType.h rename to llvm/include/llvm/CodeGen/MachineValueType.h --- a/llvm/include/llvm/Support/MachineValueType.h +++ b/llvm/include/llvm/CodeGen/MachineValueType.h @@ -1,4 +1,4 @@ -//===- Support/MachineValueType.h - Machine-Level types ---------*- C++ -*-===// +//===- CodeGen/MachineValueType.h - Machine-Level types ---------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -11,8 +11,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_SUPPORT_MACHINEVALUETYPE_H -#define LLVM_SUPPORT_MACHINEVALUETYPE_H +#ifndef LLVM_CODEGEN_MACHINEVALUETYPE_H +#define LLVM_CODEGEN_MACHINEVALUETYPE_H #include "llvm/ADT/Sequence.h" #include "llvm/ADT/iterator_range.h" diff --git a/llvm/include/llvm/CodeGen/RegisterBankInfo.h b/llvm/include/llvm/CodeGen/RegisterBankInfo.h --- a/llvm/include/llvm/CodeGen/RegisterBankInfo.h +++ b/llvm/include/llvm/CodeGen/RegisterBankInfo.h @@ -18,9 +18,9 @@ #include "llvm/ADT/Hashing.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/iterator_range.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/Register.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include #include #include diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h --- a/llvm/include/llvm/CodeGen/SelectionDAG.h +++ b/llvm/include/llvm/CodeGen/SelectionDAG.h @@ -29,6 +29,7 @@ #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DebugLoc.h" @@ -37,7 +38,6 @@ #include "llvm/Support/ArrayRecycler.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/RecyclingAllocator.h" #include #include diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h --- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h @@ -30,6 +30,7 @@ #include "llvm/ADT/iterator_range.h" #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/Register.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Constants.h" @@ -42,7 +43,6 @@ #include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/TypeSize.h" #include #include diff --git a/llvm/include/llvm/CodeGen/TargetCallingConv.h b/llvm/include/llvm/CodeGen/TargetCallingConv.h --- a/llvm/include/llvm/CodeGen/TargetCallingConv.h +++ b/llvm/include/llvm/CodeGen/TargetCallingConv.h @@ -13,9 +13,9 @@ #ifndef LLVM_CODEGEN_TARGETCALLINGCONV_H #define LLVM_CODEGEN_TARGETCALLINGCONV_H +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/Support/Alignment.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include #include diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -31,6 +31,7 @@ #include "llvm/CodeGen/DAGCombine.h" #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/LowLevelType.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -49,7 +50,6 @@ #include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h --- a/llvm/include/llvm/CodeGen/TargetRegisterInfo.h +++ b/llvm/include/llvm/CodeGen/TargetRegisterInfo.h @@ -20,11 +20,11 @@ #include "llvm/ADT/StringRef.h" #include "llvm/ADT/iterator_range.h" #include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/IR/CallingConv.h" #include "llvm/MC/LaneBitmask.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Printable.h" #include diff --git a/llvm/include/llvm/CodeGen/ValueTypes.h b/llvm/include/llvm/CodeGen/ValueTypes.h --- a/llvm/include/llvm/CodeGen/ValueTypes.h +++ b/llvm/include/llvm/CodeGen/ValueTypes.h @@ -15,8 +15,8 @@ #ifndef LLVM_CODEGEN_VALUETYPES_H #define LLVM_CODEGEN_VALUETYPES_H +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/TypeSize.h" #include diff --git a/llvm/include/llvm/Support/LowLevelTypeImpl.h b/llvm/include/llvm/Support/LowLevelTypeImpl.h deleted file mode 100644 --- a/llvm/include/llvm/Support/LowLevelTypeImpl.h +++ /dev/null @@ -1,431 +0,0 @@ -//== llvm/Support/LowLevelTypeImpl.h --------------------------- -*- C++ -*-==// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -/// \file -/// Implement a low-level type suitable for MachineInstr level instruction -/// selection. -/// -/// For a type attached to a MachineInstr, we only care about 2 details: total -/// size and the number of vector lanes (if any). Accordingly, there are 4 -/// possible valid type-kinds: -/// -/// * `sN` for scalars and aggregates -/// * `` for vectors, which must have at least 2 elements. -/// * `pN` for pointers -/// -/// Other information required for correct selection is expected to be carried -/// by the opcode, or non-type flags. For example the distinction between G_ADD -/// and G_FADD for int/float or fast-math flags. -/// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_SUPPORT_LOWLEVELTYPEIMPL_H -#define LLVM_SUPPORT_LOWLEVELTYPEIMPL_H - -#include "llvm/ADT/DenseMapInfo.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/MachineValueType.h" -#include - -namespace llvm { - -class Type; -class raw_ostream; - -class LLT { -public: - /// Get a low-level scalar or aggregate "bag of bits". - static constexpr LLT scalar(unsigned SizeInBits) { - return LLT{/*isPointer=*/false, /*isVector=*/false, /*isScalar=*/true, - ElementCount::getFixed(0), SizeInBits, - /*AddressSpace=*/0}; - } - - /// Get a low-level pointer in the given address space. - static constexpr LLT pointer(unsigned AddressSpace, unsigned SizeInBits) { - assert(SizeInBits > 0 && "invalid pointer size"); - return LLT{/*isPointer=*/true, /*isVector=*/false, /*isScalar=*/false, - ElementCount::getFixed(0), SizeInBits, AddressSpace}; - } - - /// Get a low-level vector of some number of elements and element width. - static constexpr LLT vector(ElementCount EC, unsigned ScalarSizeInBits) { - assert(!EC.isScalar() && "invalid number of vector elements"); - return LLT{/*isPointer=*/false, /*isVector=*/true, /*isScalar=*/false, - EC, ScalarSizeInBits, /*AddressSpace=*/0}; - } - - /// Get a low-level vector of some number of elements and element type. - static constexpr LLT vector(ElementCount EC, LLT ScalarTy) { - assert(!EC.isScalar() && "invalid number of vector elements"); - assert(!ScalarTy.isVector() && "invalid vector element type"); - return LLT{ScalarTy.isPointer(), - /*isVector=*/true, - /*isScalar=*/false, - EC, - ScalarTy.getSizeInBits().getFixedValue(), - ScalarTy.isPointer() ? ScalarTy.getAddressSpace() : 0}; - } - - /// Get a low-level fixed-width vector of some number of elements and element - /// width. - static constexpr LLT fixed_vector(unsigned NumElements, - unsigned ScalarSizeInBits) { - return vector(ElementCount::getFixed(NumElements), ScalarSizeInBits); - } - - /// Get a low-level fixed-width vector of some number of elements and element - /// type. - static constexpr LLT fixed_vector(unsigned NumElements, LLT ScalarTy) { - return vector(ElementCount::getFixed(NumElements), ScalarTy); - } - - /// Get a low-level scalable vector of some number of elements and element - /// width. - static constexpr LLT scalable_vector(unsigned MinNumElements, - unsigned ScalarSizeInBits) { - return vector(ElementCount::getScalable(MinNumElements), ScalarSizeInBits); - } - - /// Get a low-level scalable vector of some number of elements and element - /// type. - static constexpr LLT scalable_vector(unsigned MinNumElements, LLT ScalarTy) { - return vector(ElementCount::getScalable(MinNumElements), ScalarTy); - } - - static constexpr LLT scalarOrVector(ElementCount EC, LLT ScalarTy) { - return EC.isScalar() ? ScalarTy : LLT::vector(EC, ScalarTy); - } - - static constexpr LLT scalarOrVector(ElementCount EC, uint64_t ScalarSize) { - assert(ScalarSize <= std::numeric_limits::max() && - "Not enough bits in LLT to represent size"); - return scalarOrVector(EC, LLT::scalar(static_cast(ScalarSize))); - } - - explicit constexpr LLT(bool isPointer, bool isVector, bool isScalar, - ElementCount EC, uint64_t SizeInBits, - unsigned AddressSpace) - : LLT() { - init(isPointer, isVector, isScalar, EC, SizeInBits, AddressSpace); - } - explicit constexpr LLT() - : IsScalar(false), IsPointer(false), IsVector(false), RawData(0) {} - - explicit LLT(MVT VT); - - constexpr bool isValid() const { return IsScalar || RawData != 0; } - - constexpr bool isScalar() const { return IsScalar; } - - constexpr bool isPointer() const { - return isValid() && IsPointer && !IsVector; - } - - constexpr bool isVector() const { return isValid() && IsVector; } - - /// Returns the number of elements in a vector LLT. Must only be called on - /// vector types. - constexpr uint16_t getNumElements() const { - if (isScalable()) - llvm::reportInvalidSizeRequest( - "Possible incorrect use of LLT::getNumElements() for " - "scalable vector. Scalable flag may be dropped, use " - "LLT::getElementCount() instead"); - return getElementCount().getKnownMinValue(); - } - - /// Returns true if the LLT is a scalable vector. Must only be called on - /// vector types. - constexpr bool isScalable() const { - assert(isVector() && "Expected a vector type"); - return IsPointer ? getFieldValue(PointerVectorScalableFieldInfo) - : getFieldValue(VectorScalableFieldInfo); - } - - constexpr ElementCount getElementCount() const { - assert(IsVector && "cannot get number of elements on scalar/aggregate"); - return ElementCount::get(IsPointer - ? getFieldValue(PointerVectorElementsFieldInfo) - : getFieldValue(VectorElementsFieldInfo), - isScalable()); - } - - /// Returns the total size of the type. Must only be called on sized types. - constexpr TypeSize getSizeInBits() const { - if (isPointer() || isScalar()) - return TypeSize::Fixed(getScalarSizeInBits()); - auto EC = getElementCount(); - return TypeSize(getScalarSizeInBits() * EC.getKnownMinValue(), - EC.isScalable()); - } - - /// Returns the total size of the type in bytes, i.e. number of whole bytes - /// needed to represent the size in bits. Must only be called on sized types. - constexpr TypeSize getSizeInBytes() const { - TypeSize BaseSize = getSizeInBits(); - return {(BaseSize.getKnownMinValue() + 7) / 8, BaseSize.isScalable()}; - } - - constexpr LLT getScalarType() const { - return isVector() ? getElementType() : *this; - } - - /// If this type is a vector, return a vector with the same number of elements - /// but the new element type. Otherwise, return the new element type. - constexpr LLT changeElementType(LLT NewEltTy) const { - return isVector() ? LLT::vector(getElementCount(), NewEltTy) : NewEltTy; - } - - /// If this type is a vector, return a vector with the same number of elements - /// but the new element size. Otherwise, return the new element type. Invalid - /// for pointer types. For pointer types, use changeElementType. - constexpr LLT changeElementSize(unsigned NewEltSize) const { - assert(!getScalarType().isPointer() && - "invalid to directly change element size for pointers"); - return isVector() ? LLT::vector(getElementCount(), NewEltSize) - : LLT::scalar(NewEltSize); - } - - /// Return a vector or scalar with the same element type and the new element - /// count. - constexpr LLT changeElementCount(ElementCount EC) const { - return LLT::scalarOrVector(EC, getScalarType()); - } - - /// Return a type that is \p Factor times smaller. Reduces the number of - /// elements if this is a vector, or the bitwidth for scalar/pointers. Does - /// not attempt to handle cases that aren't evenly divisible. - constexpr LLT divide(int Factor) const { - assert(Factor != 1); - assert((!isScalar() || getScalarSizeInBits() != 0) && - "cannot divide scalar of size zero"); - if (isVector()) { - assert(getElementCount().isKnownMultipleOf(Factor)); - return scalarOrVector(getElementCount().divideCoefficientBy(Factor), - getElementType()); - } - - assert(getScalarSizeInBits() % Factor == 0); - return scalar(getScalarSizeInBits() / Factor); - } - - /// Produce a vector type that is \p Factor times bigger, preserving the - /// element type. For a scalar or pointer, this will produce a new vector with - /// \p Factor elements. - constexpr LLT multiplyElements(int Factor) const { - if (isVector()) { - return scalarOrVector(getElementCount().multiplyCoefficientBy(Factor), - getElementType()); - } - - return fixed_vector(Factor, *this); - } - - constexpr bool isByteSized() const { - return getSizeInBits().isKnownMultipleOf(8); - } - - constexpr unsigned getScalarSizeInBits() const { - if (IsScalar) - return getFieldValue(ScalarSizeFieldInfo); - if (IsVector) { - if (!IsPointer) - return getFieldValue(VectorSizeFieldInfo); - else - return getFieldValue(PointerVectorSizeFieldInfo); - } else if (IsPointer) - return getFieldValue(PointerSizeFieldInfo); - else - llvm_unreachable("unexpected LLT"); - } - - constexpr unsigned getAddressSpace() const { - assert(RawData != 0 && "Invalid Type"); - assert(IsPointer && "cannot get address space of non-pointer type"); - if (!IsVector) - return getFieldValue(PointerAddressSpaceFieldInfo); - else - return getFieldValue(PointerVectorAddressSpaceFieldInfo); - } - - /// Returns the vector's element type. Only valid for vector types. - constexpr LLT getElementType() const { - assert(isVector() && "cannot get element type of scalar/aggregate"); - if (IsPointer) - return pointer(getAddressSpace(), getScalarSizeInBits()); - else - return scalar(getScalarSizeInBits()); - } - - void print(raw_ostream &OS) const; - -#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) - LLVM_DUMP_METHOD void dump() const { - print(dbgs()); - dbgs() << '\n'; - } -#endif - - constexpr bool operator==(const LLT &RHS) const { - return IsPointer == RHS.IsPointer && IsVector == RHS.IsVector && - IsScalar == RHS.IsScalar && RHS.RawData == RawData; - } - - constexpr bool operator!=(const LLT &RHS) const { return !(*this == RHS); } - - friend struct DenseMapInfo; - friend class GISelInstProfileBuilder; - -private: - /// LLT is packed into 64 bits as follows: - /// isScalar : 1 - /// isPointer : 1 - /// isVector : 1 - /// with 61 bits remaining for Kind-specific data, packed in bitfields - /// as described below. As there isn't a simple portable way to pack bits - /// into bitfields, here the different fields in the packed structure is - /// described in static const *Field variables. Each of these variables - /// is a 2-element array, with the first element describing the bitfield size - /// and the second element describing the bitfield offset. - typedef int BitFieldInfo[2]; - /// - /// This is how the bitfields are packed per Kind: - /// * Invalid: - /// gets encoded as RawData == 0, as that is an invalid encoding, since for - /// valid encodings, SizeInBits/SizeOfElement must be larger than 0. - /// * Non-pointer scalar (isPointer == 0 && isVector == 0): - /// SizeInBits: 32; - static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 0}; - /// * Pointer (isPointer == 1 && isVector == 0): - /// SizeInBits: 16; - /// AddressSpace: 24; - static const constexpr BitFieldInfo PointerSizeFieldInfo{16, 0}; - static const constexpr BitFieldInfo PointerAddressSpaceFieldInfo{ - 24, PointerSizeFieldInfo[0] + PointerSizeFieldInfo[1]}; - static_assert((PointerAddressSpaceFieldInfo[0] + - PointerAddressSpaceFieldInfo[1]) <= 61, - "Insufficient bits to encode all data"); - /// * Vector-of-non-pointer (isPointer == 0 && isVector == 1): - /// NumElements: 16; - /// SizeOfElement: 32; - /// Scalable: 1; - static const constexpr BitFieldInfo VectorElementsFieldInfo{16, 0}; - static const constexpr BitFieldInfo VectorSizeFieldInfo{ - 32, VectorElementsFieldInfo[0] + VectorElementsFieldInfo[1]}; - static const constexpr BitFieldInfo VectorScalableFieldInfo{ - 1, VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]}; - static_assert((VectorSizeFieldInfo[0] + VectorSizeFieldInfo[1]) <= 61, - "Insufficient bits to encode all data"); - /// * Vector-of-pointer (isPointer == 1 && isVector == 1): - /// NumElements: 16; - /// SizeOfElement: 16; - /// AddressSpace: 24; - /// Scalable: 1; - static const constexpr BitFieldInfo PointerVectorElementsFieldInfo{16, 0}; - static const constexpr BitFieldInfo PointerVectorSizeFieldInfo{ - 16, - PointerVectorElementsFieldInfo[1] + PointerVectorElementsFieldInfo[0]}; - static const constexpr BitFieldInfo PointerVectorAddressSpaceFieldInfo{ - 24, PointerVectorSizeFieldInfo[1] + PointerVectorSizeFieldInfo[0]}; - static const constexpr BitFieldInfo PointerVectorScalableFieldInfo{ - 1, PointerVectorAddressSpaceFieldInfo[0] + - PointerVectorAddressSpaceFieldInfo[1]}; - static_assert((PointerVectorAddressSpaceFieldInfo[0] + - PointerVectorAddressSpaceFieldInfo[1]) <= 61, - "Insufficient bits to encode all data"); - - uint64_t IsScalar : 1; - uint64_t IsPointer : 1; - uint64_t IsVector : 1; - uint64_t RawData : 61; - - static constexpr uint64_t getMask(const BitFieldInfo FieldInfo) { - const int FieldSizeInBits = FieldInfo[0]; - return (((uint64_t)1) << FieldSizeInBits) - 1; - } - static constexpr uint64_t maskAndShift(uint64_t Val, uint64_t Mask, - uint8_t Shift) { - assert(Val <= Mask && "Value too large for field"); - return (Val & Mask) << Shift; - } - static constexpr uint64_t maskAndShift(uint64_t Val, - const BitFieldInfo FieldInfo) { - return maskAndShift(Val, getMask(FieldInfo), FieldInfo[1]); - } - - constexpr uint64_t getFieldValue(const BitFieldInfo FieldInfo) const { - return getMask(FieldInfo) & (RawData >> FieldInfo[1]); - } - - constexpr void init(bool IsPointer, bool IsVector, bool IsScalar, - ElementCount EC, uint64_t SizeInBits, - unsigned AddressSpace) { - assert(SizeInBits <= std::numeric_limits::max() && - "Not enough bits in LLT to represent size"); - this->IsPointer = IsPointer; - this->IsVector = IsVector; - this->IsScalar = IsScalar; - if (IsScalar) - RawData = maskAndShift(SizeInBits, ScalarSizeFieldInfo); - else if (IsVector) { - assert(EC.isVector() && "invalid number of vector elements"); - if (!IsPointer) - RawData = - maskAndShift(EC.getKnownMinValue(), VectorElementsFieldInfo) | - maskAndShift(SizeInBits, VectorSizeFieldInfo) | - maskAndShift(EC.isScalable() ? 1 : 0, VectorScalableFieldInfo); - else - RawData = - maskAndShift(EC.getKnownMinValue(), - PointerVectorElementsFieldInfo) | - maskAndShift(SizeInBits, PointerVectorSizeFieldInfo) | - maskAndShift(AddressSpace, PointerVectorAddressSpaceFieldInfo) | - maskAndShift(EC.isScalable() ? 1 : 0, - PointerVectorScalableFieldInfo); - } else if (IsPointer) - RawData = maskAndShift(SizeInBits, PointerSizeFieldInfo) | - maskAndShift(AddressSpace, PointerAddressSpaceFieldInfo); - else - llvm_unreachable("unexpected LLT configuration"); - } - -public: - constexpr uint64_t getUniqueRAWLLTData() const { - return ((uint64_t)RawData) << 3 | ((uint64_t)IsScalar) << 2 | - ((uint64_t)IsPointer) << 1 | ((uint64_t)IsVector); - } -}; - -inline raw_ostream& operator<<(raw_ostream &OS, const LLT &Ty) { - Ty.print(OS); - return OS; -} - -template<> struct DenseMapInfo { - static inline LLT getEmptyKey() { - LLT Invalid; - Invalid.IsPointer = true; - return Invalid; - } - static inline LLT getTombstoneKey() { - LLT Invalid; - Invalid.IsVector = true; - return Invalid; - } - static inline unsigned getHashValue(const LLT &Ty) { - uint64_t Val = Ty.getUniqueRAWLLTData(); - return DenseMapInfo::getHashValue(Val); - } - static bool isEqual(const LLT &LHS, const LLT &RHS) { - return LHS == RHS; - } -}; - -} - -#endif // LLVM_SUPPORT_LOWLEVELTYPEIMPL_H diff --git a/llvm/include/llvm/module.modulemap b/llvm/include/llvm/module.modulemap --- a/llvm/include/llvm/module.modulemap +++ b/llvm/include/llvm/module.modulemap @@ -15,6 +15,20 @@ module * { export * } } +module LLVM_CodeGenTypes { + requires cplusplus + + module LLT { + header "CodeGen/LowLevelType.h" export * + } + module MVT { + header "CodeGen/MachineValueType.h" export * + } + module VT { + header "CodeGen/ValueTypes.h" export * + } +} + // A module covering CodeGen/ and Target/. These are intertwined // and codependent, and thus notionally form a single module. module LLVM_Backend { @@ -336,15 +350,6 @@ module * { export * } } -// Used by llvm-tblgen -module LLVM_MC_TableGen { - requires cplusplus - module MC_LaneBitmask { header "MC/LaneBitmask.h" export * } - module MC_InstrItineraries { header "MC/MCInstrItineraries.h" export * } - module MC_Schedule { header "MC/MCSchedule.h" export * } - module MC_SubtargetFeature { header "MC/SubtargetFeature.h" export * } -} - module LLVM_Object { requires cplusplus umbrella "Object" diff --git a/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp --- a/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp +++ b/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RegisterClassInfo.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/TargetInstrInfo.h" @@ -31,7 +32,6 @@ #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/raw_ostream.h" #include #include diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -33,6 +33,7 @@ #include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/BasicBlockSectionsProfileReader.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetPassConfig.h" @@ -82,7 +83,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -74,7 +74,6 @@ #include "llvm/Support/CodeGen.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetIntrinsicInfo.h" diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp --- a/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp @@ -13,6 +13,7 @@ #include "llvm/CodeGen/GlobalISel/LegalizerInfo.h" #include "llvm/ADT/SmallBitVector.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -21,7 +22,6 @@ #include "llvm/MC/MCInstrInfo.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include using namespace llvm; diff --git a/llvm/lib/CodeGen/LowLevelType.cpp b/llvm/lib/CodeGen/LowLevelType.cpp --- a/llvm/lib/CodeGen/LowLevelType.cpp +++ b/llvm/lib/CodeGen/LowLevelType.cpp @@ -83,3 +83,46 @@ } llvm_unreachable("Invalid FP type size."); } + +LLT::LLT(MVT VT) { + if (VT.isVector()) { + bool asVector = VT.getVectorMinNumElements() > 1; + init(/*IsPointer=*/false, asVector, /*IsScalar=*/!asVector, + VT.getVectorElementCount(), VT.getVectorElementType().getSizeInBits(), + /*AddressSpace=*/0); + } else if (VT.isValid() && !VT.isScalableTargetExtVT()) { + // Aggregates are no different from real scalars as far as GlobalISel is + // concerned. + init(/*IsPointer=*/false, /*IsVector=*/false, /*IsScalar=*/true, + ElementCount::getFixed(0), VT.getSizeInBits(), /*AddressSpace=*/0); + } else { + IsScalar = false; + IsPointer = false; + IsVector = false; + RawData = 0; + } +} + +void LLT::print(raw_ostream &OS) const { + if (isVector()) { + OS << "<"; + OS << getElementCount() << " x " << getElementType() << ">"; + } else if (isPointer()) + OS << "p" << getAddressSpace(); + else if (isValid()) { + assert(isScalar() && "unexpected type"); + OS << "s" << getScalarSizeInBits(); + } else + OS << "LLT_invalid"; +} + +const constexpr LLT::BitFieldInfo LLT::ScalarSizeFieldInfo; +const constexpr LLT::BitFieldInfo LLT::PointerSizeFieldInfo; +const constexpr LLT::BitFieldInfo LLT::PointerAddressSpaceFieldInfo; +const constexpr LLT::BitFieldInfo LLT::VectorElementsFieldInfo; +const constexpr LLT::BitFieldInfo LLT::VectorScalableFieldInfo; +const constexpr LLT::BitFieldInfo LLT::VectorSizeFieldInfo; +const constexpr LLT::BitFieldInfo LLT::PointerVectorElementsFieldInfo; +const constexpr LLT::BitFieldInfo LLT::PointerVectorScalableFieldInfo; +const constexpr LLT::BitFieldInfo LLT::PointerVectorSizeFieldInfo; +const constexpr LLT::BitFieldInfo LLT::PointerVectorAddressSpaceFieldInfo; diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -24,6 +24,7 @@ #include "llvm/Analysis/MemoryLocation.h" #include "llvm/AsmParser/Parser.h" #include "llvm/AsmParser/SlotMapping.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MIRFormatter.h" #include "llvm/CodeGen/MIRPrinter.h" #include "llvm/CodeGen/MachineBasicBlock.h" @@ -62,7 +63,6 @@ #include "llvm/Support/BranchProbability.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SMLoc.h" #include "llvm/Support/SourceMgr.h" diff --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp --- a/llvm/lib/CodeGen/MIRPrinter.cpp +++ b/llvm/lib/CodeGen/MIRPrinter.cpp @@ -18,6 +18,7 @@ #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MIRYamlMapping.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineConstantPool.h" @@ -47,7 +48,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -18,6 +18,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/MemoryLocation.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" @@ -50,7 +51,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp --- a/llvm/lib/CodeGen/MachineScheduler.cpp +++ b/llvm/lib/CodeGen/MachineScheduler.cpp @@ -32,6 +32,7 @@ #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachinePassRegistry.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RegisterClassInfo.h" #include "llvm/CodeGen/RegisterPressure.h" #include "llvm/CodeGen/ScheduleDAG.h" @@ -56,7 +57,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/GraphWriter.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/raw_ostream.h" #include #include diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp --- a/llvm/lib/CodeGen/MachineVerifier.cpp +++ b/llvm/lib/CodeGen/MachineVerifier.cpp @@ -37,6 +37,7 @@ #include "llvm/CodeGen/LiveRangeCalc.h" #include "llvm/CodeGen/LiveStacks.h" #include "llvm/CodeGen/LiveVariables.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" @@ -71,7 +72,6 @@ #include "llvm/Pass.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/ModRef.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -36,6 +36,7 @@ #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" @@ -58,7 +59,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -59,6 +59,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/StackMaps.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" @@ -95,7 +96,6 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -23,6 +23,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -41,7 +42,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -29,6 +29,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" @@ -38,7 +39,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp @@ -24,6 +24,7 @@ #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/Register.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/ScheduleHazardRecognizer.h" @@ -45,7 +46,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/raw_ostream.h" #include #include diff --git a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h --- a/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h +++ b/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h @@ -16,10 +16,10 @@ #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -35,6 +35,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -61,7 +62,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Mutex.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -21,6 +21,7 @@ #include "llvm/CodeGen/AssignmentTrackingAnalysis.h" #include "llvm/CodeGen/CodeGenCommonISel.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/SwitchLoweringUtils.h" #include "llvm/CodeGen/TargetLowering.h" @@ -30,7 +31,6 @@ #include "llvm/Support/BranchProbability.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -19,6 +19,7 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetInstrInfo.h" @@ -40,7 +41,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/Printable.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetIntrinsicInfo.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -48,6 +48,7 @@ #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachinePassRegistry.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SchedulerRegistry.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -92,7 +93,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/Timer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetIntrinsicInfo.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -26,6 +26,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -42,7 +43,6 @@ #include "llvm/IR/Type.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" #include diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -28,6 +28,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/StackMaps.h" #include "llvm/CodeGen/TargetLowering.h" @@ -48,7 +49,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" diff --git a/llvm/lib/CodeGen/TargetRegisterInfo.cpp b/llvm/lib/CodeGen/TargetRegisterInfo.cpp --- a/llvm/lib/CodeGen/TargetRegisterInfo.cpp +++ b/llvm/lib/CodeGen/TargetRegisterInfo.cpp @@ -21,6 +21,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetFrameLowering.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" @@ -33,7 +34,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/Printable.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/Support/CMakeLists.txt b/llvm/lib/Support/CMakeLists.txt --- a/llvm/lib/Support/CMakeLists.txt +++ b/llvm/lib/Support/CMakeLists.txt @@ -182,7 +182,6 @@ LineIterator.cpp Locale.cpp LockFileManager.cpp - LowLevelType.cpp ManagedStatic.cpp MathExtras.cpp MemAlloc.cpp diff --git a/llvm/lib/Support/LowLevelType.cpp b/llvm/lib/Support/LowLevelType.cpp deleted file mode 100644 --- a/llvm/lib/Support/LowLevelType.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//===-- llvm/Support/LowLevelType.cpp -------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -/// \file This file implements the more header-heavy bits of the LLT class to -/// avoid polluting users' namespaces. -// -//===----------------------------------------------------------------------===// - -#include "llvm/Support/LowLevelTypeImpl.h" -#include "llvm/Support/raw_ostream.h" -using namespace llvm; - -LLT::LLT(MVT VT) { - if (VT.isVector()) { - bool asVector = VT.getVectorMinNumElements() > 1; - init(/*IsPointer=*/false, asVector, /*IsScalar=*/!asVector, - VT.getVectorElementCount(), VT.getVectorElementType().getSizeInBits(), - /*AddressSpace=*/0); - } else if (VT.isValid() && !VT.isScalableTargetExtVT()) { - // Aggregates are no different from real scalars as far as GlobalISel is - // concerned. - init(/*IsPointer=*/false, /*IsVector=*/false, /*IsScalar=*/true, - ElementCount::getFixed(0), VT.getSizeInBits(), /*AddressSpace=*/0); - } else { - IsScalar = false; - IsPointer = false; - IsVector = false; - RawData = 0; - } -} - -void LLT::print(raw_ostream &OS) const { - if (isVector()) { - OS << "<"; - OS << getElementCount() << " x " << getElementType() << ">"; - } else if (isPointer()) - OS << "p" << getAddressSpace(); - else if (isValid()) { - assert(isScalar() && "unexpected type"); - OS << "s" << getScalarSizeInBits(); - } else - OS << "LLT_invalid"; -} - -const constexpr LLT::BitFieldInfo LLT::ScalarSizeFieldInfo; -const constexpr LLT::BitFieldInfo LLT::PointerSizeFieldInfo; -const constexpr LLT::BitFieldInfo LLT::PointerAddressSpaceFieldInfo; -const constexpr LLT::BitFieldInfo LLT::VectorElementsFieldInfo; -const constexpr LLT::BitFieldInfo LLT::VectorScalableFieldInfo; -const constexpr LLT::BitFieldInfo LLT::VectorSizeFieldInfo; -const constexpr LLT::BitFieldInfo LLT::PointerVectorElementsFieldInfo; -const constexpr LLT::BitFieldInfo LLT::PointerVectorScalableFieldInfo; -const constexpr LLT::BitFieldInfo LLT::PointerVectorSizeFieldInfo; -const constexpr LLT::BitFieldInfo LLT::PointerVectorAddressSpaceFieldInfo; diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp --- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp +++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp @@ -35,6 +35,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" @@ -65,7 +66,6 @@ #include "llvm/Support/CodeGen.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include #include diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -44,6 +44,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -80,7 +81,6 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/InstructionCost.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt b/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/AArch64/AsmParser/CMakeLists.txt @@ -7,6 +7,7 @@ AArch64Desc AArch64Info AArch64Utils + CodeGen MC MCParser Support diff --git a/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp b/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp --- a/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp @@ -33,6 +33,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/ValueTypes.h" @@ -41,7 +42,6 @@ #include "llvm/IR/Function.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/AArch64/MCTargetDesc/CMakeLists.txt @@ -16,6 +16,7 @@ AArch64Info AArch64Utils BinaryFormat + CodeGen MC Support TargetParser diff --git a/llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp b/llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp --- a/llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUGlobalISelUtils.cpp @@ -10,8 +10,8 @@ #include "GCNSubtarget.h" #include "llvm/CodeGen/GlobalISel/GISelKnownBits.h" #include "llvm/CodeGen/GlobalISel/MIPatternMatch.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/IR/Constants.h" -#include "llvm/Support/LowLevelTypeImpl.h" using namespace llvm; using namespace MIPatternMatch; diff --git a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp --- a/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp +++ b/llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp @@ -21,6 +21,7 @@ #include "llvm/ADT/StringSet.h" #include "llvm/ADT/Twine.h" #include "llvm/BinaryFormat/ELF.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCExpr.h" @@ -35,7 +36,6 @@ #include "llvm/Support/AMDGPUMetadata.h" #include "llvm/Support/AMDHSAKernelDescriptor.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/TargetParser/TargetParser.h" #include diff --git a/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt b/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/AsmParser/CMakeLists.txt @@ -5,6 +5,7 @@ AMDGPUDesc AMDGPUInfo AMDGPUUtils + CodeGen MC MCParser Support diff --git a/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt b/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/Disassembler/CMakeLists.txt @@ -7,6 +7,7 @@ AMDGPUDesc AMDGPUInfo AMDGPUUtils + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt b/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/MCA/CMakeLists.txt @@ -5,6 +5,7 @@ AMDGPUDesc AMDGPUInfo AMDGPUUtils + CodeGen MC MCA MCParser diff --git a/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/MCTargetDesc/CMakeLists.txt @@ -16,6 +16,7 @@ AMDGPUInfo AMDGPUUtils BinaryFormat + CodeGen Core MC Support diff --git a/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt b/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt --- a/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/Utils/CMakeLists.txt @@ -8,6 +8,7 @@ LINK_COMPONENTS Analysis BinaryFormat + CodeGen Core MC Support diff --git a/llvm/lib/Target/ARM/ARMCallLowering.cpp b/llvm/lib/Target/ARM/ARMCallLowering.cpp --- a/llvm/lib/Target/ARM/ARMCallLowering.cpp +++ b/llvm/lib/Target/ARM/ARMCallLowering.cpp @@ -30,6 +30,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/ValueTypes.h" @@ -40,8 +41,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/LowLevelTypeImpl.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -40,6 +40,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" @@ -72,7 +73,6 @@ #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" diff --git a/llvm/lib/Target/ARM/ARMISelLowering.h b/llvm/lib/Target/ARM/ARMISelLowering.h --- a/llvm/lib/Target/ARM/ARMISelLowering.h +++ b/llvm/lib/Target/ARM/ARMISelLowering.h @@ -20,6 +20,7 @@ #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/ValueTypes.h" @@ -29,7 +30,6 @@ #include "llvm/IR/IRBuilder.h" #include "llvm/IR/InlineAsm.h" #include "llvm/Support/CodeGen.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -52,6 +52,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGAddressAnalysis.h" @@ -98,7 +99,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -14,6 +14,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/CodeGen/CostTable.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/DataLayout.h" @@ -28,7 +29,6 @@ #include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/Casting.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Transforms/InstCombine/InstCombiner.h" #include "llvm/Transforms/Utils/Local.h" diff --git a/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt b/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/ARM/AsmParser/CMakeLists.txt @@ -5,6 +5,7 @@ ARMDesc ARMInfo ARMUtils + CodeGen MC MCParser Support diff --git a/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt b/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/ARM/Disassembler/CMakeLists.txt @@ -5,6 +5,7 @@ ARMDesc ARMInfo ARMUtils + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/ARM/MCTargetDesc/CMakeLists.txt @@ -18,6 +18,7 @@ ARMInfo ARMUtils BinaryFormat + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt b/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/AVR/AsmParser/CMakeLists.txt @@ -4,6 +4,7 @@ LINK_COMPONENTS AVRDesc AVRInfo + CodeGen MC MCParser Support diff --git a/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt b/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/AVR/Disassembler/CMakeLists.txt @@ -3,6 +3,7 @@ LINK_COMPONENTS AVRInfo + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.h b/llvm/lib/Target/Hexagon/HexagonISelLowering.h --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.h +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.h @@ -18,12 +18,12 @@ #include "MCTargetDesc/HexagonMCTargetDesc.h" #include "llvm/ADT/StringRef.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/InlineAsm.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.h b/llvm/lib/Target/Hexagon/HexagonInstrInfo.h --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.h +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.h @@ -17,9 +17,9 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/ValueTypes.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp @@ -33,6 +33,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/ScheduleDAG.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetOpcodes.h" @@ -48,7 +49,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt b/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/Lanai/AsmParser/CMakeLists.txt @@ -4,6 +4,7 @@ LanaiAsmParser.cpp LINK_COMPONENTS + CodeGen LanaiDesc LanaiInfo MC diff --git a/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt b/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/Lanai/Disassembler/CMakeLists.txt @@ -2,6 +2,7 @@ LanaiDisassembler.cpp LINK_COMPONENTS + CodeGen LanaiDesc LanaiInfo MC diff --git a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp --- a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp +++ b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp @@ -27,6 +27,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -42,7 +43,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/Target/M68k/M68kMachineFunction.h b/llvm/lib/Target/M68k/M68kMachineFunction.h --- a/llvm/lib/Target/M68k/M68kMachineFunction.h +++ b/llvm/lib/Target/M68k/M68kMachineFunction.h @@ -16,7 +16,7 @@ #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/MachineFunction.h" -#include "llvm/Support/MachineValueType.h" +#include "llvm/CodeGen/MachineValueType.h" namespace llvm { diff --git a/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt b/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/MSP430/AsmParser/CMakeLists.txt @@ -2,6 +2,7 @@ MSP430AsmParser.cpp LINK_COMPONENTS + CodeGen MC MCParser MSP430Desc diff --git a/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/Mips/MCTargetDesc/CMakeLists.txt @@ -14,6 +14,7 @@ MipsTargetStreamer.cpp LINK_COMPONENTS + CodeGen MC MipsInfo Support diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp @@ -9,10 +9,10 @@ #include "MipsABIInfo.h" #include "MipsRegisterInfo.h" #include "llvm/ADT/StringRef.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/MC/MCTargetOptions.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/LowLevelTypeImpl.h" using namespace llvm; diff --git a/llvm/lib/Target/Mips/MipsFastISel.cpp b/llvm/lib/Target/Mips/MipsFastISel.cpp --- a/llvm/lib/Target/Mips/MipsFastISel.cpp +++ b/llvm/lib/Target/Mips/MipsFastISel.cpp @@ -35,6 +35,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/ValueTypes.h" @@ -63,7 +64,6 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -21,6 +21,7 @@ #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/ISDOpcodes.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" @@ -28,7 +29,6 @@ #include "llvm/IR/CallingConv.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/Type.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Target/TargetMachine.h" #include #include diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -40,6 +40,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -63,7 +64,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" diff --git a/llvm/lib/Target/Mips/MipsOptimizePICCall.cpp b/llvm/lib/Target/Mips/MipsOptimizePICCall.cpp --- a/llvm/lib/Target/Mips/MipsOptimizePICCall.cpp +++ b/llvm/lib/Target/Mips/MipsOptimizePICCall.cpp @@ -26,6 +26,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/CodeGen/TargetRegisterInfo.h" @@ -33,7 +34,6 @@ #include "llvm/Support/Allocator.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/RecyclingAllocator.h" #include #include diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.h b/llvm/lib/Target/Mips/MipsSEISelLowering.h --- a/llvm/lib/Target/Mips/MipsSEISelLowering.h +++ b/llvm/lib/Target/Mips/MipsSEISelLowering.h @@ -14,8 +14,8 @@ #define LLVM_LIB_TARGET_MIPS_MIPSSEISELLOWERING_H #include "MipsISelLowering.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAGNodes.h" -#include "llvm/Support/MachineValueType.h" namespace llvm { diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp --- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp @@ -26,6 +26,7 @@ #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetInstrInfo.h" @@ -38,7 +39,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/TargetParser/Triple.h" diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp --- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -44,6 +44,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" @@ -74,7 +75,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Endian.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/NativeFormatting.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -25,6 +25,7 @@ #include "llvm/CodeGen/Analysis.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetCallingConv.h" @@ -48,7 +49,6 @@ #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt @@ -13,6 +13,7 @@ LINK_COMPONENTS BinaryFormat + CodeGen MC PowerPCInfo Support diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp --- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -32,6 +32,7 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -53,7 +54,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h --- a/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -18,6 +18,7 @@ #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineMemOperand.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" @@ -28,7 +29,6 @@ #include "llvm/IR/InlineAsm.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Type.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -46,6 +46,7 @@ #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" @@ -85,7 +86,6 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Format.h" #include "llvm/Support/KnownBits.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" diff --git a/llvm/lib/Target/RISCV/MCA/CMakeLists.txt b/llvm/lib/Target/RISCV/MCA/CMakeLists.txt --- a/llvm/lib/Target/RISCV/MCA/CMakeLists.txt +++ b/llvm/lib/Target/RISCV/MCA/CMakeLists.txt @@ -2,6 +2,7 @@ RISCVCustomBehaviour.cpp LINK_COMPONENTS + CodeGen MC MCA MCParser diff --git a/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/SystemZ/MCTargetDesc/CMakeLists.txt @@ -7,6 +7,7 @@ SystemZMCTargetDesc.cpp LINK_COMPONENTS + CodeGen MC Support SystemZInfo diff --git a/llvm/lib/Target/VE/AsmParser/CMakeLists.txt b/llvm/lib/Target/VE/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/VE/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/VE/AsmParser/CMakeLists.txt @@ -2,6 +2,7 @@ VEAsmParser.cpp LINK_COMPONENTS + CodeGen MC MCParser Support diff --git a/llvm/lib/Target/VE/Disassembler/CMakeLists.txt b/llvm/lib/Target/VE/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/VE/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/VE/Disassembler/CMakeLists.txt @@ -2,6 +2,7 @@ VEDisassembler.cpp LINK_COMPONENTS + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/VE/MCTargetDesc/CMakeLists.txt @@ -9,6 +9,7 @@ VETargetStreamer.cpp LINK_COMPONENTS + CodeGen MC Support TargetParser diff --git a/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt b/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt --- a/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt +++ b/llvm/lib/Target/WebAssembly/AsmParser/CMakeLists.txt @@ -3,6 +3,7 @@ WebAssemblyAsmTypeCheck.cpp LINK_COMPONENTS + CodeGen MC MCParser Support diff --git a/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt b/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/WebAssembly/Disassembler/CMakeLists.txt @@ -2,6 +2,7 @@ WebAssemblyDisassembler.cpp LINK_COMPONENTS + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/CMakeLists.txt @@ -9,6 +9,7 @@ WebAssemblyWasmObjectWriter.cpp LINK_COMPONENTS + CodeGen MC Support TargetParser diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyInstPrinter.h @@ -16,8 +16,8 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/BinaryFormat/Wasm.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/MC/MCInstPrinter.h" -#include "llvm/Support/MachineValueType.h" namespace llvm { diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h @@ -16,8 +16,8 @@ #define LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYTARGETSTREAMER_H #include "llvm/BinaryFormat/Wasm.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Support/MachineValueType.h" namespace llvm { diff --git a/llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h b/llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h --- a/llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h +++ b/llvm/lib/Target/WebAssembly/Utils/WebAssemblyTypeUtilities.h @@ -17,9 +17,9 @@ #include "MCTargetDesc/WebAssemblyMCTypeUtilities.h" #include "llvm/BinaryFormat/Wasm.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/MC/MCSymbolWasm.h" -#include "llvm/Support/MachineValueType.h" namespace llvm { diff --git a/llvm/lib/Target/X86/MCA/CMakeLists.txt b/llvm/lib/Target/X86/MCA/CMakeLists.txt --- a/llvm/lib/Target/X86/MCA/CMakeLists.txt +++ b/llvm/lib/Target/X86/MCA/CMakeLists.txt @@ -2,6 +2,7 @@ X86CustomBehaviour.cpp LINK_COMPONENTS + CodeGen MC MCA MCParser diff --git a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt --- a/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt +++ b/llvm/lib/Target/X86/MCTargetDesc/CMakeLists.txt @@ -18,6 +18,7 @@ LINK_COMPONENTS BinaryFormat + CodeGen MC MCDisassembler Support diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp --- a/llvm/lib/Target/X86/X86AsmPrinter.cpp +++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp @@ -23,6 +23,7 @@ #include "llvm/BinaryFormat/ELF.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineModuleInfoImpls.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/InlineAsm.h" @@ -42,7 +43,6 @@ #include "llvm/MC/TargetRegistry.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Target/TargetMachine.h" using namespace llvm; diff --git a/llvm/lib/Target/X86/X86CallLowering.cpp b/llvm/lib/Target/X86/X86CallLowering.cpp --- a/llvm/lib/Target/X86/X86CallLowering.cpp +++ b/llvm/lib/Target/X86/X86CallLowering.cpp @@ -33,6 +33,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/ValueTypes.h" @@ -41,8 +42,6 @@ #include "llvm/IR/Function.h" #include "llvm/IR/Value.h" #include "llvm/MC/MCRegisterInfo.h" -#include "llvm/Support/LowLevelTypeImpl.h" -#include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/X86/X86InstructionSelector.cpp b/llvm/lib/Target/X86/X86InstructionSelector.cpp --- a/llvm/lib/Target/X86/X86InstructionSelector.cpp +++ b/llvm/lib/Target/X86/X86InstructionSelector.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/GlobalISel/InstructionSelector.h" #include "llvm/CodeGen/GlobalISel/InstructionSelectorImpl.h" #include "llvm/CodeGen/GlobalISel/Utils.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/MachineConstantPool.h" #include "llvm/CodeGen/MachineFunction.h" @@ -40,7 +41,6 @@ #include "llvm/Support/CodeGen.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/llvm/lib/Target/X86/X86InterleavedAccess.cpp b/llvm/lib/Target/X86/X86InterleavedAccess.cpp --- a/llvm/lib/Target/X86/X86InterleavedAccess.cpp +++ b/llvm/lib/Target/X86/X86InterleavedAccess.cpp @@ -18,6 +18,7 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/VectorUtils.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DerivedTypes.h" @@ -28,7 +29,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt b/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt --- a/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt +++ b/llvm/lib/Target/XCore/Disassembler/CMakeLists.txt @@ -2,6 +2,7 @@ XCoreDisassembler.cpp LINK_COMPONENTS + CodeGen MC MCDisassembler Support diff --git a/llvm/tools/llvm-dwarfutil/CMakeLists.txt b/llvm/tools/llvm-dwarfutil/CMakeLists.txt --- a/llvm/tools/llvm-dwarfutil/CMakeLists.txt +++ b/llvm/tools/llvm-dwarfutil/CMakeLists.txt @@ -6,6 +6,7 @@ AllTargetsCodeGens AllTargetsDescs AllTargetsInfos + CodeGen DWARFLinker DebugInfoDWARF MC diff --git a/llvm/tools/llvm-exegesis/CMakeLists.txt b/llvm/tools/llvm-exegesis/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/CMakeLists.txt @@ -4,6 +4,7 @@ AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos + CodeGen MC MCParser Support diff --git a/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/AArch64/CMakeLists.txt @@ -5,6 +5,7 @@ set(LLVM_LINK_COMPONENTS AArch64 + CodeGen Core Exegesis MC diff --git a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/Mips/CMakeLists.txt @@ -4,6 +4,7 @@ ) set(LLVM_LINK_COMPONENTS + CodeGen Core Exegesis MC diff --git a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt --- a/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt +++ b/llvm/tools/llvm-exegesis/lib/PowerPC/CMakeLists.txt @@ -4,6 +4,7 @@ ) set(LLVM_LINK_COMPONENTS + CodeGen Core Exegesis MC diff --git a/llvm/unittests/CodeGen/MachineOperandTest.cpp b/llvm/unittests/CodeGen/MachineOperandTest.cpp --- a/llvm/unittests/CodeGen/MachineOperandTest.cpp +++ b/llvm/unittests/CodeGen/MachineOperandTest.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "llvm/CodeGen/MachineOperand.h" +#include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/MachineModuleInfo.h" #include "llvm/CodeGen/TargetFrameLowering.h" @@ -21,7 +22,6 @@ #include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/TargetRegistry.h" -#include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include "gtest/gtest.h" diff --git a/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp b/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp --- a/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp +++ b/llvm/unittests/CodeGen/ScalableVectorMVTsTest.cpp @@ -6,10 +6,10 @@ // //===----------------------------------------------------------------------===// +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/LLVMContext.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/TypeSize.h" #include "gtest/gtest.h" diff --git a/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt b/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt --- a/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt +++ b/llvm/unittests/DebugInfo/DWARF/CMakeLists.txt @@ -2,6 +2,7 @@ ${LLVM_TARGETS_TO_BUILD} AsmPrinter BinaryFormat + CodeGen DebugInfoDWARF MC Object diff --git a/llvm/unittests/Support/MVTTest.cpp b/llvm/unittests/Support/MVTTest.cpp --- a/llvm/unittests/Support/MVTTest.cpp +++ b/llvm/unittests/Support/MVTTest.cpp @@ -7,12 +7,12 @@ //===----------------------------------------------------------------------===// // // Make sure the generated version of MachineValueType.h to be equivalent to -// the constant version of llvm/Support/MachineValueType.h. +// the constant version of llvm/CodeGen/MachineValueType.h. // //===----------------------------------------------------------------------===// #include "MachineValueType.h" -#include "llvm/Support/MachineValueType.h" +#include "llvm/CodeGen/MachineValueType.h" #include "gtest/gtest.h" #include #include diff --git a/llvm/utils/TableGen/CMakeLists.txt b/llvm/utils/TableGen/CMakeLists.txt --- a/llvm/utils/TableGen/CMakeLists.txt +++ b/llvm/utils/TableGen/CMakeLists.txt @@ -15,6 +15,11 @@ ) set_target_properties(llvm-min-tblgen PROPERTIES FOLDER "Tablegenning") +set(LLVM_LINK_COMPONENTS + CodeGen + Support + ) + add_tablegen(llvm-tblgen LLVM DESTINATION "${LLVM_TOOLS_INSTALL_DIR}" EXPORT LLVM diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h --- a/llvm/utils/TableGen/CodeGenInstruction.h +++ b/llvm/utils/TableGen/CodeGenInstruction.h @@ -16,7 +16,7 @@ #include "llvm/ADT/BitVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Support/MachineValueType.h" +#include "llvm/CodeGen/MachineValueType.h" #include #include #include diff --git a/llvm/utils/TableGen/CodeGenTarget.h b/llvm/utils/TableGen/CodeGenTarget.h --- a/llvm/utils/TableGen/CodeGenTarget.h +++ b/llvm/utils/TableGen/CodeGenTarget.h @@ -24,7 +24,7 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" -#include "llvm/Support/MachineValueType.h" +#include "llvm/CodeGen/MachineValueType.h" #include #include #include diff --git a/llvm/utils/TableGen/DAGISelMatcher.h b/llvm/utils/TableGen/DAGISelMatcher.h --- a/llvm/utils/TableGen/DAGISelMatcher.h +++ b/llvm/utils/TableGen/DAGISelMatcher.h @@ -12,8 +12,8 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/Support/Casting.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/utils/TableGen/GlobalISel/CMakeLists.txt b/llvm/utils/TableGen/GlobalISel/CMakeLists.txt --- a/llvm/utils/TableGen/GlobalISel/CMakeLists.txt +++ b/llvm/utils/TableGen/GlobalISel/CMakeLists.txt @@ -1,4 +1,5 @@ set(LLVM_LINK_COMPONENTS + CodeGen Support TableGen ) diff --git a/llvm/utils/TableGen/GlobalISelEmitter.cpp b/llvm/utils/TableGen/GlobalISelEmitter.cpp --- a/llvm/utils/TableGen/GlobalISelEmitter.cpp +++ b/llvm/utils/TableGen/GlobalISelEmitter.cpp @@ -37,11 +37,11 @@ #include "InfoByHwMode.h" #include "SubtargetFeatureInfo.h" #include "llvm/ADT/Statistic.h" +#include "llvm/CodeGen/LowLevelType.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/Support/CodeGenCoverage.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Error.h" -#include "llvm/Support/LowLevelTypeImpl.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/SaveAndRestore.h" #include "llvm/Support/ScopedPrinter.h" #include "llvm/TableGen/Error.h" diff --git a/llvm/utils/TableGen/InfoByHwMode.h b/llvm/utils/TableGen/InfoByHwMode.h --- a/llvm/utils/TableGen/InfoByHwMode.h +++ b/llvm/utils/TableGen/InfoByHwMode.h @@ -18,8 +18,8 @@ #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/Support/Compiler.h" -#include "llvm/Support/MachineValueType.h" #include #include #include diff --git a/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/llvm/utils/TableGen/RegisterInfoEmitter.cpp --- a/llvm/utils/TableGen/RegisterInfoEmitter.cpp +++ b/llvm/utils/TableGen/RegisterInfoEmitter.cpp @@ -25,10 +25,10 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SparseBitVector.h" #include "llvm/ADT/Twine.h" +#include "llvm/CodeGen/MachineValueType.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Format.h" -#include "llvm/Support/MachineValueType.h" #include "llvm/Support/raw_ostream.h" #include "llvm/TableGen/Error.h" #include "llvm/TableGen/Record.h" diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel --- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel +++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel @@ -616,6 +616,7 @@ features = ["-header_modules"], strip_include_prefix = "utils/TableGen", deps = [ + ":CodeGen", ":Support", ":TableGen", ":config", @@ -642,6 +643,7 @@ copts = llvm_copts, stamp = 0, deps = [ + ":CodeGen", ":Support", ":TableGen", ":TableGenGlobalISel", @@ -2335,6 +2337,7 @@ copts = llvm_copts, features = ["-layering_check"], deps = [ + ":CodeGen", ":MC", ":MCA", ":MCParser", @@ -3403,6 +3406,7 @@ deps = [ ":AllTargetsAsmParsers", ":AllTargetsCodeGens", + ":CodeGen", ":DWARFLinker", ":DebugInfoDWARF", ":DwarfutilOptionsTableGen", @@ -3443,6 +3447,7 @@ ":AllTargetsAsmParsers", ":AllTargetsCodeGens", ":AllTargetsDisassemblers", + ":CodeGen", ":Exegesis", ":MC", ":MCParser",