class InstCombiner
Declaration
class InstCombiner { /* full declaration omitted */ };
Description
The core instruction combiner logic. This class provides both the logic to recursively visit instructions and combine them.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:45
Member Variables
- private llvm::TargetTransformInfo& TTI
- Only used to call target specific intrinsic combining. It must **NOT** be used for any other purpose, as InstCombine is a target-independent canonicalization transform.
- public uint64_t MaxArraySizeForCombine = 0
- Maximum size of array considered when transforming.
- public llvm::InstCombiner::BuilderTy& Builder
- protected llvm::InstructionWorklist& Worklist
- A worklist of the instructions that need to be simplified.
- protected const bool MinimizeSize
- protected llvm::AAResults* AA
- protected llvm::AssumptionCache& AC
- protected llvm::TargetLibraryInfo& TLI
- protected llvm::DominatorTree& DT
- protected const llvm::DataLayout& DL
- protected const llvm::SimplifyQuery SQ
- protected llvm::OptimizationRemarkEmitter& ORE
- protected llvm::BlockFrequencyInfo* BFI
- protected llvm::ProfileSummaryInfo* PSI
- protected llvm::LoopInfo* LI
- protected bool MadeIRChange = false
Method Overview
- public static llvm::Constant * AddOne(llvm::Constant * C)
- public unsigned int ComputeMaxSignificantBits(const llvm::Value * Op, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr) const
- public unsigned int ComputeNumSignBits(const llvm::Value * Op, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr) const
- public llvm::Instruction * InsertNewInstBefore(llvm::Instruction * New, llvm::Instruction & Old)
- public llvm::Instruction * InsertNewInstWith(llvm::Instruction * New, llvm::Instruction & Old)
- public InstCombiner(llvm::InstructionWorklist & Worklist, llvm::InstCombiner::BuilderTy & Builder, bool MinimizeSize, llvm::AAResults * AA, llvm::AssumptionCache & AC, llvm::TargetLibraryInfo & TLI, llvm::TargetTransformInfo & TTI, llvm::DominatorTree & DT, llvm::OptimizationRemarkEmitter & ORE, llvm::BlockFrequencyInfo * BFI, llvm::ProfileSummaryInfo * PSI, const llvm::DataLayout & DL, llvm::LoopInfo * LI)
- public bool MaskedValueIsZero(const llvm::Value * V, const llvm::APInt & Mask, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr) const
- public virtual bool SimplifyDemandedBits(llvm::Instruction * I, unsigned int OpNo, const llvm::APInt & DemandedMask, llvm::KnownBits & Known, unsigned int Depth = 0)
- public virtual llvm::Value * SimplifyDemandedVectorElts(llvm::Value * V, llvm::APInt DemandedElts, llvm::APInt & UndefElts, unsigned int Depth = 0, bool AllowMultipleUsers = false)
- public static llvm::Constant * SubOne(llvm::Constant * C)
- public void addToWorklist(llvm::Instruction * I)
- public static bool canFreelyInvertAllUsersOf(llvm::Value * V, llvm::Value * IgnoredUser)
- public llvm::KnownBits computeKnownBits(const llvm::Value * V, unsigned int Depth, const llvm::Instruction * CxtI) const
- public void computeKnownBits(const llvm::Value * V, llvm::KnownBits & Known, unsigned int Depth, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForSignedAdd(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForSignedMul(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForSignedSub(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForUnsignedAdd(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForUnsignedMul(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public llvm::OverflowResult computeOverflowForUnsignedSub(const llvm::Value * LHS, const llvm::Value * RHS, const llvm::Instruction * CxtI) const
- public virtual llvm::Instruction * eraseInstFromFunction(llvm::Instruction & I)
- public llvm::AssumptionCache & getAssumptionCache() const
- public llvm::BlockFrequencyInfo * getBlockFrequencyInfo() const
- public static unsigned int getComplexity(llvm::Value * V)
- public const llvm::DataLayout & getDataLayout() const
- public llvm::DominatorTree & getDominatorTree() const
- public static llvm::Optional<std::pair<CmpInst::Predicate, Constant *>> getFlippedStrictnessPredicateAndConstant(CmpInst::Predicate Pred, llvm::Constant * C)
- public llvm::LoopInfo * getLoopInfo() const
- public llvm::OptimizationRemarkEmitter & getOptimizationRemarkEmitter() const
- public llvm::ProfileSummaryInfo * getProfileSummaryInfo() const
- public static llvm::Constant * getSafeVectorConstantForBinop(BinaryOperator::BinaryOps Opcode, llvm::Constant * In, bool IsRHSConstant)
- public const llvm::SimplifyQuery & getSimplifyQuery() const
- public llvm::TargetLibraryInfo & getTargetLibraryInfo() const
- public static bool isCanonicalPredicate(CmpInst::Predicate Pred)
- public static bool isFreeToInvert(llvm::Value * V, bool WillInvertAllUses)
- public bool isKnownToBeAPowerOfTwo(const llvm::Value * V, bool OrZero = false, unsigned int Depth = 0, const llvm::Instruction * CxtI = nullptr)
- public static bool isSignBitCheck(ICmpInst::Predicate Pred, const llvm::APInt & RHS, bool & TrueIfSigned)
- public static llvm::Value * peekThroughBitcast(llvm::Value * V, bool OneUseOnly = false)
- public llvm::Instruction * replaceInstUsesWith(llvm::Instruction & I, llvm::Value * V)
- public llvm::Instruction * replaceOperand(llvm::Instruction & I, unsigned int OpNum, llvm::Value * V)
- public void replaceUse(llvm::Use & U, llvm::Value * NewValue)
- public static bool shouldAvoidAbsorbingNotIntoSelect(const llvm::SelectInst & SI)
- public Optional<llvm::Instruction *> targetInstCombineIntrinsic(llvm::IntrinsicInst & II)
- public Optional<llvm::Value *> targetSimplifyDemandedUseBitsIntrinsic(llvm::IntrinsicInst & II, llvm::APInt DemandedMask, llvm::KnownBits & Known, bool & KnownBitsComputed)
- public Optional<llvm::Value *> targetSimplifyDemandedVectorEltsIntrinsic(llvm::IntrinsicInst & II, llvm::APInt DemandedElts, llvm::APInt & UndefElts, llvm::APInt & UndefElts2, llvm::APInt & UndefElts3, std::function<void (Instruction *, unsigned int, APInt, APInt &)> SimplifyAndSetOp)
- public virtual ~InstCombiner()
Methods
¶static llvm::Constant* AddOne(llvm::Constant* C)
static llvm::Constant* AddOne(llvm::Constant* C)
Description
Add one to a Constant
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:202
Parameters
¶unsigned int ComputeMaxSignificantBits(
const llvm::Value* Op,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
unsigned int ComputeMaxSignificantBits(
const llvm::Value* Op,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:483
Parameters
- const llvm::Value* Op
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶unsigned int ComputeNumSignBits(
const llvm::Value* Op,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
unsigned int ComputeNumSignBits(
const llvm::Value* Op,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:478
Parameters
- const llvm::Value* Op
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶llvm::Instruction* InsertNewInstBefore(
llvm::Instruction* New,
llvm::Instruction& Old)
llvm::Instruction* InsertNewInstBefore(
llvm::Instruction* New,
llvm::Instruction& Old)
Description
Inserts an instruction \p New before instruction \p Old Also adds the new instruction to the worklist and returns \p New so that it is suitable for use as the return from the visitation patterns.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:396
Parameters
- llvm::Instruction* New
- llvm::Instruction& Old
¶llvm::Instruction* InsertNewInstWith(
llvm::Instruction* New,
llvm::Instruction& Old)
llvm::Instruction* InsertNewInstWith(
llvm::Instruction* New,
llvm::Instruction& Old)
Description
Same as InsertNewInstBefore, but also sets the debug loc.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:406
Parameters
- llvm::Instruction* New
- llvm::Instruction& Old
¶InstCombiner(
llvm::InstructionWorklist& Worklist,
llvm::InstCombiner::BuilderTy& Builder,
bool MinimizeSize,
llvm::AAResults* AA,
llvm::AssumptionCache& AC,
llvm::TargetLibraryInfo& TLI,
llvm::TargetTransformInfo& TTI,
llvm::DominatorTree& DT,
llvm::OptimizationRemarkEmitter& ORE,
llvm::BlockFrequencyInfo* BFI,
llvm::ProfileSummaryInfo* PSI,
const llvm::DataLayout& DL,
llvm::LoopInfo* LI)
InstCombiner(
llvm::InstructionWorklist& Worklist,
llvm::InstCombiner::BuilderTy& Builder,
bool MinimizeSize,
llvm::AAResults* AA,
llvm::AssumptionCache& AC,
llvm::TargetLibraryInfo& TLI,
llvm::TargetTransformInfo& TTI,
llvm::DominatorTree& DT,
llvm::OptimizationRemarkEmitter& ORE,
llvm::BlockFrequencyInfo* BFI,
llvm::ProfileSummaryInfo* PSI,
const llvm::DataLayout& DL,
llvm::LoopInfo* LI)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:86
Parameters
- llvm::InstructionWorklist& Worklist
- llvm::InstCombiner::BuilderTy& Builder
- bool MinimizeSize
- llvm::AAResults* AA
- llvm::AssumptionCache& AC
- llvm::TargetLibraryInfo& TLI
- llvm::TargetTransformInfo& TTI
- llvm::DominatorTree& DT
- llvm::OptimizationRemarkEmitter& ORE
- llvm::BlockFrequencyInfo* BFI
- llvm::ProfileSummaryInfo* PSI
- const llvm::DataLayout& DL
- llvm::LoopInfo* LI
¶bool MaskedValueIsZero(
const llvm::Value* V,
const llvm::APInt& Mask,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
bool MaskedValueIsZero(
const llvm::Value* V,
const llvm::APInt& Mask,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:473
Parameters
- const llvm::Value* V
- const llvm::APInt& Mask
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶virtual bool SimplifyDemandedBits(
llvm::Instruction* I,
unsigned int OpNo,
const llvm::APInt& DemandedMask,
llvm::KnownBits& Known,
unsigned int Depth = 0)
virtual bool SimplifyDemandedBits(
llvm::Instruction* I,
unsigned int OpNo,
const llvm::APInt& DemandedMask,
llvm::KnownBits& Known,
unsigned int Depth = 0)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:521
Parameters
- llvm::Instruction* I
- unsigned int OpNo
- const llvm::APInt& DemandedMask
- llvm::KnownBits& Known
- unsigned int Depth = 0
¶virtual llvm::Value* SimplifyDemandedVectorElts(
llvm::Value* V,
llvm::APInt DemandedElts,
llvm::APInt& UndefElts,
unsigned int Depth = 0,
bool AllowMultipleUsers = false)
virtual llvm::Value* SimplifyDemandedVectorElts(
llvm::Value* V,
llvm::APInt DemandedElts,
llvm::APInt& UndefElts,
unsigned int Depth = 0,
bool AllowMultipleUsers = false)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:525
Parameters
- llvm::Value* V
- llvm::APInt DemandedElts
- llvm::APInt& UndefElts
- unsigned int Depth = 0
- bool AllowMultipleUsers = false
¶static llvm::Constant* SubOne(llvm::Constant* C)
static llvm::Constant* SubOne(llvm::Constant* C)
Description
Subtract one from a Constant
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:207
Parameters
¶void addToWorklist(llvm::Instruction* I)
void addToWorklist(llvm::Instruction* I)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:366
Parameters
¶static bool canFreelyInvertAllUsersOf(
llvm::Value* V,
llvm::Value* IgnoredUser)
static bool canFreelyInvertAllUsersOf(
llvm::Value* V,
llvm::Value* IgnoredUser)
Description
Given i1 V, can every user of V be freely adapted if V is changed to !V ? InstCombine's freelyInvertAllUsersOf() must be kept in sync with this fn. See also: isFreeToInvert()
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:278
Parameters
- llvm::Value* V
- llvm::Value* IgnoredUser
¶llvm::KnownBits computeKnownBits(
const llvm::Value* V,
unsigned int Depth,
const llvm::Instruction* CxtI) const
llvm::KnownBits computeKnownBits(
const llvm::Value* V,
unsigned int Depth,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:462
Parameters
- const llvm::Value* V
- unsigned int Depth
- const llvm::Instruction* CxtI
¶void computeKnownBits(
const llvm::Value* V,
llvm::KnownBits& Known,
unsigned int Depth,
const llvm::Instruction* CxtI) const
void computeKnownBits(
const llvm::Value* V,
llvm::KnownBits& Known,
unsigned int Depth,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:457
Parameters
- const llvm::Value* V
- llvm::KnownBits& Known
- unsigned int Depth
- const llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflowForSignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflowForSignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:505
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflowForSignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflowForSignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:494
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult computeOverflowForSignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult computeOverflowForSignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:516
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult
computeOverflowForUnsignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult
computeOverflowForUnsignedAdd(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:499
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult
computeOverflowForUnsignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult
computeOverflowForUnsignedMul(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:488
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶llvm::OverflowResult
computeOverflowForUnsignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
llvm::OverflowResult
computeOverflowForUnsignedSub(
const llvm::Value* LHS,
const llvm::Value* RHS,
const llvm::Instruction* CxtI) const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:510
Parameters
- const llvm::Value* LHS
- const llvm::Value* RHS
- const llvm::Instruction* CxtI
¶virtual llvm::Instruction* eraseInstFromFunction(
llvm::Instruction& I)
virtual llvm::Instruction* eraseInstFromFunction(
llvm::Instruction& I)
Description
Combiner aware instruction erasure. When dealing with an instruction that has side effects or produces a void value, we can't rely on DCE to delete the instruction. Instead, visit methods should return the value returned by this function.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:455
Parameters
¶llvm::AssumptionCache& getAssumptionCache() const
llvm::AssumptionCache& getAssumptionCache() const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:368
¶llvm::BlockFrequencyInfo* getBlockFrequencyInfo()
const
llvm::BlockFrequencyInfo* getBlockFrequencyInfo()
const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:376
¶static unsigned int getComplexity(llvm::Value* V)
static unsigned int getComplexity(llvm::Value* V)
Description
Assign a complexity or rank value to LLVM Values. This is used to reduce the amount of pattern matching needed for compares and commutative instructions. For example, if we have: icmp ugt X, Constant or xor (add X, Constant), cast Z We do not have to consider the commuted variants of these patterns because canonicalization based on complexity guarantees the above ordering. This routine maps IR values to various complexity ranks: 0 -> undef 1 -> Constants 2 -> Other non-instructions 3 -> Arguments 4 -> Cast and (f)neg/not instructions 5 -> Other instructions
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:127
Parameters
- llvm::Value* V
¶const llvm::DataLayout& getDataLayout() const
const llvm::DataLayout& getDataLayout() const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:371
¶llvm::DominatorTree& getDominatorTree() const
llvm::DominatorTree& getDominatorTree() const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:370
¶static llvm::Optional<
std::pair<CmpInst::Predicate, Constant*>>
getFlippedStrictnessPredicateAndConstant(
CmpInst::Predicate Pred,
llvm::Constant* C)
static llvm::Optional<
std::pair<CmpInst::Predicate, Constant*>>
getFlippedStrictnessPredicateAndConstant(
CmpInst::Predicate Pred,
llvm::Constant* C)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:213
Parameters
- CmpInst::Predicate Pred
- llvm::Constant* C
¶llvm::LoopInfo* getLoopInfo() const
llvm::LoopInfo* getLoopInfo() const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:378
¶llvm::OptimizationRemarkEmitter&
getOptimizationRemarkEmitter() const
llvm::OptimizationRemarkEmitter&
getOptimizationRemarkEmitter() const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:373
¶llvm::ProfileSummaryInfo* getProfileSummaryInfo()
const
llvm::ProfileSummaryInfo* getProfileSummaryInfo()
const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:377
¶static llvm::Constant*
getSafeVectorConstantForBinop(
BinaryOperator::BinaryOps Opcode,
llvm::Constant* In,
bool IsRHSConstant)
static llvm::Constant*
getSafeVectorConstantForBinop(
BinaryOperator::BinaryOps Opcode,
llvm::Constant* In,
bool IsRHSConstant)
Description
Some binary operators require special handling to avoid poison and undefined behavior. If a constant vector has undef elements, replace those undefs with identity constants if possible because those are always safe to execute. If no identity constant exists, replace undef with some other safe constant.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:314
Parameters
- BinaryOperator::BinaryOps Opcode
- llvm::Constant* In
- bool IsRHSConstant
¶const llvm::SimplifyQuery& getSimplifyQuery()
const
const llvm::SimplifyQuery& getSimplifyQuery()
const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:372
¶llvm::TargetLibraryInfo& getTargetLibraryInfo()
const
llvm::TargetLibraryInfo& getTargetLibraryInfo()
const
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:369
¶static bool isCanonicalPredicate(
CmpInst::Predicate Pred)
static bool isCanonicalPredicate(
CmpInst::Predicate Pred)
Description
Predicate canonicalization reduces the number of patterns that need to be matched by other transforms. For example, we may swap the operands of a conditional branch or select to create a compare with a canonical (inverted) predicate which is then more likely to be matched with other values.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:145
Parameters
- CmpInst::Predicate Pred
¶static bool isFreeToInvert(llvm::Value* V,
bool WillInvertAllUses)
static bool isFreeToInvert(llvm::Value* V,
bool WillInvertAllUses)
Description
Return true if the specified value is free to invert (apply ~ to). This happens in cases where the ~ can be eliminated. If WillInvertAllUses is true, work under the assumption that the caller intends to remove all uses of V and only keep uses of ~V. See also: canFreelyInvertAllUsersOf()
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:235
Parameters
- llvm::Value* V
- bool WillInvertAllUses
¶bool isKnownToBeAPowerOfTwo(
const llvm::Value* V,
bool OrZero = false,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr)
bool isKnownToBeAPowerOfTwo(
const llvm::Value* V,
bool OrZero = false,
unsigned int Depth = 0,
const llvm::Instruction* CxtI = nullptr)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:467
Parameters
- const llvm::Value* V
- bool OrZero = false
- unsigned int Depth = 0
- const llvm::Instruction* CxtI = nullptr
¶static bool isSignBitCheck(
ICmpInst::Predicate Pred,
const llvm::APInt& RHS,
bool& TrueIfSigned)
static bool isSignBitCheck(
ICmpInst::Predicate Pred,
const llvm::APInt& RHS,
bool& TrueIfSigned)
Description
Given an exploded icmp instruction, return true if the comparison only checks the sign bit. If it only checks the sign bit, set TrueIfSigned if the result of the comparison is true when the input value is signed.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:165
Parameters
- ICmpInst::Predicate Pred
- const llvm::APInt& RHS
- bool& TrueIfSigned
¶static llvm::Value* peekThroughBitcast(
llvm::Value* V,
bool OneUseOnly = false)
static llvm::Value* peekThroughBitcast(
llvm::Value* V,
bool OneUseOnly = false)
Description
Return the source operand of a potentially bitcasted value while optionally checking if it has one use. If there is no bitcast or the one use check is not met, return the input value itself.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:101
Parameters
- llvm::Value* V
- bool OneUseOnly = false
¶llvm::Instruction* replaceInstUsesWith(
llvm::Instruction& I,
llvm::Value* V)
llvm::Instruction* replaceInstUsesWith(
llvm::Instruction& I,
llvm::Value* V)
Description
A combiner-aware RAUW-like routine. This method is to be used when an instruction is found to be dead, replaceable with another preexisting expression. Here we add all uses of I to the worklist, replace all uses of I with the new value, then return I, so that the inst combiner will know that I was modified.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:417
Parameters
¶llvm::Instruction* replaceOperand(
llvm::Instruction& I,
unsigned int OpNum,
llvm::Value* V)
llvm::Instruction* replaceOperand(
llvm::Instruction& I,
unsigned int OpNum,
llvm::Value* V)
Description
Replace operand of instruction and add old operand to the worklist.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:438
Parameters
- llvm::Instruction& I
- unsigned int OpNum
- llvm::Value* V
¶void replaceUse(llvm::Use& U,
llvm::Value* NewValue)
void replaceUse(llvm::Use& U,
llvm::Value* NewValue)
Description
Replace use and add the previously used value to the worklist.
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:445
Parameters
- llvm::Use& U
- llvm::Value* NewValue
¶static bool shouldAvoidAbsorbingNotIntoSelect(
const llvm::SelectInst& SI)
static bool shouldAvoidAbsorbingNotIntoSelect(
const llvm::SelectInst& SI)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:218
Parameters
- const llvm::SelectInst& SI
¶Optional<llvm::Instruction*>
targetInstCombineIntrinsic(
llvm::IntrinsicInst& II)
Optional<llvm::Instruction*>
targetInstCombineIntrinsic(
llvm::IntrinsicInst& II)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:381
Parameters
¶Optional<llvm::Value*>
targetSimplifyDemandedUseBitsIntrinsic(
llvm::IntrinsicInst& II,
llvm::APInt DemandedMask,
llvm::KnownBits& Known,
bool& KnownBitsComputed)
Optional<llvm::Value*>
targetSimplifyDemandedUseBitsIntrinsic(
llvm::IntrinsicInst& II,
llvm::APInt DemandedMask,
llvm::KnownBits& Known,
bool& KnownBitsComputed)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:383
Parameters
- llvm::IntrinsicInst& II
- llvm::APInt DemandedMask
- llvm::KnownBits& Known
- bool& KnownBitsComputed
¶Optional<llvm::Value*>
targetSimplifyDemandedVectorEltsIntrinsic(
llvm::IntrinsicInst& II,
llvm::APInt DemandedElts,
llvm::APInt& UndefElts,
llvm::APInt& UndefElts2,
llvm::APInt& UndefElts3,
std::function<void(Instruction*,
unsigned int,
APInt,
APInt&)> SimplifyAndSetOp)
Optional<llvm::Value*>
targetSimplifyDemandedVectorEltsIntrinsic(
llvm::IntrinsicInst& II,
llvm::APInt DemandedElts,
llvm::APInt& UndefElts,
llvm::APInt& UndefElts2,
llvm::APInt& UndefElts3,
std::function<void(Instruction*,
unsigned int,
APInt,
APInt&)> SimplifyAndSetOp)
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:386
Parameters
- llvm::IntrinsicInst& II
- llvm::APInt DemandedElts
- llvm::APInt& UndefElts
- llvm::APInt& UndefElts2
- llvm::APInt& UndefElts3
- std::function<void(Instruction*, unsigned int, APInt, APInt&)> SimplifyAndSetOp
¶virtual ~InstCombiner()
virtual ~InstCombiner()
Declared at: llvm/include/llvm/Transforms/InstCombine/InstCombiner.h:96