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 "AMDGPU.h"
19#include "Utils/AMDGPUBaseInfo.h"
20#include "llvm/CodeGen/TargetInstrInfo.h"
21
22namespace llvm {
23
24class GCNSubtarget;
25class MachineFunction;
26class MachineInstr;
27class MachineInstrBuilder;
28
29class AMDGPUInstrInfo {
30public:
31  explicit AMDGPUInstrInfo(const GCNSubtarget &st);
32
33  static bool isUniformMMO(const MachineMemOperand *MMO);
34};
35
36namespace AMDGPU {
37
38struct RsrcIntrinsic {
39  unsigned Intr;
40  uint8_t RsrcArg;
41  bool IsImage;
42};
43const RsrcIntrinsic *lookupRsrcIntrinsic(unsigned Intr);
44
45struct D16ImageDimIntrinsic {
46  unsigned Intr;
47  unsigned D16HelperIntr;
48};
49const D16ImageDimIntrinsic *lookupD16ImageDimIntrinsic(unsigned Intr);
50
51struct ImageDimIntrinsicInfo {
52  unsigned Intr;
53  unsigned BaseOpcode;
54  MIMGDim Dim;
55};
56const ImageDimIntrinsicInfo *getImageDimIntrinsicInfo(unsigned Intr);
57
58const ImageDimIntrinsicInfo *getImageDimInstrinsicByBaseOpcode(unsigned BaseOpcode,
59                                                               unsigned Dim);
60
61} // end AMDGPU namespace
62} // End llvm namespace
63
64#endif
65