Path: blob/main/contrib/llvm-project/llvm/lib/Target/SPIRV/SPIRVRegisterBankInfo.cpp
96353 views
//===- SPIRVRegisterBankInfo.cpp ------------------------------*- 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 implements the targeting of the RegisterBankInfo class for SPIR-V.9//10//===----------------------------------------------------------------------===//1112#include "SPIRVRegisterBankInfo.h"13#include "SPIRVRegisterInfo.h"14#include "llvm/CodeGen/RegisterBank.h"1516#define GET_REGINFO_ENUM17#include "SPIRVGenRegisterInfo.inc"1819#define GET_TARGET_REGBANK_IMPL20#include "SPIRVGenRegisterBank.inc"2122using namespace llvm;2324// This required for .td selection patterns to work or we'd end up with RegClass25// checks being redundant as all the classes would be mapped to the same bank.26const RegisterBank &27SPIRVRegisterBankInfo::getRegBankFromRegClass(const TargetRegisterClass &RC,28LLT Ty) const {29if (RC.getID() == SPIRV::TYPERegClassID)30return SPIRV::TYPERegBank;31return SPIRV::IDRegBank;32}333435