|
LLVM
10.0.0
|
#include "InstCombineInternal.h"#include "llvm/ADT/APFloat.h"#include "llvm/ADT/APInt.h"#include "llvm/ADT/APSInt.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/None.h"#include "llvm/ADT/Optional.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/Twine.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/Loads.h"#include "llvm/Analysis/MemoryBuiltins.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/Analysis/VectorUtils.h"#include "llvm/IR/Attributes.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/Constant.h"#include "llvm/IR/Constants.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/DerivedTypes.h"#include "llvm/IR/Function.h"#include "llvm/IR/GlobalVariable.h"#include "llvm/IR/InstrTypes.h"#include "llvm/IR/Instruction.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Intrinsics.h"#include "llvm/IR/IntrinsicsX86.h"#include "llvm/IR/IntrinsicsARM.h"#include "llvm/IR/IntrinsicsAArch64.h"#include "llvm/IR/IntrinsicsNVPTX.h"#include "llvm/IR/IntrinsicsAMDGPU.h"#include "llvm/IR/IntrinsicsPowerPC.h"#include "llvm/IR/LLVMContext.h"#include "llvm/IR/Metadata.h"#include "llvm/IR/PatternMatch.h"#include "llvm/IR/Statepoint.h"#include "llvm/IR/Type.h"#include "llvm/IR/User.h"#include "llvm/IR/Value.h"#include "llvm/IR/ValueHandle.h"#include "llvm/Support/AtomicOrdering.h"#include "llvm/Support/Casting.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Compiler.h"#include "llvm/Support/Debug.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/KnownBits.h"#include "llvm/Support/MathExtras.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/InstCombine/InstCombineWorklist.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/SimplifyLibCalls.h"#include <algorithm>#include <cassert>#include <cstdint>#include <cstring>#include <utility>#include <vector>Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "instcombine" |
Functions | |
| STATISTIC (NumSimplified, "Number of library calls simplified") | |
| static Type * | getPromotedType (Type *Ty) |
| Return the specified type promoted as it would be to pass though a va_arg area. More... | |
| static Constant * | getNegativeIsTrueBoolVec (ConstantDataVector *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 Value * | simplifyX86immShift (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyX86varShift (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyX86pack (IntrinsicInst &II, InstCombiner::BuilderTy &Builder, bool IsSigned) |
| static Value * | simplifyX86movmsk (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyX86addcarry (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyX86insertps (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyX86extrq (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 Value * | simplifyX86insertq (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 Value * | simplifyX86pshufb (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| Attempt to convert pshufb* to shufflevector if the mask is constant. More... | |
| static Value * | simplifyX86vpermilvar (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| Attempt to convert vpermilvar* to shufflevector if the mask is constant. More... | |
| static Value * | simplifyX86vpermv (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| Attempt to convert vpermd/vpermps to shufflevector if the mask is constant. More... | |
| static Instruction * | simplifyInvariantGroupIntrinsic (IntrinsicInst &II, InstCombiner &IC) |
| This function transforms launder.invariant.group and strip.invariant.group like: launder(launder(x)) -> launder(x) (the result is not the argument) launder(strip(x)) -> launder(x) strip(strip(x)) -> strip(x) (the result is not the argument) strip(launder(x)) -> strip(x) This is legal because it preserves the most recent information about the presence or absence of invariant.group. More... | |
| static Instruction * | foldCttzCtlz (IntrinsicInst &II, InstCombiner &IC) |
| static Instruction * | foldCtpop (IntrinsicInst &II, InstCombiner &IC) |
| static Instruction * | simplifyX86MaskedLoad (IntrinsicInst &II, InstCombiner &IC) |
| static bool | simplifyX86MaskedStore (IntrinsicInst &II, InstCombiner &IC) |
| static APFloat | fmed3AMDGCN (const APFloat &Src0, const APFloat &Src1, const APFloat &Src2) |
| static Value * | simplifyNeonTbl1 (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| Convert a table lookup to shufflevector if the mask is constant. More... | |
| static Value * | simplifyNeonVld1 (const IntrinsicInst &II, unsigned MemAlign, InstCombiner::BuilderTy &Builder) |
| Convert a vector load intrinsic into a simple llvm load instruction. More... | |
| static bool | haveSameOperands (const IntrinsicInst &I, const IntrinsicInst &E, unsigned NumOperands) |
| static bool | removeTriviallyEmptyRange (IntrinsicInst &I, unsigned StartID, unsigned EndID, InstCombiner &IC) |
| static Instruction * | SimplifyNVVMIntrinsic (IntrinsicInst *II, InstCombiner &IC) |
| static Instruction * | canonicalizeConstantArg0ToArg1 (CallInst &Call) |
| static bool | isSafeToEliminateVarargsCast (const CallBase &Call, const DataLayout &DL, const CastInst *const CI, const int ix) |
| If this cast does not affect the value passed through the varargs area, we can eliminate the use of the cast. More... | |
| static IntrinsicInst * | findInitTrampolineFromAlloca (Value *TrampMem) |
| static IntrinsicInst * | findInitTrampolineFromBB (IntrinsicInst *AdjustTramp, Value *TrampMem) |
| static IntrinsicInst * | findInitTrampoline (Value *Callee) |
| static void | annotateAnyAllocSite (CallBase &Call, const TargetLibraryInfo *TLI) |
Variables | |
| static cl::opt< unsigned > | GuardWideningWindow ("instcombine-guard-widening-window", cl::init(3), cl::desc("How wide an instruction window to bypass looking for " "another guard")) |
| #define DEBUG_TYPE "instcombine" |
Definition at line 79 of file InstCombineCalls.cpp.
|
static |
Definition at line 4351 of file InstCombineCalls.cpp.
References llvm::CallBase::addAttribute(), llvm::CallBase::addParamAttr(), llvm::AttributeList::addParamAttribute(), llvm::CallBase::arg_begin(), llvm::CallBase::arg_end(), llvm::CallBase::arg_size(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::CallBase::args(), assert(), llvm::AMDGPU::HSAMD::Kernel::Key::Attrs, Callee, llvm::CallInst::Create(), llvm::InvokeInst::Create(), llvm::CallBrInst::Create(), llvm::CastInst::CreateBitOrPointerCast(), llvm::dbgs(), llvm::CallBase::doesNotThrow(), llvm::dyn_cast(), llvm::numbers::e, E, llvm::SmallVectorBase::empty(), llvm::Instruction::extractProfTotalWeight(), findInitTrampoline(), llvm::Attribute::get(), llvm::FunctionType::get(), llvm::AttributeSet::get(), llvm::AttributeList::get(), llvm::UndefValue::get(), llvm::CallBase::getArgOperand(), llvm::Function::getAttributes(), llvm::CallBase::getAttributes(), llvm::ConstantExpr::getBitCast(), llvm::CallBase::getCalledValue(), llvm::CallBase::getCallingConv(), llvm::CastInst::getCastOpcode(), llvm::Type::getContext(), llvm::Value::getContext(), llvm::Instruction::getDebugLoc(), llvm::PointerType::getElementType(), llvm::AttributeList::getFnAttributes(), llvm::Instruction::getFunction(), llvm::Function::getFunctionType(), llvm::FunctionCallee::getFunctionType(), llvm::CallBase::getFunctionType(), llvm::Constant::getNullValue(), llvm::CallBase::getNumArgOperands(), llvm::FunctionType::getNumParams(), llvm::User::getOperand(), llvm::CallBase::getOperandBundlesAsDefs(), llvm::AttributeList::getParamAttributes(), llvm::CallBase::getParamByValType(), llvm::FunctionType::getParamType(), llvm::Instruction::getParent(), llvm::Type::getPointerElementType(), getPromotedType(), llvm::AttributeList::getRetAttributes(), llvm::FunctionType::getReturnType(), llvm::GetStringLength(), llvm::Value::getType(), llvm::GlobalValue::getType(), llvm::PointerType::getUnqual(), llvm::ConstantInt::getValue(), llvm::Attribute::getWithByValType(), llvm::Attribute::getWithDereferenceableBytes(), llvm::Attribute::getWithDereferenceableOrNullBytes(), llvm::ConstantInt::getZExtValue(), llvm::APInt::getZExtValue(), llvm::AttributeSet::hasAttribute(), llvm::AttributeList::hasAttrSomewhere(), llvm::AttributeList::hasParamAttribute(), llvm::Value::hasValueHandle(), I, llvm::isAllocationFn(), llvm::isAllocLikeFn(), llvm::CastInst::isBitOrNoopPointerCastable(), llvm::CallBase::isByValArgument(), llvm::isCallocLikeFn(), llvm::CallBase::isConvergent(), llvm::AttributeList::isEmpty(), llvm::CallBase::isInAllocaArgument(), llvm::isKnownNonZero(), llvm::isMallocLikeFn(), llvm::CallBase::isMustTailCall(), llvm::Constant::isNullValue(), llvm::isOpNewLikeFn(), llvm::isReallocLikeFn(), isSafeToEliminateVarargsCast(), llvm::Type::isSized(), llvm::isStrdupLikeFn(), llvm::Type::isStructTy(), llvm::Instruction::isTerminator(), llvm::FunctionType::isVarArg(), llvm::Type::isVoidTy(), LLVM_DEBUG, N, NC, llvm::NullPointerIsDefined(), llvm::AttrBuilder::overlaps(), llvm::FunctionType::param_begin(), llvm::FunctionType::param_end(), llvm::CallBase::paramHasAttr(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::AttrBuilder::remove(), llvm::CallBase::removeParamAttr(), llvm::SmallVectorImpl< T >::reserve(), llvm::AttributeList::ReturnIndex, llvm::CallBase::setAttributes(), llvm::CallBase::setCalledFunction(), llvm::CallBase::setCallingConv(), llvm::Instruction::setDebugLoc(), llvm::CallBase::setDoesNotThrow(), llvm::Value::setName(), llvm::CallBase::setNotConvergent(), llvm::Instruction::setProfWeight(), Size, llvm::SmallVectorBase::size(), llvm::Value::stripPointerCasts(), llvm::Value::takeName(), llvm::AttributeFuncs::typeIncompatible(), llvm::APInt::umul_ov(), llvm::Value::use_empty(), llvm::Value::users(), llvm::ValueHandleBase::ValueIsDeleted(), llvm::ValueHandleBase::ValueIsRAUWd(), and llvm::RISCVFenceField::W.
|
static |
Definition at line 1764 of file InstCombineCalls.cpp.
References assert(), llvm::CallBase::getArgOperand(), llvm::BinaryOpIntrinsic::getBinaryOp(), llvm::BinaryOpIntrinsic::getLHS(), llvm::CallBase::getNumArgOperands(), llvm::BinaryOpIntrinsic::getRHS(), llvm::BinaryOpIntrinsic::isSigned(), and llvm::CallBase::setArgOperand().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 4335 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), findInitTrampolineFromAlloca(), findInitTrampolineFromBB(), llvm::IntrinsicInst::getIntrinsicID(), llvm::User::getOperand(), IT, and llvm::Value::stripPointerCasts().
Referenced by annotateAnyAllocSite().
|
static |
Definition at line 4275 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), llvm::IntrinsicInst::getIntrinsicID(), llvm::User::getOperand(), llvm::Value::hasOneUse(), llvm::Value::stripPointerCasts(), llvm::BitmaskEnumDetail::Underlying(), llvm::Value::user_back(), and llvm::Value::users().
Referenced by findInitTrampoline().
|
static |
Definition at line 4314 of file InstCombineCalls.cpp.
References llvm::BasicBlock::begin(), E, llvm::IntrinsicInst::getIntrinsicID(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::User::getOperand(), llvm::Instruction::getParent(), I, and llvm::Instruction::mayWriteToMemory().
Referenced by findInitTrampoline().
|
static |
Definition at line 1385 of file InstCombineCalls.cpp.
References assert(), llvm::APFloatBase::cmpEqual, llvm::APFloatBase::cmpUnordered, llvm::APFloat::compare(), and llvm::maxnum().
|
static |
Definition at line 1264 of file InstCombineCalls.cpp.
References assert(), llvm::InstCombiner::computeKnownBits(), llvm::KnownBits::countMaxPopulation(), llvm::KnownBits::countMinPopulation(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getMetadata(), IT, LowAndHigh, llvm::PatternMatch::m_BitReverse(), llvm::PatternMatch::m_BSwap(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::Instruction::setMetadata(), llvm::User::setOperand(), and X.
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1188 of file InstCombineCalls.cpp.
References assert(), llvm::InstCombiner::Builder, C, llvm::InstCombiner::computeKnownBits(), llvm::KnownBits::countMaxLeadingZeros(), llvm::KnownBits::countMaxTrailingZeros(), llvm::KnownBits::countMinLeadingZeros(), llvm::KnownBits::countMinTrailingZeros(), llvm::CallInst::Create(), llvm::dyn_cast(), F(), llvm::SelectPatternResult::Flavor, llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::CallBase::getArgOperand(), llvm::InstCombiner::getAssumptionCache(), llvm::Value::getContext(), llvm::InstCombiner::getDataLayout(), llvm::Intrinsic::getDeclaration(), llvm::InstCombiner::getDominatorTree(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getMetadata(), llvm::Instruction::getModule(), llvm::IRBuilderBase::getTrue(), llvm::Value::getType(), llvm::isKnownNonZero(), llvm::APInt::isNullValue(), IT, LowAndHigh, llvm::PatternMatch::m_BitReverse(), llvm::PatternMatch::m_Neg(), llvm::PatternMatch::m_One(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), llvm::KnownBits::One, llvm::InstCombiner::replaceInstUsesWith(), llvm::Instruction::setMetadata(), llvm::User::setOperand(), llvm::SPF_ABS, llvm::SPF_NABS, X, and Y.
Referenced by llvm::InstCombiner::visitCallInst().
|
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 101 of file InstCombineCalls.cpp.
References assert(), llvm::assumeAligned(), llvm::dyn_cast(), E, llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::PointerType::get(), llvm::Value::getContext(), llvm::MemIntrinsicBase< Derived >::getDest(), llvm::ConstantDataSequential::getElementAsConstant(), llvm::ConstantDataSequential::getElementType(), llvm::Type::getInt1Ty(), llvm::getKnownAlignment(), llvm::ConstantInt::getLimitedValue(), llvm::Constant::getNullValue(), llvm::ConstantDataSequential::getNumElements(), llvm::MemIntrinsicBase< Derived >::getRawDest(), llvm::ConstantInt::getType(), I, llvm::Type::isIntegerTy(), llvm::isPowerOf2_32(), isZero(), MI, llvm::SmallVectorTemplateBase< T >::push_back(), llvm::LoadInst::setAlignment(), llvm::StoreInst::setAlignment(), llvm::Instruction::setMetadata(), llvm::LoadInst::setOrdering(), llvm::StoreInst::setOrdering(), llvm::LoadInst::setVolatile(), llvm::StoreInst::setVolatile(), Size, and llvm::Unordered.
Referenced by simplifyX86MaskedLoad(), and simplifyX86MaskedStore().
Return the specified type promoted as it would be to pass though a va_arg area.
Definition at line 91 of file InstCombineCalls.cpp.
References llvm::Type::getContext(), and llvm::Type::getInt32Ty().
Referenced by annotateAnyAllocSite().
|
static |
Definition at line 1466 of file InstCombineCalls.cpp.
References assert(), llvm::CallBase::getArgOperand(), and llvm::CallBase::getNumArgOperands().
Referenced by removeTriviallyEmptyRange().
|
static |
If this cast does not affect the value passed through the varargs area, we can eliminate the use of the cast.
Definition at line 4223 of file InstCombineCalls.cpp.
References llvm::AMDGPUISD::BFI, From, llvm::CallBase::getCalledFunction(), llvm::User::getOperand(), llvm::CallBase::getParamByValType(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), I, llvm::CallBase::isByValArgument(), llvm::CallBase::isByValOrInAllocaArgument(), llvm::isGCRelocate(), llvm::isGCResult(), llvm::CastInst::isLosslessCast(), llvm::Type::isSized(), llvm::isStatepoint(), llvm::LibCallSimplifier::optimizeCall(), and llvm::Value::use_empty().
Referenced by annotateAnyAllocSite().
|
static |
Definition at line 1485 of file InstCombineCalls.cpp.
References assert(), E, llvm::BasicBlock::end(), llvm::InstCombiner::eraseInstFromFunction(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getParent(), and haveSameOperands().
Referenced by llvm::InstCombiner::visitVACopyInst(), and llvm::InstCombiner::visitVAStartInst().
|
static |
This function transforms launder.invariant.group and strip.invariant.group like: launder(launder(x)) -> launder(x) (the result is not the argument) launder(strip(x)) -> launder(x) strip(strip(x)) -> strip(x) (the result is not the argument) strip(launder(x)) -> strip(x) This is legal because it preserves the most recent information about the presence or absence of invariant.group.
Definition at line 1162 of file InstCombineCalls.cpp.
References Arg, llvm::InstCombiner::Builder, llvm::IRBuilder< T, Inserter >::CreateAddrSpaceCast(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateLaunderInvariantGroup(), llvm::IRBuilder< T, Inserter >::CreateStripInvariantGroup(), llvm::CallBase::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Type::getPointerAddressSpace(), llvm::Value::getType(), and llvm_unreachable.
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Convert a table lookup to shufflevector if the mask is constant.
This could benefit tbl1 if the mask is { 7,6,5,4,3,2,1,0 }, in which case we could lower the shufflevector with rev64 instructions as it's actually a byte reverse.
Definition at line 1406 of file InstCombineCalls.cpp.
References C, llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantDataVector::get(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Constant::getNullValue(), llvm::Value::getType(), I, llvm::makeArrayRef(), and llvm::NVPTX::PTXLdStInstCode::V2.
|
static |
Convert a vector load intrinsic into a simple llvm load instruction.
This is beneficial when the underlying object being addressed comes from a constant, since we get constant-folding for free.
Definition at line 1445 of file InstCombineCalls.cpp.
References llvm::IRBuilder< T, Inserter >::CreateAlignedLoad(), llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::dyn_cast(), llvm::PointerType::get(), llvm::CallBase::getArgOperand(), llvm::ConstantInt::getLimitedValue(), llvm::Value::getType(), and llvm::isPowerOf2_32().
|
static |
Definition at line 1508 of file InstCombineCalls.cpp.
References llvm::CallBase::arg_operands(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::BinaryOperator::Create(), llvm::CastInst::Create(), llvm::CallInst::Create(), FtzEnabled, llvm::ConstantFP::get(), llvm::CallBase::getArgOperand(), llvm::Intrinsic::getDeclaration(), llvm::Function::getFnAttribute(), llvm::Instruction::getFunction(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getModule(), llvm::Value::getName(), llvm::Value::getType(), llvm::Attribute::getValueAsString(), llvm_unreachable, llvm::maxnum(), llvm::minnum(), and round().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 646 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateExtractValue(), llvm::IRBuilder< T, Inserter >::CreateInsertValue(), llvm::IRBuilderBase::CreateIntrinsic(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::UndefValue::get(), llvm::CallBase::getArgOperand(), llvm::IRBuilderBase::getInt8Ty(), llvm::Type::getStructElementType(), llvm::Value::getType(), llvm::Type::isIntegerTy(), llvm::PatternMatch::m_ZeroInt(), and llvm::PatternMatch::match().
|
static |
Attempt to simplify SSE4A EXTRQ/EXTRQI instructions using constant folding or conversion to a shuffle vector.
Definition at line 732 of file InstCombineCalls.cpp.
References llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::Value::getContext(), llvm::Type::getInt64Ty(), llvm::ConstantInt::getValue(), llvm::APInt::getZExtValue(), and llvm::APInt::zextOrTrunc().
|
static |
Definition at line 292 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateAShr(), llvm::IRBuilder< T, Inserter >::CreateLShr(), llvm::IRBuilder< T, Inserter >::CreateShl(), llvm::IRBuilder< T, Inserter >::CreateVectorSplat(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::APInt::isNullValue(), llvm_unreachable, llvm::APInt::uge(), and llvm::APInt::zextOrTrunc().
|
static |
Definition at line 673 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantAggregateZero::get(), llvm::CallBase::getArgOperand(), llvm::SequentialType::getNumElements(), and llvm::Value::getType().
|
static |
Attempt to simplify SSE4A INSERTQ/INSERTQI instructions using constant folding or conversion to a shuffle vector.
Definition at line 826 of file InstCombineCalls.cpp.
References llvm::APInt::getZExtValue(), and llvm::APInt::zextOrTrunc().
|
static |
Definition at line 1304 of file InstCombineCalls.cpp.
References llvm::InstCombiner::Builder, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilderBase::CreateMaskedLoad(), llvm::dyn_cast(), llvm::PointerType::get(), getNegativeIsTrueBoolVec(), llvm::Constant::getNullValue(), llvm::User::getOperand(), llvm::Value::getType(), llvm::BitmaskEnumDetail::Mask(), and llvm::InstCombiner::replaceInstUsesWith().
|
static |
Definition at line 1340 of file InstCombineCalls.cpp.
References llvm::InstCombiner::Builder, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilderBase::CreateMaskedStore(), llvm::dyn_cast(), llvm::InstCombiner::eraseInstFromFunction(), llvm::PointerType::get(), llvm::IntrinsicInst::getIntrinsicID(), getNegativeIsTrueBoolVec(), llvm::User::getOperand(), llvm::Value::getType(), and llvm::BitmaskEnumDetail::Mask().
|
static |
Definition at line 616 of file InstCombineCalls.cpp.
References Arg, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateICmpSLT(), llvm::IRBuilder< T, Inserter >::CreateZExtOrTrunc(), llvm::CallBase::getArgOperand(), llvm::VectorType::getInteger(), llvm::IRBuilderBase::getIntNTy(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::Type::isVectorTy().
|
static |
Definition at line 550 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateICmpSGT(), llvm::IRBuilder< T, Inserter >::CreateICmpSLT(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::IRBuilder< T, Inserter >::CreateTrunc(), llvm::UndefValue::get(), llvm::CallBase::getArgOperand(), llvm::Constant::getIntegerValue(), llvm::APInt::getLowBitsSet(), llvm::APInt::getNullValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::APInt::sext().
|
static |
Attempt to convert pshufb* to shufflevector if the mask is constant.
Definition at line 921 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::Constant::getNullValue(), llvm::Value::getType(), I, llvm::makeArrayRef(), and llvm::NVPTX::PTXLdStInstCode::V2.
|
static |
Definition at line 426 of file InstCombineCalls.cpp.
References llvm::all_of(), assert(), llvm::IRBuilder< T, Inserter >::CreateAShr(), llvm::IRBuilder< T, Inserter >::CreateLShr(), llvm::IRBuilder< T, Inserter >::CreateShl(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::CallBase::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::APInt::getZExtValue(), I, llvm_unreachable, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateBase< T >::push_back(), and llvm::APInt::uge().
|
static |
Attempt to convert vpermilvar* to shufflevector if the mask is constant.
Definition at line 968 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::CallBase::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::APInt::getLoBits(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), I, llvm::APInt::lshrInPlace(), llvm::makeArrayRef(), llvm::NVPTX::PTXLdStInstCode::V2, and llvm::APInt::zextOrTrunc().
|
static |
Attempt to convert vpermd/vpermps to shufflevector if the mask is constant.
Definition at line 1018 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::CallBase::getArgOperand(), llvm::APInt::getBitWidth(), llvm::Value::getContext(), llvm::Module::getDataLayout(), llvm::Type::getInt32Ty(), llvm::Instruction::getModule(), llvm::User::getOperand(), llvm::Value::getType(), I, llvm::isDereferenceableAndAlignedPointer(), llvm::makeArrayRef(), llvm::maskIsAllOneOrUndef(), llvm::possiblyDemandedEltsInMask(), llvm::User::setOperand(), Size, and llvm::NVPTX::PTXLdStInstCode::V2.
| STATISTIC | ( | NumSimplified | , |
| "Number of library calls simplified" | |||
| ) |
1.8.13