LLVM  9.0.0svn
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 "X86GenCallingConv.inc"
Include dependency graph for X86CallingConv.cpp:

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. More...
 
static ArrayRef< MCPhysReg > CC_X86_VectorCallGetSSEs (const MVT &ValVT)
 
static ArrayRef< MCPhysReg > CC_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. More...
 
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. More...
 
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. More...
 

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 26 of file X86CallingConv.cpp.

References llvm::CCState::addLoc(), llvm::CCState::AllocateReg(), assert(), llvm::N86::EAX, llvm::N86::ECX, llvm::N86::EDI, llvm::N86::EDX, llvm::N86::ESI, llvm::CCValAssign::getCustomReg(), I, llvm::CCState::isAllocated(), llvm::SmallVectorTemplateBase< T >::push_back(), Reg, and llvm::SmallVectorBase::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 188 of file X86CallingConv.cpp.

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

◆ 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 128 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(), Reg, llvm::TargetRegisterInfo::regsOverlap(), and TRI.

◆ CC_X86_64_VectorCallGetGPRs()

static ArrayRef<MCPhysReg> CC_X86_64_VectorCallGetGPRs ( )
static

◆ CC_X86_AnyReg_Error()

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

Definition at line 228 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 297 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(), 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