diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-01-18 20:27:02 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-01-18 20:27:02 +0000 |
commit | 85af701e857229f87542650682ae993f224ced0b (patch) | |
tree | aa89db703ca810566f054acaffa8f96d4052e5dc /llvm/lib | |
parent | e33a90b9cdbf3fd44ab541c060f0aff62146e471 (diff) | |
download | bcm5719-llvm-85af701e857229f87542650682ae993f224ced0b.tar.gz bcm5719-llvm-85af701e857229f87542650682ae993f224ced0b.zip |
AMDGPU: Remove llvm.SI.load.const
It's taken 3 years, but now all of the old AMDGPU and SI intrinsics
are finally gone
llvm-svn: 351586
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPU.td | 1 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.cpp | 103 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h | 58 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h | 6 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/CMakeLists.txt | 1 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 7 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIInstrInfo.cpp | 1 | ||||
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIIntrinsics.td | 19 |
10 files changed, 0 insertions, 198 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPU.td b/llvm/lib/Target/AMDGPU/AMDGPU.td index 6a4cfe08e49..b6a58d73ba5 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPU.td +++ b/llvm/lib/Target/AMDGPU/AMDGPU.td @@ -784,7 +784,6 @@ def EnableLateCFGStructurize : Predicate< include "SISchedule.td" include "GCNProcessors.td" include "AMDGPUInstrInfo.td" -include "SIIntrinsics.td" include "AMDGPURegisterInfo.td" include "AMDGPURegisterBanks.td" include "AMDGPUInstructions.td" diff --git a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp index f88e3b0dac8..b6c1c2b2de7 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUAnnotateUniformValues.cpp @@ -14,7 +14,6 @@ //===----------------------------------------------------------------------===// #include "AMDGPU.h" -#include "AMDGPUIntrinsicInfo.h" #include "llvm/ADT/SetVector.h" #include "llvm/Analysis/LegacyDivergenceAnalysis.h" #include "llvm/Analysis/LoopInfo.h" diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index 8d36511a283..a366f7df47d 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -21,7 +21,6 @@ #include "AMDGPU.h" #include "AMDGPUCallLowering.h" #include "AMDGPUFrameLowering.h" -#include "AMDGPUIntrinsicInfo.h" #include "AMDGPURegisterInfo.h" #include "AMDGPUSubtarget.h" #include "AMDGPUTargetMachine.h" diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.cpp deleted file mode 100644 index 02108ca3ddd..00000000000 --- a/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.cpp +++ /dev/null @@ -1,103 +0,0 @@ -//===- AMDGPUIntrinsicInfo.cpp - AMDGPU Intrinsic Information ---*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//==-----------------------------------------------------------------------===// -// -/// \file -/// AMDGPU Implementation of the IntrinsicInfo class. -// -//===-----------------------------------------------------------------------===// - -#include "AMDGPUIntrinsicInfo.h" -#include "AMDGPUSubtarget.h" -#include "llvm/IR/DerivedTypes.h" -#include "llvm/IR/Intrinsics.h" -#include "llvm/IR/Module.h" - -using namespace llvm; - -AMDGPUIntrinsicInfo::AMDGPUIntrinsicInfo() - : TargetIntrinsicInfo() {} - -static const char *const IntrinsicNameTable[] = { -#define GET_INTRINSIC_NAME_TABLE -#include "AMDGPUGenIntrinsicImpl.inc" -#undef GET_INTRINSIC_NAME_TABLE -}; - -namespace { -#define GET_INTRINSIC_ATTRIBUTES -#include "AMDGPUGenIntrinsicImpl.inc" -#undef GET_INTRINSIC_ATTRIBUTES -} - -StringRef AMDGPUIntrinsicInfo::getName(unsigned IntrID, - ArrayRef<Type *> Tys) const { - if (IntrID < Intrinsic::num_intrinsics) - return StringRef(); - - assert(IntrID < SIIntrinsic::num_AMDGPU_intrinsics && - "Invalid intrinsic ID"); - - return IntrinsicNameTable[IntrID - Intrinsic::num_intrinsics]; -} - -std::string AMDGPUIntrinsicInfo::getName(unsigned IntrID, Type **Tys, - unsigned NumTys) const { - return getName(IntrID, makeArrayRef(Tys, NumTys)).str(); -} - -FunctionType *AMDGPUIntrinsicInfo::getType(LLVMContext &Context, unsigned ID, - ArrayRef<Type*> Tys) const { - // FIXME: Re-use Intrinsic::getType machinery - llvm_unreachable("unhandled intrinsic"); -} - -unsigned AMDGPUIntrinsicInfo::lookupName(const char *NameData, - unsigned Len) const { - StringRef Name(NameData, Len); - if (!Name.startswith("llvm.")) - return 0; // All intrinsics start with 'llvm.' - - // Look for a name match in our table. If the intrinsic is not overloaded, - // require an exact match. If it is overloaded, require a prefix match. The - // AMDGPU enum enum starts at Intrinsic::num_intrinsics. - int Idx = Intrinsic::lookupLLVMIntrinsicByName(IntrinsicNameTable, Name); - if (Idx >= 0) { - bool IsPrefixMatch = Name.size() > strlen(IntrinsicNameTable[Idx]); - return IsPrefixMatch == isOverloaded(Idx + 1) - ? Intrinsic::num_intrinsics + Idx - : 0; - } - - return 0; -} - -bool AMDGPUIntrinsicInfo::isOverloaded(unsigned id) const { -// Overload Table -#define GET_INTRINSIC_OVERLOAD_TABLE -#include "AMDGPUGenIntrinsicImpl.inc" -#undef GET_INTRINSIC_OVERLOAD_TABLE -} - -Function *AMDGPUIntrinsicInfo::getDeclaration(Module *M, unsigned IntrID, - ArrayRef<Type *> Tys) const { - FunctionType *FTy = getType(M->getContext(), IntrID, Tys); - Function *F - = cast<Function>(M->getOrInsertFunction(getName(IntrID, Tys), FTy)); - - AttributeList AS = - getAttributes(M->getContext(), static_cast<SIIntrinsic::ID>(IntrID)); - F->setAttributes(AS); - return F; -} - -Function *AMDGPUIntrinsicInfo::getDeclaration(Module *M, unsigned IntrID, - Type **Tys, - unsigned NumTys) const { - return getDeclaration(M, IntrID, makeArrayRef(Tys, NumTys)); -} diff --git a/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h deleted file mode 100644 index a1a094dded2..00000000000 --- a/llvm/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h +++ /dev/null @@ -1,58 +0,0 @@ -//===- AMDGPUIntrinsicInfo.h - AMDGPU Intrinsic Information ------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//==-----------------------------------------------------------------------===// -// -/// \file -/// Interface for the AMDGPU Implementation of the Intrinsic Info class. -// -//===-----------------------------------------------------------------------===// -#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINTRINSICINFO_H -#define LLVM_LIB_TARGET_AMDGPU_AMDGPUINTRINSICINFO_H - -#include "llvm/IR/Intrinsics.h" -#include "llvm/Target/TargetIntrinsicInfo.h" - -namespace llvm { -class TargetMachine; - -namespace SIIntrinsic { -enum ID { - last_non_AMDGPU_intrinsic = Intrinsic::num_intrinsics - 1, -#define GET_INTRINSIC_ENUM_VALUES -#include "AMDGPUGenIntrinsicEnums.inc" -#undef GET_INTRINSIC_ENUM_VALUES - , num_AMDGPU_intrinsics -}; - -} // end namespace AMDGPUIntrinsic - -class AMDGPUIntrinsicInfo final : public TargetIntrinsicInfo { -public: - AMDGPUIntrinsicInfo(); - - StringRef getName(unsigned IntrId, ArrayRef<Type *> Tys = None) const; - - std::string getName(unsigned IntrId, Type **Tys = nullptr, - unsigned NumTys = 0) const override; - - unsigned lookupName(const char *Name, unsigned Len) const override; - bool isOverloaded(unsigned IID) const override; - Function *getDeclaration(Module *M, unsigned ID, - Type **Tys = nullptr, - unsigned NumTys = 0) const override; - - Function *getDeclaration(Module *M, unsigned ID, - ArrayRef<Type *> = None) const; - - FunctionType *getType(LLVMContext &Context, unsigned ID, - ArrayRef<Type*> Tys = None) const; -}; - -} // end namespace llvm - -#endif diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h index 62fbe71d190..fe1d03e60da 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.h @@ -15,7 +15,6 @@ #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETMACHINE_H #define LLVM_LIB_TARGET_AMDGPU_AMDGPUTARGETMACHINE_H -#include "AMDGPUIntrinsicInfo.h" #include "AMDGPUSubtarget.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringMap.h" @@ -95,7 +94,6 @@ public: class GCNTargetMachine final : public AMDGPUTargetMachine { private: - AMDGPUIntrinsicInfo IntrinsicInfo; mutable StringMap<std::unique_ptr<GCNSubtarget>> SubtargetMap; public: @@ -110,10 +108,6 @@ public: TargetTransformInfo getTargetTransformInfo(const Function &F) override; - const AMDGPUIntrinsicInfo *getIntrinsicInfo() const override { - return &IntrinsicInfo; - } - bool useIPRA() const override { return true; } diff --git a/llvm/lib/Target/AMDGPU/CMakeLists.txt b/llvm/lib/Target/AMDGPU/CMakeLists.txt index 393311791ec..66f677f0b91 100644 --- a/llvm/lib/Target/AMDGPU/CMakeLists.txt +++ b/llvm/lib/Target/AMDGPU/CMakeLists.txt @@ -45,7 +45,6 @@ add_llvm_target(AMDGPUCodeGen AMDGPUHSAMetadataStreamer.cpp AMDGPUInstrInfo.cpp AMDGPUInstructionSelector.cpp - AMDGPUIntrinsicInfo.cpp AMDGPUISelDAGToDAG.cpp AMDGPUISelLowering.cpp AMDGPULegalizerInfo.cpp diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index a6af4958b21..9ba4e170742 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -19,7 +19,6 @@ #include "SIISelLowering.h" #include "AMDGPU.h" -#include "AMDGPUIntrinsicInfo.h" #include "AMDGPUSubtarget.h" #include "AMDGPUTargetMachine.h" #include "SIDefines.h" @@ -5267,12 +5266,6 @@ SDValue SITargetLowering::LowerINTRINSIC_WO_CHAIN(SDValue Op, return loadInputValue(DAG, &AMDGPU::VGPR_32RegClass, MVT::i32, SDLoc(DAG.getEntryNode()), MFI->getArgInfo().WorkItemIDZ); - case SIIntrinsic::SI_load_const: { - SDValue Load = - lowerSBuffer(MVT::i32, DL, Op.getOperand(1), Op.getOperand(2), - DAG.getTargetConstant(0, DL, MVT::i1), DAG); - return DAG.getNode(ISD::BITCAST, DL, MVT::f32, Load); - } case Intrinsic::amdgcn_s_buffer_load: { unsigned Cache = cast<ConstantSDNode>(Op.getOperand(3))->getZExtValue(); return lowerSBuffer(VT, DL, Op.getOperand(1), Op.getOperand(2), diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp index 7f7f1807987..c6beb9e3eb4 100644 --- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp @@ -14,7 +14,6 @@ #include "SIInstrInfo.h" #include "AMDGPU.h" -#include "AMDGPUIntrinsicInfo.h" #include "AMDGPUSubtarget.h" #include "GCNHazardRecognizer.h" #include "SIDefines.h" diff --git a/llvm/lib/Target/AMDGPU/SIIntrinsics.td b/llvm/lib/Target/AMDGPU/SIIntrinsics.td deleted file mode 100644 index e51ff4b4bc5..00000000000 --- a/llvm/lib/Target/AMDGPU/SIIntrinsics.td +++ /dev/null @@ -1,19 +0,0 @@ -//===-- SIIntrinsics.td - SI Intrinsic defs ----------------*- tablegen -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Backend internal SI Intrinsic Definitions. User code should not -// directly use these. -// -//===----------------------------------------------------------------------===// - - -let TargetPrefix = "SI", isTarget = 1 in { - def int_SI_load_const : Intrinsic <[llvm_float_ty], [llvm_anyint_ty, llvm_i32_ty], [IntrNoMem]>; - -} // End TargetPrefix = "SI", isTarget = 1 |