LLVM  14.0.0git
Macros | Functions
X86InstCombineIntrinsic.cpp File Reference
#include "X86TargetTransformInfo.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/IntrinsicsX86.h"
#include "llvm/Support/KnownBits.h"
#include "llvm/Transforms/InstCombine/InstCombiner.h"
Include dependency graph for X86InstCombineIntrinsic.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86tti"
 

Functions

static ConstantgetNegativeIsTrueBoolVec (Constant *V)
 Return a constant boolean vector that has true elements in all positions where the input constant data vector has an element with the sign bit set. More...
 
static ValuegetBoolVecFromMask (Value *Mask)
 Convert the x86 XMM integer vector mask to a vector of bools based on each element's most significant bit (the sign bit). More...
 
static InstructionsimplifyX86MaskedLoad (IntrinsicInst &II, InstCombiner &IC)
 
static bool simplifyX86MaskedStore (IntrinsicInst &II, InstCombiner &IC)
 
static ValuesimplifyX86immShift (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 
static ValuesimplifyX86varShift (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 
static ValuesimplifyX86pack (IntrinsicInst &II, InstCombiner::BuilderTy &Builder, bool IsSigned)
 
static ValuesimplifyX86movmsk (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 
static ValuesimplifyX86addcarry (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 
static ValuesimplifyX86insertps (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 
static ValuesimplifyX86extrq (IntrinsicInst &II, Value *Op0, ConstantInt *CILength, ConstantInt *CIIndex, InstCombiner::BuilderTy &Builder)
 Attempt to simplify SSE4A EXTRQ/EXTRQI instructions using constant folding or conversion to a shuffle vector. More...
 
static ValuesimplifyX86insertq (IntrinsicInst &II, Value *Op0, Value *Op1, APInt APLength, APInt APIndex, InstCombiner::BuilderTy &Builder)
 Attempt to simplify SSE4A INSERTQ/INSERTQI instructions using constant folding or conversion to a shuffle vector. More...
 
static ValuesimplifyX86pshufb (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 Attempt to convert pshufb* to shufflevector if the mask is constant. More...
 
static ValuesimplifyX86vpermilvar (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 Attempt to convert vpermilvar* to shufflevector if the mask is constant. More...
 
static ValuesimplifyX86vpermv (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder)
 Attempt to convert vpermd/vpermps to shufflevector if the mask is constant. More...
 

Detailed Description

This file implements a TargetTransformInfo analysis pass specific to the X86 target machine. It uses the target's detailed information to provide more precise answers to certain TTI queries, while letting the target independent and default TTI implementations handle the rest.

Definition in file X86InstCombineIntrinsic.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86tti"

Definition at line 24 of file X86InstCombineIntrinsic.cpp.

Function Documentation

◆ getBoolVecFromMask()

static Value* getBoolVecFromMask ( Value Mask)
static

Convert the x86 XMM integer vector mask to a vector of bools based on each element's most significant bit (the sign bit).

Definition at line 38 of file X86InstCombineIntrinsic.cpp.

References getNegativeIsTrueBoolVec(), llvm::Value::getType(), llvm::Type::isIntOrIntVectorTy(), llvm::PatternMatch::m_SExt(), llvm::PatternMatch::m_Value(), llvm::BitmaskEnumDetail::Mask(), and llvm::PatternMatch::match().

Referenced by simplifyX86MaskedLoad(), and simplifyX86MaskedStore().

◆ getNegativeIsTrueBoolVec()

static Constant* getNegativeIsTrueBoolVec ( Constant V)
static

Return a constant boolean vector that has true elements in all positions where the input constant data vector has an element with the sign bit set.

Definition at line 28 of file X86InstCombineIntrinsic.cpp.

References llvm::ConstantExpr::getBitCast(), llvm::ConstantExpr::getICmp(), llvm::VectorType::getInteger(), llvm::Constant::getNullValue(), llvm::Value::getType(), and llvm::CmpInst::ICMP_SGT.

Referenced by getBoolVecFromMask(), and llvm::X86TTIImpl::instCombineIntrinsic().

◆ simplifyX86addcarry()

static Value* simplifyX86addcarry ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86extrq()

static Value* simplifyX86extrq ( IntrinsicInst II,
Value Op0,
ConstantInt CILength,
ConstantInt CIIndex,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86immShift()

static Value* simplifyX86immShift ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86insertps()

static Value* simplifyX86insertps ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86insertq()

static Value* simplifyX86insertq ( IntrinsicInst II,
Value Op0,
Value Op1,
APInt  APLength,
APInt  APIndex,
InstCombiner::BuilderTy Builder 
)
static

Attempt to simplify SSE4A INSERTQ/INSERTQI instructions using constant folding or conversion to a shuffle vector.

Definition at line 711 of file X86InstCombineIntrinsic.cpp.

References llvm::APInt::getZExtValue(), Index, and llvm::APInt::zextOrTrunc().

Referenced by llvm::X86TTIImpl::instCombineIntrinsic().

◆ simplifyX86MaskedLoad()

static Instruction* simplifyX86MaskedLoad ( IntrinsicInst II,
InstCombiner IC 
)
static

◆ simplifyX86MaskedStore()

static bool simplifyX86MaskedStore ( IntrinsicInst II,
InstCombiner IC 
)
static

◆ simplifyX86movmsk()

static Value* simplifyX86movmsk ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86pack()

static Value* simplifyX86pack ( IntrinsicInst II,
InstCombiner::BuilderTy Builder,
bool  IsSigned 
)
static

◆ simplifyX86pshufb()

static Value* simplifyX86pshufb ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86varShift()

static Value* simplifyX86varShift ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

◆ simplifyX86vpermilvar()

static Value* simplifyX86vpermilvar ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

Attempt to convert vpermilvar* to shufflevector if the mask is constant.

Definition at line 849 of file X86InstCombineIntrinsic.cpp.

References assert(), Builder, llvm::Constant::getAggregateElement(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), I, Index, and llvm::makeArrayRef().

Referenced by llvm::X86TTIImpl::instCombineIntrinsic().

◆ simplifyX86vpermv()

static Value* simplifyX86vpermv ( const IntrinsicInst II,
InstCombiner::BuilderTy Builder 
)
static

Attempt to convert vpermd/vpermps to shufflevector if the mask is constant.

Definition at line 896 of file X86InstCombineIntrinsic.cpp.

References assert(), Builder, llvm::Constant::getAggregateElement(), llvm::CallBase::getArgOperand(), llvm::Value::getType(), I, Index, llvm::makeArrayRef(), and llvm::Check::Size.

Referenced by llvm::X86TTIImpl::instCombineIntrinsic().