clang 19.0.0git
Functions
X86.cpp File Reference
#include "ABIInfoImpl.h"
#include "TargetInfo.h"
#include "clang/Basic/DiagnosticFrontend.h"
#include "llvm/ADT/SmallBitVector.h"

Go to the source code of this file.

Functions

static void rewriteInputConstraintReferences (unsigned FirstIn, unsigned NumNewOuts, std::string &AsmString)
 Rewrite input constraint references after adding some output constraints.
 
static bool is32Or64BitBasicType (QualType Ty, ASTContext &Context)
 
static bool addFieldSizes (ASTContext &Context, const RecordDecl *RD, uint64_t &Size)
 
static bool addBaseAndFieldSizes (ASTContext &Context, const CXXRecordDecl *RD, uint64_t &Size)
 
static bool isArgInAlloca (const ABIArgInfo &Info)
 
static void addX86InterruptAttrs (const FunctionDecl *FD, llvm::GlobalValue *GV, CodeGen::CodeGenModule &CGM)
 
static void initFeatureMaps (const ASTContext &Ctx, llvm::StringMap< bool > &CallerMap, const FunctionDecl *Caller, llvm::StringMap< bool > &CalleeMap, const FunctionDecl *Callee)
 
static bool checkAVXParamFeature (DiagnosticsEngine &Diag, SourceLocation CallLoc, const llvm::StringMap< bool > &CallerMap, const llvm::StringMap< bool > &CalleeMap, QualType Ty, StringRef Feature, bool IsArgument)
 
static bool checkAVX512ParamFeature (DiagnosticsEngine &Diag, SourceLocation CallLoc, const llvm::StringMap< bool > &CallerMap, const llvm::StringMap< bool > &CalleeMap, QualType Ty, bool IsArgument)
 
static bool checkAVXParam (DiagnosticsEngine &Diag, ASTContext &Ctx, SourceLocation CallLoc, const llvm::StringMap< bool > &CallerMap, const llvm::StringMap< bool > &CalleeMap, QualType Ty, bool IsArgument)
 
static bool BitsContainNoUserData (QualType Ty, unsigned StartBit, unsigned EndBit, ASTContext &Context)
 BitsContainNoUserData - Return true if the specified [start,end) bit range is known to either be off the end of the specified type or being in alignment padding.
 
static llvm::TypegetFPTypeAtOffset (llvm::Type *IRType, unsigned IROffset, const llvm::DataLayout &TD)
 getFPTypeAtOffset - Return a floating point type at the specified offset.
 
static llvm::TypeGetX86_64ByValArgumentPair (llvm::Type *Lo, llvm::Type *Hi, const llvm::DataLayout &TD)
 GetX86_64ByValArgumentPair - Given a high and low type that can ideally be used as elements of a two register pair to pass or return, return a first class aggregate to represent them.
 
static Address EmitX86_64VAArgFromMemory (CodeGenFunction &CGF, Address VAListAddr, QualType Ty)
 

Function Documentation

◆ addBaseAndFieldSizes()

static bool addBaseAndFieldSizes ( ASTContext Context,
const CXXRecordDecl RD,
uint64_t &  Size 
)
static

Definition at line 423 of file X86.cpp.

References addBaseAndFieldSizes(), addFieldSizes(), and clang::CXXRecordDecl::bases().

Referenced by addBaseAndFieldSizes().

◆ addFieldSizes()

static bool addFieldSizes ( ASTContext Context,
const RecordDecl RD,
uint64_t &  Size 
)
static

◆ addX86InterruptAttrs()

static void addX86InterruptAttrs ( const FunctionDecl FD,
llvm::GlobalValue *  GV,
CodeGen::CodeGenModule CGM 
)
static

◆ BitsContainNoUserData()

static bool BitsContainNoUserData ( QualType  Ty,
unsigned  StartBit,
unsigned  EndBit,
ASTContext Context 
)
static

BitsContainNoUserData - Return true if the specified [start,end) bit range is known to either be off the end of the specified type or being in alignment padding.

The user type specified is known to be at most 128 bits in size, and have passed through X86_64ABIInfo::classify with a successful classification that put one of the two halves in the INTEGER class.

It is conservatively correct to return false.

Definition at line 2296 of file X86.cpp.

References BitsContainNoUserData(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getASTRecordLayout(), clang::ASTRecordLayout::getBaseClassOffset(), clang::RecordType::getDecl(), clang::ASTRecordLayout::getFieldOffset(), clang::ASTContext::getTypeSize(), and clang::ASTContext::toBits().

Referenced by BitsContainNoUserData().

◆ checkAVX512ParamFeature()

static bool checkAVX512ParamFeature ( DiagnosticsEngine Diag,
SourceLocation  CallLoc,
const llvm::StringMap< bool > &  CallerMap,
const llvm::StringMap< bool > &  CalleeMap,
QualType  Ty,
bool  IsArgument 
)
static

Definition at line 1526 of file X86.cpp.

References checkAVXParamFeature(), and Diag().

Referenced by checkAVXParam().

◆ checkAVXParam()

static bool checkAVXParam ( DiagnosticsEngine Diag,
ASTContext Ctx,
SourceLocation  CallLoc,
const llvm::StringMap< bool > &  CallerMap,
const llvm::StringMap< bool > &  CalleeMap,
QualType  Ty,
bool  IsArgument 
)
static

◆ checkAVXParamFeature()

static bool checkAVXParamFeature ( DiagnosticsEngine Diag,
SourceLocation  CallLoc,
const llvm::StringMap< bool > &  CallerMap,
const llvm::StringMap< bool > &  CalleeMap,
QualType  Ty,
StringRef  Feature,
bool  IsArgument 
)
static

Definition at line 1504 of file X86.cpp.

References Diag().

Referenced by checkAVX512ParamFeature(), and checkAVXParam().

◆ EmitX86_64VAArgFromMemory()

static Address EmitX86_64VAArgFromMemory ( CodeGenFunction CGF,
Address  VAListAddr,
QualType  Ty 
)
static

◆ getFPTypeAtOffset()

static llvm::Type * getFPTypeAtOffset ( llvm::Type IRType,
unsigned  IROffset,
const llvm::DataLayout &  TD 
)
static

getFPTypeAtOffset - Return a floating point type at the specified offset.

Definition at line 2374 of file X86.cpp.

References getFPTypeAtOffset().

Referenced by getFPTypeAtOffset().

◆ GetX86_64ByValArgumentPair()

static llvm::Type * GetX86_64ByValArgumentPair ( llvm::Type Lo,
llvm::Type Hi,
const llvm::DataLayout &  TD 
)
static

GetX86_64ByValArgumentPair - Given a high and low type that can ideally be used as elements of a two register pair to pass or return, return a first class aggregate to represent them.

For example, if the low part of a by-value argument should be passed as i32* and the high part as float, return {i32*, float}.

Definition at line 2532 of file X86.cpp.

References clang::Result.

◆ initFeatureMaps()

static void initFeatureMaps ( const ASTContext Ctx,
llvm::StringMap< bool > &  CallerMap,
const FunctionDecl Caller,
llvm::StringMap< bool > &  CalleeMap,
const FunctionDecl Callee 
)
static

Definition at line 1490 of file X86.cpp.

References clang::ASTContext::getFunctionFeatureMap().

◆ is32Or64BitBasicType()

static bool is32Or64BitBasicType ( QualType  Ty,
ASTContext Context 
)
static

◆ isArgInAlloca()

static bool isArgInAlloca ( const ABIArgInfo Info)
static

◆ rewriteInputConstraintReferences()

static void rewriteInputConstraintReferences ( unsigned  FirstIn,
unsigned  NumNewOuts,
std::string &  AsmString 
)
static

Rewrite input constraint references after adding some output constraints.

In the case where there is one output and one input and we add one output, we need to replace all operand references greater than or equal to 1: mov $0, $1 mov eax, $1 The result will be: mov $0, $2 mov eax, $2

Definition at line 262 of file X86.cpp.