LLVM  6.0.0svn
Macros | Functions
RegisterBankInfo.cpp File Reference

This file implements the RegisterBankInfo class. More...

#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/IR/Type.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetOpcodes.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.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 32 of file RegisterBankInfo.cpp.

Function Documentation

◆ hashInstructionMapping()

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

◆ hashPartialMapping()

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

◆ 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 152 of file RegisterBankInfo.cpp.

References llvm::MachineInstr::getOpcode(), llvm::MachineInstr::isCopy(), and llvm::MachineInstr::isPHI().

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

◆ STATISTIC() [1/8]

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

◆ STATISTIC() [2/8]

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

◆ STATISTIC() [3/8]

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

◆ STATISTIC() [4/8]

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

◆ STATISTIC() [5/8]

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

◆ STATISTIC() [6/8]

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

◆ STATISTIC() [7/8]

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

◆ STATISTIC() [8/8]

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