50 assert(
Op &&
Op->isCast() &&
"Can't fold cast of cast without a cast!");
55 Type *SrcTy =
Op->getOperand(0)->getType();
56 Type *MidTy =
Op->getType();
64 Type *SrcTy = V->getType();
68 if (V->isAllOnesValue())
81 return ConstantByte::get(DestTy, CI->getValue());
87 return ConstantFP::get(
104 return ConstantInt::get(DestTy, CB->getValue());
110 return ConstantFP::get(
121 APInt Val =
FP->getValueAPF().bitcastToAPInt();
123 return ConstantFP::get(DestTy->
getContext(), ResultFP);
137 if (SrcTy->isPPC_FP128Ty())
143 return ConstantInt::get(DestTy,
FP->getValueAPF().bitcastToAPInt());
148 return ConstantByte::get(DestTy,
FP->getValueAPF().bitcastToAPInt());
172 if (opc == Instruction::ZExt || opc == Instruction::SExt ||
173 opc == Instruction::UIToFP || opc == Instruction::SIToFP)
179 opc != Instruction::AddrSpaceCast)
195 if (DestTy->
isVectorTy() && V->getType()->isVectorTy() &&
229 case Instruction::FPTrunc:
230 case Instruction::FPExt:
233 APFloat Val = FPC->getValueAPF();
236 return ConstantFP::get(DestTy, Val);
239 case Instruction::FPToUI:
240 case Instruction::FPToSI:
242 const APFloat &V = FPC->getValueAPF();
251 return ConstantInt::get(DestTy, IntVal);
254 case Instruction::UIToFP:
255 case Instruction::SIToFP:
257 const APInt &api = CI->getValue();
262 return ConstantFP::get(DestTy, apf);
265 case Instruction::ZExt:
268 return ConstantInt::get(DestTy, CI->getValue().zext(
BitWidth));
271 case Instruction::SExt:
274 return ConstantInt::get(DestTy, CI->getValue().sext(
BitWidth));
277 case Instruction::Trunc: {
280 return ConstantInt::get(DestTy, CI->getValue().trunc(
BitWidth));
285 case Instruction::BitCast:
287 case Instruction::AddrSpaceCast:
288 case Instruction::IntToPtr:
289 case Instruction::PtrToAddr:
290 case Instruction::PtrToInt:
298 if (
Cond->isNullValue())
return V2;
299 if (
Cond->isAllOnesValue())
return V1;
303 auto *V1VTy = CondV->getType();
306 for (
unsigned i = 0, e = V1VTy->getNumElements(); i != e; ++i) {
309 ConstantInt::get(Ty, i));
311 ConstantInt::get(Ty, i));
315 }
else if (V1Element == V2Element) {
321 V =
Cond->isNullValue() ? V2Element : V1Element;
327 if (Result.size() == V1VTy->getNumElements())
339 if (V1 == V2)
return V1;
361 if (
C->getType()->isVectorTy())
362 return !
C->containsPoisonElement() && !
C->containsConstantExpression();
392 if (CIdx->uge(ValFVTy->getNumElements()))
400 Ops.reserve(CE->getNumOperands());
401 for (
unsigned i = 0, e = CE->getNumOperands(); i != e; ++i) {
403 if (
Op->getType()->isVectorTy()) {
407 Ops.push_back(ScalarOp);
411 return CE->getWithOperands(
Ops, ValVTy->getElementType(),
false,
412 GEP->getSourceElementType());
413 }
else if (CE->getOpcode() == Instruction::InsertElement) {
416 APSInt(CIdx->getValue()))) {
417 return CE->getOperand(1);
429 if (CIdx->getValue().ult(ValVTy->getElementCount().getKnownMinValue())) {
449 if (!CIdx)
return nullptr;
458 unsigned NumElts = ValTy->getNumElements();
459 if (CIdx->
uge(NumElts))
463 Result.reserve(NumElts);
466 for (
unsigned i = 0; i != NumElts; ++i) {
468 Result.push_back(Elt);
482 unsigned MaskNumElts = Mask.size();
485 Type *EltTy = V1VTy->getElementType();
510 unsigned SrcNumElts = V1VTy->getElementCount().getKnownMinValue();
514 for (
unsigned i = 0; i != MaskNumElts; ++i) {
521 if (
unsigned(Elt) >= SrcNumElts*2)
523 else if (
unsigned(Elt) >= SrcNumElts) {
527 ConstantInt::get(Ty, Elt - SrcNumElts));
532 Result.push_back(InElt);
559 NumElts = ST->getNumElements();
564 for (
unsigned i = 0; i != NumElts; ++i) {
566 if (!
C)
return nullptr;
585 bool HasScalarUndefOrScalableVectorUndef =
588 if (HasScalarUndefOrScalableVectorUndef) {
590 case Instruction::FNeg:
592 case Instruction::UnaryOpsEnd:
598 assert(!HasScalarUndefOrScalableVectorUndef &&
"Unexpected UndefValue");
603 const APFloat &CV = CFP->getValueAPF();
607 case Instruction::FNeg:
608 return ConstantFP::get(
C->getType(),
neg(CV));
620 for (
unsigned i = 0, e = FVTy->getNumElements(); i != e; ++i) {
621 Constant *ExtractIdx = ConstantInt::get(Ty, i);
626 Result.push_back(Res);
644 Opcode, C1->
getType(),
false)) {
650 Opcode, C1->
getType(),
true)) {
662 bool HasScalarUndefOrScalableVectorUndef =
663 (!C1->
getType()->isVectorTy() || IsScalableVector) &&
665 if (HasScalarUndefOrScalableVectorUndef) {
667 case Instruction::Xor:
673 case Instruction::Add:
674 case Instruction::Sub:
676 case Instruction::And:
680 case Instruction::Mul: {
693 case Instruction::SDiv:
694 case Instruction::UDiv:
701 case Instruction::URem:
702 case Instruction::SRem:
709 case Instruction::Or:
713 case Instruction::LShr:
719 case Instruction::AShr:
726 case Instruction::Shl:
732 case Instruction::FSub:
737 case Instruction::FAdd:
738 case Instruction::FMul:
739 case Instruction::FDiv:
740 case Instruction::FRem:
752 case Instruction::BinaryOpsEnd:
758 assert((!HasScalarUndefOrScalableVectorUndef) &&
"Unexpected UndefValue");
767 case Instruction::UDiv:
768 case Instruction::SDiv:
772 case Instruction::URem:
773 case Instruction::SRem:
779 case Instruction::And:
780 assert(!CI2->isZero() &&
"And zero handled above");
783 if ((CE1->getOpcode() == Instruction::PtrToInt ||
784 CE1->getOpcode() == Instruction::PtrToAddr) &&
810 unsigned DstWidth = CI2->getBitWidth();
811 unsigned SrcWidth = std::min(DstWidth,
Log2(GVAlign));
815 if ((CI2->getValue() & BitsNotSet) == CI2->getValue())
832 const APInt &C1V = CI1->getValue();
833 const APInt &C2V = CI2->getValue();
837 case Instruction::Add:
838 return ConstantInt::get(C1->
getType(), C1V + C2V);
839 case Instruction::Sub:
840 return ConstantInt::get(C1->
getType(), C1V - C2V);
841 case Instruction::Mul:
842 return ConstantInt::get(C1->
getType(), C1V * C2V);
843 case Instruction::UDiv:
844 assert(!CI2->isZero() &&
"Div by zero handled above");
845 return ConstantInt::get(CI1->getType(), C1V.
udiv(C2V));
846 case Instruction::SDiv:
847 assert(!CI2->isZero() &&
"Div by zero handled above");
850 return ConstantInt::get(CI1->getType(), C1V.
sdiv(C2V));
851 case Instruction::URem:
852 assert(!CI2->isZero() &&
"Div by zero handled above");
853 return ConstantInt::get(C1->
getType(), C1V.
urem(C2V));
854 case Instruction::SRem:
855 assert(!CI2->isZero() &&
"Div by zero handled above");
858 return ConstantInt::get(C1->
getType(), C1V.
srem(C2V));
859 case Instruction::And:
860 return ConstantInt::get(C1->
getType(), C1V & C2V);
861 case Instruction::Or:
862 return ConstantInt::get(C1->
getType(), C1V | C2V);
863 case Instruction::Xor:
864 return ConstantInt::get(C1->
getType(), C1V ^ C2V);
865 case Instruction::Shl:
867 return ConstantInt::get(C1->
getType(), C1V.
shl(C2V));
869 case Instruction::LShr:
871 return ConstantInt::get(C1->
getType(), C1V.
lshr(C2V));
873 case Instruction::AShr:
875 return ConstantInt::get(C1->
getType(), C1V.
ashr(C2V));
885 const APFloat &C1V = CFP1->getValueAPF();
886 const APFloat &C2V = CFP2->getValueAPF();
891 case Instruction::FAdd:
893 return ConstantFP::get(C1->
getType(), C3V);
894 case Instruction::FSub:
896 return ConstantFP::get(C1->
getType(), C3V);
897 case Instruction::FMul:
899 return ConstantFP::get(C1->
getType(), C3V);
900 case Instruction::FDiv:
902 return ConstantFP::get(C1->
getType(), C3V);
903 case Instruction::FRem:
905 return ConstantFP::get(C1->
getType(), C3V);
930 for (
unsigned i = 0, e = FVTy->getNumElements(); i != e; ++i) {
931 Constant *ExtractIdx = ConstantInt::get(Ty, i);
939 Result.push_back(Res);
968 case Instruction::Add:
969 case Instruction::Sub:
971 case Instruction::Shl:
972 case Instruction::LShr:
973 case Instruction::AShr:
977 case Instruction::SDiv:
978 case Instruction::UDiv:
982 case Instruction::URem:
983 case Instruction::SRem:
998 auto isGlobalUnsafeForEquality = [](
const GlobalValue *GV) {
999 if (GV->isInterposable() || GV->hasGlobalUnnamedAddr())
1002 Type *Ty = GVar->getValueType();
1008 if (Ty->isEmptyTy())
1015 if (!isGlobalUnsafeForEquality(GV1) && !isGlobalUnsafeForEquality(GV2))
1028 "Cannot compare different types of values!");
1039 auto GetComplexity = [](
Constant *V) {
1048 if (GetComplexity(V1) < GetComplexity(V2)) {
1061 if (BA2->getFunction() != BA->getFunction())
1081 GV->getType()->getAddressSpace()))
1089 switch (CE1->getOpcode()) {
1090 case Instruction::GetElementPtr: {
1100 if (!GV->hasExternalWeakLinkage() && CE1GEP->
isInBounds())
1117 if (CE1Op0 != CE2Op0) {
1140 VT->getElementCount());
1165 if (isIntegerPredicate)
1186 switch (Predicate) {
1225 for (
unsigned I = 0, E = C1VTy->getElementCount().getKnownMinValue();
1262 switch (Predicate) {
1272 switch (Predicate) {
1282 switch (Predicate) {
1292 switch (Predicate) {
1335 return ConstantInt::get(ResultTy, Result);
1350 std::optional<ConstantRange>
InRange,
1352 if (Idxs.
empty())
return C;
1363 auto IsNoOp = [&]() {
1374 return GEPTy->
isVectorTy() && !
C->getType()->isVectorTy()
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements a class to represent arbitrary precision integral constant values and operations...
This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
static unsigned foldConstantCastPair(unsigned opc, ConstantExpr *Op, Type *DstTy)
This function determines which opcode to use to fold two constant cast expressions together.
static Constant * foldMaybeUndesirableCast(unsigned opc, Constant *V, Type *DestTy)
static ICmpInst::Predicate areGlobalsPotentiallyEqual(const GlobalValue *GV1, const GlobalValue *GV2)
static Constant * FoldBitCast(Constant *V, Type *DestTy)
static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2)
This function determines if there is anything we can decide about the two constants provided.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Module.h This file contains the declarations for the Module class.
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static bool InRange(int64_t Value, unsigned short Shift, int LBound, int HBound)
const SmallVectorImpl< MachineOperand > & Cond
This file defines the SmallVector class.
static std::optional< unsigned > getOpcode(ArrayRef< VPValue * > Values)
Returns the opcode of Values or ~0 if they do not all agree.
static constexpr roundingMode rmTowardZero
static constexpr roundingMode rmNearestTiesToEven
opStatus divide(const APFloat &RHS, roundingMode RM)
LLVM_ABI opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
opStatus subtract(const APFloat &RHS, roundingMode RM)
opStatus add(const APFloat &RHS, roundingMode RM)
opStatus convertFromAPInt(const APInt &Input, bool IsSigned, roundingMode RM)
opStatus multiply(const APFloat &RHS, roundingMode RM)
opStatus mod(const APFloat &RHS)
Class for arbitrary precision integers.
LLVM_ABI APInt udiv(const APInt &RHS) const
Unsigned division operation.
bool isMinSignedValue() const
Determine if this is the smallest signed value.
LLVM_ABI APInt urem(const APInt &RHS) const
Unsigned remainder operation.
unsigned getBitWidth() const
Return the number of bits in the APInt.
LLVM_ABI APInt sdiv(const APInt &RHS) const
Signed division function for APInt.
APInt ashr(unsigned ShiftAmt) const
Arithmetic right-shift function.
LLVM_ABI APInt srem(const APInt &RHS) const
Function for signed remainder operation.
APInt shl(unsigned shiftAmt) const
Left-shift function.
static APInt getLowBitsSet(unsigned numBits, unsigned loBitsSet)
Constructs an APInt value that has the bottom loBitsSet bits set.
static APInt getZero(unsigned numBits)
Get the '0' value for the specified bit-width.
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.
An arbitrary precision integer that knows its signedness.
static bool isSameValue(const APSInt &I1, const APSInt &I2)
Determine if two APSInts have the same value, zero- or sign-extending as needed.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
The address of a basic block.
static LLVM_ABI unsigned isEliminableCastPair(Instruction::CastOps firstOpcode, Instruction::CastOps secondOpcode, Type *SrcTy, Type *MidTy, Type *DstTy, const DataLayout *DL)
Determine how a pair of casts can be eliminated, if they can be at all.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ FCMP_TRUE
1 1 1 1 Always true (always folded)
@ ICMP_SLT
signed less than
@ ICMP_SLE
signed less or equal
@ ICMP_UGE
unsigned greater or equal
@ ICMP_UGT
unsigned greater than
@ ICMP_SGT
signed greater than
@ FCMP_ONE
0 1 1 0 True if ordered and operands are unequal
@ FCMP_UEQ
1 0 0 1 True if unordered or equal
@ ICMP_ULT
unsigned less than
@ ICMP_SGE
signed greater or equal
@ ICMP_ULE
unsigned less or equal
@ FCMP_FALSE
0 0 0 0 Always false (always folded)
Predicate getSwappedPredicate() const
For example, EQ->EQ, SLE->SGE, ULT->UGT, OEQ->OEQ, ULE->UGE, OLT->OGT, etc.
bool isTrueWhenEqual() const
This is just a convenience.
static LLVM_ABI bool isUnordered(Predicate predicate)
Determine if the predicate is an unordered operation.
static bool isIntPredicate(Predicate P)
static LLVM_ABI Constant * get(ArrayType *T, ArrayRef< Constant * > V)
Class for constant bytes.
A constant value that is initialized with an expression using other constant values.
static LLVM_ABI Constant * getExtractElement(Constant *Vec, Constant *Idx, Type *OnlyIfReducedTy=nullptr)
static LLVM_ABI bool isDesirableCastOp(unsigned Opcode)
Whether creating a constant expression for this cast is desirable.
static LLVM_ABI Constant * getBinOpAbsorber(unsigned Opcode, Type *Ty, bool AllowLHSConstant=false)
Return the absorbing element for the given binary operation, i.e.
static LLVM_ABI Constant * getCast(unsigned ops, Constant *C, Type *Ty, bool OnlyIfReduced=false)
Convenience function for getting a Cast operation.
static LLVM_ABI Constant * getNot(Constant *C)
static LLVM_ABI Constant * getXor(Constant *C1, Constant *C2)
static LLVM_ABI Constant * get(unsigned Opcode, Constant *C1, Constant *C2, unsigned Flags=0, Type *OnlyIfReducedTy=nullptr)
get - Return a binary or shift operator constant expression, folding if possible.
static LLVM_ABI bool isDesirableBinOp(unsigned Opcode)
Whether creating a constant expression for this binary operator is desirable.
static LLVM_ABI Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static LLVM_ABI Constant * getBinOpIdentity(unsigned Opcode, Type *Ty, bool AllowRHSConstant=false, bool NSZ=false)
Return the identity constant for a binary opcode.
ConstantFP - Floating Point Values [float, double].
static LLVM_ABI Constant * getNaN(Type *Ty, bool Negative=false, uint64_t Payload=0)
This is the shared class of boolean and integer constants.
static LLVM_ABI ConstantInt * getTrue(LLVMContext &Context)
static LLVM_ABI ConstantInt * getFalse(LLVMContext &Context)
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
bool uge(uint64_t Num) const
This function will return true iff this constant represents a value with active bits bigger than 64 b...
static LLVM_ABI Constant * get(StructType *T, ArrayRef< Constant * > V)
Constant Vector Declarations.
static LLVM_ABI Constant * getSplat(ElementCount EC, Constant *Elt)
Return a ConstantVector with the specified constant in each element.
static LLVM_ABI Constant * get(ArrayRef< Constant * > V)
This is an important base class in LLVM.
LLVM_ABI Constant * getSplatValue(bool AllowPoison=false) const
If all elements of the vector constant have the same value, return that value.
static LLVM_ABI Constant * getAllOnesValue(Type *Ty)
static LLVM_ABI Constant * getNullValue(Type *Ty)
Constructor to create a '0' constant of arbitrary type.
LLVM_ABI Constant * getAggregateElement(unsigned Elt) const
For aggregates (struct/array/vector) return the constant that corresponds to the specified element if...
LLVM_ABI bool isNullValue() const
Return true if this is the value that would be returned by getNullValue.
A parsed version of the target data layout string in and methods for querying it.
static constexpr ElementCount get(ScalarTy MinVal, bool Scalable)
static LLVM_ABI bool compare(const APFloat &LHS, const APFloat &RHS, FCmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
bool isInBounds() const
Test whether this is an inbounds GEP, as defined by LangRef.html.
bool hasAllZeroIndices() const
Return true if all of the indices of this GEP are zeros.
static Type * getGEPReturnType(Value *Ptr, ArrayRef< Value * > IdxList)
Returns the pointer type returned by the GEP instruction, which may be a vector of pointers.
Module * getParent()
Get the module that this global value is contained inside of...
static LLVM_ABI bool compare(const APInt &LHS, const APInt &RHS, ICmpInst::Predicate Pred)
Return result of LHS Pred RHS comparison.
static bool isEquality(Predicate P)
Return true if this predicate is either EQ or NE.
LLVM_ABI bool isAssociative() const LLVM_READONLY
Return true if the instruction is associative:
LLVM_ABI bool isCommutative() const LLVM_READONLY
Return true if the instruction is commutative:
static LLVM_ABI IntegerType * get(LLVMContext &C, unsigned NumBits)
This static method is the primary way of constructing an IntegerType.
A Module instance is used to store all the information related to an LLVM module.
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Class to represent struct types.
The instances of the Type class are immutable: once they are created, they are never changed.
bool isVectorTy() const
True if this is an instance of VectorType.
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
bool isIntOrIntVectorTy() const
Return true if this is an integer type or a vector of integer types.
bool isPointerTy() const
True if this is an instance of PointerType.
bool isPPC_FP128Ty() const
Return true if this is powerpc long double.
LLVM_ABI bool isFirstClassType() const
Return true if the type is "first class", meaning it is a valid type for a Value.
Type * getScalarType() const
If this is a vector type, return the element type, otherwise return 'this'.
bool isByteOrByteVectorTy() const
Return true if this is a byte type or a vector of byte types.
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
LLVM_ABI unsigned getScalarSizeInBits() const LLVM_READONLY
If this is a vector type, return the getPrimitiveSizeInBits value for the element type.
static LLVM_ABI IntegerType * getInt1Ty(LLVMContext &C)
bool isFloatingPointTy() const
Return true if this is one of the floating-point types.
bool isX86_AMXTy() const
Return true if this is X86 AMX.
bool isIntegerTy() const
True if this is an instance of IntegerType.
bool isFPOrFPVectorTy() const
Return true if this is a FP type or a vector of FP.
LLVM_ABI const fltSemantics & getFltSemantics() const
static LLVM_ABI UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
Value * getOperand(unsigned i) const
LLVM Value Representation.
Type * getType() const
All values are typed, get the type of this value.
LLVMContext & getContext() const
All values hold a context through their type.
LLVM_ABI Align getPointerAlignment(const DataLayout &DL) const
Returns an alignment of the pointer value.
Base class of all SIMD vector types.
static LLVM_ABI VectorType * get(Type *ElementType, ElementCount EC)
This static method is the primary way to construct an VectorType.
Type * getElementType() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ C
The default llvm calling convention, compatible with C.
match_combine_or< Ty... > m_CombineOr(const Ty &...Ps)
Combine pattern matchers matching any of Ps patterns.
ap_match< APInt > m_APInt(const APInt *&Res)
Match a ConstantInt or splatted ConstantVector, binding the specified pointer to the contained APInt.
bool match(Val *V, const Pattern &P)
cstfp_pred_ty< is_neg_zero_fp > m_NegZeroFP()
Match a floating-point negative zero.
auto m_Undef()
Match an arbitrary undef constant.
is_zero m_Zero()
Match any null constant or a vector with all elements equal to 0.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
LLVM_ABI Constant * ConstantFoldSelectInstruction(Constant *Cond, Constant *V1, Constant *V2)
Attempt to constant fold a select instruction with the specified operands.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI Constant * ConstantFoldCompareInstruction(CmpInst::Predicate Predicate, Constant *C1, Constant *C2)
LLVM_ABI Constant * ConstantFoldUnaryInstruction(unsigned Opcode, Constant *V)
LLVM_ABI Constant * ConstantFoldGetElementPtr(Type *Ty, Constant *C, std::optional< ConstantRange > InRange, ArrayRef< Value * > Idxs)
constexpr auto equal_to(T &&Arg)
Functor variant of std::equal_to that can be used as a UnaryPredicate in functional algorithms like a...
LLVM_ABI Constant * ConstantFoldExtractValueInstruction(Constant *Agg, ArrayRef< unsigned > Idxs)
Attempt to constant fold an extractvalue instruction with the specified operands and indices.
LLVM_ABI bool NullPointerIsDefined(const Function *F, unsigned AS=0)
Check whether null pointer dereferencing is considered undefined behavior for a given function or an ...
LLVM_ABI Constant * ConstantFoldInsertElementInstruction(Constant *Val, Constant *Elt, Constant *Idx)
Attempt to constant fold an insertelement instruction with the specified operands and indices.
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
constexpr int PoisonMaskElem
LLVM_ABI Constant * ConstantFoldExtractElementInstruction(Constant *Val, Constant *Idx)
Attempt to constant fold an extractelement instruction with the specified operands and indices.
DWARFExpression::Operation Op
ArrayRef(const T &OneElt) -> ArrayRef< T >
constexpr unsigned BitWidth
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
APFloat neg(APFloat X)
Returns the negated value of the argument.
LLVM_ABI Constant * ConstantFoldCastInstruction(unsigned opcode, Constant *V, Type *DestTy)
LLVM_ABI Constant * ConstantFoldInsertValueInstruction(Constant *Agg, Constant *Val, ArrayRef< unsigned > Idxs)
Attempt to constant fold an insertvalue instruction with the specified operands and indices.
unsigned Log2(Align A)
Returns the log2 of the alignment.
LLVM_ABI Constant * ConstantFoldShuffleVectorInstruction(Constant *V1, Constant *V2, ArrayRef< int > Mask)
Attempt to constant fold a shufflevector instruction with the specified operands and mask.
LLVM_ABI Constant * ConstantFoldBinaryInstruction(unsigned Opcode, Constant *V1, Constant *V2)
This struct is a compact representation of a valid (non-zero power of two) alignment.