LLVM 22.0.0git
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]

◆ extractConstantBits() [2/2]

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

Definition at line 148 of file X86FixupVectorConstants.cpp.

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

◆ getSplatableConstant()

◆ getSplatValueAllowUndef()

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 69 of file X86FixupVectorConstants.cpp.

References llvm::CallingConv::C, llvm::cast(), and llvm::isa().

Referenced by extractConstantBits().

◆ rebuildConstant()

◆ rebuildExtCst()

◆ rebuildSExtCst()

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

Definition at line 329 of file X86FixupVectorConstants.cpp.

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

◆ rebuildSplatCst()

◆ rebuildZeroUpperCst()

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

◆ rebuildZExtCst()

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

Definition at line 333 of file X86FixupVectorConstants.cpp.

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

◆ STATISTIC()

STATISTIC ( NumInstChanges ,
"Number of instructions changes"  )