LLVM
22.0.0git
lib
Target
SPIRV
SPIRVRegisterBankInfo.cpp
Go to the documentation of this file.
1
//===- SPIRVRegisterBankInfo.cpp ------------------------------*- 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 implements the targeting of the RegisterBankInfo class for SPIR-V.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "
SPIRVRegisterBankInfo.h
"
14
#include "
SPIRVRegisterInfo.h
"
15
#include "
llvm/ADT/Twine.h
"
16
#include "
llvm/CodeGen/RegisterBank.h
"
17
18
#define GET_REGINFO_ENUM
19
#include "SPIRVGenRegisterInfo.inc"
20
21
#define GET_TARGET_REGBANK_IMPL
22
#include "SPIRVGenRegisterBank.inc"
23
24
using namespace
llvm
;
25
26
// This required for .td selection patterns to work or we'd end up with RegClass
27
// checks being redundant as all the classes would be mapped to the same bank.
28
const
RegisterBank
&
29
SPIRVRegisterBankInfo::getRegBankFromRegClass
(
const
TargetRegisterClass
&RC,
30
LLT
Ty)
const
{
31
if
(RC.
getID
() == SPIRV::TYPERegClassID)
32
return
SPIRV::TYPERegBank;
33
return
SPIRV::IDRegBank;
34
}
RegisterBank.h
SPIRVRegisterBankInfo.h
SPIRVRegisterInfo.h
Twine.h
llvm::LLT
Definition
LowLevelType.h:40
llvm::RegisterBank
This class implements the register bank concept.
Definition
RegisterBank.h:29
llvm::SPIRVRegisterBankInfo::getRegBankFromRegClass
const RegisterBank & getRegBankFromRegClass(const TargetRegisterClass &RC, LLT Ty) const override
Get a register bank that covers RC.
Definition
SPIRVRegisterBankInfo.cpp:29
llvm::TargetRegisterClass
Definition
TargetRegisterInfo.h:45
llvm::TargetRegisterClass::getID
unsigned getID() const
Return the register class ID number.
Definition
TargetRegisterInfo.h:74
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
Generated on
for LLVM by
1.14.0