LLVM 20.0.0git
Macros | Functions
X86FixupVectorConstants.cpp File Reference
#include "X86.h"
#include "X86InstrFoldTables.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineConstantPool.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-fixup-vector-constants"
 

Functions

 STATISTIC (NumInstChanges, "Number of instructions changes")
 
static ConstantgetSplatValueAllowUndef (const ConstantVector *C)
 Normally, we only allow poison in vector splats.
 
static std::optional< APIntextractConstantBits (const Constant *C)
 
static std::optional< APIntextractConstantBits (const Constant *C, unsigned NumBits)
 
static std::optional< APIntgetSplatableConstant (const Constant *C, unsigned SplatBitWidth)
 
static ConstantrebuildConstant (LLVMContext &Ctx, Type *SclTy, const APInt &Bits, unsigned NumSclBits)
 
static ConstantrebuildSplatCst (const Constant *C, unsigned, unsigned, unsigned SplatBitWidth)
 
static ConstantrebuildZeroUpperCst (const Constant *C, unsigned NumBits, unsigned, unsigned ScalarBitWidth)
 
static ConstantrebuildExtCst (const Constant *C, bool IsSExt, unsigned NumBits, unsigned NumElts, unsigned SrcEltBitWidth)
 
static ConstantrebuildSExtCst (const Constant *C, unsigned NumBits, unsigned NumElts, unsigned SrcEltBitWidth)
 
static ConstantrebuildZExtCst (const Constant *C, unsigned NumBits, unsigned NumElts, unsigned SrcEltBitWidth)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-fixup-vector-constants"

Definition at line 27 of file X86FixupVectorConstants.cpp.

Function Documentation

◆ extractConstantBits() [1/2]

static std::optional< APInt > extractConstantBits ( const Constant C)
static

◆ extractConstantBits() [2/2]

static std::optional< APInt > extractConstantBits ( const Constant C,
unsigned  NumBits 
)
static

Definition at line 141 of file X86FixupVectorConstants.cpp.

References llvm::CallingConv::C, and extractConstantBits().

◆ getSplatableConstant()

static std::optional< APInt > getSplatableConstant ( const Constant C,
unsigned  SplatBitWidth 
)
static

◆ getSplatValueAllowUndef()

static Constant * getSplatValueAllowUndef ( const ConstantVector C)
static

Normally, we only allow poison in vector splats.

However, as this is part of the backend, and working with the DAG representation, which currently only natively represents undef values, we need to accept undefs here.

Definition at line 70 of file X86FixupVectorConstants.cpp.

References llvm::CallingConv::C.

Referenced by extractConstantBits().

◆ rebuildConstant()

static Constant * rebuildConstant ( LLVMContext Ctx,
Type SclTy,
const APInt Bits,
unsigned  NumSclBits 
)
static

◆ rebuildExtCst()

static Constant * rebuildExtCst ( const Constant C,
bool  IsSExt,
unsigned  NumBits,
unsigned  NumElts,
unsigned  SrcEltBitWidth 
)
static

◆ rebuildSExtCst()

static Constant * rebuildSExtCst ( const Constant C,
unsigned  NumBits,
unsigned  NumElts,
unsigned  SrcEltBitWidth 
)
static

Definition at line 322 of file X86FixupVectorConstants.cpp.

References llvm::CallingConv::C, and rebuildExtCst().

◆ rebuildSplatCst()

static Constant * rebuildSplatCst ( const Constant C,
unsigned  ,
unsigned  ,
unsigned  SplatBitWidth 
)
static

◆ rebuildZeroUpperCst()

static Constant * rebuildZeroUpperCst ( const Constant C,
unsigned  NumBits,
unsigned  ,
unsigned  ScalarBitWidth 
)
static

◆ rebuildZExtCst()

static Constant * rebuildZExtCst ( const Constant C,
unsigned  NumBits,
unsigned  NumElts,
unsigned  SrcEltBitWidth 
)
static

Definition at line 326 of file X86FixupVectorConstants.cpp.

References llvm::CallingConv::C, and rebuildExtCst().

◆ STATISTIC()

STATISTIC ( NumInstChanges  ,
"Number of instructions changes"   
)