class CastInst
Declaration
class CastInst : public UnaryInstruction { /* full declaration omitted */ };
Declared at: llvm/include/llvm/IR/InstrTypes.h:439
Inherits from: UnaryInstruction
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 CastInst(llvm::Type * Ty, unsigned int iType, llvm::Value * S, const llvm::Twine & NameStr, llvm::BasicBlock * InsertAtEnd)
- protected CastInst(llvm::Type * Ty, unsigned int iType, llvm::Value * S, const llvm::Twine & NameStr = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * Create(Instruction::CastOps, llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * Create(Instruction::CastOps, llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreateBitOrPointerCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateFPCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreateFPCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateIntegerCast(llvm::Value * S, llvm::Type * Ty, bool isSigned, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateIntegerCast(llvm::Value * S, llvm::Type * Ty, bool isSigned, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreatePointerBitCastOrAddrSpaceCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreatePointerBitCastOrAddrSpaceCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreatePointerCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreatePointerCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateSExtOrBitCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreateSExtOrBitCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateTruncOrBitCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static llvm::CastInst * CreateTruncOrBitCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateZExtOrBitCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
- public static llvm::CastInst * CreateZExtOrBitCast(llvm::Value * S, llvm::Type * Ty, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
- public static bool castIsValid(Instruction::CastOps op, llvm::Value * S, llvm::Type * DstTy)
- public static bool classof(const llvm::Value * V)
- public static bool classof(const llvm::Instruction * I)
- public static Instruction::CastOps getCastOpcode(const llvm::Value * Val, bool SrcIsSigned, llvm::Type * Ty, bool DstIsSigned)
- public llvm::Type * getDestTy() const
- public Instruction::CastOps getOpcode() const
- public llvm::Type * getSrcTy() const
- public static bool isBitCastable(llvm::Type * SrcTy, llvm::Type * DestTy)
- public static bool isBitOrNoopPointerCastable(llvm::Type * SrcTy, llvm::Type * DestTy, const llvm::DataLayout & DL)
- public static bool isCastable(llvm::Type * SrcTy, llvm::Type * DestTy)
- public static unsigned int isEliminableCastPair(Instruction::CastOps firstOpcode, Instruction::CastOps secondOpcode, llvm::Type * SrcTy, llvm::Type * MidTy, llvm::Type * DstTy, llvm::Type * SrcIntPtrTy, llvm::Type * MidIntPtrTy, llvm::Type * DstIntPtrTy)
- public bool isIntegerCast() const
- public bool isLosslessCast() const
- public static bool isNoopCast(Instruction::CastOps Opcode, llvm::Type * SrcTy, llvm::Type * DstTy, const llvm::DataLayout & DL)
- public bool isNoopCast(const llvm::DataLayout & DL) const
Inherited from UnaryInstruction:
Inherited from Instruction:
- public andIRFlags
- public applyMergedLocation
- public classof
- public clone
- public copyFastMathFlags
- public copyFastMathFlags
- public copyIRFlags
- public copyMetadata
- public dropPoisonGeneratingFlags
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public dropUnknownNonDebugMetadata
- public eraseFromParent
- public extractProfMetadata
- public extractProfTotalWeight
- public getAAMetadata
- public getAllMetadata
- public getAllMetadataOtherThanDebugLoc
- public getDebugLoc
- public getFastMathFlags
- public getFunction
- public getFunction
- public getMetadata
- public getMetadata
- public getModule
- public getModule
- public getNextNonDebugInstruction
- public getNextNonDebugInstruction
- public getNumSuccessors
- public getOpcode
- public getOpcodeName
- public getOpcodeName
- public getParent
- public getParent
- public getPrevNonDebugInstruction
- public getPrevNonDebugInstruction
- protected getSubclassDataFromInstruction
- public getSuccessor
- public hasAllowContract
- public hasAllowReassoc
- public hasAllowReciprocal
- public hasApproxFunc
- public hasAtomicLoad
- public hasAtomicStore
- public hasMetadata
- public hasMetadata
- public hasMetadata
- public hasMetadataOtherThanDebugLoc
- public hasNoInfs
- public hasNoNaNs
- public hasNoSignedWrap
- public hasNoSignedZeros
- public hasNoUnsignedWrap
- public insertAfter
- public insertBefore
- public isArithmeticShift
- public isAssociative
- public isAssociative
- public isAtomic
- public isBinaryOp
- public isBinaryOp
- public isBitwiseLogicOp
- public isBitwiseLogicOp
- public isCast
- public isCast
- public isCommutative
- public isCommutative
- public isEHPad
- public isExact
- public isExceptionalTerminator
- public isExceptionalTerminator
- public isFast
- public isFenceLike
- public isFuncletPad
- public isFuncletPad
- public isIdempotent
- public isIdempotent
- public isIdenticalTo
- public isIdenticalToWhenDefined
- public isIndirectTerminator
- public isIndirectTerminator
- public isIntDivRem
- public isIntDivRem
- public isLifetimeStartOrEnd
- public isLogicalShift
- public isNilpotent
- public isNilpotent
- public isSafeToRemove
- public isSameOperationAs
- public isShift
- public isShift
- public isTerminator
- public isTerminator
- public isUnaryOp
- public isUnaryOp
- public isUsedOutsideOfBlock
- public mayHaveSideEffects
- public mayReadFromMemory
- public mayReadOrWriteMemory
- public mayThrow
- public mayWriteToMemory
- public moveAfter
- public moveBefore
- public moveBefore
- public removeFromParent
- public replaceSuccessorWith
- public setAAMetadata
- public setDebugLoc
- public setFast
- public setFastMathFlags
- public setHasAllowReassoc
- public setHasAllowReciprocal
- public setHasApproxFunc
- public setHasNoInfs
- public setHasNoNaNs
- public setHasNoSignedWrap
- public setHasNoSignedZeros
- public setHasNoUnsignedWrap
- protected setInstructionSubclassData
- public setIsExact
- public setMetadata
- public setMetadata
- public setProfWeight
- public setSuccessor
- public swapProfMetadata
- public user_back
- public user_back
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public clearSubclassOptionalData
- public deleteValue
- public dump
- public getContext
- public getName
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- protected getSubclassDataFromValue
- public getType
- public getValueID
- public getValueName
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶CastInst(llvm::Type* Ty,
unsigned int iType,
llvm::Value* S,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
CastInst(llvm::Type* Ty,
unsigned int iType,
llvm::Value* S,
const llvm::Twine& NameStr,
llvm::BasicBlock* InsertAtEnd)
Description
Constructor with insert-at-end-of-block semantics for subclasses
Declared at: llvm/include/llvm/IR/InstrTypes.h:448
Parameters
- llvm::Type* Ty
- unsigned int iType
- llvm::Value* S
- const llvm::Twine& NameStr
- llvm::BasicBlock* InsertAtEnd
¶CastInst(
llvm::Type* Ty,
unsigned int iType,
llvm::Value* S,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
CastInst(
llvm::Type* Ty,
unsigned int iType,
llvm::Value* S,
const llvm::Twine& NameStr = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Constructor with insert-before-instruction semantics for subclasses
Declared at: llvm/include/llvm/IR/InstrTypes.h:442
Parameters
- llvm::Type* Ty
- unsigned int iType
- llvm::Value* S
- const llvm::Twine& NameStr = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* Create(
Instruction::CastOps,
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* Create(
Instruction::CastOps,
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's constructor. The opcode must be in the CastOps category (Instruction::isCast(opcode) returns true). This constructor has insert-before-instruction semantics to automatically insert the new CastInst before InsertBefore (if it is non-null). Construct any of the CastInst subclasses
Declared at: llvm/include/llvm/IR/InstrTypes.h:461
Parameters
- Instruction::CastOps
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* Create(
Instruction::CastOps,
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* Create(
Instruction::CastOps,
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's constructor. The opcode must be in the CastOps category. This constructor has insert-at-end-of-block semantics to automatically insert the new CastInst at the end of InsertAtEnd (if its non-null). Construct any of the CastInst subclasses
Declared at: llvm/include/llvm/IR/InstrTypes.h:474
Parameters
- Instruction::CastOps
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst* CreateBitOrPointerCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreateBitOrPointerCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a BitCast, a PtrToInt, or an IntToPTr cast instruction. If the value is a pointer type and the destination an integer type, creates a PtrToInt cast. If the value is an integer type and the destination a pointer type, creates an IntToPtr cast. Otherwise, creates a bitcast.
Declared at: llvm/include/llvm/IR/InstrTypes.h:552
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateFPCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* CreateFPCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
Declared at: llvm/include/llvm/IR/InstrTypes.h:586
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst* CreateFPCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreateFPCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
Declared at: llvm/include/llvm/IR/InstrTypes.h:578
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateIntegerCast(
llvm::Value* S,
llvm::Type* Ty,
bool isSigned,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreateIntegerCast(
llvm::Value* S,
llvm::Type* Ty,
bool isSigned,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a ZExt, BitCast, or Trunc for int -> int casts.
Declared at: llvm/include/llvm/IR/InstrTypes.h:560
Parameters
- llvm::Value* S
- llvm::Type* Ty
- bool isSigned
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateIntegerCast(
llvm::Value* S,
llvm::Type* Ty,
bool isSigned,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* CreateIntegerCast(
llvm::Value* S,
llvm::Type* Ty,
bool isSigned,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create a ZExt, BitCast, or Trunc for int -> int casts.
Declared at: llvm/include/llvm/IR/InstrTypes.h:569
Parameters
- llvm::Value* S
- llvm::Type* Ty
- bool isSigned
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst*
CreatePointerBitCastOrAddrSpaceCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst*
CreatePointerBitCastOrAddrSpaceCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create a BitCast or an AddrSpaceCast cast instruction.
Declared at: llvm/include/llvm/IR/InstrTypes.h:531
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst*
CreatePointerBitCastOrAddrSpaceCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst*
CreatePointerBitCastOrAddrSpaceCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a BitCast or an AddrSpaceCast cast instruction.
Declared at: llvm/include/llvm/IR/InstrTypes.h:539
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreatePointerCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* CreatePointerCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create a BitCast AddrSpaceCast, or a PtrToInt cast instruction.
Declared at: llvm/include/llvm/IR/InstrTypes.h:515
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst* CreatePointerCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreatePointerCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a BitCast, AddrSpaceCast or a PtrToInt cast instruction.
Declared at: llvm/include/llvm/IR/InstrTypes.h:523
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateSExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* CreateSExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create a SExt or BitCast cast instruction
Declared at: llvm/include/llvm/IR/InstrTypes.h:507
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst* CreateSExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreateSExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a SExt or BitCast cast instruction
Declared at: llvm/include/llvm/IR/InstrTypes.h:499
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateTruncOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* CreateTruncOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create a Trunc or BitCast cast instruction
Declared at: llvm/include/llvm/IR/InstrTypes.h:602
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static llvm::CastInst* CreateTruncOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreateTruncOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a Trunc or BitCast cast instruction
Declared at: llvm/include/llvm/IR/InstrTypes.h:594
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateZExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
static llvm::CastInst* CreateZExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Instruction* InsertBefore = nullptr)
Description
Create a ZExt or BitCast cast instruction
Declared at: llvm/include/llvm/IR/InstrTypes.h:483
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Instruction* InsertBefore = nullptr
¶static llvm::CastInst* CreateZExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
static llvm::CastInst* CreateZExtOrBitCast(
llvm::Value* S,
llvm::Type* Ty,
const llvm::Twine& Name,
llvm::BasicBlock* InsertAtEnd)
Description
Create a ZExt or BitCast cast instruction
Declared at: llvm/include/llvm/IR/InstrTypes.h:491
Parameters
- llvm::Value* S
- llvm::Type* Ty
- const llvm::Twine& Name
- llvm::BasicBlock* InsertAtEnd
¶static bool castIsValid(Instruction::CastOps op,
llvm::Value* S,
llvm::Type* DstTy)
static bool castIsValid(Instruction::CastOps op,
llvm::Value* S,
llvm::Type* DstTy)
Description
This method can be used to determine if a cast from S to DstTy using Opcode op is valid or not.
Declared at: llvm/include/llvm/IR/InstrTypes.h:705
Parameters
- Instruction::CastOps op
- llvm::Value* S
- llvm::Type* DstTy
Returns
true iff the proposed cast is valid. Determine if a cast is valid without creating one.
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Declared at: llvm/include/llvm/IR/InstrTypes.h:711
Parameters
- const llvm::Value* V
¶static bool classof(const llvm::Instruction* I)
static bool classof(const llvm::Instruction* I)
Description
Methods for support type inquiry through isa, cast, and dyn_cast:
Declared at: llvm/include/llvm/IR/InstrTypes.h:708
Parameters
- const llvm::Instruction* I
¶static Instruction::CastOps getCastOpcode(
const llvm::Value* Val,
bool SrcIsSigned,
llvm::Type* Ty,
bool DstIsSigned)
static Instruction::CastOps getCastOpcode(
const llvm::Value* Val,
bool SrcIsSigned,
llvm::Type* Ty,
bool DstIsSigned)
Description
Returns the opcode necessary to cast Val into Ty using usual casting rules. Infer the opcode for cast operand and type
Declared at: llvm/include/llvm/IR/InstrTypes.h:634
Parameters
- const llvm::Value* Val
- bool SrcIsSigned
- llvm::Type* Ty
- bool DstIsSigned
¶llvm::Type* getDestTy() const
llvm::Type* getDestTy() const
Description
Return the destination type, as a convenience
Declared at: llvm/include/llvm/IR/InstrTypes.h:699
¶Instruction::CastOps getOpcode() const
Instruction::CastOps getOpcode() const
Description
Return the opcode of this CastInst
Declared at: llvm/include/llvm/IR/InstrTypes.h:692
¶llvm::Type* getSrcTy() const
llvm::Type* getSrcTy() const
Description
Return the source type, as a convenience
Declared at: llvm/include/llvm/IR/InstrTypes.h:697
¶static bool isBitCastable(llvm::Type* SrcTy,
llvm::Type* DestTy)
static bool isBitCastable(llvm::Type* SrcTy,
llvm::Type* DestTy)
Description
Check whether a bitcast between these types is valid
Declared at: llvm/include/llvm/IR/InstrTypes.h:616
Parameters
- llvm::Type* SrcTy
- llvm::Type* DestTy
¶static bool isBitOrNoopPointerCastable(
llvm::Type* SrcTy,
llvm::Type* DestTy,
const llvm::DataLayout& DL)
static bool isBitOrNoopPointerCastable(
llvm::Type* SrcTy,
llvm::Type* DestTy,
const llvm::DataLayout& DL)
Description
Check whether a bitcast, inttoptr, or ptrtoint cast between these types is valid and a no-op. This ensures that any pointer < ->integer cast has enough bits in the integer and any other cast is a bitcast.
Declared at: llvm/include/llvm/IR/InstrTypes.h:626
Parameters
- llvm::Type* SrcTy
- llvm::Type* DestTy
- const llvm::DataLayout& DL
¶static bool isCastable(llvm::Type* SrcTy,
llvm::Type* DestTy)
static bool isCastable(llvm::Type* SrcTy,
llvm::Type* DestTy)
Description
Check whether it is valid to call getCastOpcode for these types.
Declared at: llvm/include/llvm/IR/InstrTypes.h:610
Parameters
- llvm::Type* SrcTy
- llvm::Type* DestTy
¶static unsigned int isEliminableCastPair(
Instruction::CastOps firstOpcode,
Instruction::CastOps secondOpcode,
llvm::Type* SrcTy,
llvm::Type* MidTy,
llvm::Type* DstTy,
llvm::Type* SrcIntPtrTy,
llvm::Type* MidIntPtrTy,
llvm::Type* DstIntPtrTy)
static unsigned int isEliminableCastPair(
Instruction::CastOps firstOpcode,
Instruction::CastOps secondOpcode,
llvm::Type* SrcTy,
llvm::Type* MidTy,
llvm::Type* DstTy,
llvm::Type* SrcIntPtrTy,
llvm::Type* MidIntPtrTy,
llvm::Type* DstIntPtrTy)
Description
Determine how a pair of casts can be eliminated, if they can be at all. This is a helper function for both CastInst and ConstantExpr.
Declared at: llvm/include/llvm/IR/InstrTypes.h:680
Parameters
- Instruction::CastOps firstOpcode
- Instruction::CastOps secondOpcode
- llvm::Type* SrcTy
- llvm::Type* MidTy
- llvm::Type* DstTy
- llvm::Type* SrcIntPtrTy
- llvm::Type* MidIntPtrTy
- llvm::Type* DstIntPtrTy
Returns
0 if the CastInst pair can't be eliminated, otherwise returns Instruction::CastOps value for a cast that can replace the pair, casting SrcTy to DstTy. Determine if a cast pair is eliminable
¶bool isIntegerCast() const
bool isIntegerCast() const
Description
There are several places where we need to know if a cast instruction only deals with integer source and destination types. To simplify that logic, this method is provided.
Declared at: llvm/include/llvm/IR/InstrTypes.h:646
Returns
true iff the cast has only integral typed operand and dest type. Determine if this is an integer-only cast.
¶bool isLosslessCast() const
bool isLosslessCast() const
Description
A lossless cast is one that does not alter the basic value. It implies a no-op cast but is more stringent, preventing things like int->float, long->double, or int->ptr.
Declared at: llvm/include/llvm/IR/InstrTypes.h:653
Returns
true iff the cast is lossless. Determine if this is a lossless cast.
¶static bool isNoopCast(
Instruction::CastOps Opcode,
llvm::Type* SrcTy,
llvm::Type* DstTy,
const llvm::DataLayout& DL)
static bool isNoopCast(
Instruction::CastOps Opcode,
llvm::Type* SrcTy,
llvm::Type* DstTy,
const llvm::DataLayout& DL)
Description
A no-op cast is one that can be effected without changing any bits. It implies that the source and destination types are the same size. The DataLayout argument is to determine the pointer size when examining casts involving Integer and Pointer types. They are no-op casts if the integer is the same size as the pointer. However, pointer size varies with platform. Determine if the described cast is a no-op cast.
Declared at: llvm/include/llvm/IR/InstrTypes.h:662
Parameters
- Instruction::CastOps Opcode
- llvm::Type* SrcTy
- llvm::Type* DstTy
- const llvm::DataLayout& DL
¶bool isNoopCast(const llvm::DataLayout& DL) const
bool isNoopCast(const llvm::DataLayout& DL) const
Description
Determine if this cast is a no-op cast.
Declared at: llvm/include/llvm/IR/InstrTypes.h:672
Parameters
- const llvm::DataLayout& DL
- is the DataLayout to determine pointer size.