LLVM 22.0.0git
SPIRVInstrInfo.h
Go to the documentation of this file.
1//===-- SPIRVInstrInfo.h - SPIR-V 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// This file contains the SPIR-V implementation of the TargetInstrInfo class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVINSTRINFO_H
14#define LLVM_LIB_TARGET_SPIRV_SPIRVINSTRINFO_H
15
16#include "SPIRVRegisterInfo.h"
18
19#define GET_INSTRINFO_HEADER
20#include "SPIRVGenInstrInfo.inc"
21
22namespace llvm {
23class SPIRVSubtarget;
24
26 const SPIRVRegisterInfo RI;
27
28public:
29 explicit SPIRVInstrInfo(const SPIRVSubtarget &STI);
30
31 const SPIRVRegisterInfo &getRegisterInfo() const { return RI; }
32 bool isHeaderInstr(const MachineInstr &MI) const;
33 bool isConstantInstr(const MachineInstr &MI) const;
34 bool isSpecConstantInstr(const MachineInstr &MI) const;
35 bool isInlineAsmDefInstr(const MachineInstr &MI) const;
36 bool isTypeDeclInstr(const MachineInstr &MI) const;
37 bool isDecorationInstr(const MachineInstr &MI) const;
38 bool isAliasingInstr(const MachineInstr &MI) const;
40 bool KHRFloatControls2) const;
41 bool canUseNSW(const MachineInstr &MI) const;
42 bool canUseNUW(const MachineInstr &MI) const;
43
47 bool AllowModify = false) const override;
48
50 int *BytesRemoved = nullptr) const override;
51
54 const DebugLoc &DL,
55 int *BytesAdded = nullptr) const override;
57 const DebugLoc &DL, Register DestReg, Register SrcReg,
58 bool KillSrc, bool RenamableDest = false,
59 bool RenamableSrc = false) const override;
60};
61
62namespace SPIRV {
64 // It is a half type
66 // It is a 64 bit type
68};
69} // namespace SPIRV
70
71} // namespace llvm
72
73#endif // LLVM_LIB_TARGET_SPIRV_SPIRVINSTRINFO_H
MachineBasicBlock & MBB
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:57
const SmallVectorImpl< MachineOperand > MachineBasicBlock * TBB
const SmallVectorImpl< MachineOperand > & Cond
spirv structurize SPIRV
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
A debug info location.
Definition DebugLoc.h:123
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
Definition Register.h:20
bool isConstantInstr(const MachineInstr &MI) const
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
bool isInlineAsmDefInstr(const MachineInstr &MI) const
SPIRVInstrInfo(const SPIRVSubtarget &STI)
bool isTypeDeclInstr(const MachineInstr &MI) const
bool isDecorationInstr(const MachineInstr &MI) const
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
bool isAliasingInstr(const MachineInstr &MI) const
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, Register DestReg, Register SrcReg, bool KillSrc, bool RenamableDest=false, bool RenamableSrc=false) const override
bool canUseFastMathFlags(const MachineInstr &MI, bool KHRFloatControls2) const
bool isHeaderInstr(const MachineInstr &MI) const
bool canUseNUW(const MachineInstr &MI) const
const SPIRVRegisterInfo & getRegisterInfo() const
bool isSpecConstantInstr(const MachineInstr &MI) const
bool canUseNSW(const MachineInstr &MI) const
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26