LLVM  14.0.0git
AMDGPUInstrInfo.h
Go to the documentation of this file.
1 //===-- AMDGPUInstrInfo.h - AMDGPU Instruction Information ------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// Contains the definition of a TargetInstrInfo class that is common
11 /// to all AMD GPUs.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
17 
18 #include "Utils/AMDGPUBaseInfo.h"
19 
20 namespace llvm {
21 
22 class GCNSubtarget;
23 class MachineMemOperand;
24 
26 public:
27  explicit AMDGPUInstrInfo(const GCNSubtarget &st);
28 
29  static bool isUniformMMO(const MachineMemOperand *MMO);
30 };
31 
32 namespace AMDGPU {
33 
34 struct RsrcIntrinsic {
35  unsigned Intr;
36  uint8_t RsrcArg;
37  bool IsImage;
38 };
39 const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr);
40 
42  unsigned Intr;
43  unsigned D16HelperIntr;
44 };
46 
48  unsigned Intr;
49  unsigned BaseOpcode;
50  MIMGDim Dim;
51 
52  uint8_t NumGradients;
53  uint8_t NumDmask;
54  uint8_t NumData;
55  uint8_t NumVAddrs;
56  uint8_t NumArgs;
57 
58  uint8_t DMaskIndex;
59  uint8_t VAddrStart;
60  uint8_t GradientStart;
61  uint8_t CoordStart;
62  uint8_t LodIndex;
63  uint8_t MipIndex;
64  uint8_t VAddrEnd;
65  uint8_t RsrcIndex;
66  uint8_t SampIndex;
67  uint8_t UnormIndex;
70 
71  uint8_t GradientTyArg;
72  uint8_t CoordTyArg;
73 };
75 
77 getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim);
78 
79 } // end AMDGPU namespace
80 } // End llvm namespace
81 
82 #endif
llvm::AMDGPU::ImageDimIntrinsicInfo::NumVAddrs
uint8_t NumVAddrs
Definition: AMDGPUInstrInfo.h:55
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::AMDGPU::ImageDimIntrinsicInfo::CoordTyArg
uint8_t CoordTyArg
Definition: AMDGPUInstrInfo.h:72
llvm::AMDGPU::ImageDimIntrinsicInfo::NumArgs
uint8_t NumArgs
Definition: AMDGPUInstrInfo.h:56
llvm::AMDGPU::ImageDimIntrinsicInfo
Definition: AMDGPUInstrInfo.h:47
llvm::AMDGPUInstrInfo::AMDGPUInstrInfo
AMDGPUInstrInfo(const GCNSubtarget &st)
Definition: AMDGPUInstrInfo.cpp:27
llvm::AMDGPUInstrInfo::isUniformMMO
static bool isUniformMMO(const MachineMemOperand *MMO)
Definition: AMDGPUInstrInfo.cpp:31
llvm::AMDGPU::ImageDimIntrinsicInfo::RsrcIndex
uint8_t RsrcIndex
Definition: AMDGPUInstrInfo.h:65
llvm::MachineMemOperand
A description of a memory reference used in the backend.
Definition: MachineMemOperand.h:128
llvm::AMDGPU::ImageDimIntrinsicInfo::GradientTyArg
uint8_t GradientTyArg
Definition: AMDGPUInstrInfo.h:71
llvm::GCNSubtarget
Definition: GCNSubtarget.h:31
llvm::AMDGPU::D16ImageDimIntrinsic::D16HelperIntr
unsigned D16HelperIntr
Definition: AMDGPUInstrInfo.h:43
llvm::AMDGPU::ImageDimIntrinsicInfo::BaseOpcode
unsigned BaseOpcode
Definition: AMDGPUInstrInfo.h:49
llvm::AMDGPU::ImageDimIntrinsicInfo::CachePolicyIndex
uint8_t CachePolicyIndex
Definition: AMDGPUInstrInfo.h:69
llvm::AMDGPU::ImageDimIntrinsicInfo::Dim
MIMGDim Dim
Definition: AMDGPUInstrInfo.h:50
Intr
unsigned Intr
Definition: AMDGPUBaseInfo.cpp:2014
llvm::AMDGPU::ImageDimIntrinsicInfo::CoordStart
uint8_t CoordStart
Definition: AMDGPUInstrInfo.h:61
AMDGPU
Definition: AMDGPUReplaceLDSUseWithPointer.cpp:114
llvm::AMDGPU::D16ImageDimIntrinsic::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:42
llvm::AMDGPU::ImageDimIntrinsicInfo::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:48
llvm::AMDGPU::RsrcIntrinsic::Intr
unsigned Intr
Definition: AMDGPUInstrInfo.h:35
llvm::AMDGPU::ImageDimIntrinsicInfo::SampIndex
uint8_t SampIndex
Definition: AMDGPUInstrInfo.h:66
llvm::AMDGPU::ImageDimIntrinsicInfo::NumDmask
uint8_t NumDmask
Definition: AMDGPUInstrInfo.h:53
llvm::AMDGPU::ImageDimIntrinsicInfo::TexFailCtrlIndex
uint8_t TexFailCtrlIndex
Definition: AMDGPUInstrInfo.h:68
llvm::AMDGPU::ImageDimIntrinsicInfo::LodIndex
uint8_t LodIndex
Definition: AMDGPUInstrInfo.h:62
llvm::AMDGPU::getImageDimIntrinsicByBaseOpcode
const ImageDimIntrinsicInfo * getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim)
llvm::AMDGPU::ImageDimIntrinsicInfo::MipIndex
uint8_t MipIndex
Definition: AMDGPUInstrInfo.h:63
llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrEnd
uint8_t VAddrEnd
Definition: AMDGPUInstrInfo.h:64
llvm::AMDGPU::ImageDimIntrinsicInfo::VAddrStart
uint8_t VAddrStart
Definition: AMDGPUInstrInfo.h:59
llvm::AMDGPU::RsrcIntrinsic::IsImage
bool IsImage
Definition: AMDGPUInstrInfo.h:37
llvm::AMDGPU::lookupRsrcIntrinsic
const RsrcIntrinsic * lookupRsrcIntrinsic(unsigned Intr)
llvm::AMDGPU::RsrcIntrinsic::RsrcArg
uint8_t RsrcArg
Definition: AMDGPUInstrInfo.h:36
llvm::AMDGPU::ImageDimIntrinsicInfo::UnormIndex
uint8_t UnormIndex
Definition: AMDGPUInstrInfo.h:67
llvm::AMDGPU::D16ImageDimIntrinsic
Definition: AMDGPUInstrInfo.h:41
llvm::AMDGPU::getImageDimIntrinsicInfo
const ImageDimIntrinsicInfo * getImageDimIntrinsicInfo(unsigned Intr)
llvm::AMDGPUInstrInfo
Definition: AMDGPUInstrInfo.h:25
llvm::AMDGPU::ImageDimIntrinsicInfo::GradientStart
uint8_t GradientStart
Definition: AMDGPUInstrInfo.h:60
llvm::AMDGPU::lookupD16ImageDimIntrinsic
const D16ImageDimIntrinsic * lookupD16ImageDimIntrinsic(unsigned Intr)
llvm::AMDGPU::ImageDimIntrinsicInfo::NumData
uint8_t NumData
Definition: AMDGPUInstrInfo.h:54
llvm::AMDGPU::ImageDimIntrinsicInfo::DMaskIndex
uint8_t DMaskIndex
Definition: AMDGPUInstrInfo.h:58
llvm::AMDGPU::RsrcIntrinsic
Definition: AMDGPUInstrInfo.h:34
llvm::AMDGPU::ImageDimIntrinsicInfo::NumGradients
uint8_t NumGradients
Definition: AMDGPUInstrInfo.h:52
AMDGPUBaseInfo.h