1 //===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
10 /// Contains the definition of a TargetInstrInfo class that is common
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
18 #include "Utils/AMDGPUBaseInfo.h"
23 class MachineMemOperand
;
26 class AMDGPUInstrInfo
{
28 explicit AMDGPUInstrInfo(const GCNSubtarget
&st
);
30 static bool isUniformMMO(const MachineMemOperand
*MMO
);
35 /// Return the intrinsic ID for opcodes with the G_AMDGPU_INTRIN_ prefix.
37 /// These opcodes have an Intrinsic::ID operand similar to a GIntrinsic. But
38 /// they are not actual instances of GIntrinsics, so we cannot use
39 /// GIntrinsic::getIntrinsicID() on them.
40 Intrinsic::ID
getIntrinsicID(const MachineInstr
&I
);
42 struct RsrcIntrinsic
{
47 const RsrcIntrinsic
*lookupRsrcIntrinsic(unsigned Intr
);
49 struct D16ImageDimIntrinsic
{
51 unsigned D16HelperIntr
;
53 const D16ImageDimIntrinsic
*lookupD16ImageDimIntrinsic(unsigned Intr
);
55 struct ImageDimIntrinsicInfo
{
60 uint8_t NumOffsetArgs
;
62 uint8_t NumZCompareArgs
;
73 uint8_t ZCompareIndex
;
74 uint8_t GradientStart
;
82 uint8_t TexFailCtrlIndex
;
83 uint8_t CachePolicyIndex
;
86 uint8_t GradientTyArg
;
89 const ImageDimIntrinsicInfo
*getImageDimIntrinsicInfo(unsigned Intr
);
91 const ImageDimIntrinsicInfo
*
92 getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode
, unsigned Dim
);
94 } // end AMDGPU namespace
95 } // End llvm namespace