LLVM  6.0.0svn
Macros | Functions
InstCombineSimplifyDemanded.cpp File Reference
#include "InstCombineInternal.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/PatternMatch.h"
#include "llvm/Support/KnownBits.h"
Include dependency graph for InstCombineSimplifyDemanded.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "instcombine"
 

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...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "instcombine"

Definition at line 24 of file InstCombineSimplifyDemanded.cpp.

Function Documentation

◆ ShrinkDemandedConstant()

static bool ShrinkDemandedConstant ( Instruction I,
unsigned  OpNo,
const APInt Demanded 
)
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 29 of file InstCombineSimplifyDemanded.cpp.

References llvm::MCID::Add, Arg, llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::APInt::ashr(), assert(), llvm::tgtok::Bit, C, llvm::MCID::Call, llvm::APInt::clearAllBits(), llvm::APInt::clearBit(), llvm::KnownBits::computeForAddSub(), llvm::computeKnownBits(), llvm::ComputeNumSignBits(), llvm::Instruction::copyMetadata(), llvm::APInt::countLeadingZeros(), llvm::KnownBits::countMinLeadingZeros(), llvm::APInt::countPopulation(), llvm::APInt::countTrailingZeros(), llvm::InsertElementInst::Create(), llvm::Depth, llvm::dyn_cast(), E, 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::CallInst::getArgOperand(), llvm::KnownBits::getBitWidth(), llvm::APInt::getBitWidth(), llvm::Value::getContext(), llvm::Intrinsic::getDeclaration(), llvm::APInt::getHighBitsSet(), llvm::Type::getInt32Ty(), llvm::Constant::getIntegerValue(), llvm::IntrinsicInst::getIntrinsicID(), llvm::APInt::getLimitedValue(), llvm::APInt::getLoBits(), llvm::APInt::getLowBitsSet(), llvm::ShuffleVectorInst::getMaskValue(), llvm::Value::getName(), llvm::Constant::getNullValue(), llvm::CallInst::getNumArgOperands(), llvm::SequentialType::getNumElements(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::User::getOperandUse(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::GlobalValue::getParent(), 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::Type::isIntOrIntVectorTy(), llvm::KnownBits::isNonNegative(), llvm::Constant::isNullValue(), llvm::APInt::isNullValue(), llvm::APInt::isOneValue(), llvm::APInt::isPowerOf2(), 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_Shr(), llvm::PatternMatch::m_Value(), llvm::KnownBits::makeNonNegative(), llvm::PatternMatch::match(), llvm::matchSelectPattern(), llvm::KnownBits::One, llvm::PowerOf2Ceil(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), RA, llvm::KnownBits::resetAll(), llvm::MCID::Select, llvm::APInt::setAllBits(), llvm::CallInst::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_UNKNOWN, llvm::Value::takeName(), llvm::APInt::trunc(), llvm::APInt::uge(), llvm::APInt::ult(), llvm::RegState::Undef, llvm::KnownBits::Zero, llvm::APInt::zext(), llvm::KnownBits::zextOrTrunc(), and llvm::APInt::zextOrTrunc().

Referenced by llvm::TargetLowering::TargetLoweringOpt::CombineTo().