From 2fa1436206177291edb2d78c84d5822bb6e58cc9 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 29 Mar 2018 17:21:10 +0000 Subject: [IR][CodeGen] Remove dependency on EVT from IR/Function.cpp. Move EVT to CodeGen layer. Currently EVT is in the IR layer only because of Function.cpp needing a very small piece of the functionality of EVT::getEVTString(). The rest of EVT is used in codegen making CodeGen a better place for it. The previous code converted a Type* to EVT and then called getEVTString. This was only expected to handle the primitive types from Type*. Since there only a few primitive types, we can just print them as strings directly. Differential Revision: https://reviews.llvm.org/D45017 llvm-svn: 328806 --- llvm/lib/CodeGen/AtomicExpandPass.cpp | 2 +- llvm/lib/CodeGen/CMakeLists.txt | 1 + llvm/lib/CodeGen/CodeGenPrepare.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 2 +- .../lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 +- .../CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 2 +- .../lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h | 2 +- .../CodeGen/SelectionDAG/SelectionDAGDumper.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 2 +- llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h | 2 +- llvm/lib/CodeGen/TargetLoweringBase.cpp | 2 +- llvm/lib/CodeGen/ValueTypes.cpp | 321 +++++++++++++++++++++ llvm/lib/IR/CMakeLists.txt | 1 - llvm/lib/IR/Function.cpp | 27 +- llvm/lib/IR/ValueTypes.cpp | 321 --------------------- llvm/lib/Target/AArch64/AArch64CallLowering.cpp | 2 +- llvm/lib/Target/AArch64/AArch64FastISel.cpp | 2 +- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 2 +- llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp | 2 +- llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | 2 +- llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp | 4 +- .../Target/AMDGPU/AMDGPUTargetTransformInfo.cpp | 2 +- llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 2 +- llvm/lib/Target/ARC/ARCISelLowering.cpp | 2 +- llvm/lib/Target/ARM/ARMCallLowering.cpp | 2 +- llvm/lib/Target/ARM/ARMFastISel.cpp | 2 +- llvm/lib/Target/ARM/ARMISelLowering.cpp | 2 +- llvm/lib/Target/ARM/ARMISelLowering.h | 2 +- llvm/lib/Target/ARM/ARMLegalizerInfo.cpp | 2 +- llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp | 2 +- llvm/lib/Target/BPF/BPFISelLowering.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 2 +- llvm/lib/Target/Hexagon/HexagonISelLowering.h | 2 +- llvm/lib/Target/Hexagon/HexagonInstrInfo.h | 2 +- llvm/lib/Target/Lanai/LanaiISelLowering.cpp | 2 +- llvm/lib/Target/MSP430/MSP430ISelLowering.cpp | 2 +- llvm/lib/Target/Mips/MipsCallLowering.h | 2 +- llvm/lib/Target/Mips/MipsFastISel.cpp | 2 +- llvm/lib/Target/Mips/MipsISelLowering.cpp | 2 +- llvm/lib/Target/Mips/MipsISelLowering.h | 2 +- llvm/lib/Target/Mips/MipsLegalizerInfo.cpp | 2 +- llvm/lib/Target/Mips/MipsSEISelLowering.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp | 2 +- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp | 2 +- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 2 +- llvm/lib/Target/PowerPC/PPCISelLowering.cpp | 2 +- llvm/lib/Target/PowerPC/PPCISelLowering.h | 2 +- llvm/lib/Target/RISCV/RISCVISelLowering.cpp | 2 +- llvm/lib/Target/X86/X86CallLowering.cpp | 2 +- llvm/lib/Target/X86/X86LegalizerInfo.cpp | 2 +- llvm/lib/Target/XCore/XCoreISelLowering.cpp | 2 +- 55 files changed, 392 insertions(+), 381 deletions(-) create mode 100644 llvm/lib/CodeGen/ValueTypes.cpp delete mode 100644 llvm/lib/IR/ValueTypes.cpp (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp index 029f31837a6..7042bc99722 100644 --- a/llvm/lib/CodeGen/AtomicExpandPass.cpp +++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp @@ -23,6 +23,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" @@ -38,7 +39,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Pass.h" #include "llvm/Support/AtomicOrdering.h" #include "llvm/Support/Casting.h" diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt index 88c6bccf7d8..b79b407685a 100644 --- a/llvm/lib/CodeGen/CMakeLists.txt +++ b/llvm/lib/CodeGen/CMakeLists.txt @@ -155,6 +155,7 @@ add_llvm_library(LLVMCodeGen TargetSubtargetInfo.cpp TwoAddressInstructionPass.cpp UnreachableBlockElim.cpp + ValueTypes.cpp VirtRegMap.cpp WinEHPrepare.cpp XRayInstrumentation.cpp diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 4854a2631ea..b054edfd556 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -38,6 +38,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -70,7 +71,6 @@ #include "llvm/IR/Value.h" #include "llvm/IR/ValueHandle.h" #include "llvm/IR/ValueMap.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Pass.h" #include "llvm/Support/BlockFrequency.h" #include "llvm/Support/BranchProbability.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index ac82f6d5952..7d0c273996b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -44,6 +44,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/Constant.h" #include "llvm/IR/DataLayout.h" @@ -51,7 +52,6 @@ #include "llvm/IR/Function.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Metadata.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 65604362ed7..601691a795a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -65,6 +65,7 @@ #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -91,7 +92,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCRegisterInfo.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index bcde4384b31..fc191c457d9 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -28,6 +28,7 @@ #include "llvm/CodeGen/TargetFrameLowering.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" @@ -35,7 +36,6 @@ #include "llvm/IR/Function.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/Debug.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index a229ff184a5..f8c2db01f0b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -35,8 +35,8 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DataLayout.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index a45217a2867..fa379664903 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -39,6 +39,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Constant.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" @@ -50,7 +51,6 @@ #include "llvm/IR/Metadata.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/Compiler.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 9c8bd553d71..bb01952bf46 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -61,6 +61,7 @@ #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/CodeGen/WinEHFuncInfo.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" @@ -91,7 +92,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCContext.h" #include "llvm/MC/MCSymbol.h" #include "llvm/Support/AtomicOrdering.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h index 39c569ec3dd..af094e4ab1c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -24,11 +24,11 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/DebugLoc.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/Statepoint.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/BranchProbability.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/ErrorHandling.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp index d1ce169742c..6ef3ec84f9f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -26,6 +26,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DebugInfoMetadata.h" @@ -34,7 +35,6 @@ #include "llvm/IR/Intrinsics.h" #include "llvm/IR/ModuleSlotTracker.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Compiler.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index ced21de29c1..e6e07e8f111 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -52,6 +52,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" @@ -70,7 +71,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Pass.h" diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h index 51bb450c1de..372c82a359f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.h @@ -20,7 +20,7 @@ #include "llvm/ADT/SmallBitVector.h" #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/SelectionDAGNodes.h" -#include "llvm/IR/ValueTypes.h" +#include "llvm/CodeGen/ValueTypes.h" #include namespace llvm { diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 91924781805..523b915dc27 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -33,6 +33,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DataLayout.h" @@ -43,7 +44,6 @@ #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/BranchProbability.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/CodeGen/ValueTypes.cpp b/llvm/lib/CodeGen/ValueTypes.cpp new file mode 100644 index 00000000000..adb7075de65 --- /dev/null +++ b/llvm/lib/CodeGen/ValueTypes.cpp @@ -0,0 +1,321 @@ +//===----------- ValueTypes.cpp - Implementation of EVT methods -----------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/CodeGen/ValueTypes.h" +#include "llvm/ADT/StringExtras.h" +#include "llvm/IR/DerivedTypes.h" +#include "llvm/IR/Type.h" +#include "llvm/Support/ErrorHandling.h" +using namespace llvm; + +EVT EVT::changeExtendedTypeToInteger() const { + LLVMContext &Context = LLVMTy->getContext(); + return getIntegerVT(Context, getSizeInBits()); +} + +EVT EVT::changeExtendedVectorElementTypeToInteger() const { + LLVMContext &Context = LLVMTy->getContext(); + EVT IntTy = getIntegerVT(Context, getScalarSizeInBits()); + return getVectorVT(Context, IntTy, getVectorNumElements()); +} + +EVT EVT::getExtendedIntegerVT(LLVMContext &Context, unsigned BitWidth) { + EVT VT; + VT.LLVMTy = IntegerType::get(Context, BitWidth); + assert(VT.isExtended() && "Type is not extended!"); + return VT; +} + +EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, + unsigned NumElements) { + EVT ResultVT; + ResultVT.LLVMTy = VectorType::get(VT.getTypeForEVT(Context), NumElements); + assert(ResultVT.isExtended() && "Type is not extended!"); + return ResultVT; +} + +bool EVT::isExtendedFloatingPoint() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->isFPOrFPVectorTy(); +} + +bool EVT::isExtendedInteger() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->isIntOrIntVectorTy(); +} + +bool EVT::isExtendedScalarInteger() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->isIntegerTy(); +} + +bool EVT::isExtendedVector() const { + assert(isExtended() && "Type is not extended!"); + return LLVMTy->isVectorTy(); +} + +bool EVT::isExtended16BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 16; +} + +bool EVT::isExtended32BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 32; +} + +bool EVT::isExtended64BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 64; +} + +bool EVT::isExtended128BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 128; +} + +bool EVT::isExtended256BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 256; +} + +bool EVT::isExtended512BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 512; +} + +bool EVT::isExtended1024BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 1024; +} + +bool EVT::isExtended2048BitVector() const { + return isExtendedVector() && getExtendedSizeInBits() == 2048; +} + +EVT EVT::getExtendedVectorElementType() const { + assert(isExtended() && "Type is not extended!"); + return EVT::getEVT(cast(LLVMTy)->getElementType()); +} + +unsigned EVT::getExtendedVectorNumElements() const { + assert(isExtended() && "Type is not extended!"); + return cast(LLVMTy)->getNumElements(); +} + +unsigned EVT::getExtendedSizeInBits() const { + assert(isExtended() && "Type is not extended!"); + if (IntegerType *ITy = dyn_cast(LLVMTy)) + return ITy->getBitWidth(); + if (VectorType *VTy = dyn_cast(LLVMTy)) + return VTy->getBitWidth(); + llvm_unreachable("Unrecognized extended type!"); +} + +/// getEVTString - This function returns value type as a string, e.g. "i32". +std::string EVT::getEVTString() const { + switch (V.SimpleTy) { + default: + if (isVector()) + return "v" + utostr(getVectorNumElements()) + + getVectorElementType().getEVTString(); + if (isInteger()) + return "i" + utostr(getSizeInBits()); + llvm_unreachable("Invalid EVT!"); + case MVT::i1: return "i1"; + case MVT::i8: return "i8"; + case MVT::i16: return "i16"; + case MVT::i32: return "i32"; + case MVT::i64: return "i64"; + case MVT::i128: return "i128"; + case MVT::f16: return "f16"; + case MVT::f32: return "f32"; + case MVT::f64: return "f64"; + case MVT::f80: return "f80"; + case MVT::f128: return "f128"; + case MVT::ppcf128: return "ppcf128"; + case MVT::isVoid: return "isVoid"; + case MVT::Other: return "ch"; + case MVT::Glue: return "glue"; + case MVT::x86mmx: return "x86mmx"; + case MVT::v1i1: return "v1i1"; + case MVT::v2i1: return "v2i1"; + case MVT::v4i1: return "v4i1"; + case MVT::v8i1: return "v8i1"; + case MVT::v16i1: return "v16i1"; + case MVT::v32i1: return "v32i1"; + case MVT::v64i1: return "v64i1"; + case MVT::v128i1: return "v128i1"; + case MVT::v512i1: return "v512i1"; + case MVT::v1024i1: return "v1024i1"; + case MVT::v1i8: return "v1i8"; + case MVT::v2i8: return "v2i8"; + case MVT::v4i8: return "v4i8"; + case MVT::v8i8: return "v8i8"; + case MVT::v16i8: return "v16i8"; + case MVT::v32i8: return "v32i8"; + case MVT::v64i8: return "v64i8"; + case MVT::v128i8: return "v128i8"; + case MVT::v256i8: return "v256i8"; + case MVT::v1i16: return "v1i16"; + case MVT::v2i16: return "v2i16"; + case MVT::v4i16: return "v4i16"; + case MVT::v8i16: return "v8i16"; + case MVT::v16i16: return "v16i16"; + case MVT::v32i16: return "v32i16"; + case MVT::v64i16: return "v64i16"; + case MVT::v128i16: return "v128i16"; + case MVT::v1i32: return "v1i32"; + case MVT::v2i32: return "v2i32"; + case MVT::v4i32: return "v4i32"; + case MVT::v8i32: return "v8i32"; + case MVT::v16i32: return "v16i32"; + case MVT::v32i32: return "v32i32"; + case MVT::v64i32: return "v64i32"; + case MVT::v1i64: return "v1i64"; + case MVT::v2i64: return "v2i64"; + case MVT::v4i64: return "v4i64"; + case MVT::v8i64: return "v8i64"; + case MVT::v16i64: return "v16i64"; + case MVT::v32i64: return "v32i64"; + case MVT::v1i128: return "v1i128"; + case MVT::v1f32: return "v1f32"; + case MVT::v2f32: return "v2f32"; + case MVT::v2f16: return "v2f16"; + case MVT::v4f16: return "v4f16"; + case MVT::v8f16: return "v8f16"; + case MVT::v4f32: return "v4f32"; + case MVT::v8f32: return "v8f32"; + case MVT::v16f32: return "v16f32"; + case MVT::v1f64: return "v1f64"; + case MVT::v2f64: return "v2f64"; + case MVT::v4f64: return "v4f64"; + case MVT::v8f64: return "v8f64"; + case MVT::Metadata:return "Metadata"; + case MVT::Untyped: return "Untyped"; + case MVT::ExceptRef: return "ExceptRef"; + } +} + +/// getTypeForEVT - This method returns an LLVM type corresponding to the +/// specified EVT. For integer types, this returns an unsigned type. Note +/// that this will abort for types that cannot be represented. +Type *EVT::getTypeForEVT(LLVMContext &Context) const { + switch (V.SimpleTy) { + default: + assert(isExtended() && "Type is not extended!"); + return LLVMTy; + case MVT::isVoid: return Type::getVoidTy(Context); + case MVT::i1: return Type::getInt1Ty(Context); + case MVT::i8: return Type::getInt8Ty(Context); + case MVT::i16: return Type::getInt16Ty(Context); + case MVT::i32: return Type::getInt32Ty(Context); + case MVT::i64: return Type::getInt64Ty(Context); + case MVT::i128: return IntegerType::get(Context, 128); + case MVT::f16: return Type::getHalfTy(Context); + case MVT::f32: return Type::getFloatTy(Context); + case MVT::f64: return Type::getDoubleTy(Context); + case MVT::f80: return Type::getX86_FP80Ty(Context); + case MVT::f128: return Type::getFP128Ty(Context); + case MVT::ppcf128: return Type::getPPC_FP128Ty(Context); + case MVT::x86mmx: return Type::getX86_MMXTy(Context); + case MVT::v1i1: return VectorType::get(Type::getInt1Ty(Context), 1); + case MVT::v2i1: return VectorType::get(Type::getInt1Ty(Context), 2); + case MVT::v4i1: return VectorType::get(Type::getInt1Ty(Context), 4); + case MVT::v8i1: return VectorType::get(Type::getInt1Ty(Context), 8); + case MVT::v16i1: return VectorType::get(Type::getInt1Ty(Context), 16); + case MVT::v32i1: return VectorType::get(Type::getInt1Ty(Context), 32); + case MVT::v64i1: return VectorType::get(Type::getInt1Ty(Context), 64); + case MVT::v128i1: return VectorType::get(Type::getInt1Ty(Context), 128); + case MVT::v512i1: return VectorType::get(Type::getInt1Ty(Context), 512); + case MVT::v1024i1: return VectorType::get(Type::getInt1Ty(Context), 1024); + case MVT::v1i8: return VectorType::get(Type::getInt8Ty(Context), 1); + case MVT::v2i8: return VectorType::get(Type::getInt8Ty(Context), 2); + case MVT::v4i8: return VectorType::get(Type::getInt8Ty(Context), 4); + case MVT::v8i8: return VectorType::get(Type::getInt8Ty(Context), 8); + case MVT::v16i8: return VectorType::get(Type::getInt8Ty(Context), 16); + case MVT::v32i8: return VectorType::get(Type::getInt8Ty(Context), 32); + case MVT::v64i8: return VectorType::get(Type::getInt8Ty(Context), 64); + case MVT::v128i8: return VectorType::get(Type::getInt8Ty(Context), 128); + case MVT::v256i8: return VectorType::get(Type::getInt8Ty(Context), 256); + case MVT::v1i16: return VectorType::get(Type::getInt16Ty(Context), 1); + case MVT::v2i16: return VectorType::get(Type::getInt16Ty(Context), 2); + case MVT::v4i16: return VectorType::get(Type::getInt16Ty(Context), 4); + case MVT::v8i16: return VectorType::get(Type::getInt16Ty(Context), 8); + case MVT::v16i16: return VectorType::get(Type::getInt16Ty(Context), 16); + case MVT::v32i16: return VectorType::get(Type::getInt16Ty(Context), 32); + case MVT::v64i16: return VectorType::get(Type::getInt16Ty(Context), 64); + case MVT::v128i16: return VectorType::get(Type::getInt16Ty(Context), 128); + case MVT::v1i32: return VectorType::get(Type::getInt32Ty(Context), 1); + case MVT::v2i32: return VectorType::get(Type::getInt32Ty(Context), 2); + case MVT::v4i32: return VectorType::get(Type::getInt32Ty(Context), 4); + case MVT::v8i32: return VectorType::get(Type::getInt32Ty(Context), 8); + case MVT::v16i32: return VectorType::get(Type::getInt32Ty(Context), 16); + case MVT::v32i32: return VectorType::get(Type::getInt32Ty(Context), 32); + case MVT::v64i32: return VectorType::get(Type::getInt32Ty(Context), 64); + case MVT::v1i64: return VectorType::get(Type::getInt64Ty(Context), 1); + case MVT::v2i64: return VectorType::get(Type::getInt64Ty(Context), 2); + case MVT::v4i64: return VectorType::get(Type::getInt64Ty(Context), 4); + case MVT::v8i64: return VectorType::get(Type::getInt64Ty(Context), 8); + case MVT::v16i64: return VectorType::get(Type::getInt64Ty(Context), 16); + case MVT::v32i64: return VectorType::get(Type::getInt64Ty(Context), 32); + case MVT::v1i128: return VectorType::get(Type::getInt128Ty(Context), 1); + case MVT::v2f16: return VectorType::get(Type::getHalfTy(Context), 2); + case MVT::v4f16: return VectorType::get(Type::getHalfTy(Context), 4); + case MVT::v8f16: return VectorType::get(Type::getHalfTy(Context), 8); + case MVT::v1f32: return VectorType::get(Type::getFloatTy(Context), 1); + case MVT::v2f32: return VectorType::get(Type::getFloatTy(Context), 2); + case MVT::v4f32: return VectorType::get(Type::getFloatTy(Context), 4); + case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8); + case MVT::v16f32: return VectorType::get(Type::getFloatTy(Context), 16); + case MVT::v1f64: return VectorType::get(Type::getDoubleTy(Context), 1); + case MVT::v2f64: return VectorType::get(Type::getDoubleTy(Context), 2); + case MVT::v4f64: return VectorType::get(Type::getDoubleTy(Context), 4); + case MVT::v8f64: return VectorType::get(Type::getDoubleTy(Context), 8); + case MVT::Metadata: return Type::getMetadataTy(Context); + } +} + +/// Return the value type corresponding to the specified type. This returns all +/// pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned +/// as Other, otherwise they are invalid. +MVT MVT::getVT(Type *Ty, bool HandleUnknown){ + switch (Ty->getTypeID()) { + default: + if (HandleUnknown) return MVT(MVT::Other); + llvm_unreachable("Unknown type!"); + case Type::VoidTyID: + return MVT::isVoid; + case Type::IntegerTyID: + return getIntegerVT(cast(Ty)->getBitWidth()); + case Type::HalfTyID: return MVT(MVT::f16); + case Type::FloatTyID: return MVT(MVT::f32); + case Type::DoubleTyID: return MVT(MVT::f64); + case Type::X86_FP80TyID: return MVT(MVT::f80); + case Type::X86_MMXTyID: return MVT(MVT::x86mmx); + case Type::FP128TyID: return MVT(MVT::f128); + case Type::PPC_FP128TyID: return MVT(MVT::ppcf128); + case Type::PointerTyID: return MVT(MVT::iPTR); + case Type::VectorTyID: { + VectorType *VTy = cast(Ty); + return getVectorVT( + getVT(VTy->getElementType(), false), VTy->getNumElements()); + } + } +} + +/// getEVT - Return the value type corresponding to the specified type. This +/// returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types +/// are returned as Other, otherwise they are invalid. +EVT EVT::getEVT(Type *Ty, bool HandleUnknown){ + switch (Ty->getTypeID()) { + default: + return MVT::getVT(Ty, HandleUnknown); + case Type::IntegerTyID: + return getIntegerVT(Ty->getContext(), cast(Ty)->getBitWidth()); + case Type::VectorTyID: { + VectorType *VTy = cast(Ty); + return getVectorVT(Ty->getContext(), getEVT(VTy->getElementType(), false), + VTy->getNumElements()); + } + } +} diff --git a/llvm/lib/IR/CMakeLists.txt b/llvm/lib/IR/CMakeLists.txt index 17822bbbb5c..6284e2175a6 100644 --- a/llvm/lib/IR/CMakeLists.txt +++ b/llvm/lib/IR/CMakeLists.txt @@ -52,7 +52,6 @@ add_llvm_library(LLVMCore User.cpp Value.cpp ValueSymbolTable.cpp - ValueTypes.cpp Verifier.cpp ADDITIONAL_HEADER_DIRS diff --git a/llvm/lib/IR/Function.cpp b/llvm/lib/IR/Function.cpp index 0349ecaff46..be50f623c91 100644 --- a/llvm/lib/IR/Function.cpp +++ b/llvm/lib/IR/Function.cpp @@ -44,7 +44,6 @@ #include "llvm/IR/User.h" #include "llvm/IR/Value.h" #include "llvm/IR/ValueSymbolTable.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" @@ -551,10 +550,7 @@ void Function::recalculateIntrinsicID() { /// which can't be confused with it's prefix. This ensures we don't have /// collisions between two unrelated function types. Otherwise, you might /// parse ffXX as f(fXX) or f(fX)X. (X is a placeholder for any other type.) -/// Manglings of integers, floats, and vectors ('i', 'f', and 'v' prefix in most -/// cases) fall back to the MVT codepath, where they could be mangled to -/// 'x86mmx', for example; matching on derived types is not sufficient to mangle -/// everything. +/// static std::string getMangledTypeStr(Type* Ty) { std::string Result; if (PointerType* PTyp = dyn_cast(Ty)) { @@ -582,11 +578,26 @@ static std::string getMangledTypeStr(Type* Ty) { Result += "vararg"; // Ensure nested function types are distinguishable. Result += "f"; - } else if (isa(Ty)) + } else if (isa(Ty)) { Result += "v" + utostr(Ty->getVectorNumElements()) + getMangledTypeStr(Ty->getVectorElementType()); - else if (Ty) - Result += EVT::getEVT(Ty).getEVTString(); + } else if (Ty) { + switch (Ty->getTypeID()) { + default: llvm_unreachable("Unhandled type"); + case Type::VoidTyID: Result += "isVoid"; break; + case Type::MetadataTyID: Result += "Metadata"; break; + case Type::HalfTyID: Result += "f16"; break; + case Type::FloatTyID: Result += "f32"; break; + case Type::DoubleTyID: Result += "f64"; break; + case Type::X86_FP80TyID: Result += "f80"; break; + case Type::FP128TyID: Result += "f128"; break; + case Type::PPC_FP128TyID: Result += "ppcf128"; break; + case Type::X86_MMXTyID: Result += "x86mmx"; break; + case Type::IntegerTyID: + Result += "i" + utostr(cast(Ty)->getBitWidth()); + break; + } + } return Result; } diff --git a/llvm/lib/IR/ValueTypes.cpp b/llvm/lib/IR/ValueTypes.cpp deleted file mode 100644 index d8007df3159..00000000000 --- a/llvm/lib/IR/ValueTypes.cpp +++ /dev/null @@ -1,321 +0,0 @@ -//===----------- ValueTypes.cpp - Implementation of EVT methods -----------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#include "llvm/IR/ValueTypes.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/IR/DerivedTypes.h" -#include "llvm/IR/Type.h" -#include "llvm/Support/ErrorHandling.h" -using namespace llvm; - -EVT EVT::changeExtendedTypeToInteger() const { - LLVMContext &Context = LLVMTy->getContext(); - return getIntegerVT(Context, getSizeInBits()); -} - -EVT EVT::changeExtendedVectorElementTypeToInteger() const { - LLVMContext &Context = LLVMTy->getContext(); - EVT IntTy = getIntegerVT(Context, getScalarSizeInBits()); - return getVectorVT(Context, IntTy, getVectorNumElements()); -} - -EVT EVT::getExtendedIntegerVT(LLVMContext &Context, unsigned BitWidth) { - EVT VT; - VT.LLVMTy = IntegerType::get(Context, BitWidth); - assert(VT.isExtended() && "Type is not extended!"); - return VT; -} - -EVT EVT::getExtendedVectorVT(LLVMContext &Context, EVT VT, - unsigned NumElements) { - EVT ResultVT; - ResultVT.LLVMTy = VectorType::get(VT.getTypeForEVT(Context), NumElements); - assert(ResultVT.isExtended() && "Type is not extended!"); - return ResultVT; -} - -bool EVT::isExtendedFloatingPoint() const { - assert(isExtended() && "Type is not extended!"); - return LLVMTy->isFPOrFPVectorTy(); -} - -bool EVT::isExtendedInteger() const { - assert(isExtended() && "Type is not extended!"); - return LLVMTy->isIntOrIntVectorTy(); -} - -bool EVT::isExtendedScalarInteger() const { - assert(isExtended() && "Type is not extended!"); - return LLVMTy->isIntegerTy(); -} - -bool EVT::isExtendedVector() const { - assert(isExtended() && "Type is not extended!"); - return LLVMTy->isVectorTy(); -} - -bool EVT::isExtended16BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 16; -} - -bool EVT::isExtended32BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 32; -} - -bool EVT::isExtended64BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 64; -} - -bool EVT::isExtended128BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 128; -} - -bool EVT::isExtended256BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 256; -} - -bool EVT::isExtended512BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 512; -} - -bool EVT::isExtended1024BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 1024; -} - -bool EVT::isExtended2048BitVector() const { - return isExtendedVector() && getExtendedSizeInBits() == 2048; -} - -EVT EVT::getExtendedVectorElementType() const { - assert(isExtended() && "Type is not extended!"); - return EVT::getEVT(cast(LLVMTy)->getElementType()); -} - -unsigned EVT::getExtendedVectorNumElements() const { - assert(isExtended() && "Type is not extended!"); - return cast(LLVMTy)->getNumElements(); -} - -unsigned EVT::getExtendedSizeInBits() const { - assert(isExtended() && "Type is not extended!"); - if (IntegerType *ITy = dyn_cast(LLVMTy)) - return ITy->getBitWidth(); - if (VectorType *VTy = dyn_cast(LLVMTy)) - return VTy->getBitWidth(); - llvm_unreachable("Unrecognized extended type!"); -} - -/// getEVTString - This function returns value type as a string, e.g. "i32". -std::string EVT::getEVTString() const { - switch (V.SimpleTy) { - default: - if (isVector()) - return "v" + utostr(getVectorNumElements()) + - getVectorElementType().getEVTString(); - if (isInteger()) - return "i" + utostr(getSizeInBits()); - llvm_unreachable("Invalid EVT!"); - case MVT::i1: return "i1"; - case MVT::i8: return "i8"; - case MVT::i16: return "i16"; - case MVT::i32: return "i32"; - case MVT::i64: return "i64"; - case MVT::i128: return "i128"; - case MVT::f16: return "f16"; - case MVT::f32: return "f32"; - case MVT::f64: return "f64"; - case MVT::f80: return "f80"; - case MVT::f128: return "f128"; - case MVT::ppcf128: return "ppcf128"; - case MVT::isVoid: return "isVoid"; - case MVT::Other: return "ch"; - case MVT::Glue: return "glue"; - case MVT::x86mmx: return "x86mmx"; - case MVT::v1i1: return "v1i1"; - case MVT::v2i1: return "v2i1"; - case MVT::v4i1: return "v4i1"; - case MVT::v8i1: return "v8i1"; - case MVT::v16i1: return "v16i1"; - case MVT::v32i1: return "v32i1"; - case MVT::v64i1: return "v64i1"; - case MVT::v128i1: return "v128i1"; - case MVT::v512i1: return "v512i1"; - case MVT::v1024i1: return "v1024i1"; - case MVT::v1i8: return "v1i8"; - case MVT::v2i8: return "v2i8"; - case MVT::v4i8: return "v4i8"; - case MVT::v8i8: return "v8i8"; - case MVT::v16i8: return "v16i8"; - case MVT::v32i8: return "v32i8"; - case MVT::v64i8: return "v64i8"; - case MVT::v128i8: return "v128i8"; - case MVT::v256i8: return "v256i8"; - case MVT::v1i16: return "v1i16"; - case MVT::v2i16: return "v2i16"; - case MVT::v4i16: return "v4i16"; - case MVT::v8i16: return "v8i16"; - case MVT::v16i16: return "v16i16"; - case MVT::v32i16: return "v32i16"; - case MVT::v64i16: return "v64i16"; - case MVT::v128i16: return "v128i16"; - case MVT::v1i32: return "v1i32"; - case MVT::v2i32: return "v2i32"; - case MVT::v4i32: return "v4i32"; - case MVT::v8i32: return "v8i32"; - case MVT::v16i32: return "v16i32"; - case MVT::v32i32: return "v32i32"; - case MVT::v64i32: return "v64i32"; - case MVT::v1i64: return "v1i64"; - case MVT::v2i64: return "v2i64"; - case MVT::v4i64: return "v4i64"; - case MVT::v8i64: return "v8i64"; - case MVT::v16i64: return "v16i64"; - case MVT::v32i64: return "v32i64"; - case MVT::v1i128: return "v1i128"; - case MVT::v1f32: return "v1f32"; - case MVT::v2f32: return "v2f32"; - case MVT::v2f16: return "v2f16"; - case MVT::v4f16: return "v4f16"; - case MVT::v8f16: return "v8f16"; - case MVT::v4f32: return "v4f32"; - case MVT::v8f32: return "v8f32"; - case MVT::v16f32: return "v16f32"; - case MVT::v1f64: return "v1f64"; - case MVT::v2f64: return "v2f64"; - case MVT::v4f64: return "v4f64"; - case MVT::v8f64: return "v8f64"; - case MVT::Metadata:return "Metadata"; - case MVT::Untyped: return "Untyped"; - case MVT::ExceptRef: return "ExceptRef"; - } -} - -/// getTypeForEVT - This method returns an LLVM type corresponding to the -/// specified EVT. For integer types, this returns an unsigned type. Note -/// that this will abort for types that cannot be represented. -Type *EVT::getTypeForEVT(LLVMContext &Context) const { - switch (V.SimpleTy) { - default: - assert(isExtended() && "Type is not extended!"); - return LLVMTy; - case MVT::isVoid: return Type::getVoidTy(Context); - case MVT::i1: return Type::getInt1Ty(Context); - case MVT::i8: return Type::getInt8Ty(Context); - case MVT::i16: return Type::getInt16Ty(Context); - case MVT::i32: return Type::getInt32Ty(Context); - case MVT::i64: return Type::getInt64Ty(Context); - case MVT::i128: return IntegerType::get(Context, 128); - case MVT::f16: return Type::getHalfTy(Context); - case MVT::f32: return Type::getFloatTy(Context); - case MVT::f64: return Type::getDoubleTy(Context); - case MVT::f80: return Type::getX86_FP80Ty(Context); - case MVT::f128: return Type::getFP128Ty(Context); - case MVT::ppcf128: return Type::getPPC_FP128Ty(Context); - case MVT::x86mmx: return Type::getX86_MMXTy(Context); - case MVT::v1i1: return VectorType::get(Type::getInt1Ty(Context), 1); - case MVT::v2i1: return VectorType::get(Type::getInt1Ty(Context), 2); - case MVT::v4i1: return VectorType::get(Type::getInt1Ty(Context), 4); - case MVT::v8i1: return VectorType::get(Type::getInt1Ty(Context), 8); - case MVT::v16i1: return VectorType::get(Type::getInt1Ty(Context), 16); - case MVT::v32i1: return VectorType::get(Type::getInt1Ty(Context), 32); - case MVT::v64i1: return VectorType::get(Type::getInt1Ty(Context), 64); - case MVT::v128i1: return VectorType::get(Type::getInt1Ty(Context), 128); - case MVT::v512i1: return VectorType::get(Type::getInt1Ty(Context), 512); - case MVT::v1024i1: return VectorType::get(Type::getInt1Ty(Context), 1024); - case MVT::v1i8: return VectorType::get(Type::getInt8Ty(Context), 1); - case MVT::v2i8: return VectorType::get(Type::getInt8Ty(Context), 2); - case MVT::v4i8: return VectorType::get(Type::getInt8Ty(Context), 4); - case MVT::v8i8: return VectorType::get(Type::getInt8Ty(Context), 8); - case MVT::v16i8: return VectorType::get(Type::getInt8Ty(Context), 16); - case MVT::v32i8: return VectorType::get(Type::getInt8Ty(Context), 32); - case MVT::v64i8: return VectorType::get(Type::getInt8Ty(Context), 64); - case MVT::v128i8: return VectorType::get(Type::getInt8Ty(Context), 128); - case MVT::v256i8: return VectorType::get(Type::getInt8Ty(Context), 256); - case MVT::v1i16: return VectorType::get(Type::getInt16Ty(Context), 1); - case MVT::v2i16: return VectorType::get(Type::getInt16Ty(Context), 2); - case MVT::v4i16: return VectorType::get(Type::getInt16Ty(Context), 4); - case MVT::v8i16: return VectorType::get(Type::getInt16Ty(Context), 8); - case MVT::v16i16: return VectorType::get(Type::getInt16Ty(Context), 16); - case MVT::v32i16: return VectorType::get(Type::getInt16Ty(Context), 32); - case MVT::v64i16: return VectorType::get(Type::getInt16Ty(Context), 64); - case MVT::v128i16: return VectorType::get(Type::getInt16Ty(Context), 128); - case MVT::v1i32: return VectorType::get(Type::getInt32Ty(Context), 1); - case MVT::v2i32: return VectorType::get(Type::getInt32Ty(Context), 2); - case MVT::v4i32: return VectorType::get(Type::getInt32Ty(Context), 4); - case MVT::v8i32: return VectorType::get(Type::getInt32Ty(Context), 8); - case MVT::v16i32: return VectorType::get(Type::getInt32Ty(Context), 16); - case MVT::v32i32: return VectorType::get(Type::getInt32Ty(Context), 32); - case MVT::v64i32: return VectorType::get(Type::getInt32Ty(Context), 64); - case MVT::v1i64: return VectorType::get(Type::getInt64Ty(Context), 1); - case MVT::v2i64: return VectorType::get(Type::getInt64Ty(Context), 2); - case MVT::v4i64: return VectorType::get(Type::getInt64Ty(Context), 4); - case MVT::v8i64: return VectorType::get(Type::getInt64Ty(Context), 8); - case MVT::v16i64: return VectorType::get(Type::getInt64Ty(Context), 16); - case MVT::v32i64: return VectorType::get(Type::getInt64Ty(Context), 32); - case MVT::v1i128: return VectorType::get(Type::getInt128Ty(Context), 1); - case MVT::v2f16: return VectorType::get(Type::getHalfTy(Context), 2); - case MVT::v4f16: return VectorType::get(Type::getHalfTy(Context), 4); - case MVT::v8f16: return VectorType::get(Type::getHalfTy(Context), 8); - case MVT::v1f32: return VectorType::get(Type::getFloatTy(Context), 1); - case MVT::v2f32: return VectorType::get(Type::getFloatTy(Context), 2); - case MVT::v4f32: return VectorType::get(Type::getFloatTy(Context), 4); - case MVT::v8f32: return VectorType::get(Type::getFloatTy(Context), 8); - case MVT::v16f32: return VectorType::get(Type::getFloatTy(Context), 16); - case MVT::v1f64: return VectorType::get(Type::getDoubleTy(Context), 1); - case MVT::v2f64: return VectorType::get(Type::getDoubleTy(Context), 2); - case MVT::v4f64: return VectorType::get(Type::getDoubleTy(Context), 4); - case MVT::v8f64: return VectorType::get(Type::getDoubleTy(Context), 8); - case MVT::Metadata: return Type::getMetadataTy(Context); - } -} - -/// Return the value type corresponding to the specified type. This returns all -/// pointers as MVT::iPTR. If HandleUnknown is true, unknown types are returned -/// as Other, otherwise they are invalid. -MVT MVT::getVT(Type *Ty, bool HandleUnknown){ - switch (Ty->getTypeID()) { - default: - if (HandleUnknown) return MVT(MVT::Other); - llvm_unreachable("Unknown type!"); - case Type::VoidTyID: - return MVT::isVoid; - case Type::IntegerTyID: - return getIntegerVT(cast(Ty)->getBitWidth()); - case Type::HalfTyID: return MVT(MVT::f16); - case Type::FloatTyID: return MVT(MVT::f32); - case Type::DoubleTyID: return MVT(MVT::f64); - case Type::X86_FP80TyID: return MVT(MVT::f80); - case Type::X86_MMXTyID: return MVT(MVT::x86mmx); - case Type::FP128TyID: return MVT(MVT::f128); - case Type::PPC_FP128TyID: return MVT(MVT::ppcf128); - case Type::PointerTyID: return MVT(MVT::iPTR); - case Type::VectorTyID: { - VectorType *VTy = cast(Ty); - return getVectorVT( - getVT(VTy->getElementType(), false), VTy->getNumElements()); - } - } -} - -/// getEVT - Return the value type corresponding to the specified type. This -/// returns all pointers as MVT::iPTR. If HandleUnknown is true, unknown types -/// are returned as Other, otherwise they are invalid. -EVT EVT::getEVT(Type *Ty, bool HandleUnknown){ - switch (Ty->getTypeID()) { - default: - return MVT::getVT(Ty, HandleUnknown); - case Type::IntegerTyID: - return getIntegerVT(Ty->getContext(), cast(Ty)->getBitWidth()); - case Type::VectorTyID: { - VectorType *VTy = cast(Ty); - return getVectorVT(Ty->getContext(), getEVT(VTy->getElementType(), false), - VTy->getNumElements()); - } - } -} diff --git a/llvm/lib/Target/AArch64/AArch64CallLowering.cpp b/llvm/lib/Target/AArch64/AArch64CallLowering.cpp index 9530161b615..1c771d8803a 100644 --- a/llvm/lib/Target/AArch64/AArch64CallLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64CallLowering.cpp @@ -33,12 +33,12 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/Function.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/AArch64/AArch64FastISel.cpp b/llvm/lib/Target/AArch64/AArch64FastISel.cpp index 2d582757a5c..b7738c3e33a 100644 --- a/llvm/lib/Target/AArch64/AArch64FastISel.cpp +++ b/llvm/lib/Target/AArch64/AArch64FastISel.cpp @@ -36,6 +36,7 @@ #include "llvm/CodeGen/MachineMemOperand.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/RuntimeLibcalls.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -56,7 +57,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSymbol.h" diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 3448cdec842..28edcc2e47b 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -43,6 +43,7 @@ #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetCallingConv.h" #include "llvm/CodeGen/TargetInstrInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" @@ -60,7 +61,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/Use.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp index 3622f0a08a3..083047c3814 100644 --- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp @@ -18,9 +18,9 @@ #include "llvm/CodeGen/MachineInstr.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" using namespace llvm; using namespace LegalizeActions; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp index 138057db454..38f0433aa19 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp @@ -36,9 +36,9 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/SelectionDAGNodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Instruction.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp index 2afea773b8b..f79e2c5ae44 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp @@ -12,13 +12,13 @@ /// \todo This should be generated by TableGen. //===----------------------------------------------------------------------===// -#include "AMDGPULegalizerInfo.h" #include "AMDGPU.h" +#include "AMDGPULegalizerInfo.h" #include "AMDGPUTargetMachine.h" #include "llvm/CodeGen/TargetOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Debug.h" using namespace llvm; diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp index 533997cdd40..9f097cd7d26 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp @@ -23,6 +23,7 @@ #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" @@ -37,7 +38,6 @@ #include "llvm/IR/PatternMatch.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index 51c27b0b1f7..b034f3d546d 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -53,6 +53,7 @@ #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetCallingConv.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DebugLoc.h" @@ -65,7 +66,6 @@ #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/Target/ARC/ARCISelLowering.cpp b/llvm/lib/Target/ARC/ARCISelLowering.cpp index 29f995140d0..5991838a15c 100644 --- a/llvm/lib/Target/ARC/ARCISelLowering.cpp +++ b/llvm/lib/Target/ARC/ARCISelLowering.cpp @@ -24,9 +24,9 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Intrinsics.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Debug.h" #include diff --git a/llvm/lib/Target/ARM/ARMCallLowering.cpp b/llvm/lib/Target/ARM/ARMCallLowering.cpp index a0661751f98..ac754fcba0d 100644 --- a/llvm/lib/Target/ARM/ARMCallLowering.cpp +++ b/llvm/lib/Target/ARM/ARMCallLowering.cpp @@ -33,13 +33,13 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/MachineValueType.h" diff --git a/llvm/lib/Target/ARM/ARMFastISel.cpp b/llvm/lib/Target/ARM/ARMFastISel.cpp index fe7aa0fda7f..023baaa0ed9 100644 --- a/llvm/lib/Target/ARM/ARMFastISel.cpp +++ b/llvm/lib/Target/ARM/ARMFastISel.cpp @@ -46,6 +46,7 @@ #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallSite.h" @@ -68,7 +69,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/Casting.h" diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index e2781444343..b5f72de1135 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -61,6 +61,7 @@ #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/CodeGen/TargetRegisterInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constant.h" @@ -82,7 +83,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCInstrItineraries.h" #include "llvm/MC/MCRegisterInfo.h" diff --git a/llvm/lib/Target/ARM/ARMISelLowering.h b/llvm/lib/Target/ARM/ARMISelLowering.h index 836ac8b82ae..20e323be245 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.h +++ b/llvm/lib/Target/ARM/ARMISelLowering.h @@ -23,12 +23,12 @@ #include "llvm/CodeGen/MachineFunction.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Function.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/InlineAsm.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/MachineValueType.h" #include diff --git a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp index c4752d5141e..dcf80fafb90 100644 --- a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp +++ b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp @@ -18,9 +18,9 @@ #include "llvm/CodeGen/LowLevelType.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" using namespace llvm; using namespace LegalizeActions; diff --git a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp index 6e7d89edc6e..232337412db 100644 --- a/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp +++ b/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp @@ -15,6 +15,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/CodeGen/CostTable.h" #include "llvm/CodeGen/ISDOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/DataLayout.h" @@ -22,7 +23,6 @@ #include "llvm/IR/Instruction.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/Casting.h" #include "llvm/Support/MachineValueType.h" diff --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp index 6b7e5d7a914..e02cdf579d2 100644 --- a/llvm/lib/Target/BPF/BPFISelLowering.cpp +++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp @@ -23,9 +23,9 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/DiagnosticPrinter.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 88d61d0b2a8..8c7b492db3d 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -30,6 +30,7 @@ #include "llvm/CodeGen/RuntimeLibcalls.h" #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/TargetCallingConv.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DataLayout.h" @@ -43,7 +44,6 @@ #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.h b/llvm/lib/Target/Hexagon/HexagonISelLowering.h index 79ab6fee6ea..adbb066171e 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.h +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.h @@ -20,9 +20,9 @@ #include "llvm/CodeGen/ISDOpcodes.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/IR/ValueTypes.h" #include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/Hexagon/HexagonInstrInfo.h b/llvm/lib/Target/Hexagon/HexagonInstrInfo.h index 733f79b199e..02d7ad92351 100644 --- a/llvm/lib/Target/Hexagon/HexagonInstrInfo.h +++ b/llvm/lib/Target/Hexagon/HexagonInstrInfo.h @@ -19,7 +19,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/CodeGen/MachineBasicBlock.h" #include "llvm/CodeGen/TargetInstrInfo.h" -#include "llvm/IR/ValueTypes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/Support/MachineValueType.h" #include #include diff --git a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp index dba1b14bdb5..33455137acc 100644 --- a/llvm/lib/Target/Lanai/LanaiISelLowering.cpp +++ b/llvm/lib/Target/Lanai/LanaiISelLowering.cpp @@ -32,11 +32,11 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetCallingConv.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalValue.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp index 93a15ebb66a..f5b2bda5d1e 100644 --- a/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp +++ b/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp @@ -23,13 +23,13 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Intrinsics.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" diff --git a/llvm/lib/Target/Mips/MipsCallLowering.h b/llvm/lib/Target/Mips/MipsCallLowering.h index 72db2100f84..4839b398405 100644 --- a/llvm/lib/Target/Mips/MipsCallLowering.h +++ b/llvm/lib/Target/Mips/MipsCallLowering.h @@ -17,7 +17,7 @@ #include "llvm/CodeGen/CallingConvLower.h" #include "llvm/CodeGen/GlobalISel/CallLowering.h" -#include "llvm/IR/ValueTypes.h" +#include "llvm/CodeGen/ValueTypes.h" namespace llvm { diff --git a/llvm/lib/Target/Mips/MipsFastISel.cpp b/llvm/lib/Target/Mips/MipsFastISel.cpp index 4f0213c01b2..85bd565571c 100644 --- a/llvm/lib/Target/Mips/MipsFastISel.cpp +++ b/llvm/lib/Target/Mips/MipsFastISel.cpp @@ -38,6 +38,7 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constant.h" @@ -55,7 +56,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/User.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCInstrDesc.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSymbol.h" diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp index deb4589766f..10ceb39629b 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp @@ -47,6 +47,7 @@ #include "llvm/CodeGen/TargetFrameLowering.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DataLayout.h" @@ -56,7 +57,6 @@ #include "llvm/IR/GlobalValue.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" diff --git a/llvm/lib/Target/Mips/MipsISelLowering.h b/llvm/lib/Target/Mips/MipsISelLowering.h index 86fe5ae7064..d7affdc6097 100644 --- a/llvm/lib/Target/Mips/MipsISelLowering.h +++ b/llvm/lib/Target/Mips/MipsISelLowering.h @@ -24,10 +24,10 @@ #include "llvm/CodeGen/SelectionDAG.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/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/MachineValueType.h" #include "llvm/Target/TargetMachine.h" #include diff --git a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp index 2b60a6c0443..869ac4d50b8 100644 --- a/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp +++ b/llvm/lib/Target/Mips/MipsLegalizerInfo.cpp @@ -13,9 +13,9 @@ #include "MipsLegalizerInfo.h" #include "llvm/CodeGen/TargetOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" using namespace llvm; diff --git a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp index c4822ba88ca..0b4ac14eeab 100644 --- a/llvm/lib/Target/Mips/MipsSEISelLowering.cpp +++ b/llvm/lib/Target/Mips/MipsSEISelLowering.cpp @@ -32,9 +32,9 @@ #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DebugLoc.h" #include "llvm/IR/Intrinsics.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" diff --git a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp index c348f4e9068..357e24136a5 100644 --- a/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp @@ -46,6 +46,7 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constant.h" @@ -64,7 +65,6 @@ #include "llvm/IR/Operator.h" #include "llvm/IR/Type.h" #include "llvm/IR/User.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrDesc.h" diff --git a/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp b/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp index ec0e8e4fe1d..fd63fdbaced 100644 --- a/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp @@ -15,6 +15,7 @@ #include "MCTargetDesc/NVPTXBaseInfo.h" #include "NVPTX.h" #include "NVPTXUtilities.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/IRBuilder.h" @@ -24,7 +25,6 @@ #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" #include "llvm/IR/ValueMap.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Transforms/Utils/ValueMapper.h" using namespace llvm; diff --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp index 82d1d94c8c0..7a1bab323bd 100644 --- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp @@ -30,6 +30,7 @@ #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetCallingConv.h" #include "llvm/CodeGen/TargetLowering.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Argument.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallSite.h" @@ -43,7 +44,6 @@ #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index 291bd8d118a..ec822aa53ca 100644 --- a/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -37,6 +37,7 @@ #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/DebugLoc.h" #include "llvm/IR/Function.h" @@ -44,7 +45,6 @@ #include "llvm/IR/InlineAsm.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/Module.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Casting.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/CommandLine.h" diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp index 986e617801e..386315b3c43 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -53,6 +53,7 @@ #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetLowering.h" #include "llvm/CodeGen/TargetRegisterInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constant.h" @@ -69,7 +70,6 @@ #include "llvm/IR/Type.h" #include "llvm/IR/Use.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/AtomicOrdering.h" diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h index 56614a89f40..76f8d72136c 100644 --- a/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -23,13 +23,13 @@ #include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAGNodes.h" #include "llvm/CodeGen/TargetLowering.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Function.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/Metadata.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/MachineValueType.h" #include diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp index bbd8e884bff..834b960a293 100644 --- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -25,9 +25,9 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAGISel.h" #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DiagnosticInfo.h" #include "llvm/IR/DiagnosticPrinter.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" diff --git a/llvm/lib/Target/X86/X86CallLowering.cpp b/llvm/lib/Target/X86/X86CallLowering.cpp index 16dbff450b9..96ea64dc8c4 100644 --- a/llvm/lib/Target/X86/X86CallLowering.cpp +++ b/llvm/lib/Target/X86/X86CallLowering.cpp @@ -35,11 +35,11 @@ #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/TargetInstrInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Function.h" #include "llvm/IR/Value.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/Support/LowLevelTypeImpl.h" #include "llvm/Support/MachineValueType.h" diff --git a/llvm/lib/Target/X86/X86LegalizerInfo.cpp b/llvm/lib/Target/X86/X86LegalizerInfo.cpp index 420f6a804de..c5e37d56d0e 100644 --- a/llvm/lib/Target/X86/X86LegalizerInfo.cpp +++ b/llvm/lib/Target/X86/X86LegalizerInfo.cpp @@ -15,9 +15,9 @@ #include "X86Subtarget.h" #include "X86TargetMachine.h" #include "llvm/CodeGen/TargetOpcodes.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Type.h" -#include "llvm/IR/ValueTypes.h" using namespace llvm; using namespace TargetOpcode; diff --git a/llvm/lib/Target/XCore/XCoreISelLowering.cpp b/llvm/lib/Target/XCore/XCoreISelLowering.cpp index 69047908dbd..0ac5ecfa7e8 100644 --- a/llvm/lib/Target/XCore/XCoreISelLowering.cpp +++ b/llvm/lib/Target/XCore/XCoreISelLowering.cpp @@ -24,6 +24,7 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/CodeGen/MachineRegisterInfo.h" #include "llvm/CodeGen/SelectionDAGISel.h" +#include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/CallingConv.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" @@ -31,7 +32,6 @@ #include "llvm/IR/GlobalAlias.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/Intrinsics.h" -#include "llvm/IR/ValueTypes.h" #include "llvm/Support/Debug.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/KnownBits.h" -- cgit v1.2.3