LLVM 19.0.0git
Functions
X86CallingConv.cpp File Reference
#include "X86CallingConv.h"
#include "X86Subtarget.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/IR/CallingConv.h"
#include "llvm/IR/Module.h"
#include "X86GenCallingConv.inc"

Go to the source code of this file.

Functions

static bool CC_X86_32_RegCall_Assign2Regs (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 When regcall calling convention compiled to 32 bit arch, special treatment is required for 64 bit masks.
 
static ArrayRef< MCPhysRegCC_X86_VectorCallGetSSEs (const MVT &ValVT)
 
static ArrayRef< MCPhysRegCC_X86_64_VectorCallGetGPRs ()
 
static bool CC_X86_VectorCallAssignRegister (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 
static bool CC_X86_64_VectorCall (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 Vectorcall calling convention has special handling for vector types or HVA for 64 bit arch.
 
static bool CC_X86_32_VectorCall (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 Vectorcall calling convention has special handling for vector types or HVA for 32 bit arch.
 
static bool CC_X86_AnyReg_Error (unsigned &, MVT &, MVT &, CCValAssign::LocInfo &, ISD::ArgFlagsTy &, CCState &)
 
static bool CC_X86_32_MCUInReg (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 
static bool CC_X86_Intr (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 X86 interrupt handlers can only take one or two stack arguments, but if there are two arguments, they are in the opposite order from the standard convention.
 
static bool CC_X86_64_Pointer (unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)
 

Function Documentation

◆ CC_X86_32_MCUInReg()

static bool CC_X86_32_MCUInReg ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

◆ CC_X86_32_RegCall_Assign2Regs()

static bool CC_X86_32_RegCall_Assign2Regs ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

When regcall calling convention compiled to 32 bit arch, special treatment is required for 64 bit masks.

The value should be assigned to two GPRs.

Returns
true if registers were allocated and false otherwise.

Definition at line 27 of file X86CallingConv.cpp.

References llvm::CCState::addLoc(), llvm::CCState::AllocateReg(), assert(), llvm::CCValAssign::getCustomReg(), I, llvm::CCState::isAllocated(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::SmallVectorBase< Size_T >::size().

◆ CC_X86_32_VectorCall()

static bool CC_X86_32_VectorCall ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

Vectorcall calling convention has special handling for vector types or HVA for 32 bit arch.

For HVAs actual XMM registers are allocated on the second pass. For vector types, actual XMM registers are allocated on the first pass.

Returns
true if registers were allocated and false otherwise.

Definition at line 189 of file X86CallingConv.cpp.

References llvm::CCState::addLoc(), llvm::CCState::AllocateReg(), CC_X86_VectorCallAssignRegister(), CC_X86_VectorCallGetSSEs(), llvm::CCValAssign::getReg(), llvm::MVT::getSizeInBits(), llvm::CCValAssign::Indirect, llvm::MVT::isFloatingPoint(), llvm::ISD::ArgFlagsTy::isHva(), llvm::ISD::ArgFlagsTy::isSecArgPass(), llvm::MVT::isVector(), and llvm::ISD::ArgFlagsTy::setInReg().

◆ CC_X86_64_Pointer()

static bool CC_X86_64_Pointer ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

Definition at line 334 of file X86CallingConv.cpp.

References llvm::CCValAssign::ZExt.

◆ CC_X86_64_VectorCall()

static bool CC_X86_64_VectorCall ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

Vectorcall calling convention has special handling for vector types or HVA for 64 bit arch.

For HVAs shadow registers might be allocated on the first pass and actual XMM registers are allocated on the second pass. For vector types, actual XMM registers are allocated on the first pass.

Returns
true if registers were allocated and false otherwise.

Definition at line 129 of file X86CallingConv.cpp.

References llvm::CCState::addLoc(), llvm::CCState::AllocateReg(), llvm::CCState::AllocateStack(), CC_X86_64_VectorCallGetGPRs(), CC_X86_VectorCallAssignRegister(), CC_X86_VectorCallGetSSEs(), llvm::CCState::getMachineFunction(), llvm::CCValAssign::getReg(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MVT::getSizeInBits(), llvm::MachineFunction::getSubtarget(), llvm::CCState::isAllocated(), llvm::MVT::isFloatingPoint(), llvm::ISD::ArgFlagsTy::isHva(), llvm::ISD::ArgFlagsTy::isHvaStart(), llvm::ISD::ArgFlagsTy::isSecArgPass(), llvm::MVT::isVector(), and TRI.

◆ CC_X86_64_VectorCallGetGPRs()

static ArrayRef< MCPhysReg > CC_X86_64_VectorCallGetGPRs ( )
static

Definition at line 86 of file X86CallingConv.cpp.

Referenced by CC_X86_64_VectorCall().

◆ CC_X86_AnyReg_Error()

static bool CC_X86_AnyReg_Error ( unsigned ,
MVT ,
MVT ,
CCValAssign::LocInfo ,
ISD::ArgFlagsTy ,
CCState  
)
static

Definition at line 229 of file X86CallingConv.cpp.

References llvm_unreachable.

◆ CC_X86_Intr()

static bool CC_X86_Intr ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

X86 interrupt handlers can only take one or two stack arguments, but if there are two arguments, they are in the opposite order from the standard convention.

Therefore, we have to look at the argument count up front before allocating stack for each argument.

Definition at line 298 of file X86CallingConv.cpp.

References llvm::CCState::addLoc(), llvm::CCState::AllocateStack(), llvm::Function::arg_size(), llvm::MachineFunction::getFunction(), llvm::CCState::getMachineFunction(), llvm::CCValAssign::getMem(), llvm::MachineFunction::getSubtarget(), is64Bit(), llvm::Offset, and llvm::report_fatal_error().

◆ CC_X86_VectorCallAssignRegister()

static bool CC_X86_VectorCallAssignRegister ( unsigned ValNo,
MVT ValVT,
MVT LocVT,
CCValAssign::LocInfo LocInfo,
ISD::ArgFlagsTy ArgFlags,
CCState State 
)
static

◆ CC_X86_VectorCallGetSSEs()

static ArrayRef< MCPhysReg > CC_X86_VectorCallGetSSEs ( const MVT ValVT)
static