llvm::IRBuilderBase

Common base class shared among various IRBuilders.

Synopsis

Declared in <llvm/IR/IRBuilder.h>

class IRBuilderBase;

Types

NameDescription
FastMathFlagGuard RAII guard that restores fast-math builder settings.
InsertPoint InsertPoint - A saved insertion point.
InsertPointGuard RAII guard that restores the builder insert point.
OperandBundlesGuard RAII guard that restores default operand bundles.

Member Functions

NameDescription
IRBuilderBase [constructor]Construct an IRBuilderBase.
ClearInsertionPoint Clear the insertion point: created instructions will not be inserted into a block.
CreateAShr Create an a shr instruction.
CreateAdd Create an add instruction.
CreateAddReduce Create a vector int add reduction intrinsic of the source vector.
CreateAddrSpaceCast Create an addr space cast.
CreateAggregateCast Cast between aggregates with matching structure.
CreateAggregateRet Create an aggregate return from multiple values.
CreateAlignedLoad Create an aligned load.
CreateAlignedStore Create an aligned store.
CreateAlignmentAssumption Create an assume intrinsic call that represents an alignment assumption on the provided pointer.
CreateAlloca Create an alloca instruction.
CreateAllocationSize Get allocation size of an alloca as a runtime Value* (handles both static and dynamic allocas and vscale factor).
CreateAnd Create an and instruction.
CreateAndReduce Create a vector int AND reduction intrinsic of the source vector.
CreateArithmeticFence Create a call to the arithmetic_fence intrinsic.
CreateAssumption CreateAssumption overloads
CreateAtomicCmpXchg Create an atomic cmpxchg instruction.
CreateAtomicRMW Create an atomicrmw instruction.
CreateBinOp Create a bin op.
CreateBinOpFMF Create a binop with fast-math flags.
CreateBinaryIntrinsic Create a call to intrinsic ID with 2 operands which is mangled on the first type.
CreateBitCast Create a bit cast instruction.
CreateBitOrPointerCast Create a bit or pointer cast.
CreateBitPreservingCastChain Create casts that preserve the bit pattern of a value.
CreateBr Create an unconditional 'br label X' instruction.
CreateCall Create a call instruction.
CreateCallBr CreateCallBr overloads
CreateCast Create a cast instruction.
CreateCatchPad Create a catch pad.
CreateCatchRet Create a catch ret.
CreateCatchSwitch Create a catch switch.
CreateCleanupPad Create a cleanup pad.
CreateCleanupRet Create a cleanup ret.
CreateCmp Create a cmp.
CreateCondBr CreateCondBr overloads
CreateConstGEP1_32 Create a const gep1_32.
CreateConstGEP1_64 Create a const gep1_64.
CreateConstGEP2_32 Create a const gep2_32.
CreateConstGEP2_64 Create a const gep2_64.
CreateConstInBoundsGEP1_32 Create a const in bounds gep1_32.
CreateConstInBoundsGEP1_64 Create a const in bounds gep1_64.
CreateConstInBoundsGEP2_32 Create a const in bounds gep2_32.
CreateConstInBoundsGEP2_64 Create a const in bounds gep2_64.
CreateConstrainedFPBinOp Create a constrained floating-point binop.
CreateConstrainedFPCall Create a constrained fp call.
CreateConstrainedFPCast Create a constrained fp cast.
CreateConstrainedFPCmp Create a constrained fp cmp.
CreateConstrainedFPIntrinsic Create a constrained floating-point intrinsic call.
CreateConstrainedFPUnroundedBinOp Create a constrained FP binop without rounding metadata.
CreateCopySign Create call to the copysign intrinsic.
CreateCountTrailingZeroElems Create a call to llvm.experimental_cttz_elts
CreateDereferenceableAssumption Create an assume intrinsic call that represents a dereferencable assumption on the provided pointer.
CreateDisjointOr Create a disjoint or.
CreateElementCount Create an expression which evaluates to the number of elements in EC at runtime. This can result in poison if type Ty is not big enough to hold the value.
CreateElementUnorderedAtomicMemCpy Create and insert an element unordered-atomic memcpy between the specified pointers.
CreateElementUnorderedAtomicMemMove Create and insert an element unordered-atomic memmove between the specified pointers.
CreateElementUnorderedAtomicMemSet CreateElementUnorderedAtomicMemSet overloads
CreateExactBinOp Create an exact binop instruction.
CreateExactSDiv Create an exact sdiv instruction.
CreateExactUDiv Create an exact udiv instruction.
CreateExtractElement Create an extract element.
CreateExtractValue Create an extract value.
CreateExtractVector Create a call to the vector.extract intrinsic.
CreateFAbs Create call to the fabs intrinsic.
CreateFAdd Create a f add instruction.
CreateFAddFMF Create a fadd with fast-math flags.
CreateFAddReduce Create a sequential vector fadd reduction intrinsic.
CreateFCmp Create a f cmp.
CreateFCmpFMF Create an fcmp fmf instruction.
CreateFCmpOEQ Create an fcmp oeq instruction.
CreateFCmpOGE Create an fcmp oge instruction.
CreateFCmpOGT Create an fcmp ogt instruction.
CreateFCmpOLE Create an fcmp ole instruction.
CreateFCmpOLT Create an fcmp olt instruction.
CreateFCmpONE Create an fcmp one instruction.
CreateFCmpORD Create an fcmp ord instruction.
CreateFCmpS Create an fcmp s instruction.
CreateFCmpUEQ Create an fcmp ueq instruction.
CreateFCmpUGE Create an fcmp uge instruction.
CreateFCmpUGT Create an fcmp ugt instruction.
CreateFCmpULE Create an fcmp ule instruction.
CreateFCmpULT Create an fcmp ult instruction.
CreateFCmpUNE Create an fcmp une instruction.
CreateFCmpUNO Create an fcmp uno instruction.
CreateFDiv Create a f div instruction.
CreateFDivFMF Create a fdiv with fast-math flags.
CreateFMA Create call to the fma intrinsic.
CreateFMul Create a f mul instruction.
CreateFMulFMF Create a fmul with fast-math flags.
CreateFMulReduce Create a sequential vector fmul reduction intrinsic.
CreateFNeg Create a f neg.
CreateFNegFMF Create a fneg with fast-math flags.
CreateFPCast Create a fp cast.
CreateFPExt Create a fp ext.
CreateFPExtFMF Create a fpext with fast-math flags.
CreateFPMaxReduce Create a vector float max reduction intrinsic of the source vector.
CreateFPMaximumNumReduce Create a vector float maximum reduction intrinsic of the source vector. This variant follows the NaN and signed zero semantic of llvm.maximumnum intrinsic.
CreateFPMaximumReduce Create a vector float maximum reduction intrinsic of the source vector. This variant follows the NaN and signed zero semantic of llvm.maximum intrinsic.
CreateFPMinReduce Create a vector float min reduction intrinsic of the source vector.
CreateFPMinimumNumReduce Create a vector float minimum reduction intrinsic of the source vector. This variant follows the NaN and signed zero semantic of llvm.minimumnum intrinsic.
CreateFPMinimumReduce Create a vector float minimum reduction intrinsic of the source vector. This variant follows the NaN and signed zero semantic of llvm.minimum intrinsic.
CreateFPToSI Create a fp to si.
CreateFPToUI Create a fp to ui.
CreateFPTrunc Create a fp trunc.
CreateFPTruncFMF Create a fptrunc with fast-math flags.
CreateFRem Create a f rem instruction.
CreateFRemFMF Create a frem with fast-math flags.
CreateFSub Create a f sub instruction.
CreateFSubFMF Create a fsub with fast-math flags.
CreateFence Create a fence instruction.
CreateFree Generate the IR for a call to the builtin free function.
CreateFreeze Create a freeze instruction.
CreateGCGetPointerBase Create a call to the experimental.gc.pointer.base intrinsic to get the base pointer for the specified derived pointer.
CreateGCGetPointerOffset Create a call to the experimental.gc.get.pointer.offset intrinsic to get the offset of the specified derived pointer from its base.
CreateGCRelocate Create a call to the experimental.gc.relocate intrinsics to project the relocated value of one pointer from the statepoint.
CreateGCResult Create a call to the experimental.gc.result intrinsic to extract the result from a call wrapped in a statepoint.
CreateGCStatepointCall CreateGCStatepointCall overloads
CreateGCStatepointInvoke CreateGCStatepointInvoke overloads
CreateGEP Create a gep instruction.
CreateGlobalString Make a new global variable with initializer type i8*
CreateICmp Create an i cmp.
CreateICmpEQ Create an icmp eq instruction.
CreateICmpNE Create an icmp ne instruction.
CreateICmpSGE Create an icmp sge instruction.
CreateICmpSGT Create an icmp sgt instruction.
CreateICmpSLE Create an icmp sle instruction.
CreateICmpSLT Create an icmp slt instruction.
CreateICmpUGE Create an icmp uge instruction.
CreateICmpUGT Create an icmp ugt instruction.
CreateICmpULE Create an icmp ule instruction.
CreateICmpULT Create an icmp ult instruction.
CreateInBoundsGEP Create an in bounds gep.
CreateInBoundsPtrAdd Create an in bounds ptr add.
CreateIndirectBr Create an indirect branch instruction.
CreateInsertElement Create an insert element.
CreateInsertValue Create an insert value.
CreateInsertVector CreateInsertVector overloads
CreateIntCast Create an int cast.
CreateIntMaxReduce Create a vector integer max reduction intrinsic of the source vector.
CreateIntMinReduce Create a vector integer min reduction intrinsic of the source vector.
CreateIntToPtr Create an int to ptr.
CreateIntrinsic Create a possibly constant-folded intrinsic call.
CreateIntrinsicWithoutFolding Create an intrinsic call that is never constant-folded.
CreateInvariantStart Create a call to invariant.start intrinsic.
CreateInvoke Create an invoke instruction.
CreateIsNeg Return a boolean value testing if Arg < 0.
CreateIsNotNeg Return a boolean value testing if Arg > -1.
CreateIsNotNull Return a boolean value testing if Arg != 0.
CreateIsNull Return a boolean value testing if Arg == 0.
CreateLShr Create an l shr instruction.
CreateLandingPad Create a landing pad.
CreateLaunderInvariantGroup Create a launder.invariant.group intrinsic call.
CreateLdexp Create call to the ldexp intrinsic.
CreateLifetimeEnd Create a lifetime.end intrinsic.
CreateLifetimeStart Create a lifetime.start intrinsic.
CreateLoad CreateLoad overloads
CreateLogicalAnd Create a logical and.
CreateLogicalOp Create a logical op.
CreateLogicalOr Create a logical or.
CreateMalloc Generate IR for a call to malloc.
CreateMaskedCompressStore Create a call to Masked Compress Store intrinsic
CreateMaskedExpandLoad Create a call to Masked Expand Load intrinsic
CreateMaskedGather Create a call to Masked Gather intrinsic
CreateMaskedLoad Create a call to Masked Load intrinsic
CreateMaskedScatter Create a call to Masked Scatter intrinsic
CreateMaskedStore Create a call to Masked Store intrinsic
CreateMaxNum Create call to the maxnum intrinsic.
CreateMaximum Create call to the maximum intrinsic.
CreateMaximumNum Create call to the maximum intrinsic.
CreateMemCpy CreateMemCpy overloads
CreateMemCpyInline Create a mem cpy inline.
CreateMemMove Create a memmove intrinsic.
CreateMemSet CreateMemSet overloads
CreateMemSetInline Create an inline memset intrinsic.
CreateMemTransferInst Create a memory-transfer intrinsic.
CreateMinNum Create call to the minnum intrinsic.
CreateMinimum Create call to the minimum intrinsic.
CreateMinimumNum Create call to the minimumnum intrinsic.
CreateMul Create a mul instruction.
CreateMulReduce Create a vector int mul reduction intrinsic of the source vector.
CreateNAryOp Create either a UnaryOperator or BinaryOperator depending on Opc. Correct number of operands must be passed accordingly.
CreateNSWAdd Create an nsw add instruction.
CreateNSWMul Create an nsw mul instruction.
CreateNSWNeg Create an nsw neg instruction.
CreateNSWSub Create an nsw sub instruction.
CreateNUWAdd Create an nuw add instruction.
CreateNUWMul Create an nuw mul instruction.
CreateNUWSub Create an nuw sub instruction.
CreateNeg Create a neg instruction.
CreateNoAliasScopeDeclaration CreateNoAliasScopeDeclaration overloads
CreateNoWrapBinOp Create a no wrap bin op.
CreateNonnullAssumption Create an assume intrinsic call that represents a nonnull assumption on the provided pointer.
CreateNot Create a not instruction.
CreateOr Create an or instruction.
CreateOrReduce Create a vector int OR reduction intrinsic of the source vector.
CreatePHI Create a phi instruction.
CreatePointerBitCastOrAddrSpaceCast Create a pointer bit cast or addr space cast.
CreatePointerCast Create a pointer cast.
CreatePreserveArrayAccessIndex Create a preserve array access index.
CreatePreserveStructAccessIndex Create a preserve struct access index.
CreatePreserveUnionAccessIndex Create a preserve union access index.
CreatePtrAdd Create a ptr add.
CreatePtrDiff CreatePtrDiff overloads
CreatePtrToAddr Create a ptr to addr.
CreatePtrToInt Create a ptr to int.
CreateResume Create a resume.
CreateRet Create a 'ret <val>' instruction.
CreateRetVoid Create a 'ret void' instruction.
CreateSDiv Create a s div instruction.
CreateSExt Create a s ext instruction.
CreateSExtOrBitCast Create a s ext or bit cast.
CreateSExtOrTrunc Create a SExt or Trunc from the integer value V to DestTy. Return the value untouched if the type of V is already DestTy.
CreateSIToFP Create a si to fp.
CreateSRem Create a s rem instruction.
CreateSelect Create a select instruction.
CreateSelectFMF Create a select with fast-math flags.
CreateSelectFMFWithUnknownProfile Create a select fmf with unknown profile.
CreateSelectWithUnknownProfile Create a select with unknown profile.
CreateShl Create a shl instruction.
CreateShuffleVector CreateShuffleVector overloads
CreateStackRestore Create a call to llvm.stackrestore
CreateStackSave Create a call to llvm.stacksave
CreateStepVector Creates a vector of type DstType with the linear sequence <0, 1, ...>
CreateStore Create a store instruction.
CreateStripInvariantGroup Create a strip.invariant.group intrinsic call.
CreateStructGEP Create a struct gep.
CreateStructuredAlloca Create a structured alloca.
CreateStructuredGEP Create a structured gep.
CreateSub Create a sub instruction.
CreateSwitch Create a switch instruction with the specified value, default dest, and with a hint for the number of cases that will be added (for efficient allocation).
CreateThreadLocalAddress Create a call to llvm.threadlocal.address intrinsic.
CreateTrunc Create a trunc instruction.
CreateTruncOrBitCast Create a trunc or bit cast.
CreateTypeSize Create an expression for the runtime size of a type.
CreateUDiv Create an u div instruction.
CreateUIToFP Create an ui to fp.
CreateURem Create an u rem instruction.
CreateUnOp Create an un op.
CreateUnaryIntrinsic Create a call to intrinsic ID with 1 operand which is mangled on its type.
CreateUnreachable Create an unreachable.
CreateVAArg Create a va arg instruction.
CreateVScale Create a call to llvm.vscale.<Ty>().
CreateVectorInterleave Create a vector interleave.
CreateVectorReverse Return a vector value that contains the vector V reversed
CreateVectorSplat Return a vector value that contains
CreateVectorSpliceLeft Create a vector.splice.left operation.
CreateVectorSpliceRight Create a vector.splice.right operation.
CreateXor Create a xor instruction.
CreateXorReduce Create a vector int XOR reduction intrinsic of the source vector.
CreateZExt Create a z ext instruction.
CreateZExtOrBitCast Create a z ext or bit cast.
CreateZExtOrTrunc Create a ZExt or Trunc from the integer value V to DestTy. Return the value untouched if the type of V is already DestTy.
GetInsertBlock Return the basic block of the current insert point.
GetInsertPoint Return the iterator of the current insert point.
Insert Insert overloads
SetCurrentDebugLocation Set location information used by debugging information.
SetInsertPoint SetInsertPoint overloads
SetInsertPointPastAllocas Set the insert point past entry-block static allocas.
SetInstDebugLocation If this builder has a current debug location, set it on the specified instruction.
clearFastMathFlags Clear the fast-math flags.
createIsFPClass Create an is.fpclass intrinsic call.
getAllOnesMask Return an all true boolean vector (mask) with NumElts lanes.
getBFloatTy Fetch the type representing a 16-bit brain floating point value.
getByte128Ty Fetch the type representing a 128-bit byte.
getByte16Ty Fetch the type representing a 16-bit byte.
getByte32Ty Fetch the type representing a 32-bit byte.
getByte64Ty Fetch the type representing a 64-bit byte.
getByte8Ty Fetch the type representing an 8-bit byte.
getByteNTy Fetch the type representing an N-bit byte.
getBytePtrTy Fetch the type of a byte with size at least as big as that of a pointer in the given address space.
getContext Return the LLVM context used by this builder.
getCurrentDebugLocation Get location information used by debugging information.
getCurrentFunctionReturnType Get the return type of the current function that we're emitting into.
getDefaultConstrainedExcept Get the exception handling used with constrained floating point
getDefaultConstrainedRounding Get the rounding mode handling used with constrained floating point
getDefaultFPMathTag Get the floating point math metadata being used.
getDoubleTy Fetch the type representing a 64-bit floating point value.
getFalse Get the constant value for i1 false.
getFastMathFlags getFastMathFlags overloads
getFloatTy Fetch the type representing a 32-bit floating point value.
getHalfTy Fetch the type representing a 16-bit floating point value.
getIndexTy Fetch the type of an integer that should be used to index GEP operations within AddressSpace.
getInt Get a constant integer value.
getInt1 Get a constant value representing either true or false.
getInt128Ty Fetch the type representing a 128-bit integer.
getInt16 Get a constant 16-bit value.
getInt16Ty Fetch the type representing a 16-bit integer.
getInt1Ty Fetch the type representing a single bit
getInt32 Get a constant 32-bit value.
getInt32Ty Fetch the type representing a 32-bit integer.
getInt64 Get a constant 64-bit value.
getInt64Ty Fetch the type representing a 64-bit integer.
getInt8 Get a constant 8-bit value.
getInt8Ty Fetch the type representing an 8-bit integer.
getIntN Get a constant N-bit value, zero extended from a 64-bit value.
getIntNTy Fetch the type representing an N-bit integer.
getIntPtrTy Fetch the type of an integer with size at least as big as that of a pointer in the given address space.
getIsFPConstrained Query for the use of constrained floating point math
getPtrTy Fetch the type representing a pointer.
getTrue Get the constant value for i1 true.
getVoidTy Fetch the type representing void.
restoreIP Sets the current insert point to a previously-saved location.
saveAndClearIP Returns the current insert point, clearing it in the process.
saveIP Returns the current insert point.
setConstrainedFPCallAttr Add the StrictFP attribute to a call instruction.
setConstrainedFPFunctionAttr Add the StrictFP attribute to the current function.
setDefaultConstrainedExcept Set the exception handling to be used with constrained floating point
setDefaultConstrainedRounding Set the rounding mode handling to be used with constrained floating point
setDefaultFPMathTag Set the floating point math metadata to be used.
setDefaultOperandBundles Set the default operand bundles for new calls.
setFastMathFlags Set the fast-math flags to be used with generated fp-math operators
setIsFPConstrained Enable or disable constrained floating-point math.

Protected Data Members

NameDescription
BB Basic block used as the current insert point.
Context LLVM context used to create IR objects.
DefaultConstrainedExcept Default exception behavior for constrained FP.
DefaultConstrainedRounding Default rounding mode for constrained FP.
DefaultFPMathTag Default floating-point math metadata tag.
DefaultOperandBundles Default operand bundles attached to new calls.
FMF Fast-math flags applied to created floating-point ops.
Folder Constant folder used when creating instructions.
InsertPt Iterator within BB where new instructions are inserted.
Inserter Helper that inserts newly created instructions.
IsFPConstrained Whether CreateF* builds constrained FP intrinsics.

Non-Member Functions

NameDescription
buildCmpXchgValueEmit IR to implement the given cmpxchg operation on values in registers, returning the new value.
concatenateVectorsConcatenate a list of vectors.
createAnyOfReductionCreate a reduction of the given vector Src for a reduction of kind RecurKind::AnyOf. The start value of the reduction is InitVal.
createBitMaskForGapsCreate a mask that filters the members of an interleave group where there are gaps.
createMinMaxOpReturns a Min/Max operation corresponding to MinMaxRecurrenceKind. The Builder's fast-math-flags must be set to propagate the expected values.
createOrderedReductionCreate an ordered reduction intrinsic using the given recurrence kind RdxKind.
createOrderedReductionOverloaded function to generate vector-predication intrinsics for ordered reduction.
createSimpleReductionOverloaded function to generate vector-predication intrinsics for reduction.
createSimpleReductionCreate a vector reduction for recurrence kind RdxKind.
emitGEPOffsetEmit code to compute a GEP's offset from its base pointer.
expandReductionViaLoopExpand a scalable vector reduction into an element-wise runtime loop.
getOrderedReductionGenerates an ordered vector reduction using extracts to reduce the value.
getShuffleReductionGenerates a vector reduction using shufflevectors to reduce the value. Fast-math-flags are propagated using the IRBuilder's setting.
splitBBSplit a basic block at an IRBuilder insertion point.
splitBBWithSuffixSplit a block and suffix the current block name for the new successor.

Derived Classes

NameDescription
IRBuilder Uniform API for creating and inserting LLVM IR instructions.