class CastInst
Declaration
class CastInst : public UnaryInstruction { /* full declaration omitted */ };
Description
This is the base class for all instructions that perform data casts. It is simply provided so that instruction category testing can be performed with code like: if (isa <CastInst >(Instr)) { ... } Base class of casting instructions.
Declared at: llvm/include/llvm/IR/InstrTypes.h:429
Inherits from: UnaryInstruction
Member Variables
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasMetadata
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 32
- public static MaximumAlignment = 1ULL << 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 castIsValid(Instruction::CastOps op, llvm::Type * SrcTy, 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 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 addAnnotationMetadata
- public andIRFlags
- public applyMergedLocation
- public classof
- public clone
- public comesBefore
- public copyFastMathFlags
- public copyFastMathFlags
- public copyIRFlags
- public copyMetadata
- public dropLocation
- public dropPoisonGeneratingFlags
- public dropUndefImplyingAttrsAndUnknownMetadata
- 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 getSubclassData
- 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 hasPoisonGeneratingFlags
- 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 isDebugOrPseudoInst
- 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 isIntDivRem
- public isIntDivRem
- public isLaunderOrStripInvariantGroup
- public isLifetimeStartOrEnd
- public isLogicalShift
- public isNilpotent
- public isNilpotent
- public isOnlyUserOfAnyOperand
- public isSafeToRemove
- public isSameOperationAs
- public isShift
- public isShift
- public isTerminator
- public isTerminator
- public isUnaryOp
- public isUnaryOp
- public isUsedOutsideOfBlock
- public isVolatile
- 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 setHasAllowContract
- public setHasAllowReassoc
- public setHasAllowReciprocal
- public setHasApproxFunc
- public setHasNoInfs
- public setHasNoNaNs
- public setHasNoSignedWrap
- public setHasNoSignedZeros
- public setHasNoUnsignedWrap
- public setIsExact
- public setMetadata
- public setMetadata
- protected setSubclassData
- public setSuccessor
- public swapProfMetadata
- public updateLocationAfterHoist
- public user_back
- public user_back
- public willReturn
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 isDroppable
- 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
- protected addMetadata
- protected addMetadata
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public canBeFreed
- protected clearMetadata
- public clearSubclassOptionalData
- public deleteValue
- public dropDroppableUse
- public dropDroppableUses
- public dropDroppableUsesIn
- public dump
- protected eraseMetadata
- protected getAllMetadata
- public getContext
- protected getMetadata
- protected getMetadata
- protected getMetadata
- protected getMetadata
- public getName
- public getNameOrAsOperand
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- public getSingleUndroppableUse
- public getSingleUndroppableUse
- protected getSubclassDataFromValue
- public getType
- public getUniqueUndroppableUser
- public getUniqueUndroppableUser
- public getValueID
- public getValueName
- protected hasMetadata
- protected hasMetadata
- protected hasMetadata
- public hasNUndroppableUses
- public hasNUndroppableUsesOrMore
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasOneUser
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isTransitiveUsedByMetadataOnly
- 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
- protected setMetadata
- protected setMetadata
- 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 stripPointerCastsForAliasAnalysis
- public stripPointerCastsForAliasAnalysis
- 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:438
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:432
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:451
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:464
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:542
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:576
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:568
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:550
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:559
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:521
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:529
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:505
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:513
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:497
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:489
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:592
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:584
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:473
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:481
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)
Declared at: llvm/include/llvm/IR/InstrTypes.h:690
Parameters
- Instruction::CastOps op
- llvm::Value* S
- llvm::Type* DstTy
¶static bool castIsValid(Instruction::CastOps op,
llvm::Type* SrcTy,
llvm::Type* DstTy)
static bool castIsValid(Instruction::CastOps op,
llvm::Type* SrcTy,
llvm::Type* DstTy)
Description
This method can be used to determine if a cast from SrcTy to DstTy using Opcode op is valid or not.
Declared at: llvm/include/llvm/IR/InstrTypes.h:689
Parameters
- Instruction::CastOps op
- llvm::Type* SrcTy
- 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:698
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:695
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:618
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:683
¶Instruction::CastOps getOpcode() const
Instruction::CastOps getOpcode() const
Description
Return the opcode of this CastInst
Declared at: llvm/include/llvm/IR/InstrTypes.h:676
¶llvm::Type* getSrcTy() const
llvm::Type* getSrcTy() const
Description
Return the source type, as a convenience
Declared at: llvm/include/llvm/IR/InstrTypes.h:681
¶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:600
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:610
Parameters
- llvm::Type* SrcTy
- llvm::Type* DestTy
- const llvm::DataLayout& DL
¶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:664
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:630
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:637
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. Note that a precondition of this method is that the cast is legal - i.e. the instruction formed with these operands would verify.
Declared at: llvm/include/llvm/IR/InstrTypes.h:646
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:656
Parameters
- const llvm::DataLayout& DL
- is the DataLayout to determine pointer size.