Path: blob/main/contrib/llvm-project/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h
35271 views
//===- NVPTXInstrInfo.h - NVPTX Instruction Information----------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains the NVPTX implementation of the TargetInstrInfo class.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXINSTRINFO_H13#define LLVM_LIB_TARGET_NVPTX_NVPTXINSTRINFO_H1415#include "NVPTX.h"16#include "NVPTXRegisterInfo.h"17#include "llvm/CodeGen/TargetInstrInfo.h"1819#define GET_INSTRINFO_HEADER20#include "NVPTXGenInstrInfo.inc"2122namespace llvm {2324class NVPTXInstrInfo : public NVPTXGenInstrInfo {25const NVPTXRegisterInfo RegInfo;26virtual void anchor();27public:28explicit NVPTXInstrInfo();2930const NVPTXRegisterInfo &getRegisterInfo() const { return RegInfo; }3132/* The following virtual functions are used in register allocation.33* They are not implemented because the existing interface and the logic34* at the caller side do not work for the elementized vector load and store.35*36* virtual Register isLoadFromStackSlot(const MachineInstr *MI,37* int &FrameIndex) const;38* virtual Register isStoreToStackSlot(const MachineInstr *MI,39* int &FrameIndex) const;40* virtual void storeRegToStackSlot(MachineBasicBlock &MBB,41* MachineBasicBlock::iterator MBBI,42* unsigned SrcReg, bool isKill, int FrameIndex,43* const TargetRegisterClass *RC,44* Register VReg) const;45* virtual void loadRegFromStackSlot(MachineBasicBlock &MBB,46* MachineBasicBlock::iterator MBBI,47* unsigned DestReg, int FrameIndex,48* const TargetRegisterClass *RC,49* const TargetRegisterInfo *TRI,50* Register VReg) const;51*/5253void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I,54const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg,55bool KillSrc) const override;5657// Branch analysis.58bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,59MachineBasicBlock *&FBB,60SmallVectorImpl<MachineOperand> &Cond,61bool AllowModify) const override;62unsigned removeBranch(MachineBasicBlock &MBB,63int *BytesRemoved = nullptr) const override;64unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,65MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,66const DebugLoc &DL,67int *BytesAdded = nullptr) const override;68};6970} // namespace llvm7172#endif737475