LLVM
8.0.1
|
#include "InstCombineInternal.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/KnownBits.h"
#include "InstCombineTables.inc"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "instcombine" |
#define | GET_AMDGPUImageDMaskIntrinsicTable_IMPL |
Functions | |
static bool | ShrinkDemandedConstant (Instruction *I, unsigned OpNo, const APInt &Demanded) |
Check to see if the specified operand of the specified instruction is a constant integer. More... | |
#define DEBUG_TYPE "instcombine" |
Definition at line 24 of file InstCombineSimplifyDemanded.cpp.
#define GET_AMDGPUImageDMaskIntrinsicTable_IMPL |
Definition at line 32 of file InstCombineSimplifyDemanded.cpp.
|
static |
Check to see if the specified operand of the specified instruction is a constant integer.
If so, check to see if there are any bits set in the constant that are not demanded. If so, shrink the constant and return true.
Definition at line 40 of file InstCombineSimplifyDemanded.cpp.
References llvm::MCID::Add, llvm::Intrinsic::amdgcn_buffer_load, llvm::Intrinsic::amdgcn_buffer_load_format, llvm::Intrinsic::amdgcn_raw_buffer_load, llvm::Intrinsic::amdgcn_raw_buffer_load_format, llvm::Intrinsic::amdgcn_struct_buffer_load, llvm::Intrinsic::amdgcn_struct_buffer_load_format, Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::APInt::ashr(), assert(), llvm::tgtok::Bit, llvm::Intrinsic::bswap, C, llvm::MCID::Call, llvm::APInt::clearAllBits(), llvm::APInt::clearBit(), llvm::KnownBits::computeForAddSub(), llvm::computeKnownBits(), llvm::ComputeNumSignBits(), llvm::Instruction::copyMetadata(), llvm::APInt::countLeadingOnes(), llvm::APInt::countLeadingZeros(), llvm::KnownBits::countMinLeadingZeros(), llvm::countPopulation(), llvm::APInt::countPopulation(), llvm::APInt::countTrailingZeros(), llvm::InsertElementInst::Create(), llvm::Depth, llvm::Instruction::dropPoisonGeneratingFlags(), llvm::dyn_cast(), E, llvm::SelectPatternResult::Flavor, llvm::Intrinsic::fshl, llvm::Intrinsic::fshr, llvm::ConstantInt::get(), llvm::Use::get(), llvm::ConstantAggregateZero::get(), llvm::VectorType::get(), llvm::ConstantVector::get(), llvm::UndefValue::get(), llvm::APInt::getActiveBits(), llvm::Constant::getAggregateElement(), llvm::APInt::getAllOnesValue(), llvm::CallBase::getArgOperand(), llvm::KnownBits::getBitWidth(), llvm::APInt::getBitWidth(), llvm::CallBase::getCalledFunction(), llvm::SelectInst::getCondition(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::Function::getFunctionType(), llvm::APInt::getHighBitsSet(), llvm::Type::getInt32Ty(), llvm::Constant::getIntegerValue(), llvm::IntrinsicInst::getIntrinsicID(), llvm::Intrinsic::getIntrinsicInfoTableEntries(), llvm::APInt::getLimitedValue(), llvm::APInt::getLoBits(), llvm::APInt::getLowBitsSet(), llvm::ShuffleVectorInst::getMaskValue(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::CallBase::getNumArgOperands(), llvm::SequentialType::getNumElements(), llvm::FunctionType::getNumParams(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::User::getOperandUse(), llvm::FunctionType::getParamType(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::FunctionType::getReturnType(), llvm::Type::getScalarSizeInBits(), llvm::APInt::getSignMask(), llvm::ConstantInt::getType(), llvm::Value::getType(), llvm::ShuffleVectorInst::getType(), llvm::ConstantInt::getValue(), llvm::Type::getVectorElementType(), llvm::Type::getVectorNumElements(), llvm::ConstantInt::getZExtValue(), llvm::APInt::getZExtValue(), llvm::KnownBits::hasConflict(), llvm::Instruction::hasNoSignedWrap(), llvm::Instruction::hasNoUnsignedWrap(), llvm::Value::hasOneUse(), I, if(), llvm::APInt::intersects(), llvm::APInt::isAllOnesValue(), llvm::Instruction::isIntDivRem(), llvm::Type::isIntOrIntVectorTy(), llvm::APInt::isMask(), llvm::KnownBits::isNonNegative(), llvm::Constant::isNullValue(), llvm::APInt::isNullValue(), llvm::APInt::isOneValue(), llvm::APInt::isPowerOf2(), llvm::Instruction::isShift(), llvm::APInt::isSignBitSet(), llvm::APInt::isSignMask(), llvm::APInt::isSubsetOf(), llvm::Type::isVectorTy(), llvm_unreachable, llvm::APInt::lshr(), llvm::APInt::lshrInPlace(), llvm::PatternMatch::m_APInt(), llvm::PatternMatch::m_BinOp(), llvm::PatternMatch::m_Shr(), llvm::PatternMatch::m_Value(), llvm::KnownBits::makeNonNegative(), llvm::PatternMatch::match(), llvm::Intrinsic::matchIntrinsicType(), llvm::matchSelectPattern(), llvm::KnownBits::One, llvm::PowerOf2Ceil(), llvm::SmallVectorTemplateBase< T >::push_back(), RA, llvm::KnownBits::resetAll(), llvm::MCID::Select, llvm::APInt::setAllBits(), llvm::CallBase::setArgOperand(), llvm::APInt::setBit(), llvm::APInt::setBitsFrom(), llvm::Instruction::setHasNoSignedWrap(), llvm::Instruction::setHasNoUnsignedWrap(), llvm::APInt::setHighBits(), llvm::Instruction::setIsExact(), llvm::APInt::setLowBits(), llvm::User::setOperand(), llvm::APInt::setSignBit(), llvm::KnownBits::sext(), llvm::APInt::shl(), llvm::SPF_UMAX, llvm::SPF_UMIN, llvm::SPF_UNKNOWN, llvm::Value::takeName(), llvm::APInt::trunc(), llvm::APInt::uge(), llvm::APInt::ult(), llvm::RegState::Undef, llvm::APInt::urem(), llvm::Intrinsic::x86_avx2_packssdw, llvm::Intrinsic::x86_avx2_packsswb, llvm::Intrinsic::x86_avx2_packusdw, llvm::Intrinsic::x86_avx2_packuswb, llvm::Intrinsic::x86_avx2_permd, llvm::Intrinsic::x86_avx2_permps, llvm::Intrinsic::x86_avx2_pmovmskb, llvm::Intrinsic::x86_avx2_pshuf_b, llvm::Intrinsic::x86_avx512_mask_add_sd_round, llvm::Intrinsic::x86_avx512_mask_add_ss_round, llvm::Intrinsic::x86_avx512_mask_div_sd_round, llvm::Intrinsic::x86_avx512_mask_div_ss_round, llvm::Intrinsic::x86_avx512_mask_max_sd_round, llvm::Intrinsic::x86_avx512_mask_max_ss_round, llvm::Intrinsic::x86_avx512_mask_min_sd_round, llvm::Intrinsic::x86_avx512_mask_min_ss_round, llvm::Intrinsic::x86_avx512_mask_mul_sd_round, llvm::Intrinsic::x86_avx512_mask_mul_ss_round, llvm::Intrinsic::x86_avx512_mask_sub_sd_round, llvm::Intrinsic::x86_avx512_mask_sub_ss_round, llvm::Intrinsic::x86_avx512_packssdw_512, llvm::Intrinsic::x86_avx512_packsswb_512, llvm::Intrinsic::x86_avx512_packusdw_512, llvm::Intrinsic::x86_avx512_packuswb_512, llvm::Intrinsic::x86_avx512_pshuf_b_512, llvm::Intrinsic::x86_avx512_vpermilvar_pd_512, llvm::Intrinsic::x86_avx512_vpermilvar_ps_512, llvm::Intrinsic::x86_avx_movmsk_pd_256, llvm::Intrinsic::x86_avx_movmsk_ps_256, llvm::Intrinsic::x86_avx_vpermilvar_pd, llvm::Intrinsic::x86_avx_vpermilvar_pd_256, llvm::Intrinsic::x86_avx_vpermilvar_ps, llvm::Intrinsic::x86_avx_vpermilvar_ps_256, llvm::Intrinsic::x86_mmx_pmovmskb, llvm::Intrinsic::x86_sse2_cmp_sd, llvm::Intrinsic::x86_sse2_max_sd, llvm::Intrinsic::x86_sse2_min_sd, llvm::Intrinsic::x86_sse2_movmsk_pd, llvm::Intrinsic::x86_sse2_packssdw_128, llvm::Intrinsic::x86_sse2_packsswb_128, llvm::Intrinsic::x86_sse2_packuswb_128, llvm::Intrinsic::x86_sse2_pmovmskb_128, llvm::Intrinsic::x86_sse41_packusdw, llvm::Intrinsic::x86_sse41_round_sd, llvm::Intrinsic::x86_sse41_round_ss, llvm::Intrinsic::x86_sse42_crc32_64_64, llvm::Intrinsic::x86_sse4a_extrq, llvm::Intrinsic::x86_sse4a_extrqi, llvm::Intrinsic::x86_sse4a_insertq, llvm::Intrinsic::x86_sse4a_insertqi, llvm::Intrinsic::x86_sse_cmp_ss, llvm::Intrinsic::x86_sse_max_ss, llvm::Intrinsic::x86_sse_min_ss, llvm::Intrinsic::x86_sse_movmsk_ps, llvm::Intrinsic::x86_sse_rcp_ss, llvm::Intrinsic::x86_sse_rsqrt_ss, llvm::Intrinsic::x86_ssse3_pshuf_b_128, llvm::Intrinsic::x86_xop_vfrcz_sd, llvm::Intrinsic::x86_xop_vfrcz_ss, llvm::KnownBits::Zero, llvm::APInt::zext(), llvm::KnownBits::zextOrTrunc(), and llvm::APInt::zextOrTrunc().
Referenced by llvm::TargetLowering::TargetLoweringOpt::CombineTo().