LLVM  16.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 
22 namespace llvm {
23 
25  const SPIRVRegisterInfo RI;
26 
27 public:
29 
30  const SPIRVRegisterInfo &getRegisterInfo() const { return RI; }
31  bool isHeaderInstr(const MachineInstr &MI) const;
32  bool isConstantInstr(const MachineInstr &MI) const;
33  bool isTypeDeclInstr(const MachineInstr &MI) const;
34  bool isDecorationInstr(const MachineInstr &MI) const;
35  bool canUseFastMathFlags(const MachineInstr &MI) const;
36  bool canUseNSW(const MachineInstr &MI) const;
37  bool canUseNUW(const MachineInstr &MI) const;
38 
40  MachineBasicBlock *&FBB,
42  bool AllowModify = false) const override;
43 
45  int *BytesRemoved = nullptr) const override;
46 
49  const DebugLoc &DL,
50  int *BytesAdded = nullptr) const override;
52  const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,
53  bool KillSrc) const override;
54  bool expandPostRAPseudo(MachineInstr &MI) const override;
55 };
56 } // namespace llvm
57 
58 #endif // LLVM_LIB_TARGET_SPIRV_SPIRVINSTRINFO_H
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
SPIRVGenInstrInfo
llvm::SPIRVInstrInfo::isDecorationInstr
bool isDecorationInstr(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:59
llvm::SPIRVInstrInfo::canUseNUW
bool canUseNUW(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:130
llvm::SPIRVInstrInfo::analyzeBranch
bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify=false) const override
Definition: SPIRVInstrInfo.cpp:171
TargetInstrInfo.h
llvm::SPIRVInstrInfo::insertBranch
unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, ArrayRef< MachineOperand > Cond, const DebugLoc &DL, int *BytesAdded=nullptr) const override
Definition: SPIRVInstrInfo.cpp:222
llvm::SPIRVInstrInfo::isConstantInstr
bool isConstantInstr(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:28
llvm::SPIRVInstrInfo::getRegisterInfo
const SPIRVRegisterInfo & getRegisterInfo() const
Definition: SPIRVInstrInfo.h:30
llvm::SPIRVInstrInfo::isTypeDeclInstr
bool isTypeDeclInstr(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:49
llvm::SPIRVInstrInfo::canUseFastMathFlags
bool canUseFastMathFlags(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:94
llvm::SPIRVInstrInfo::isHeaderInstr
bool isHeaderInstr(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:72
SPIRVRegisterInfo.h
llvm::SPIRVInstrInfo::canUseNSW
bool canUseNSW(const MachineInstr &MI) const
Definition: SPIRVInstrInfo.cpp:113
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::SPIRVRegisterInfo
Definition: SPIRVRegisterInfo.h:23
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::SPIRVInstrInfo::SPIRVInstrInfo
SPIRVInstrInfo()
Definition: SPIRVInstrInfo.cpp:26
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::SPIRVInstrInfo
Definition: SPIRVInstrInfo.h:24
Cond
SmallVector< MachineOperand, 4 > Cond
Definition: BasicBlockSections.cpp:137
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::SPIRVInstrInfo::removeBranch
unsigned removeBranch(MachineBasicBlock &MBB, int *BytesRemoved=nullptr) const override
Definition: SPIRVInstrInfo.cpp:203
llvm::SPIRVInstrInfo::copyPhysReg
void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const override
Definition: SPIRVInstrInfo.cpp:230
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
llvm::SPIRVInstrInfo::expandPostRAPseudo
bool expandPostRAPseudo(MachineInstr &MI) const override
Definition: SPIRVInstrInfo.cpp:247
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::MCRegister
Wrapper class representing physical registers. Should be passed by value.
Definition: MCRegister.h:24