LLVM 20.0.0git
Macros | Functions | Variables
AArch64RegisterBankInfo.cpp File Reference

This file implements the targeting of the RegisterBankInfo class for AArch64. More...

#include "AArch64RegisterBankInfo.h"
#include "AArch64RegisterInfo.h"
#include "MCTargetDesc/AArch64MCTargetDesc.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/GlobalISel/GenericMachineInstrs.h"
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
#include "llvm/CodeGen/GlobalISel/Utils.h"
#include "llvm/CodeGen/LowLevelTypeUtils.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/RegisterBank.h"
#include "llvm/CodeGen/RegisterBankInfo.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/IntrinsicsAArch64.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Threading.h"
#include <algorithm>
#include <cassert>
#include "AArch64GenRegisterBank.inc"
#include "AArch64GenRegisterBankInfo.def"

Go to the source code of this file.

Macros

#define GET_TARGET_REGBANK_IMPL
 
#define CHECK_PARTIALMAP(Idx, ValStartIdx, ValLength, RB)
 
#define CHECK_VALUEMAP_IMPL(RBName, Size, Offset)
 
#define CHECK_VALUEMAP(RBName, Size)   CHECK_VALUEMAP_IMPL(RBName, Size, 0)
 
#define CHECK_VALUEMAP_3OPS(RBName, Size)
 
#define CHECK_VALUEMAP_CROSSREGCPY(RBNameDst, RBNameSrc, Size)
 
#define CHECK_VALUEMAP_FPEXT(DstSize, SrcSize)
 

Functions

static bool isFPIntrinsic (const MachineRegisterInfo &MRI, const MachineInstr &MI)
 

Variables

static const unsigned CustomMappingID = 1
 

Detailed Description

This file implements the targeting of the RegisterBankInfo class for AArch64.

Todo:
This should be generated by TableGen.

Definition in file AArch64RegisterBankInfo.cpp.

Macro Definition Documentation

◆ CHECK_PARTIALMAP

#define CHECK_PARTIALMAP (   Idx,
  ValStartIdx,
  ValLength,
  RB 
)
Value:
do { \
assert( \
checkPartialMap(PartialMappingIdx::Idx, ValStartIdx, ValLength, RB) && \
#Idx " is incorrectly initialized"); \
} while (false)
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx

◆ CHECK_VALUEMAP

#define CHECK_VALUEMAP (   RBName,
  Size 
)    CHECK_VALUEMAP_IMPL(RBName, Size, 0)

◆ CHECK_VALUEMAP_3OPS

#define CHECK_VALUEMAP_3OPS (   RBName,
  Size 
)
Value:
do { \
CHECK_VALUEMAP_IMPL(RBName, Size, 0); \
CHECK_VALUEMAP_IMPL(RBName, Size, 1); \
CHECK_VALUEMAP_IMPL(RBName, Size, 2); \
} while (false)
uint64_t Size

◆ CHECK_VALUEMAP_CROSSREGCPY

#define CHECK_VALUEMAP_CROSSREGCPY (   RBNameDst,
  RBNameSrc,
  Size 
)
Value:
do { \
unsigned PartialMapDstIdx = PMI_##RBNameDst##Size - PMI_Min; \
unsigned PartialMapSrcIdx = PMI_##RBNameSrc##Size - PMI_Min; \
(void)PartialMapDstIdx; \
(void)PartialMapSrcIdx; \
const ValueMapping *Map = getCopyMapping(AArch64::RBNameDst##RegBankID, \
AArch64::RBNameSrc##RegBankID, \
(void)Map; \
assert(Map[0].BreakDown == \
Map[0].NumBreakDowns == 1 && \
#RBNameDst #Size " Dst is incorrectly initialized"); \
assert(Map[1].BreakDown == \
Map[1].NumBreakDowns == 1 && \
#RBNameSrc #Size " Src is incorrectly initialized"); \
\
} while (false)
static const RegisterBankInfo::PartialMapping PartMappings[]
static constexpr TypeSize getFixed(ScalarTy ExactSize)
Definition: TypeSize.h:345

◆ CHECK_VALUEMAP_FPEXT

#define CHECK_VALUEMAP_FPEXT (   DstSize,
  SrcSize 
)
Value:
do { \
unsigned PartialMapDstIdx = PMI_FPR##DstSize - PMI_Min; \
unsigned PartialMapSrcIdx = PMI_FPR##SrcSize - PMI_Min; \
(void)PartialMapDstIdx; \
(void)PartialMapSrcIdx; \
const ValueMapping *Map = getFPExtMapping(DstSize, SrcSize); \
(void)Map; \
assert(Map[0].BreakDown == \
Map[0].NumBreakDowns == 1 && "FPR" #DstSize \
" Dst is incorrectly initialized"); \
assert(Map[1].BreakDown == \
Map[1].NumBreakDowns == 1 && "FPR" #SrcSize \
" Src is incorrectly initialized"); \
\
} while (false)

◆ CHECK_VALUEMAP_IMPL

#define CHECK_VALUEMAP_IMPL (   RBName,
  Size,
  Offset 
)
Value:
do { \
assert(checkValueMapImpl(PartialMappingIdx::PMI_##RBName##Size, \
PartialMappingIdx::PMI_First##RBName, Size, \
Offset) && \
#RBName #Size " " #Offset " is incorrectly initialized"); \
} while (false)
@ Offset
Definition: DWP.cpp:480

◆ GET_TARGET_REGBANK_IMPL

#define GET_TARGET_REGBANK_IMPL

Definition at line 38 of file AArch64RegisterBankInfo.cpp.

Function Documentation

◆ isFPIntrinsic()

static bool isFPIntrinsic ( const MachineRegisterInfo MRI,
const MachineInstr MI 
)
static

Variable Documentation

◆ CustomMappingID

const unsigned CustomMappingID = 1
static