diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp | 39 |
2 files changed, 40 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt index bb6225f031a..162c8197e95 100644 --- a/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt +++ b/llvm/lib/CodeGen/GlobalISel/CMakeLists.txt @@ -3,6 +3,7 @@ set(GLOBAL_ISEL_FILES IRTranslator.cpp MachineIRBuilder.cpp RegBankSelect.cpp + RegisterBank.cpp ) # Add GlobalISel files to the dependencies if the user wants to build it. diff --git a/llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp b/llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp new file mode 100644 index 00000000000..5c86e426e1b --- /dev/null +++ b/llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp @@ -0,0 +1,39 @@ +//===- llvm/CodeGen/GlobalISel/RegisterBank.cpp - Register Bank --*- C++ -*-==// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// \file +/// This file implements the RegisterBank class. +//===----------------------------------------------------------------------===// + +#include "llvm/CodeGen/GlobalISel/RegisterBank.h" + +#include "llvm/Target/TargetRegisterInfo.h" + +#define DEBUG_TYPE "registerbank" + +using namespace llvm; + +void RegisterBank::verify(const TargetRegisterInfo &TRI) const { + // Verify that the Size of the register bank is big enough to cover all the + // register classes it covers. + // Verify that the register bank covers all the sub and super classes of the + // classes it covers. +} + +bool RegisterBank::contains(const TargetRegisterClass &RC) const { + return ContainedRegClass.test(RC.getID()); +} + +bool RegisterBank::operator==(const RegisterBank &OtherRB) const { + // There must be only one instance of a given register bank alive + // for the whole compilation. + // The RegisterBankInfo is supposed to enforce that. + assert((OtherRB.getID() != getID() || &OtherRB == this) && + "ID does not uniquely identify a RegisterBank"); + return &OtherRB == this; +} |

