class ConstantExpr

Declaration

class ConstantExpr : public Constant { /* full declaration omitted */ };

Description

A constant value that is initialized with an expression using other constant values. This class uses the standard Instruction opcodes to define the various constant expressions. The Opcode field for the ConstantExpr class is maintained in the Value::SubclassData field.

Declared at: llvm/include/llvm/IR/Constants.h:889

Inherits from: Constant

Member Variables

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 29
public static MaximumAlignment = 1U << MaxAlignmentExponent

Method Overview

  • protected ConstantExpr(llvm::Type * ty, unsigned int Opcode, llvm::Use * Ops, unsigned int NumOps)
  • public static bool classof(const llvm::Value * V)
  • public static llvm::Constant * get(unsigned int Opcode, llvm::Constant * C1, llvm::Constant * C2, unsigned int Flags = 0, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * get(unsigned int Opcode, llvm::Constant * C1, unsigned int Flags = 0, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getAShr(llvm::Constant * C1, llvm::Constant * C2, bool isExact = false)
  • public static llvm::Constant * getAdd(llvm::Constant * C1, llvm::Constant * C2, bool HasNUW = false, bool HasNSW = false)
  • public static llvm::Constant * getAddrSpaceCast(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getAlignOf(llvm::Type * Ty)
  • public static llvm::Constant * getAnd(llvm::Constant * C1, llvm::Constant * C2)
  • public llvm::Instruction * getAsInstruction() const
  • public static llvm::Constant * getBinOpAbsorber(unsigned int Opcode, llvm::Type * Ty)
  • public static llvm::Constant * getBinOpIdentity(unsigned int Opcode, llvm::Type * Ty, bool AllowRHSConstant = false)
  • public static llvm::Constant * getBitCast(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getCast(unsigned int ops, llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getCompare(unsigned short pred, llvm::Constant * C1, llvm::Constant * C2, bool OnlyIfReduced = false)
  • public static llvm::Constant * getExactAShr(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getExactLShr(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getExactSDiv(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getExactUDiv(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getExtractElement(llvm::Constant * Vec, llvm::Constant * Idx, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getExtractValue(llvm::Constant * Agg, ArrayRef<unsigned int> Idxs, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getFAdd(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getFCmp(unsigned short pred, llvm::Constant * LHS, llvm::Constant * RHS, bool OnlyIfReduced = false)
  • public static llvm::Constant * getFDiv(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getFMul(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getFNeg(llvm::Constant * C)
  • public static llvm::Constant * getFPCast(llvm::Constant * C, llvm::Type * Ty)
  • public static llvm::Constant * getFPExtend(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getFPToSI(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getFPToUI(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getFPTrunc(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getFRem(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getFSub(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getGetElementPtr(llvm::Type * Ty, llvm::Constant * C, llvm::Constant * Idx, bool InBounds = false, Optional<unsigned int> InRangeIndex = None, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getGetElementPtr(llvm::Type * Ty, llvm::Constant * C, ArrayRef<llvm::Value *> IdxList, bool InBounds = false, Optional<unsigned int> InRangeIndex = None, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getGetElementPtr(llvm::Type * Ty, llvm::Constant * C, ArrayRef<llvm::Constant *> IdxList, bool InBounds = false, Optional<unsigned int> InRangeIndex = None, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getICmp(unsigned short pred, llvm::Constant * LHS, llvm::Constant * RHS, bool OnlyIfReduced = false)
  • public static llvm::Constant * getInBoundsGetElementPtr(llvm::Type * Ty, llvm::Constant * C, ArrayRef<llvm::Constant *> IdxList)
  • public static llvm::Constant * getInBoundsGetElementPtr(llvm::Type * Ty, llvm::Constant * C, llvm::Constant * Idx)
  • public static llvm::Constant * getInBoundsGetElementPtr(llvm::Type * Ty, llvm::Constant * C, ArrayRef<llvm::Value *> IdxList)
  • public ArrayRef<unsigned int> getIndices() const
  • public static llvm::Constant * getInsertElement(llvm::Constant * Vec, llvm::Constant * Elt, llvm::Constant * Idx, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getInsertValue(llvm::Constant * Agg, llvm::Constant * Val, ArrayRef<unsigned int> Idxs, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getIntToPtr(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getIntegerCast(llvm::Constant * C, llvm::Type * Ty, bool isSigned)
  • public static llvm::Constant * getLShr(llvm::Constant * C1, llvm::Constant * C2, bool isExact = false)
  • public static llvm::Constant * getMul(llvm::Constant * C1, llvm::Constant * C2, bool HasNUW = false, bool HasNSW = false)
  • public static llvm::Constant * getNSWAdd(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNSWMul(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNSWNeg(llvm::Constant * C)
  • public static llvm::Constant * getNSWShl(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNSWSub(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNUWAdd(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNUWMul(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNUWNeg(llvm::Constant * C)
  • public static llvm::Constant * getNUWShl(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNUWSub(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getNeg(llvm::Constant * C, bool HasNUW = false, bool HasNSW = false)
  • public static llvm::Constant * getNot(llvm::Constant * C)
  • public static llvm::Constant * getOffsetOf(llvm::StructType * STy, unsigned int FieldNo)
  • public static llvm::Constant * getOffsetOf(llvm::Type * Ty, llvm::Constant * FieldNo)
  • public unsigned int getOpcode() const
  • public const char * getOpcodeName() const
  • public static llvm::Constant * getOr(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getPointerBitCastOrAddrSpaceCast(llvm::Constant * C, llvm::Type * Ty)
  • public static llvm::Constant * getPointerCast(llvm::Constant * C, llvm::Type * Ty)
  • public unsigned int getPredicate() const
  • public static llvm::Constant * getPtrToInt(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getSDiv(llvm::Constant * C1, llvm::Constant * C2, bool isExact = false)
  • public static llvm::Constant * getSExt(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getSExtOrBitCast(llvm::Constant * C, llvm::Type * Ty)
  • public static llvm::Constant * getSIToFP(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getSRem(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getSelect(llvm::Constant * C, llvm::Constant * V1, llvm::Constant * V2, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getShl(llvm::Constant * C1, llvm::Constant * C2, bool HasNUW = false, bool HasNSW = false)
  • public static llvm::Constant * getShuffleVector(llvm::Constant * V1, llvm::Constant * V2, llvm::Constant * Mask, llvm::Type * OnlyIfReducedTy = nullptr)
  • public static llvm::Constant * getSizeOf(llvm::Type * Ty)
  • public static llvm::Constant * getSub(llvm::Constant * C1, llvm::Constant * C2, bool HasNUW = false, bool HasNSW = false)
  • public static llvm::Constant * getTrunc(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getTruncOrBitCast(llvm::Constant * C, llvm::Type * Ty)
  • public static llvm::Constant * getUDiv(llvm::Constant * C1, llvm::Constant * C2, bool isExact = false)
  • public static llvm::Constant * getUIToFP(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getURem(llvm::Constant * C1, llvm::Constant * C2)
  • public llvm::Constant * getWithOperandReplaced(unsigned int OpNo, llvm::Constant * Op) const
  • public llvm::Constant * getWithOperands(ArrayRef<llvm::Constant *> Ops) const
  • public llvm::Constant * getWithOperands(ArrayRef<llvm::Constant *> Ops, llvm::Type * Ty, bool OnlyIfReduced = false, llvm::Type * SrcTy = nullptr) const
  • public static llvm::Constant * getXor(llvm::Constant * C1, llvm::Constant * C2)
  • public static llvm::Constant * getZExt(llvm::Constant * C, llvm::Type * Ty, bool OnlyIfReduced = false)
  • public static llvm::Constant * getZExtOrBitCast(llvm::Constant * C, llvm::Type * Ty)
  • public bool hasIndices() const
  • public bool isCast() const
  • public bool isCompare() const
  • public bool isGEPWithNoNotionalOverIndexing() const

Inherited from Constant:

Inherited from User:

Inherited from Value:

Methods

ConstantExpr(llvm::Type* ty,
             unsigned int Opcode,
             llvm::Use* Ops,
             unsigned int NumOps)

Declared at: llvm/include/llvm/IR/Constants.h:897

Parameters

llvm::Type* ty
unsigned int Opcode
llvm::Use* Ops
unsigned int NumOps

static bool classof(const llvm::Value* V)

Description

Methods for support type inquiry through isa, cast, and dyn_cast:

Declared at: llvm/include/llvm/IR/Constants.h:1257

Parameters

const llvm::Value* V

static llvm::Constant* get(
    unsigned int Opcode,
    llvm::Constant* C1,
    llvm::Constant* C2,
    unsigned int Flags = 0,
    llvm::Type* OnlyIfReducedTy = nullptr)

Description

get - Return a binary or shift operator constant expression, folding if possible.

Declared at: llvm/include/llvm/IR/Constants.h:1132

Parameters

unsigned int Opcode
llvm::Constant* C1
llvm::Constant* C2
unsigned int Flags = 0
llvm::Type* OnlyIfReducedTy = nullptr
see \a getWithOperands() docs.

static llvm::Constant* get(
    unsigned int Opcode,
    llvm::Constant* C1,
    unsigned int Flags = 0,
    llvm::Type* OnlyIfReducedTy = nullptr)

Description

get - Return a unary operator constant expression, folding if possible.

Declared at: llvm/include/llvm/IR/Constants.h:1125

Parameters

unsigned int Opcode
llvm::Constant* C1
unsigned int Flags = 0
llvm::Type* OnlyIfReducedTy = nullptr
see \a getWithOperands() docs.

static llvm::Constant* getAShr(
    llvm::Constant* C1,
    llvm::Constant* C2,
    bool isExact = false)

Declared at: llvm/include/llvm/IR/Constants.h:953

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool isExact = false

static llvm::Constant* getAdd(llvm::Constant* C1,
                              llvm::Constant* C2,
                              bool HasNUW = false,
                              bool HasNSW = false)

Declared at: llvm/include/llvm/IR/Constants.h:932

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool HasNUW = false
bool HasNSW = false

static llvm::Constant* getAddrSpaceCast(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:971

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getAlignOf(llvm::Type* Ty)

Description

getAlignOf constant expr - computes the alignment of a type in a target independent way (Note: the return type is an i64).

Declared at: llvm/include/llvm/IR/Constants.h:911

Parameters

llvm::Type* Ty

static llvm::Constant* getAnd(llvm::Constant* C1,
                              llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:947

Parameters

llvm::Constant* C1
llvm::Constant* C2

llvm::Instruction* getAsInstruction() const

Description

Returns an Instruction which implements the same operation as this ConstantExpr. The instruction is not linked to any basic block. A better approach to this could be to have a constructor for Instruction which would take a ConstantExpr parameter, but that would have spread implementation details of ConstantExpr outside of Constants.cpp, which would make it harder to remove ConstantExprs altogether.

Declared at: llvm/include/llvm/IR/Constants.h:1254

static llvm::Constant* getBinOpAbsorber(
    unsigned int Opcode,
    llvm::Type* Ty)

Description

Return the absorbing element for the given binary operation, i.e. a constant C such that X op C = C and C op X = C for every X. For example, this returns zero for integer multiplication. It returns null if the operator doesn't have an absorbing element.

Declared at: llvm/include/llvm/IR/Constants.h:1039

Parameters

unsigned int Opcode
llvm::Type* Ty

static llvm::Constant* getBinOpIdentity(
    unsigned int Opcode,
    llvm::Type* Ty,
    bool AllowRHSConstant = false)

Description

Return the identity constant for a binary opcode. The identity constant C is defined as X op C = X and C op X = X for every X when the binary operation is commutative. If the binop is not commutative, callers can acquire the operand 1 identity constant by setting AllowRHSConstant to true. For example, any shift has a zero identity constant for operand 1: X shift 0 = X. Return nullptr if the operator does not have an identity constant.

Declared at: llvm/include/llvm/IR/Constants.h:1032

Parameters

unsigned int Opcode
llvm::Type* Ty
bool AllowRHSConstant = false

static llvm::Constant* getBitCast(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:969

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getCast(
    unsigned int ops,
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Description

Convenience function for getting a Cast operation.

Declared at: llvm/include/llvm/IR/Constants.h:1050

Parameters

unsigned int ops
The opcode for the conversion
llvm::Constant* C
The constant to be converted
llvm::Type* Ty
The type to which the constant is converted
bool OnlyIfReduced = false
see \a getWithOperands() docs.

static llvm::Constant* getCompare(
    unsigned short pred,
    llvm::Constant* C1,
    llvm::Constant* C2,
    bool OnlyIfReduced = false)

Description

Return an ICmp or FCmp comparison operator constant expression.

Declared at: llvm/include/llvm/IR/Constants.h:1138

Parameters

unsigned short pred
llvm::Constant* C1
llvm::Constant* C2
bool OnlyIfReduced = false
see \a getWithOperands() docs.

static llvm::Constant* getExactAShr(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:1017

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getExactLShr(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:1021

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getExactSDiv(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:1009

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getExactUDiv(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:1013

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getExtractElement(
    llvm::Constant* Vec,
    llvm::Constant* Idx,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1197

Parameters

llvm::Constant* Vec
llvm::Constant* Idx
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getExtractValue(
    llvm::Constant* Agg,
    ArrayRef<unsigned int> Idxs,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1203

Parameters

llvm::Constant* Agg
ArrayRef<unsigned int> Idxs
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getFAdd(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:934

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getFCmp(
    unsigned short pred,
    llvm::Constant* LHS,
    llvm::Constant* RHS,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:1146

Parameters

unsigned short pred
llvm::Constant* LHS
llvm::Constant* RHS
bool OnlyIfReduced = false

static llvm::Constant* getFDiv(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:943

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getFMul(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:940

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getFNeg(llvm::Constant* C)

Declared at: llvm/include/llvm/IR/Constants.h:930

Parameters

llvm::Constant* C

static llvm::Constant* getFPCast(
    llvm::Constant* C,
    llvm::Type* Ty)

Description

Create a FPExt, Bitcast or FPTrunc for fp -> fp casts

Declared at: llvm/include/llvm/IR/Constants.h:1093

Parameters

llvm::Constant* C
llvm::Type* Ty

static llvm::Constant* getFPExtend(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:959

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getFPToSI(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:964

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getFPToUI(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:963

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getFPTrunc(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:957

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getFRem(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:946

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getFSub(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:937

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getGetElementPtr(
    llvm::Type* Ty,
    llvm::Constant* C,
    llvm::Constant* Idx,
    bool InBounds = false,
    Optional<unsigned int> InRangeIndex = None,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1163

Parameters

llvm::Type* Ty
llvm::Constant* C
llvm::Constant* Idx
bool InBounds = false
Optional<unsigned int> InRangeIndex = None
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getGetElementPtr(
    llvm::Type* Ty,
    llvm::Constant* C,
    ArrayRef<llvm::Value*> IdxList,
    bool InBounds = false,
    Optional<unsigned int> InRangeIndex = None,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1173

Parameters

llvm::Type* Ty
llvm::Constant* C
ArrayRef<llvm::Value*> IdxList
bool InBounds = false
Optional<unsigned int> InRangeIndex = None
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getGetElementPtr(
    llvm::Type* Ty,
    llvm::Constant* C,
    ArrayRef<llvm::Constant*> IdxList,
    bool InBounds = false,
    Optional<unsigned int> InRangeIndex = None,
    llvm::Type* OnlyIfReducedTy = nullptr)

Description

Getelementptr form. Value* is only accepted for convenience; all elements must be Constants.

Declared at: llvm/include/llvm/IR/Constants.h:1154

Parameters

llvm::Type* Ty
llvm::Constant* C
ArrayRef<llvm::Constant*> IdxList
bool InBounds = false
Optional<unsigned int> InRangeIndex = None
the inrange index if present or None.
llvm::Type* OnlyIfReducedTy = nullptr
see \a getWithOperands() docs.

static llvm::Constant* getICmp(
    unsigned short pred,
    llvm::Constant* LHS,
    llvm::Constant* RHS,
    bool OnlyIfReduced = false)

Description

get* - Return some common constants without having to specify the full Instruction::OPCODE identifier.

Declared at: llvm/include/llvm/IR/Constants.h:1144

Parameters

unsigned short pred
llvm::Constant* LHS
llvm::Constant* RHS
bool OnlyIfReduced = false

static llvm::Constant* getInBoundsGetElementPtr(
    llvm::Type* Ty,
    llvm::Constant* C,
    ArrayRef<llvm::Constant*> IdxList)

Description

Create an "inbounds" getelementptr. See the documentation for the "inbounds" flag in LangRef.html for details.

Declared at: llvm/include/llvm/IR/Constants.h:1181

Parameters

llvm::Type* Ty
llvm::Constant* C
ArrayRef<llvm::Constant*> IdxList

static llvm::Constant* getInBoundsGetElementPtr(
    llvm::Type* Ty,
    llvm::Constant* C,
    llvm::Constant* Idx)

Declared at: llvm/include/llvm/IR/Constants.h:1185

Parameters

llvm::Type* Ty
llvm::Constant* C
llvm::Constant* Idx

static llvm::Constant* getInBoundsGetElementPtr(
    llvm::Type* Ty,
    llvm::Constant* C,
    ArrayRef<llvm::Value*> IdxList)

Declared at: llvm/include/llvm/IR/Constants.h:1192

Parameters

llvm::Type* Ty
llvm::Constant* C
ArrayRef<llvm::Value*> IdxList

ArrayRef<unsigned int> getIndices() const

Description

Assert that this is an insertvalue or exactvalue expression and return the list of indices.

Declared at: llvm/include/llvm/IR/Constants.h:1218

static llvm::Constant* getInsertElement(
    llvm::Constant* Vec,
    llvm::Constant* Elt,
    llvm::Constant* Idx,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1199

Parameters

llvm::Constant* Vec
llvm::Constant* Elt
llvm::Constant* Idx
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getInsertValue(
    llvm::Constant* Agg,
    llvm::Constant* Val,
    ArrayRef<unsigned int> Idxs,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1205

Parameters

llvm::Constant* Agg
llvm::Constant* Val
ArrayRef<unsigned int> Idxs
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getIntToPtr(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:967

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getIntegerCast(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool isSigned)

Description

Create a ZExt, Bitcast or Trunc for integer -> integer casts

Declared at: llvm/include/llvm/IR/Constants.h:1086

Parameters

llvm::Constant* C
llvm::Type* Ty
bool isSigned

static llvm::Constant* getLShr(
    llvm::Constant* C1,
    llvm::Constant* C2,
    bool isExact = false)

Declared at: llvm/include/llvm/IR/Constants.h:952

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool isExact = false

static llvm::Constant* getMul(llvm::Constant* C1,
                              llvm::Constant* C2,
                              bool HasNUW = false,
                              bool HasNSW = false)

Declared at: llvm/include/llvm/IR/Constants.h:938

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool HasNUW = false
bool HasNSW = false

static llvm::Constant* getNSWAdd(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:977

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNSWMul(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:993

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNSWNeg(
    llvm::Constant* C)

Declared at: llvm/include/llvm/IR/Constants.h:974

Parameters

llvm::Constant* C

static llvm::Constant* getNSWShl(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:1001

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNSWSub(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:985

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNUWAdd(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:981

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNUWMul(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:997

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNUWNeg(
    llvm::Constant* C)

Declared at: llvm/include/llvm/IR/Constants.h:975

Parameters

llvm::Constant* C

static llvm::Constant* getNUWShl(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:1005

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNUWSub(
    llvm::Constant* C1,
    llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:989

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getNeg(llvm::Constant* C,
                              bool HasNUW = false,
                              bool HasNSW = false)

Declared at: llvm/include/llvm/IR/Constants.h:929

Parameters

llvm::Constant* C
bool HasNUW = false
bool HasNSW = false

static llvm::Constant* getNot(llvm::Constant* C)

Declared at: llvm/include/llvm/IR/Constants.h:931

Parameters

llvm::Constant* C

static llvm::Constant* getOffsetOf(
    llvm::StructType* STy,
    unsigned int FieldNo)

Description

getOffsetOf constant expr - computes the offset of a struct field in a target independent way (Note: the return type is an i64).

Declared at: llvm/include/llvm/IR/Constants.h:922

Parameters

llvm::StructType* STy
unsigned int FieldNo

static llvm::Constant* getOffsetOf(
    llvm::Type* Ty,
    llvm::Constant* FieldNo)

Description

getOffsetOf constant expr - This is a generalized form of getOffsetOf, which supports any aggregate type, and any Constant index.

Declared at: llvm/include/llvm/IR/Constants.h:927

Parameters

llvm::Type* Ty
llvm::Constant* FieldNo

unsigned int getOpcode() const

Description

Return the opcode at the root of this constant expression

Declared at: llvm/include/llvm/IR/Constants.h:1210

const char* getOpcodeName() const

Description

Return a string representation for an opcode.

Declared at: llvm/include/llvm/IR/Constants.h:1221

static llvm::Constant* getOr(llvm::Constant* C1,
                             llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:948

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant*
getPointerBitCastOrAddrSpaceCast(
    llvm::Constant* C,
    llvm::Type* Ty)

Description

Create a BitCast or AddrSpaceCast for a pointer type depending on the address space.

Declared at: llvm/include/llvm/IR/Constants.h:1080

Parameters

llvm::Constant* C
llvm::Type* Ty

static llvm::Constant* getPointerCast(
    llvm::Constant* C,
    llvm::Type* Ty)

Description

Create a BitCast, AddrSpaceCast, or a PtrToInt cast constant expression.

Declared at: llvm/include/llvm/IR/Constants.h:1073

Parameters

llvm::Constant* C
llvm::Type* Ty

unsigned int getPredicate() const

Description

Return the ICMP or FCMP predicate value. Assert if this is not an ICMP or FCMP constant expression.

Declared at: llvm/include/llvm/IR/Constants.h:1214

static llvm::Constant* getPtrToInt(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:965

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getSDiv(
    llvm::Constant* C1,
    llvm::Constant* C2,
    bool isExact = false)

Declared at: llvm/include/llvm/IR/Constants.h:942

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool isExact = false

static llvm::Constant* getSExt(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:955

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getSExtOrBitCast(
    llvm::Constant* C,
    llvm::Type* Ty)

Declared at: llvm/include/llvm/IR/Constants.h:1060

Parameters

llvm::Constant* C
llvm::Type* Ty

static llvm::Constant* getSIToFP(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:962

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getSRem(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:945

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getSelect(
    llvm::Constant* C,
    llvm::Constant* V1,
    llvm::Constant* V2,
    llvm::Type* OnlyIfReducedTy = nullptr)

Description

Select constant expr

Declared at: llvm/include/llvm/IR/Constants.h:1118

Parameters

llvm::Constant* C
llvm::Constant* V1
llvm::Constant* V2
llvm::Type* OnlyIfReducedTy = nullptr
see \a getWithOperands() docs.

static llvm::Constant* getShl(llvm::Constant* C1,
                              llvm::Constant* C2,
                              bool HasNUW = false,
                              bool HasNSW = false)

Declared at: llvm/include/llvm/IR/Constants.h:950

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool HasNUW = false
bool HasNSW = false

static llvm::Constant* getShuffleVector(
    llvm::Constant* V1,
    llvm::Constant* V2,
    llvm::Constant* Mask,
    llvm::Type* OnlyIfReducedTy = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:1201

Parameters

llvm::Constant* V1
llvm::Constant* V2
llvm::Constant* Mask
llvm::Type* OnlyIfReducedTy = nullptr

static llvm::Constant* getSizeOf(llvm::Type* Ty)

Description

getSizeOf constant expr - computes the (alloc) size of a type (in address-units, not bits) in a target independent way (Note: the return type is an i64).

Declared at: llvm/include/llvm/IR/Constants.h:917

Parameters

llvm::Type* Ty

static llvm::Constant* getSub(llvm::Constant* C1,
                              llvm::Constant* C2,
                              bool HasNUW = false,
                              bool HasNSW = false)

Declared at: llvm/include/llvm/IR/Constants.h:935

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool HasNUW = false
bool HasNSW = false

static llvm::Constant* getTrunc(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:954

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getTruncOrBitCast(
    llvm::Constant* C,
    llvm::Type* Ty)

Declared at: llvm/include/llvm/IR/Constants.h:1066

Parameters

llvm::Constant* C
llvm::Type* Ty

static llvm::Constant* getUDiv(
    llvm::Constant* C1,
    llvm::Constant* C2,
    bool isExact = false)

Declared at: llvm/include/llvm/IR/Constants.h:941

Parameters

llvm::Constant* C1
llvm::Constant* C2
bool isExact = false

static llvm::Constant* getUIToFP(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:961

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getURem(llvm::Constant* C1,
                               llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:944

Parameters

llvm::Constant* C1
llvm::Constant* C2

llvm::Constant* getWithOperandReplaced(
    unsigned int OpNo,
    llvm::Constant* Op) const

Description

Return a constant expression identical to this one, but with the specified operand set to the specified value.

Declared at: llvm/include/llvm/IR/Constants.h:1225

Parameters

unsigned int OpNo
llvm::Constant* Op

llvm::Constant* getWithOperands(
    ArrayRef<llvm::Constant*> Ops) const

Description

This returns the current constant expression with the operands replaced with the specified values. The specified array must have the same number of operands as our current one.

Declared at: llvm/include/llvm/IR/Constants.h:1230

Parameters

ArrayRef<llvm::Constant*> Ops

llvm::Constant* getWithOperands(
    ArrayRef<llvm::Constant*> Ops,
    llvm::Type* Ty,
    bool OnlyIfReduced = false,
    llvm::Type* SrcTy = nullptr) const

Description

Get the current expression with the operands replaced. Return the current constant expression with the operands replaced with \c Ops and the type with \c Ty. The new operands must have the same number as the current ones. If \c OnlyIfReduced is \c true, nullptr will be returned unless something gets constant-folded, the type changes, or the expression is otherwise canonicalized. This parameter should almost always be \c false.

Declared at: llvm/include/llvm/IR/Constants.h:1243

Parameters

ArrayRef<llvm::Constant*> Ops
llvm::Type* Ty
bool OnlyIfReduced = false
llvm::Type* SrcTy = nullptr

static llvm::Constant* getXor(llvm::Constant* C1,
                              llvm::Constant* C2)

Declared at: llvm/include/llvm/IR/Constants.h:949

Parameters

llvm::Constant* C1
llvm::Constant* C2

static llvm::Constant* getZExt(
    llvm::Constant* C,
    llvm::Type* Ty,
    bool OnlyIfReduced = false)

Declared at: llvm/include/llvm/IR/Constants.h:956

Parameters

llvm::Constant* C
llvm::Type* Ty
bool OnlyIfReduced = false

static llvm::Constant* getZExtOrBitCast(
    llvm::Constant* C,
    llvm::Type* Ty)

Declared at: llvm/include/llvm/IR/Constants.h:1054

Parameters

llvm::Constant* C
llvm::Type* Ty

bool hasIndices() const

Description

Return true if this is an insertvalue or extractvalue expression, and the getIndices() method may be used.

Declared at: llvm/include/llvm/IR/Constants.h:1106

bool isCast() const

Description

Return true if this is a convert constant expression

Declared at: llvm/include/llvm/IR/Constants.h:1099

bool isCompare() const

Description

Return true if this is a compare constant expression

Declared at: llvm/include/llvm/IR/Constants.h:1102

bool isGEPWithNoNotionalOverIndexing() const

Description

Return true if this is a getelementptr expression and all the index operands are compile-time known integers within the corresponding notional static array extents. Note that this is not equivalant to, a subset of, or a superset of the "inbounds" property.

Declared at: llvm/include/llvm/IR/Constants.h:1113