LLVM 19.0.0git
Macros | Functions
RegisterBankInfo.cpp File Reference

This file implements the RegisterBankInfo class. More...

#include "llvm/CodeGen/RegisterBankInfo.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterBank.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Config/llvm-config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>

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.
static hash_code hashPartialMapping (unsigned StartIdx, unsigned Length, const RegisterBank *RegBank)
 Hashing function for PartialMapping.
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 29 of file RegisterBankInfo.cpp.

Function Documentation

◆ hashInstructionMapping()

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

Definition at line 376 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 269 of file RegisterBankInfo.cpp.

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

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 158 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"