LLVM: lib/Target/X86/X86FixupVectorConstants.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "x86-fixup-vector-constants"
Functions
STATISTIC (NumInstChanges, "Number of instructions changes")
static Constant * getSplatValueAllowUndef (const ConstantVector *C)
Normally, we only allow poison in vector splats.
static std::optional< APInt > extractConstantBits (const Constant *C)
static std::optional< APInt > extractConstantBits (const Constant *C, unsigned NumBits)
static std::optional< APInt > getSplatableConstant (const Constant *C, unsigned SplatBitWidth)
static Constant * rebuildConstant (LLVMContext &Ctx, Type *SclTy, const APInt &Bits, unsigned NumSclBits)
static Constant * rebuildSplatCst (const Constant *C, unsigned, unsigned, unsigned SplatBitWidth)
static Constant * rebuildZeroUpperCst (const Constant *C, unsigned NumBits, unsigned, unsigned ScalarBitWidth)
static Constant * rebuildExtCst (const Constant *C, bool IsSExt, unsigned NumBits, unsigned NumElts, unsigned SrcEltBitWidth)
static Constant * rebuildSExtCst (const Constant *C, unsigned NumBits, unsigned NumElts, unsigned SrcEltBitWidth)
static Constant * rebuildZExtCst (const Constant *C, unsigned NumBits, unsigned NumElts, unsigned SrcEltBitWidth)

DEBUG_TYPE

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

extractConstantBits() [1/2]

Definition at line 84 of file X86FixupVectorConstants.cpp.

References assert(), llvm::CallingConv::C, llvm::dyn_cast(), E(), extractConstantBits(), llvm::User::getOperand(), llvm::APInt::getSplat(), getSplatValueAllowUndef(), llvm::APInt::getZero(), I, and llvm::isa().

Referenced by extractConstantBits(), extractConstantBits(), getSplatableConstant(), rebuildExtCst(), and rebuildZeroUpperCst().

extractConstantBits() [2/2]

getSplatableConstant()

Definition at line 157 of file X86FixupVectorConstants.cpp.

References AbstractManglingParser< Derived, Alloc >::NumOps, assert(), llvm::CallingConv::C, llvm::dyn_cast(), extractConstantBits(), llvm::Constant::getAggregateElement(), llvm::APInt::getZero(), I, llvm::APInt::insertBits(), and llvm::isa().

Referenced by rebuildSplatCst().

getSplatValueAllowUndef()

rebuildConstant()

Definition at line 210 of file X86FixupVectorConstants.cpp.

References assert(), llvm::BitWidth, llvm::ConstantDataVector::get(), llvm::ConstantDataVector::getFP(), I, llvm::Type::is16bitFPTy(), llvm::Type::isDoubleTy(), llvm::Type::isFloatTy(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().

Referenced by rebuildExtCst(), rebuildSplatCst(), and rebuildZeroUpperCst().

rebuildExtCst()

Definition at line 299 of file X86FixupVectorConstants.cpp.

References assert(), llvm::CallingConv::C, extractConstantBits(), llvm::APInt::getActiveBits(), llvm::APInt::getSignificantBits(), llvm::APInt::getZero(), I, llvm::APInt::insertBits(), rebuildConstant(), and llvm::APInt::trunc().

Referenced by rebuildSExtCst(), and rebuildZExtCst().

rebuildSExtCst()

rebuildSplatCst()

rebuildZeroUpperCst()

rebuildZExtCst()

STATISTIC()

STATISTIC ( NumInstChanges ,
"Number of instructions changes" )