LLVM 22.0.0git
IRBuilder.cpp File Reference
#include "llvm/IR/IRBuilder.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/NoFolder.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Statepoint.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Support/Casting.h"
#include <cassert>
#include <cstdint>
#include <optional>
#include <vector>

Go to the source code of this file.

Functions

static ValueCreateVScaleMultiple (IRBuilderBase &B, Type *Ty, uint64_t Scale)
static bool isConstantOne (const Value *Val)
 isConstantOne - Return true only if val is constant int 1
static MaybeAlign getAlign (Value *Ptr)
template<typename T0>
static std::vector< Value * > getStatepointArgs (IRBuilderBase &B, uint64_t ID, uint32_t NumPatchBytes, Value *ActualCallee, uint32_t Flags, ArrayRef< T0 > CallArgs)
template<typename T1, typename T2, typename T3>
static std::vector< OperandBundleDefgetStatepointBundles (std::optional< ArrayRef< T1 > > TransitionArgs, std::optional< ArrayRef< T2 > > DeoptArgs, ArrayRef< T3 > GCArgs)
template<typename T0, typename T1, typename T2, typename T3>
static CallInstCreateGCStatepointCallCommon (IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualCallee, uint32_t Flags, ArrayRef< T0 > CallArgs, std::optional< ArrayRef< T1 > > TransitionArgs, std::optional< ArrayRef< T2 > > DeoptArgs, ArrayRef< T3 > GCArgs, const Twine &Name)
template<typename T0, typename T1, typename T2, typename T3>
static InvokeInstCreateGCStatepointInvokeCommon (IRBuilderBase *Builder, uint64_t ID, uint32_t NumPatchBytes, FunctionCallee ActualInvokee, BasicBlock *NormalDest, BasicBlock *UnwindDest, uint32_t Flags, ArrayRef< T0 > InvokeArgs, std::optional< ArrayRef< T1 > > TransitionArgs, std::optional< ArrayRef< T2 > > DeoptArgs, ArrayRef< T3 > GCArgs, const Twine &Name)

Function Documentation

◆ CreateGCStatepointCallCommon()

template<typename T0, typename T1, typename T2, typename T3>
CallInst * CreateGCStatepointCallCommon ( IRBuilderBase * Builder,
uint64_t ID,
uint32_t NumPatchBytes,
FunctionCallee ActualCallee,
uint32_t Flags,
ArrayRef< T0 > CallArgs,
std::optional< ArrayRef< T1 > > TransitionArgs,
std::optional< ArrayRef< T2 > > DeoptArgs,
ArrayRef< T3 > GCArgs,
const Twine & Name )
static

◆ CreateGCStatepointInvokeCommon()

template<typename T0, typename T1, typename T2, typename T3>
InvokeInst * CreateGCStatepointInvokeCommon ( IRBuilderBase * Builder,
uint64_t ID,
uint32_t NumPatchBytes,
FunctionCallee ActualInvokee,
BasicBlock * NormalDest,
BasicBlock * UnwindDest,
uint32_t Flags,
ArrayRef< T0 > InvokeArgs,
std::optional< ArrayRef< T1 > > TransitionArgs,
std::optional< ArrayRef< T2 > > DeoptArgs,
ArrayRef< T3 > GCArgs,
const Twine & Name )
static

◆ CreateVScaleMultiple()

Value * CreateVScaleMultiple ( IRBuilderBase & B,
Type * Ty,
uint64_t Scale )
static

Definition at line 115 of file IRBuilder.cpp.

References B().

Referenced by llvm::IRBuilderBase::CreateElementCount(), and llvm::IRBuilderBase::CreateTypeSize().

◆ getAlign()

MaybeAlign getAlign ( Value * Ptr)
static

Definition at line 442 of file IRBuilder.cpp.

References A(), llvm::dyn_cast(), llvm::getAlign(), and Ptr.

Referenced by foldPatternedLoads(), and needsConstrainedOpcode().

◆ getStatepointArgs()

template<typename T0>
std::vector< Value * > getStatepointArgs ( IRBuilderBase & B,
uint64_t ID,
uint32_t NumPatchBytes,
Value * ActualCallee,
uint32_t Flags,
ArrayRef< T0 > CallArgs )
static

◆ getStatepointBundles()

template<typename T1, typename T2, typename T3>
std::vector< OperandBundleDef > getStatepointBundles ( std::optional< ArrayRef< T1 > > TransitionArgs,
std::optional< ArrayRef< T2 > > DeoptArgs,
ArrayRef< T3 > GCArgs )
static

◆ isConstantOne()

bool isConstantOne ( const Value * Val)
static

isConstantOne - Return true only if val is constant int 1

Definition at line 253 of file IRBuilder.cpp.

References assert(), llvm::dyn_cast(), and llvm::ConstantInt::isOne().

Referenced by llvm::IRBuilderBase::CreateMalloc().