|
LLVM
5.0.0
|
#include "InstCombineInternal.h"#include "llvm/ADT/APFloat.h"#include "llvm/ADT/APInt.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/None.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/Statistic.h"#include "llvm/ADT/Twine.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/MemoryBuiltins.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/BasicBlock.h"#include "llvm/IR/CallSite.h"#include "llvm/IR/Constant.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/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/Value.h"#include "llvm/IR/ValueHandle.h"#include "llvm/Support/Casting.h"#include "llvm/Support/Debug.h"#include "llvm/Support/KnownBits.h"#include "llvm/Support/MathExtras.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/SimplifyLibCalls.h"#include <algorithm>#include <cassert>#include <cstdint>#include <cstring>#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 * | simplifyX86muldq (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyX86pack (IntrinsicInst &II, bool IsSigned) |
| static Value * | simplifyX86movmsk (const IntrinsicInst &II) |
| 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 Value * | simplifyX86vperm2 (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| The shuffle mask for a perm2*128 selects any two halves of two 256-bit source vectors, unless a zero bit is set. More... | |
| static Value * | simplifyX86vpcom (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder, bool IsSigned) |
| Decode XOP integer vector comparison intrinsics. More... | |
| static Value * | emitX86MaskSelect (Value *Mask, Value *Op0, Value *Op1, InstCombiner::BuilderTy &Builder) |
| static Value * | simplifyMinnumMaxnum (const IntrinsicInst &II) |
| static bool | maskIsAllOneOrUndef (Value *Mask) |
| static Value * | simplifyMaskedLoad (const IntrinsicInst &II, InstCombiner::BuilderTy &Builder) |
| static Instruction * | simplifyMaskedStore (IntrinsicInst &II, InstCombiner &IC) |
| static Instruction * | simplifyMaskedGather (IntrinsicInst &II, InstCombiner &IC) |
| static Instruction * | simplifyMaskedScatter (IntrinsicInst &II, InstCombiner &IC) |
| 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 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 bool | isSafeToEliminateVarargsCast (const CallSite CS, 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) |
Variables | |
| static cl::opt< unsigned > | UnfoldElementAtomicMemcpyMaxElements ("unfold-element-atomic-memcpy-max-elements", cl::init(16), cl::desc("Maximum number of elements in atomic memcpy the optimizer is ""allowed to unfold")) |
| #define DEBUG_TYPE "instcombine" |
Definition at line 60 of file InstCombineCalls.cpp.
|
static |
Definition at line 1204 of file InstCombineCalls.cpp.
References C, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateSelect(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::VectorType::get(), getBitWidth(), llvm::IRBuilderBase::getInt1Ty(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::makeArrayRef().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 3857 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), findInitTrampolineFromAlloca(), findInitTrampolineFromBB(), llvm::IntrinsicInst::getIntrinsicID(), llvm::User::getOperand(), IT(), and llvm::Value::stripPointerCasts().
|
static |
Definition at line 3796 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 3835 of file InstCombineCalls.cpp.
References llvm::BasicBlock::begin(), E, llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getParent(), I, and llvm::Instruction::mayWriteToMemory().
Referenced by findInitTrampoline().
|
static |
Definition at line 1538 of file InstCombineCalls.cpp.
References assert(), llvm::APFloatBase::cmpEqual, llvm::APFloatBase::cmpUnordered, llvm::APFloat::compare(), and llvm::maxnum().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1425 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::CallInst::getArgOperand(), llvm::Value::getContext(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getMetadata(), IT(), LowAndHigh, llvm::LLVMContext::MD_range, and llvm::Instruction::setMetadata().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1374 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::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantAsMetadata::get(), llvm::MDNode::get(), llvm::CallInst::getArgOperand(), llvm::InstCombiner::getAssumptionCache(), llvm::Value::getContext(), llvm::InstCombiner::getDataLayout(), llvm::InstCombiner::getDominatorTree(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getMetadata(), llvm::IRBuilderBase::getTrue(), llvm::Value::getType(), llvm::isKnownNonZero(), llvm::APInt::isNullValue(), IT(), LowAndHigh, llvm::PatternMatch::m_One(), llvm::PatternMatch::match(), llvm::LLVMContext::MD_range, llvm::KnownBits::One, llvm::InstCombiner::replaceInstUsesWith(), llvm::Instruction::setMetadata(), and llvm::User::setOperand().
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 82 of file InstCombineCalls.cpp.
References assert(), E, llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::Value::getContext(), llvm::ConstantDataSequential::getElementAsConstant(), llvm::ConstantDataSequential::getElementType(), llvm::Type::getInt1Ty(), llvm::ConstantDataSequential::getNumElements(), I, llvm::Type::isIntegerTy(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by simplifyX86MaskedLoad(), simplifyX86MaskedStore(), and llvm::InstCombiner::visitCallInst().
Return the specified type promoted as it would be to pass though a va_arg area.
Definition at line 72 of file InstCombineCalls.cpp.
References llvm::Type::getContext(), and llvm::Type::getInt32Ty().
|
static |
Definition at line 1557 of file InstCombineCalls.cpp.
References assert(), llvm::CallInst::getArgOperand(), and llvm::CallInst::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 3750 of file InstCombineCalls.cpp.
References llvm::User::getOperand(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isByValOrInAllocaArgument(), llvm::isGCRelocate(), llvm::isGCResult(), llvm::CastInst::isLosslessCast(), llvm::Type::isSized(), and llvm::isStatepoint().
Definition at line 1308 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), E, I, and llvm::BitmaskEnumDetail::Mask().
Referenced by simplifyMaskedLoad().
|
static |
Definition at line 1576 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::visitCallInst(), llvm::InstCombiner::visitVACopyInst(), and llvm::InstCombiner::visitVAStartInst().
|
static |
Definition at line 1356 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), llvm::CallInst::getArgOperand(), and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1324 of file InstCombineCalls.cpp.
References llvm::IRBuilder< T, Inserter >::CreateAlignedLoad(), llvm::CallInst::getArgOperand(), and maskIsAllOneOrUndef().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1365 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), llvm::InstCombiner::eraseInstFromFunction(), and llvm::CallInst::getArgOperand().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1337 of file InstCombineCalls.cpp.
References llvm::dyn_cast(), llvm::InstCombiner::eraseInstFromFunction(), and llvm::CallInst::getArgOperand().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1232 of file InstCombineCalls.cpp.
References assert(), llvm::dyn_cast(), llvm::CallInst::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::PatternMatch::m_FMax(), llvm::PatternMatch::m_FMin(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::match(), llvm::maxnum(), llvm::minnum(), X, and Y.
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1599 of file InstCombineCalls.cpp.
References llvm::CallInst::arg_operands(), llvm::AMDGPU::CodeObject::Kernel::Key::Args, llvm::BinaryOperator::Create(), llvm::CastInst::Create(), llvm::CallInst::Create(), FtzEnabled, llvm::ConstantFP::get(), llvm::CallInst::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 |
Attempt to simplify SSE4A EXTRQ/EXTRQI instructions using constant folding or conversion to a shuffle vector.
Definition at line 775 of file InstCombineCalls.cpp.
References llvm::AMDGPU::CodeObject::Kernel::Key::Args, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::WebAssembly::End, F, llvm::ConstantInt::get(), llvm::ConstantAggregateZero::get(), llvm::VectorType::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Type::getInt8Ty(), llvm::Constant::getIntegerValue(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Instruction::getModule(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::APInt::getZExtValue(), llvm::APInt::lshrInPlace(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::APInt::zextOrTrunc().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 296 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::CallInst::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::APInt::isNullValue(), llvm_unreachable(), llvm::APInt::uge(), and llvm::APInt::zextOrTrunc().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 716 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantAggregateZero::get(), llvm::CallInst::getArgOperand(), llvm::SequentialType::getNumElements(), and llvm::Value::getType().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Attempt to simplify SSE4A INSERTQ/INSERTQI instructions using constant folding or conversion to a shuffle vector.
Definition at line 869 of file InstCombineCalls.cpp.
References llvm::AMDGPU::CodeObject::Kernel::Key::Args, llvm::IRBuilder< T, Inserter >::CreateBitCast(), llvm::IRBuilder< T, Inserter >::CreateCall(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::WebAssembly::End, F, llvm::ConstantInt::get(), llvm::VectorType::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::Constant::getAggregateElement(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Type::getInt32Ty(), llvm::Type::getInt64Ty(), llvm::Type::getInt8Ty(), llvm::Constant::getIntegerValue(), llvm::IntrinsicInst::getIntrinsicID(), llvm::APInt::getLowBitsSet(), llvm::Instruction::getModule(), llvm::Value::getType(), llvm::APInt::getZExtValue(), llvm::BitmaskEnumDetail::Mask(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::APInt::shl(), and llvm::APInt::zextOrTrunc().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1457 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(), Ptr, and llvm::InstCombiner::replaceInstUsesWith().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 1493 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(), llvm::BitmaskEnumDetail::Mask(), and Ptr.
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 678 of file InstCombineCalls.cpp.
References C, llvm::dyn_cast(), E, llvm::CallInst::getArgOperand(), llvm::Constant::getIntegerValue(), llvm::Constant::getNullValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), I, and llvm::Type::isVectorTy().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 554 of file InstCombineCalls.cpp.
References assert(), llvm::IRBuilder< T, Inserter >::CreateMul(), llvm::IRBuilder< T, Inserter >::CreateSExt(), llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::IRBuilder< T, Inserter >::CreateZExt(), llvm::ConstantAggregateZero::get(), llvm::CallInst::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Type::getScalarSizeInBits(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 603 of file InstCombineCalls.cpp.
References assert(), llvm::dyn_cast(), llvm::ConstantInt::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::APInt::getAllOnesValue(), llvm::CallInst::getArgOperand(), llvm::APInt::getBitWidth(), llvm::APInt::getNullValue(), llvm::Type::getPrimitiveSizeInBits(), llvm::Type::getScalarSizeInBits(), llvm::Type::getScalarType(), llvm::APInt::getSignedMaxValue(), llvm::APInt::getSignedMinValue(), llvm::Value::getType(), llvm::Type::getVectorNumElements(), llvm::APInt::isIntN(), llvm::APInt::isNegative(), llvm::APInt::isSignedIntN(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::APInt::trunc().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Attempt to convert pshufb* to shufflevector if the mask is constant.
Definition at line 964 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::CallInst::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::Constant::getNullValue(), llvm::Value::getType(), I, llvm::makeArrayRef(), and llvm::NVPTX::PTXLdStInstCode::V2.
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 430 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::CallInst::getArgOperand(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Constant::getNullValue(), llvm::Value::getType(), llvm::APInt::getZExtValue(), I, llvm_unreachable(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::APInt::uge().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Decode XOP integer vector comparison intrinsics.
Definition at line 1164 of file InstCombineCalls.cpp.
References llvm::CmpInst::BAD_ICMP_PREDICATE, llvm::IRBuilder< T, Inserter >::CreateICmp(), llvm::IRBuilder< T, Inserter >::CreateSExtOrTrunc(), llvm::CallInst::getArgOperand(), llvm::ConstantInt::getSigned(), llvm::Value::getType(), llvm::CmpInst::ICMP_EQ, llvm::CmpInst::ICMP_NE, llvm::CmpInst::ICMP_SGE, llvm::CmpInst::ICMP_SGT, llvm::CmpInst::ICMP_SLE, llvm::CmpInst::ICMP_SLT, llvm::CmpInst::ICMP_UGE, llvm::CmpInst::ICMP_UGT, llvm::CmpInst::ICMP_ULE, and llvm::CmpInst::ICMP_ULT.
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
The shuffle mask for a perm2*128 selects any two halves of two 256-bit source vectors, unless a zero bit is set.
If a zero bit is set, then ignore that half of the mask and clear that half of the vector.
Definition at line 1100 of file InstCombineCalls.cpp.
References llvm::IRBuilder< T, Inserter >::CreateShuffleVector(), llvm::dyn_cast(), llvm::ConstantAggregateZero::get(), llvm::CallInst::getArgOperand(), llvm::SequentialType::getNumElements(), and llvm::Value::getType().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Attempt to convert vpermilvar* to shufflevector if the mask is constant.
Definition at line 1011 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::CallInst::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().
Referenced by llvm::InstCombiner::visitCallInst().
|
static |
Attempt to convert vpermd/vpermps to shufflevector if the mask is constant.
Definition at line 1061 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::CallInst::getArgOperand(), llvm::Value::getContext(), llvm::Type::getInt32Ty(), llvm::Value::getType(), I, llvm::makeArrayRef(), llvm::AMDGPU::CodeObject::Kernel::Arg::Key::Size, and llvm::NVPTX::PTXLdStInstCode::V2.
Referenced by llvm::InstCombiner::visitCallInst().
| STATISTIC | ( | NumSimplified | , |
| "Number of library calls simplified" | |||
| ) |
1.8.6