xref: /freebsd/contrib/llvm-project/llvm/lib/Target/SPIRV/SPIRVRegisterInfo.cpp (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
1*81ad6265SDimitry Andric //===-- SPIRVRegisterInfo.cpp - SPIR-V Register Information -----*- C++ -*-===//
2*81ad6265SDimitry Andric //
3*81ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*81ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*81ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*81ad6265SDimitry Andric //
7*81ad6265SDimitry Andric //===----------------------------------------------------------------------===//
8*81ad6265SDimitry Andric //
9*81ad6265SDimitry Andric // This file contains the SPIR-V implementation of the TargetRegisterInfo class.
10*81ad6265SDimitry Andric //
11*81ad6265SDimitry Andric //===----------------------------------------------------------------------===//
12*81ad6265SDimitry Andric 
13*81ad6265SDimitry Andric #include "SPIRVRegisterInfo.h"
14*81ad6265SDimitry Andric #include "SPIRV.h"
15*81ad6265SDimitry Andric #include "SPIRVSubtarget.h"
16*81ad6265SDimitry Andric #include "llvm/CodeGen/MachineFunction.h"
17*81ad6265SDimitry Andric 
18*81ad6265SDimitry Andric #define GET_REGINFO_TARGET_DESC
19*81ad6265SDimitry Andric #include "SPIRVGenRegisterInfo.inc"
20*81ad6265SDimitry Andric using namespace llvm;
21*81ad6265SDimitry Andric 
SPIRVRegisterInfo()22*81ad6265SDimitry Andric SPIRVRegisterInfo::SPIRVRegisterInfo() : SPIRVGenRegisterInfo(SPIRV::ID0) {}
23*81ad6265SDimitry Andric 
getReservedRegs(const MachineFunction & MF) const24*81ad6265SDimitry Andric BitVector SPIRVRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
25*81ad6265SDimitry Andric   return BitVector(getNumRegs());
26*81ad6265SDimitry Andric }
27*81ad6265SDimitry Andric 
28*81ad6265SDimitry Andric const MCPhysReg *
getCalleeSavedRegs(const MachineFunction * MF) const29*81ad6265SDimitry Andric SPIRVRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
30*81ad6265SDimitry Andric   static const MCPhysReg CalleeSavedReg = {0};
31*81ad6265SDimitry Andric   return &CalleeSavedReg;
32*81ad6265SDimitry Andric }
33