21#ifndef LLVM_IR_NOFOLDER_H
22#define LLVM_IR_NOFOLDER_H
36 virtual void anchor();
54 bool IsExact)
const override {
59 bool HasNUW,
bool HasNSW)
const override {
78 bool IsInBounds =
false)
const override {
115 Type *DestTy)
const override {
138 return CreateCast(Instruction::BitCast,
C, DestTy);
142 return CreateCast(Instruction::IntToPtr,
C, DestTy);
146 return CreateCast(Instruction::PtrToInt,
C, DestTy);
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
static bool isSigned(unsigned int Opcode)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
static CastInst * CreateIntegerCast(Value *S, Type *Ty, bool isSigned, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt, BitCast, or Trunc for int -> int casts.
static CastInst * CreateZExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a ZExt or BitCast cast instruction.
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
static CastInst * CreateFPCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create an FPExt, BitCast, or FPTrunc for fp -> fp casts.
static CastInst * CreateSExtOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a SExt or BitCast cast instruction.
static CastInst * CreatePointerBitCastOrAddrSpaceCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast or an AddrSpaceCast cast instruction.
static CastInst * CreateTruncOrBitCast(Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Create a Trunc or BitCast cast instruction.
static CastInst * CreatePointerCast(Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
Create a BitCast AddrSpaceCast, or a PtrToInt cast instruction.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
This is an important base class in LLVM.
This class represents an Operation in the Expression.
This instruction compares its operands according to the predicate given to the constructor.
Convenience struct for specifying and reasoning about fast-math flags.
IRBuilderFolder - Interface for constant folding in IRBuilder.
NoFolder - Create "constants" (actually, instructions) with no folding.
Value * FoldShuffleVector(Value *V1, Value *V2, ArrayRef< int > Mask) const override
Value * FoldExactBinOp(Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool IsExact) const override
Instruction * CreateIntToPtr(Constant *C, Type *DestTy) const override
Value * FoldSelect(Value *C, Value *True, Value *False) const override
Value * FoldBinOp(Instruction::BinaryOps Opc, Value *LHS, Value *RHS) const override
Instruction * CreateBitCast(Constant *C, Type *DestTy) const override
Instruction * CreateSExtOrBitCast(Constant *C, Type *DestTy) const override
Value * FoldICmp(CmpInst::Predicate P, Value *LHS, Value *RHS) const override
Instruction * CreateIntCast(Constant *C, Type *DestTy, bool isSigned) const override
Value * FoldGEP(Type *Ty, Value *Ptr, ArrayRef< Value * > IdxList, bool IsInBounds=false) const override
Instruction * CreateTruncOrBitCast(Constant *C, Type *DestTy) const override
Value * FoldInsertValue(Value *Agg, Value *Val, ArrayRef< unsigned > IdxList) const override
Instruction * CreatePtrToInt(Constant *C, Type *DestTy) const override
Instruction * CreateFCmp(CmpInst::Predicate P, Constant *LHS, Constant *RHS) const override
Value * FoldBinOpFMF(Instruction::BinaryOps Opc, Value *LHS, Value *RHS, FastMathFlags FMF) const override
Value * FoldNoWrapBinOp(Instruction::BinaryOps Opc, Value *LHS, Value *RHS, bool HasNUW, bool HasNSW) const override
Instruction * CreateFPCast(Constant *C, Type *DestTy) const override
Instruction * CreatePointerBitCastOrAddrSpaceCast(Constant *C, Type *DestTy) const override
Value * FoldExtractElement(Value *Vec, Value *Idx) const override
Instruction * CreatePointerCast(Constant *C, Type *DestTy) const override
Value * FoldInsertElement(Value *Vec, Value *NewElt, Value *Idx) const override
Instruction * CreateCast(Instruction::CastOps Op, Constant *C, Type *DestTy) const override
Value * FoldExtractValue(Value *Agg, ArrayRef< unsigned > IdxList) const override
Instruction * CreateZExtOrBitCast(Constant *C, Type *DestTy) const override
Value * FoldUnOpFMF(Instruction::UnaryOps Opc, Value *V, FastMathFlags FMF) const override
The instances of the Type class are immutable: once they are created, they are never changed.
LLVM Value Representation.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.