LLVM  14.0.0git
Macros | Functions
RegisterBankInfo.cpp File Reference
#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/GlobalISel/RegisterBank.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/IR/Type.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
Include dependency graph for RegisterBankInfo.cpp:

Go to the source code of this file.


#define DEBUG_TYPE   "registerbankinfo"


 STATISTIC (NumPartialMappingsCreated, "Number of partial mappings dynamically created")
 STATISTIC (NumPartialMappingsAccessed, "Number of partial mappings dynamically accessed")
 STATISTIC (NumValueMappingsCreated, "Number of value mappings dynamically created")
 STATISTIC (NumValueMappingsAccessed, "Number of value mappings dynamically accessed")
 STATISTIC (NumOperandsMappingsCreated, "Number of operands mappings dynamically created")
 STATISTIC (NumOperandsMappingsAccessed, "Number of operands mappings dynamically accessed")
 STATISTIC (NumInstructionMappingsCreated, "Number of instruction mappings dynamically created")
 STATISTIC (NumInstructionMappingsAccessed, "Number of instruction mappings dynamically accessed")
static bool isCopyLike (const MachineInstr &MI)
 Check whether or not MI should be treated like a copy for the mappings. More...
static hash_code hashPartialMapping (unsigned StartIdx, unsigned Length, const RegisterBank *RegBank)
 Hashing function for PartialMapping. More...
static hash_code hashValueMapping (const RegisterBankInfo::PartialMapping *BreakDown, unsigned NumBreakDowns)
static hash_code hashInstructionMapping (unsigned ID, unsigned Cost, const RegisterBankInfo::ValueMapping *OperandsMapping, unsigned NumOperands)

Detailed Description

This file implements the RegisterBankInfo class.

Definition in file RegisterBankInfo.cpp.

Macro Definition Documentation


#define DEBUG_TYPE   "registerbankinfo"

Definition at line 31 of file RegisterBankInfo.cpp.

Function Documentation

◆ hashInstructionMapping()

static hash_code hashInstructionMapping ( unsigned  ID,
unsigned  Cost,
const RegisterBankInfo::ValueMapping OperandsMapping,
unsigned  NumOperands 

Definition at line 374 of file RegisterBankInfo.cpp.

References llvm::hash_combine().

◆ hashPartialMapping()

static hash_code hashPartialMapping ( unsigned  StartIdx,
unsigned  Length,
const RegisterBank RegBank 

Hashing function for PartialMapping.

Definition at line 267 of file RegisterBankInfo.cpp.

References llvm::RegisterBank::getID(), and llvm::hash_combine().

Referenced by llvm::RegisterBankInfo::getPartialMapping(), and llvm::hash_value().

◆ hashValueMapping()

static hash_code hashValueMapping ( const RegisterBankInfo::PartialMapping BreakDown,
unsigned  NumBreakDowns 

◆ isCopyLike()

static bool isCopyLike ( const MachineInstr MI)

Check whether or not MI should be treated like a copy for the mappings.

Copy like instruction are special for mapping because they don't have actual register constraints. Moreover, they sometimes have register classes assigned and we can just use that instead of failing to provide a generic mapping.

Definition at line 156 of file RegisterBankInfo.cpp.

References MI.

Referenced by llvm::RegisterBankInfo::getInstrMappingImpl(), and llvm::RegisterBankInfo::InstructionMapping::verify().

◆ STATISTIC() [1/8]

STATISTIC ( NumInstructionMappingsAccessed  ,
"Number of instruction mappings dynamically accessed"   

◆ STATISTIC() [2/8]

STATISTIC ( NumInstructionMappingsCreated  ,
"Number of instruction mappings dynamically created"   

◆ STATISTIC() [3/8]

STATISTIC ( NumOperandsMappingsAccessed  ,
"Number of operands mappings dynamically accessed"   

◆ STATISTIC() [4/8]

STATISTIC ( NumOperandsMappingsCreated  ,
"Number of operands mappings dynamically created"   

◆ STATISTIC() [5/8]

STATISTIC ( NumPartialMappingsAccessed  ,
"Number of partial mappings dynamically accessed"   

◆ STATISTIC() [6/8]

STATISTIC ( NumPartialMappingsCreated  ,
"Number of partial mappings dynamically created"   

◆ STATISTIC() [7/8]

STATISTIC ( NumValueMappingsAccessed  ,
"Number of value mappings dynamically accessed"   

◆ STATISTIC() [8/8]

STATISTIC ( NumValueMappingsCreated  ,
"Number of value mappings dynamically created"