LLVM 24.0.0git
InstCombineSimplifyDemanded.cpp File Reference

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.
static Value * simplifyShiftSelectingPackedElement (Instruction *I, const APInt &DemandedMask, InstCombinerImpl &IC, unsigned Depth)
 Let N = 2 * M.
static unsigned getBitWidth (Type *Ty, const DataLayout &DL)
 Returns the bitwidth of the given scalar or pointer type.
static bool canSkipDemandedEltsInInsertChain (InsertElementInst &IE, unsigned VWidth, unsigned DepthLimit)
 Return true if the top-level all-lanes demanded-elements query can be skipped for an intermediate insertelement chain node.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "instcombine"

Definition at line 27 of file InstCombineSimplifyDemanded.cpp.

Function Documentation

◆ canSkipDemandedEltsInInsertChain()

bool canSkipDemandedEltsInInsertChain ( InsertElementInst & IE,
unsigned VWidth,
unsigned DepthLimit )
static

Return true if the top-level all-lanes demanded-elements query can be skipped for an intermediate insertelement chain node.

This is limited to a bounded one-use chain with distinct in-range constant indices, where SDVE cannot remove a dead insert before hitting its depth limit.

Definition at line 1447 of file InstCombineSimplifyDemanded.cpp.

References llvm::sampleprof::Base, llvm::dyn_cast(), I, llvm::PatternMatch::m_Poison(), llvm::PatternMatch::match(), llvm::SmallBitVector::set(), and llvm::SmallBitVector::test().

Referenced by llvm::InstCombinerImpl::SimplifyDemandedVectorElts().

◆ getBitWidth()

unsigned getBitWidth ( Type * Ty,
const DataLayout & DL )
static

Returns the bitwidth of the given scalar or pointer type.

For vector types, returns the element type's bitwidth.

Definition at line 112 of file InstCombineSimplifyDemanded.cpp.

References llvm::BitWidth, and DL.

◆ ShrinkDemandedConstant()

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 32 of file InstCombineSimplifyDemanded.cpp.

References assert(), C(), I, llvm::PatternMatch::m_APInt(), and llvm::PatternMatch::match().

Referenced by llvm::TargetLowering::ShrinkDemandedConstant(), llvm::TargetLowering::SimplifyDemandedBits(), and llvm::InstCombinerImpl::SimplifyDemandedUseBits().

◆ simplifyShiftSelectingPackedElement()

Value * simplifyShiftSelectingPackedElement ( Instruction * I,
const APInt & DemandedMask,
InstCombinerImpl & IC,
unsigned Depth )
static