LLVM
8.0.1
|
Helper class to build MachineInstr. More...
#include "llvm/CodeGen/GlobalISel/MachineIRBuilder.h"
Public Member Functions | |
MachineIRBuilder ()=default | |
Some constructors for easy use. More... | |
MachineIRBuilder (MachineFunction &MF) | |
MachineIRBuilder (MachineInstr &MI) | |
virtual | ~MachineIRBuilder ()=default |
MachineIRBuilder (const MachineIRBuilderState &BState) | |
const TargetInstrInfo & | getTII () |
MachineFunction & | getMF () |
Getter for the function we currently build. More... | |
const DebugLoc & | getDL () |
Getter for DebugLoc. More... | |
MachineRegisterInfo * | getMRI () |
Getter for MRI. More... | |
const MachineRegisterInfo * | getMRI () const |
MachineIRBuilderState & | getState () |
Getter for the State. More... | |
const MachineBasicBlock & | getMBB () const |
Getter for the basic block we currently build. More... | |
MachineBasicBlock & | getMBB () |
GISelCSEInfo * | getCSEInfo () |
const GISelCSEInfo * | getCSEInfo () const |
MachineBasicBlock::iterator | getInsertPt () |
Current insertion point for new instructions. More... | |
void | setInsertPt (MachineBasicBlock &MBB, MachineBasicBlock::iterator II) |
Set the insertion point before the specified position. More... | |
void | setCSEInfo (GISelCSEInfo *Info) |
void | setChangeObserver (GISelChangeObserver &Observer) |
void | stopObservingChanges () |
void | setDebugLoc (const DebugLoc &DL) |
Set the debug location to DL for all the next build instructions. More... | |
DebugLoc | getDebugLoc () |
Get the current instruction's debug location. More... | |
MachineInstrBuilder | buildInstr (unsigned Opcode) |
Build and insert <empty> = Opcode <empty>. More... | |
MachineInstrBuilder | buildInstrNoInsert (unsigned Opcode) |
Build but don't insert <empty> = Opcode <empty>. More... | |
MachineInstrBuilder | insertInstr (MachineInstrBuilder MIB) |
Insert an existing instruction at the insertion point. More... | |
MachineInstrBuilder | buildDirectDbgValue (unsigned Reg, const MDNode *Variable, const MDNode *Expr) |
Build and insert a DBG_VALUE instruction expressing the fact that the associated Variable lives in Reg (suitably modified by Expr ). More... | |
MachineInstrBuilder | buildIndirectDbgValue (unsigned Reg, const MDNode *Variable, const MDNode *Expr) |
Build and insert a DBG_VALUE instruction expressing the fact that the associated Variable lives in memory at Reg (suitably modified by Expr ). More... | |
MachineInstrBuilder | buildFIDbgValue (int FI, const MDNode *Variable, const MDNode *Expr) |
Build and insert a DBG_VALUE instruction expressing the fact that the associated Variable lives in the stack slot specified by FI (suitably modified by Expr ). More... | |
MachineInstrBuilder | buildConstDbgValue (const Constant &C, const MDNode *Variable, const MDNode *Expr) |
Build and insert a DBG_VALUE instructions specifying that Variable is given by C (suitably modified by Expr ). More... | |
MachineInstrBuilder | buildDbgLabel (const MDNode *Label) |
Build and insert a DBG_LABEL instructions specifying that Label is given. More... | |
MachineInstrBuilder | buildFrameIndex (unsigned Res, int Idx) |
Build and insert Res = G_FRAME_INDEX Idx . More... | |
MachineInstrBuilder | buildGlobalValue (unsigned Res, const GlobalValue *GV) |
Build and insert Res = G_GLOBAL_VALUE GV . More... | |
MachineInstrBuilder | buildGEP (unsigned Res, unsigned Op0, unsigned Op1) |
Build and insert Res = G_GEP Op0 , Op1 . More... | |
Optional< MachineInstrBuilder > | materializeGEP (unsigned &Res, unsigned Op0, const LLT &ValueTy, uint64_t Value) |
Materialize and insert Res = G_GEP Op0 , (G_CONSTANT Value ) More... | |
MachineInstrBuilder | buildPtrMask (unsigned Res, unsigned Op0, uint32_t NumBits) |
Build and insert Res = G_PTR_MASK Op0 , NumBits . More... | |
MachineInstrBuilder | buildUAdde (const DstOp &Res, const DstOp &CarryOut, const SrcOp &Op0, const SrcOp &Op1, const SrcOp &CarryIn) |
Build and insert Res , CarryOut = G_UADDE Op0 , Op1 , CarryIn . More... | |
MachineInstrBuilder | buildAnyExt (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_ANYEXT Op0 . More... | |
MachineInstrBuilder | buildSExt (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_SEXT Op . More... | |
MachineInstrBuilder | buildZExt (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_ZEXT Op . More... | |
MachineInstrBuilder | buildSExtOrTrunc (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_SEXT Op , Res = G_TRUNC Op , or Res = COPY Op depending on the differing sizes of Res and Op . More... | |
MachineInstrBuilder | buildZExtOrTrunc (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_ZEXT Op , Res = G_TRUNC Op , or Res = COPY Op depending on the differing sizes of Res and Op . More... | |
MachineInstrBuilder | buildAnyExtOrTrunc (const DstOp &Res, const SrcOp &Op) |
Res = COPY Op depending on the differing sizes of Res and Op . More... | |
MachineInstrBuilder | buildExtOrTrunc (unsigned ExtOpc, const DstOp &Res, const SrcOp &Op) |
Build and insert Res = ExtOpc , Res = G_TRUNC Op , or Res = COPY Op depending on the differing sizes of Res and Op . More... | |
MachineInstrBuilder | buildCast (const DstOp &Dst, const SrcOp &Src) |
Build and insert an appropriate cast between two registers of equal size. More... | |
MachineInstrBuilder | buildBr (MachineBasicBlock &Dest) |
Build and insert G_BR Dest . More... | |
MachineInstrBuilder | buildBrCond (unsigned Tst, MachineBasicBlock &Dest) |
Build and insert G_BRCOND Tst , Dest . More... | |
MachineInstrBuilder | buildBrIndirect (unsigned Tgt) |
Build and insert G_BRINDIRECT Tgt . More... | |
virtual MachineInstrBuilder | buildConstant (const DstOp &Res, const ConstantInt &Val) |
Build and insert Res = G_CONSTANT Val . More... | |
MachineInstrBuilder | buildConstant (const DstOp &Res, int64_t Val) |
Build and insert Res = G_CONSTANT Val . More... | |
virtual MachineInstrBuilder | buildFConstant (const DstOp &Res, const ConstantFP &Val) |
Build and insert Res = G_FCONSTANT Val . More... | |
MachineInstrBuilder | buildFConstant (const DstOp &Res, double Val) |
MachineInstrBuilder | buildCopy (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = COPY Op. More... | |
MachineInstrBuilder | buildLoad (unsigned Res, unsigned Addr, MachineMemOperand &MMO) |
Build and insert Res = G_LOAD Addr, MMO . More... | |
MachineInstrBuilder | buildLoadInstr (unsigned Opcode, unsigned Res, unsigned Addr, MachineMemOperand &MMO) |
Build and insert Res = <opcode> Addr, MMO . More... | |
MachineInstrBuilder | buildStore (unsigned Val, unsigned Addr, MachineMemOperand &MMO) |
Build and insert G_STORE Val, Addr, MMO . More... | |
MachineInstrBuilder | buildExtract (unsigned Res, unsigned Src, uint64_t Index) |
Build and insert `Res0, ... More... | |
MachineInstrBuilder | buildUndef (const DstOp &Res) |
Build and insert Res = IMPLICIT_DEF. More... | |
void | buildSequence (unsigned Res, ArrayRef< unsigned > Ops, ArrayRef< uint64_t > Indices) |
Build and insert instructions to put Ops together at the specified p Indices to form a larger register. More... | |
MachineInstrBuilder | buildMerge (const DstOp &Res, ArrayRef< unsigned > Ops) |
Build and insert Res = G_MERGE_VALUES Op0 , ... More... | |
MachineInstrBuilder | buildUnmerge (ArrayRef< LLT > Res, const SrcOp &Op) |
Build and insert Res0 , ... More... | |
MachineInstrBuilder | buildUnmerge (ArrayRef< unsigned > Res, const SrcOp &Op) |
MachineInstrBuilder | buildBuildVector (const DstOp &Res, ArrayRef< unsigned > Ops) |
Build and insert Res = G_BUILD_VECTOR Op0 , ... More... | |
MachineInstrBuilder | buildBuildVectorTrunc (const DstOp &Res, ArrayRef< unsigned > Ops) |
Build and insert Res = G_BUILD_VECTOR_TRUNC Op0 , ... More... | |
MachineInstrBuilder | buildConcatVectors (const DstOp &Res, ArrayRef< unsigned > Ops) |
Build and insert Res = G_CONCAT_VECTORS Op0 , ... More... | |
MachineInstrBuilder | buildInsert (unsigned Res, unsigned Src, unsigned Op, unsigned Index) |
MachineInstrBuilder | buildIntrinsic (Intrinsic::ID ID, unsigned Res, bool HasSideEffects) |
Build and insert either a G_INTRINSIC (if HasSideEffects is false) or G_INTRINSIC_W_SIDE_EFFECTS instruction. More... | |
MachineInstrBuilder | buildFPTrunc (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_FPTRUNC Op . More... | |
MachineInstrBuilder | buildTrunc (const DstOp &Res, const SrcOp &Op) |
Build and insert Res = G_TRUNC Op . More... | |
MachineInstrBuilder | buildICmp (CmpInst::Predicate Pred, const DstOp &Res, const SrcOp &Op0, const SrcOp &Op1) |
Build and insert a Res = G_ICMP Pred , Op0 , Op1 . More... | |
MachineInstrBuilder | buildFCmp (CmpInst::Predicate Pred, const DstOp &Res, const SrcOp &Op0, const SrcOp &Op1) |
Build and insert a Res = G_FCMP Pred Op1 . More... | |
MachineInstrBuilder | buildSelect (const DstOp &Res, const SrcOp &Tst, const SrcOp &Op0, const SrcOp &Op1) |
Build and insert a Res = G_SELECT Tst , Op0 , Op1 . More... | |
MachineInstrBuilder | buildInsertVectorElement (const DstOp &Res, const SrcOp &Val, const SrcOp &Elt, const SrcOp &Idx) |
Build and insert Res = G_INSERT_VECTOR_ELT Val , Elt , Idx . More... | |
MachineInstrBuilder | buildExtractVectorElement (const DstOp &Res, const SrcOp &Val, const SrcOp &Idx) |
Build and insert Res = G_EXTRACT_VECTOR_ELT Val , Idx . More... | |
MachineInstrBuilder | buildAtomicCmpXchgWithSuccess (unsigned OldValRes, unsigned SuccessRes, unsigned Addr, unsigned CmpVal, unsigned NewVal, MachineMemOperand &MMO) |
Build and insert OldValRes<def>, SuccessRes<def> = G_ATOMIC_CMPXCHG_WITH_SUCCESS Addr, CmpVal, NewVal, MMO . More... | |
MachineInstrBuilder | buildAtomicCmpXchg (unsigned OldValRes, unsigned Addr, unsigned CmpVal, unsigned NewVal, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMIC_CMPXCHG Addr, CmpVal, NewVal, MMO . More... | |
MachineInstrBuilder | buildAtomicRMW (unsigned Opcode, unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_<Opcode> Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWXchg (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_XCHG Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWAdd (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_ADD Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWSub (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_SUB Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWAnd (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_AND Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWNand (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_NAND Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWOr (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_OR Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWXor (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_XOR Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWMax (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_MAX Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWMin (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_MIN Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWUmax (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_UMAX Addr, Val, MMO . More... | |
MachineInstrBuilder | buildAtomicRMWUmin (unsigned OldValRes, unsigned Addr, unsigned Val, MachineMemOperand &MMO) |
Build and insert OldValRes<def> = G_ATOMICRMW_UMIN Addr, Val, MMO . More... | |
MachineInstrBuilder | buildBlockAddress (unsigned Res, const BlockAddress *BA) |
Build and insert Res = G_BLOCK_ADDR BA . More... | |
MachineInstrBuilder | buildAdd (const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1, Optional< unsigned > Flags=None) |
Build and insert Res = G_ADD Op0 , Op1 . More... | |
MachineInstrBuilder | buildSub (const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1, Optional< unsigned > Flags=None) |
Build and insert Res = G_SUB Op0 , Op1 . More... | |
MachineInstrBuilder | buildMul (const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1, Optional< unsigned > Flags=None) |
Build and insert Res = G_MUL Op0 , Op1 . More... | |
MachineInstrBuilder | buildAnd (const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1) |
Build and insert Res = G_AND Op0 , Op1 . More... | |
MachineInstrBuilder | buildOr (const DstOp &Dst, const SrcOp &Src0, const SrcOp &Src1) |
Build and insert Res = G_OR Op0 , Op1 . More... | |
virtual MachineInstrBuilder | buildInstr (unsigned Opc, ArrayRef< DstOp > DstOps, ArrayRef< SrcOp > SrcOps, Optional< unsigned > Flags=None) |
Setters for the insertion point. | |
Set the MachineFunction where to build instructions. | |
void | setMF (MachineFunction &MF) |
void | setMBB (MachineBasicBlock &MBB) |
Set the insertion point to the end of MBB . More... | |
void | setInstr (MachineInstr &MI) |
Set the insertion point to before MI. More... | |
Protected Member Functions | |
void | validateTruncExt (const LLT &Dst, const LLT &Src, bool IsExtend) |
void | validateBinaryOp (const LLT &Res, const LLT &Op0, const LLT &Op1) |
void | validateSelectOp (const LLT &ResTy, const LLT &TstTy, const LLT &Op0Ty, const LLT &Op1Ty) |
void | recordInsertion (MachineInstr *MI) const |
Helper class to build MachineInstr.
It keeps internally the insertion point and debug location for all the new instructions we want to create. This information can be modify via the related setters.
Definition at line 197 of file MachineIRBuilder.h.
|
default |
Some constructors for easy use.
|
inline |
Definition at line 213 of file MachineIRBuilder.h.
|
inline |
Definition at line 214 of file MachineIRBuilder.h.
|
virtualdefault |
|
inline |
Definition at line 220 of file MachineIRBuilder.h.
|
inline |
Build and insert Res
= G_ADD Op0
, Op1
.
G_ADD sets Res
to the sum of integer parameters Op0
and Op1
, truncated to their width.
Res
, Op0
and Op1
must be generic virtual registers with the same (scalar or vector) type).Definition at line 1088 of file MachineIRBuilder.h.
Referenced by llvm::LegalizerHelper::fewerElementsVector(), and llvm::LegalizerHelper::lower().
|
inline |
Build and insert Res
= G_AND Op0
, Op1
.
G_AND sets Res
to the bitwise and of integer parameters Op0
and Op1
.
Res
, Op0
and Op1
must be generic virtual registers with the same (scalar or vector) type).Definition at line 1138 of file MachineIRBuilder.h.
Referenced by llvm::LegalizationArtifactCombiner::tryCombineZExt().
MachineInstrBuilder MachineIRBuilder::buildAnyExt | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_ANYEXT Op0
.
G_ANYEXT produces a register of the specified width, with bits 0 to sizeof(Ty
) * 8 set to Op
. The remaining bits are unspecified (i.e. this is neither zero nor sign-extension). For a vector register, each element is extended individually.
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type. Op
must be smaller than Res
Definition at line 332 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), llvm::CallLowering::ValueHandler::extendRegister(), llvm::LegalizerHelper::lower(), and llvm::X86CallLowering::X86CallLowering().
MachineInstrBuilder MachineIRBuilder::buildAnyExtOrTrunc | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Res
= COPY Op
depending on the differing sizes of Res
and Op
.
///
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type.Definition at line 381 of file MachineIRBuilder.cpp.
References buildExtOrTrunc().
Referenced by llvm::LegalizationArtifactCombiner::tryCombineAnyExt(), llvm::LegalizationArtifactCombiner::tryCombineSExt(), and llvm::LegalizationArtifactCombiner::tryCombineZExt().
MachineInstrBuilder MachineIRBuilder::buildAtomicCmpXchg | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | CmpVal, | ||
unsigned | NewVal, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMIC_CMPXCHG Addr, CmpVal, NewVal, MMO
.
Atomically replace the value at Addr
with NewVal
if it is currently CmpVal
otherwise leaves it unchanged. Puts the original value from Addr
in Res
.
OldValRes
must be a generic virtual register of scalar type. Addr
must be a generic virtual register with pointer type. OldValRes
, CmpVal
, and NewVal
must be generic virtual registers of the same type.Definition at line 631 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), llvm::MachineRegisterInfo::getType(), llvm::LLT::isPointer(), llvm::LLT::isScalar(), and llvm::LLT::isValid().
Referenced by llvm::LegalizerHelper::lower().
MachineInstrBuilder MachineIRBuilder::buildAtomicCmpXchgWithSuccess | ( | unsigned | OldValRes, |
unsigned | SuccessRes, | ||
unsigned | Addr, | ||
unsigned | CmpVal, | ||
unsigned | NewVal, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def>, SuccessRes<def> = G_ATOMIC_CMPXCHG_WITH_SUCCESS Addr, CmpVal, NewVal, MMO
.
Atomically replace the value at Addr
with NewVal
if it is currently CmpVal
otherwise leaves it unchanged. Puts the original value from Addr
in Res
, along with an s1 indicating whether it was replaced.
OldValRes
must be a generic virtual register of scalar type. SuccessRes
must be a generic virtual register of scalar type. It will be assigned 0 on failure and 1 on success. Addr
must be a generic virtual register with pointer type. OldValRes
, CmpVal
, and NewVal
must be generic virtual registers of the same type.Definition at line 603 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), llvm::MachineRegisterInfo::getType(), llvm::LLT::isPointer(), llvm::LLT::isScalar(), and llvm::LLT::isValid().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMW | ( | unsigned | Opcode, |
unsigned | OldValRes, | ||
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_<Opcode> Addr, Val, MMO
.
Atomically read-modify-update the value at Addr
with Val
. Puts the original value from Addr
in OldValRes
. The modification is determined by the opcode.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 655 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), llvm::MachineRegisterInfo::getType(), llvm::LLT::isPointer(), llvm::LLT::isScalar(), and llvm::LLT::isValid().
Referenced by buildAtomicRMWAdd(), buildAtomicRMWAnd(), buildAtomicRMWMax(), buildAtomicRMWMin(), buildAtomicRMWNand(), buildAtomicRMWOr(), buildAtomicRMWSub(), buildAtomicRMWUmax(), buildAtomicRMWUmin(), buildAtomicRMWXchg(), buildAtomicRMWXor(), and getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWAdd | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_ADD Addr, Val, MMO
.
Atomically replace the value at Addr
with the addition of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 684 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWAnd | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_AND Addr, Val, MMO
.
Atomically replace the value at Addr
with the bitwise and of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 696 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWMax | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_MAX Addr, Val, MMO
.
Atomically replace the value at Addr
with the signed maximum of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 721 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWMin | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_MIN Addr, Val, MMO
.
Atomically replace the value at Addr
with the signed minimum of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 727 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWNand | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_NAND Addr, Val, MMO
.
Atomically replace the value at Addr
with the bitwise nand of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 702 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWOr | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_OR Addr, Val, MMO
.
Atomically replace the value at Addr
with the bitwise or of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 707 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWSub | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_SUB Addr, Val, MMO
.
Atomically replace the value at Addr
with the subtraction of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 690 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWUmax | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_UMAX Addr, Val, MMO
.
Atomically replace the value at Addr
with the unsigned maximum of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 733 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWUmin | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_UMIN Addr, Val, MMO
.
Atomically replace the value at Addr
with the unsigned minimum of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 739 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWXchg | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_XCHG Addr, Val, MMO
.
Atomically replace the value at Addr
with Val
. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 678 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildAtomicRMWXor | ( | unsigned | OldValRes, |
unsigned | Addr, | ||
unsigned | Val, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert OldValRes<def> = G_ATOMICRMW_XOR Addr, Val, MMO
.
Atomically replace the value at Addr
with the bitwise xor of Val
and the original value. Puts the original value from Addr
in OldValRes
.
OldValRes
must be a generic virtual register. Addr
must be a generic virtual register with pointer type. OldValRes
, and Val
must be generic virtual registers of the same type.Definition at line 715 of file MachineIRBuilder.cpp.
References buildAtomicRMW().
MachineInstrBuilder MachineIRBuilder::buildBlockAddress | ( | unsigned | Res, |
const BlockAddress * | BA | ||
) |
Build and insert Res
= G_BLOCK_ADDR BA
.
G_BLOCK_ADDR computes the address of a basic block.
Res
must be a generic virtual register of a pointer type.Definition at line 746 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addBlockAddress(), llvm::MachineInstrBuilder::addDef(), assert(), buildInstr(), getMRI(), and getType().
MachineInstrBuilder MachineIRBuilder::buildBr | ( | MachineBasicBlock & | Dest | ) |
Build and insert G_BR Dest
.
G_BR is an unconditional branch to Dest
.
Definition at line 229 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addMBB(), and buildInstr().
Referenced by computeValueLLTs(), and getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildBrCond | ( | unsigned | Tst, |
MachineBasicBlock & | Dest | ||
) |
Build and insert G_BRCOND Tst
, Dest
.
G_BRCOND is a conditional branch to Dest
.
Tst
must be a generic virtual register with scalar type. At the beginning of legalization, this will be a single bit (s1). Targets with interesting flags registers may change this. For a wider type, whether the branch is taken must only depend on bit 0 (for now).Definition at line 287 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), getType(), and llvm::LegalityPredicates::isScalar().
Referenced by computeValueLLTs().
MachineInstrBuilder MachineIRBuilder::buildBrIndirect | ( | unsigned | Tgt | ) |
Build and insert G_BRINDIRECT Tgt
.
G_BRINDIRECT is an indirect branch to Tgt
.
Tgt
must be a generic virtual register with pointer type.Definition at line 233 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), and getType().
Referenced by computeValueLLTs().
MachineInstrBuilder MachineIRBuilder::buildBuildVector | ( | const DstOp & | Res, |
ArrayRef< unsigned > | Ops | ||
) |
Build and insert Res
= G_BUILD_VECTOR Op0
, ...
G_BUILD_VECTOR creates a vector value from multiple scalar registers.
Res
(and no more) must be covered by the input scalar registers. Ops
registers must be identical.Definition at line 500 of file MachineIRBuilder.cpp.
References llvm::ArrayRef< T >::begin(), buildInstr(), and llvm::ArrayRef< T >::end().
Referenced by llvm::LegalizerHelper::fewerElementsVector(), and llvm::LegalizerHelper::narrowScalar().
MachineInstrBuilder MachineIRBuilder::buildBuildVectorTrunc | ( | const DstOp & | Res, |
ArrayRef< unsigned > | Ops | ||
) |
Build and insert Res
= G_BUILD_VECTOR_TRUNC Op0
, ...
G_BUILD_VECTOR_TRUNC creates a vector value from multiple scalar registers which have types larger than the destination vector element type, and truncates the values to fit.
If the operands given are already the same size as the vector elt type, then this method will instead create a G_BUILD_VECTOR instruction.
Ops
registers must be identical.Definition at line 510 of file MachineIRBuilder.cpp.
References llvm::ArrayRef< T >::begin(), buildInstr(), and llvm::ArrayRef< T >::end().
MachineInstrBuilder MachineIRBuilder::buildCast | ( | const DstOp & | Dst, |
const SrcOp & | Src | ||
) |
Build and insert an appropriate cast between two registers of equal size.
Definition at line 386 of file MachineIRBuilder.cpp.
References assert(), buildCopy(), buildInstr(), llvm::DstOp::getLLTTy(), llvm::SrcOp::getLLTTy(), getMRI(), llvm::LLT::isPointer(), and llvm::LLT::isScalar().
Referenced by buildExtract(), buildInsert(), buildInstr(), and getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildConcatVectors | ( | const DstOp & | Res, |
ArrayRef< unsigned > | Ops | ||
) |
Build and insert Res
= G_CONCAT_VECTORS Op0
, ...
G_CONCAT_VECTORS creates a vector from the concatenation of 2 or more vectors.
Res
(and no more) must be covered by the input registers. Definition at line 520 of file MachineIRBuilder.cpp.
References llvm::ArrayRef< T >::begin(), buildInstr(), and llvm::ArrayRef< T >::end().
Referenced by llvm::LegalizerHelper::fewerElementsVector().
|
virtual |
Build and insert Res
= G_CONSTANT Val
.
G_CONSTANT is an integer constant with the specified size and value. Val
will be extended or truncated to the size of Reg
.
Res
must be a generic virtual register with scalar or pointer type.Reimplemented in llvm::CSEMIRBuilder.
Definition at line 243 of file MachineIRBuilder.cpp.
References llvm::DstOp::addDefToMIB(), assert(), buildInstr(), llvm::ConstantInt::get(), llvm::ConstantInt::getBitWidth(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::DstOp::getLLTTy(), getMF(), getMRI(), llvm::LLT::getSizeInBits(), llvm::ConstantInt::getValue(), llvm::LLT::isPointer(), llvm::LLT::isScalar(), and llvm::APInt::sextOrTrunc().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), llvm::CSEMIRBuilder::buildConstant(), buildConstant(), llvm::ConstantFoldingMIRBuilder::buildInstr(), llvm::LegalizerHelper::fewerElementsVector(), getOffsetFromIndices(), isSupportedType(), llvm::AArch64LegalizerInfo::legalizeCustom(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::lower(), llvm::AMDGPUCallLowering::lowerReturn(), materializeGEP(), llvm::LegalizerHelper::narrowScalar(), llvm::LegalizationArtifactCombiner::tryCombineSExt(), llvm::LegalizationArtifactCombiner::tryCombineZExt(), llvm::LegalizationArtifactCombiner::tryFoldImplicitDef(), llvm::LegalizerHelper::widenScalar(), and llvm::X86CallLowering::X86CallLowering().
MachineInstrBuilder MachineIRBuilder::buildConstant | ( | const DstOp & | Res, |
int64_t | Val | ||
) |
Build and insert Res
= G_CONSTANT Val
.
G_CONSTANT is an integer constant with the specified size and value.
Res
must be a generic virtual register with scalar type.Definition at line 260 of file MachineIRBuilder.cpp.
References buildConstant(), llvm::IntegerType::get(), llvm::ConstantInt::get(), getFunction(), llvm::DstOp::getLLTTy(), getMF(), getMRI(), and llvm::LLT::getSizeInBits().
MachineInstrBuilder MachineIRBuilder::buildConstDbgValue | ( | const Constant & | C, |
const MDNode * | Variable, | ||
const MDNode * | Expr | ||
) |
Build and insert a DBG_VALUE instructions specifying that Variable
is given by C
(suitably modified by Expr
).
Definition at line 130 of file MachineIRBuilder.cpp.
References assert(), buildInstr(), and getDL().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildCopy | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= COPY Op.
Register-to-register COPY sets Res
to Op
.
Definition at line 238 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), buildCast(), computeValueLLTs(), getOffsetFromIndices(), isSupportedType(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), llvm::CombinerHelper::replaceRegWith(), and llvm::X86CallLowering::X86CallLowering().
MachineInstrBuilder MachineIRBuilder::buildDbgLabel | ( | const MDNode * | Label | ) |
Build and insert a DBG_LABEL instructions specifying that Label
is given.
Convert "llvm.dbg.label Label" to "DBG_LABEL Label".
Definition at line 154 of file MachineIRBuilder.cpp.
References assert(), buildInstr(), and llvm::MachineIRBuilderState::DL.
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildDirectDbgValue | ( | unsigned | Reg, |
const MDNode * | Variable, | ||
const MDNode * | Expr | ||
) |
Build and insert a DBG_VALUE instruction expressing the fact that the associated Variable
lives in Reg
(suitably modified by Expr
).
Definition at line 90 of file MachineIRBuilder.cpp.
References assert(), llvm::BuildMI(), getDL(), getMF(), getTII(), and insertInstr().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildExtOrTrunc | ( | unsigned | ExtOpc, |
const DstOp & | Res, | ||
const SrcOp & | Op | ||
) |
Build and insert Res
= ExtOpc
, Res
= G_TRUNC Op
, or Res
= COPY Op
depending on the differing sizes of Res
and Op
.
///
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type.Definition at line 347 of file MachineIRBuilder.cpp.
References assert(), buildInstr(), llvm::DstOp::getLLTTy(), llvm::SrcOp::getLLTTy(), getMRI(), llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), and llvm::LLT::isVector().
Referenced by buildAnyExtOrTrunc(), buildSExtOrTrunc(), and buildZExtOrTrunc().
MachineInstrBuilder MachineIRBuilder::buildExtract | ( | unsigned | Res, |
unsigned | Src, | ||
uint64_t | Index | ||
) |
Build and insert `Res0, ...
= G_EXTRACT Src, Idx0`.
Res
and Src
must be generic virtual registers.Definition at line 406 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addUse(), assert(), buildCast(), buildInstr(), getMRI(), llvm::getSizeInBits(), and getType().
Referenced by getOffsetFromIndices(), llvm::AArch64CallLowering::lowerCall(), llvm::AArch64CallLowering::lowerReturn(), and llvm::LegalizerHelper::narrowScalar().
MachineInstrBuilder MachineIRBuilder::buildExtractVectorElement | ( | const DstOp & | Res, |
const SrcOp & | Val, | ||
const SrcOp & | Idx | ||
) |
Build and insert Res
= G_EXTRACT_VECTOR_ELT Val
, Idx
.
Res
must be a generic virtual register with scalar type. Val
must be a generic virtual register with vector type. Idx
must be a generic virtual register with scalar type.Definition at line 598 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildFCmp | ( | CmpInst::Predicate | Pred, |
const DstOp & | Res, | ||
const SrcOp & | Op0, | ||
const SrcOp & | Op1 | ||
) |
Build and insert a Res
= G_FCMP Pred
Op0
,Op1
.
Res
must be a generic virtual register with scalar or vector type. Typically this starts as s1 or <N x="" s1>="">. Op0
and Op1 must be generic virtual registers with the same number of elements as Res
(or scalar, if Res
is scalar). Pred
must be a floating-point predicate.Definition at line 575 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by computeValueLLTs().
|
virtual |
Build and insert Res
= G_FCONSTANT Val
.
G_FCONSTANT is a floating-point constant with the specified size and value.
Res
must be a generic virtual register with scalar type.Reimplemented in llvm::CSEMIRBuilder.
Definition at line 268 of file MachineIRBuilder.cpp.
References llvm::DstOp::addDefToMIB(), assert(), buildInstr(), llvm::DstOp::getLLTTy(), getMRI(), and llvm::LLT::isScalar().
Referenced by llvm::CSEMIRBuilder::buildFConstant(), buildFConstant(), and llvm::LegalizerHelper::lower().
MachineInstrBuilder MachineIRBuilder::buildFConstant | ( | const DstOp & | Res, |
double | Val | ||
) |
Definition at line 278 of file MachineIRBuilder.cpp.
References buildFConstant(), llvm::ConstantFP::get(), llvm::getAPFloatFromSize(), llvm::Function::getContext(), llvm::MachineFunction::getFunction(), llvm::DstOp::getLLTTy(), getMF(), getMRI(), and llvm::LLT::getSizeInBits().
MachineInstrBuilder MachineIRBuilder::buildFIDbgValue | ( | int | FI, |
const MDNode * | Variable, | ||
const MDNode * | Expr | ||
) |
Build and insert a DBG_VALUE instruction expressing the fact that the associated Variable
lives in the stack slot specified by FI
(suitably modified by Expr
).
Definition at line 115 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addFrameIndex(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMetadata(), assert(), buildInstr(), and getDL().
MachineInstrBuilder MachineIRBuilder::buildFPTrunc | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_FPTRUNC Op
.
G_FPTRUNC converts a floating-point value into one with a smaller type.
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type. Res
must be smaller than Op
Definition at line 563 of file MachineIRBuilder.cpp.
References buildInstr().
MachineInstrBuilder MachineIRBuilder::buildFrameIndex | ( | unsigned | Res, |
int | Idx | ||
) |
Build and insert Res
= G_FRAME_INDEX Idx
.
G_FRAME_INDEX materializes the address of an alloca value or other stack-based object.
Res
must be a generic virtual register with pointer type.Definition at line 163 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addFrameIndex(), assert(), buildInstr(), getMRI(), and getType().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), getOffsetFromIndices(), llvm::X86CallLowering::lowerReturn(), and llvm::ARMCallLowering::lowerReturn().
MachineInstrBuilder MachineIRBuilder::buildGEP | ( | unsigned | Res, |
unsigned | Op0, | ||
unsigned | Op1 | ||
) |
Build and insert Res
= G_GEP Op0
, Op1
.
G_GEP adds Op1
bytes to the pointer specified by Op0
, storing the resulting pointer in Res
.
Res
and Op0
must be generic virtual registers with pointer type. Op1
must be a generic virtual register with scalar type.Definition at line 188 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), getType(), and llvm::LegalityPredicates::isScalar().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), getOffsetFromIndices(), isSupportedType(), llvm::AArch64LegalizerInfo::legalizeCustom(), llvm::AMDGPUCallLowering::lowerReturn(), materializeGEP(), and llvm::X86CallLowering::X86CallLowering().
MachineInstrBuilder MachineIRBuilder::buildGlobalValue | ( | unsigned | Res, |
const GlobalValue * | GV | ||
) |
Build and insert Res
= G_GLOBAL_VALUE GV
.
G_GLOBAL_VALUE materializes the address of the specified global into Res
.
Res
must be a generic virtual register with pointer type in the same address space as GV
.Definition at line 170 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addGlobalAddress(), assert(), buildInstr(), llvm::PointerType::getAddressSpace(), getMRI(), getType(), and llvm::GlobalValue::getType().
MachineInstrBuilder MachineIRBuilder::buildICmp | ( | CmpInst::Predicate | Pred, |
const DstOp & | Res, | ||
const SrcOp & | Op0, | ||
const SrcOp & | Op1 | ||
) |
Build and insert a Res
= G_ICMP Pred
, Op0
, Op1
.
Res
must be a generic virtual register with scalar or vector type. Typically this starts as s1 or <N x="" s1>="">. Op0
and Op1 must be generic virtual registers with the same number of elements as Res
. If Res
is a scalar, Op0
must be either a scalar or pointer. Pred
must be an integer predicate.Definition at line 568 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by computeValueLLTs(), llvm::LegalizerHelper::fewerElementsVector(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::lower(), and llvm::LegalizerHelper::widenScalar().
MachineInstrBuilder MachineIRBuilder::buildIndirectDbgValue | ( | unsigned | Reg, |
const MDNode * | Variable, | ||
const MDNode * | Expr | ||
) |
Build and insert a DBG_VALUE instruction expressing the fact that the associated Variable
lives in memory at Reg
(suitably modified by Expr
).
Definition at line 103 of file MachineIRBuilder.cpp.
References assert(), llvm::BuildMI(), getDL(), getMF(), getTII(), and insertInstr().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildInsert | ( | unsigned | Res, |
unsigned | Src, | ||
unsigned | Op, | ||
unsigned | Index | ||
) |
Definition at line 528 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addUse(), assert(), buildCast(), buildInstr(), getMRI(), llvm::getSizeInBits(), and getType().
Referenced by buildSequence(), getOffsetFromIndices(), llvm::AArch64CallLowering::lowerFormalArguments(), and llvm::LegalizerHelper::narrowScalar().
MachineInstrBuilder MachineIRBuilder::buildInsertVectorElement | ( | const DstOp & | Res, |
const SrcOp & | Val, | ||
const SrcOp & | Elt, | ||
const SrcOp & | Idx | ||
) |
Build and insert Res
= G_INSERT_VECTOR_ELT Val
, Elt
, Idx
.
Res
and Val
must be a generic virtual register Elt
and Idx
must be a generic virtual register with scalar type.Definition at line 592 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildInstr | ( | unsigned | Opcode | ) |
Build and insert <empty> = Opcode
<empty>.
The insertion point is the one set by the last call of either setBasicBlock or setMI.
Definition at line 74 of file MachineIRBuilder.cpp.
References buildInstrNoInsert(), and insertInstr().
Referenced by buildAnyExt(), buildAtomicCmpXchg(), buildAtomicCmpXchgWithSuccess(), buildAtomicRMW(), buildBlockAddress(), buildBr(), buildBrCond(), buildBrIndirect(), buildBuildVector(), buildBuildVectorTrunc(), buildCast(), buildConcatVectors(), buildConstant(), buildConstDbgValue(), buildCopy(), buildDbgLabel(), buildExtOrTrunc(), buildExtract(), buildExtractVectorElement(), buildFCmp(), buildFConstant(), buildFIDbgValue(), buildFPTrunc(), buildFrameIndex(), buildGEP(), buildGlobalValue(), buildICmp(), buildInsert(), buildInsertVectorElement(), llvm::ConstantFoldingMIRBuilder::buildInstr(), llvm::CSEMIRBuilder::buildInstr(), buildInstr(), buildIntrinsic(), buildLoadInstr(), buildMerge(), buildPtrMask(), buildSelect(), buildSExt(), buildStore(), buildTrunc(), buildUAdde(), buildUndef(), buildUnmerge(), buildZExt(), changeFCMPPredToAArch64CC(), computeValueLLTs(), llvm::LegalizerHelper::fewerElementsVector(), getOffsetFromIndices(), llvm::LegalizerHelper::lower(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::AMDGPUCallLowering::lowerReturn(), llvm::LegalizerHelper::narrowScalar(), llvm::LegalizationArtifactCombiner::tryCombineAnyExt(), llvm::LegalizationArtifactCombiner::tryCombineSExt(), llvm::LegalizationArtifactCombiner::tryFoldImplicitDef(), and llvm::LegalizerHelper::widenScalar().
|
virtual |
Reimplemented in llvm::CSEMIRBuilder, and llvm::ConstantFoldingMIRBuilder.
Definition at line 789 of file MachineIRBuilder.cpp.
References llvm::all_of(), assert(), llvm::ArrayRef< T >::begin(), buildCast(), buildInstr(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), getMRI(), llvm::LLT::getNumElements(), llvm::getSizeInBits(), llvm::CmpInst::isFPPredicate(), llvm::CmpInst::isIntPredicate(), llvm::LLT::isPointer(), llvm::LLT::isScalar(), llvm::LegalityPredicates::isScalar(), llvm::LLT::isVector(), llvm::HexagonMCInstrInfo::isVector(), llvm::ArrayRef< T >::size(), llvm::SrcOp::Ty_Predicate, validateBinaryOp(), validateSelectOp(), and validateTruncExt().
MachineInstrBuilder MachineIRBuilder::buildInstrNoInsert | ( | unsigned | Opcode | ) |
Build but don't insert <empty> = Opcode
<empty>.
Definition at line 78 of file MachineIRBuilder.cpp.
References llvm::BuildMI(), getDL(), getMF(), and getTII().
Referenced by buildInstr(), llvm::RegBankSelect::getAnalysisUsage(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::X86CallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), llvm::AArch64CallLowering::lowerReturn(), and llvm::MipsCallLowering::lowerReturn().
MachineInstrBuilder MachineIRBuilder::buildIntrinsic | ( | Intrinsic::ID | ID, |
unsigned | Res, | ||
bool | HasSideEffects | ||
) |
Build and insert either a G_INTRINSIC (if HasSideEffects
is false) or G_INTRINSIC_W_SIDE_EFFECTS instruction.
Its first operand will be the result register definition unless Reg
is NoReg (== 0). The second operand will be the intrinsic's ID.
Callers are expected to add the required definitions and uses afterwards.
Definition at line 546 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildLoad | ( | unsigned | Res, |
unsigned | Addr, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert Res = G_LOAD Addr, MMO
.
Loads the value stored at Addr
. Puts the result in Res
.
Res
must be a generic virtual register. Addr
must be a generic virtual register with pointer type.Definition at line 294 of file MachineIRBuilder.cpp.
References buildLoadInstr().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), computeValueLLTs(), llvm::LegalizerHelper::fewerElementsVector(), llvm::MipsCallLowering::MipsHandler::handle(), llvm::AArch64LegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::lower(), llvm::X86CallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), llvm::AMDGPUCallLowering::lowerReturn(), and llvm::LegalizerHelper::narrowScalar().
MachineInstrBuilder MachineIRBuilder::buildLoadInstr | ( | unsigned | Opcode, |
unsigned | Res, | ||
unsigned | Addr, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert Res = <opcode> Addr, MMO
.
Loads the value stored at Addr
. Puts the result in Res
.
Res
must be a generic virtual register. Addr
must be a generic virtual register with pointer type.Definition at line 299 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), and getType().
Referenced by buildLoad().
MachineInstrBuilder MachineIRBuilder::buildMerge | ( | const DstOp & | Res, |
ArrayRef< unsigned > | Ops | ||
) |
Build and insert Res
= G_MERGE_VALUES Op0
, ...
G_MERGE_VALUES combines the input elements contiguously into a larger register.
Res
(and no more) must be covered by the input registers. Ops
registers must be identical.Definition at line 473 of file MachineIRBuilder.cpp.
References llvm::ArrayRef< T >::begin(), buildInstr(), and llvm::ArrayRef< T >::end().
Referenced by buildSequence(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::X86CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerReturn(), llvm::LegalizerHelper::narrowScalar(), and llvm::LegalizationArtifactCombiner::tryCombineMerges().
|
inline |
Build and insert Res
= G_MUL Op0
, Op1
.
G_MUL sets Res
to the sum of integer parameters Op0
and Op1
, truncated to their width.
Res
, Op0
and Op1
must be generic virtual registers with the same (scalar or vector) type).Definition at line 1121 of file MachineIRBuilder.h.
Referenced by getOffsetFromIndices(), and llvm::LegalizerHelper::lower().
|
inline |
Build and insert Res
= G_OR Op0
, Op1
.
G_OR sets Res
to the bitwise or of integer parameters Op0
and Op1
.
Res
, Op0
and Op1
must be generic virtual registers with the same (scalar or vector) type).Definition at line 1153 of file MachineIRBuilder.h.
References llvm::None.
Referenced by llvm::ARMLegalizerInfo::legalizeCustom().
MachineInstrBuilder MachineIRBuilder::buildPtrMask | ( | unsigned | Res, |
unsigned | Op0, | ||
uint32_t | NumBits | ||
) |
Build and insert Res
= G_PTR_MASK Op0
, NumBits
.
G_PTR_MASK clears the low bits of a pointer operand without destroying its pointer properties. This has the effect of rounding the address down to a specified alignment in bits.
Res
and Op0
must be generic virtual registers with pointer type. NumBits
must be an integer representing the number of low bits to be cleared in Op0
.Definition at line 218 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addDef(), llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), and getType().
Referenced by getOffsetFromIndices(), and llvm::AArch64LegalizerInfo::legalizeCustom().
MachineInstrBuilder MachineIRBuilder::buildSelect | ( | const DstOp & | Res, |
const SrcOp & | Tst, | ||
const SrcOp & | Op0, | ||
const SrcOp & | Op1 | ||
) |
Build and insert a Res
= G_SELECT Tst
, Op0
, Op1
.
Res
, Op0
and Op1
must be generic virtual registers with the same type. Tst
must be a generic virtual register with scalar, pointer or vector type. If vector then it must have the same number of elements as the other parameters.Definition at line 583 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::LegalizerHelper::fewerElementsVector(), and getOffsetFromIndices().
void MachineIRBuilder::buildSequence | ( | unsigned | Res, |
ArrayRef< unsigned > | Ops, | ||
ArrayRef< uint64_t > | Indices | ||
) |
Build and insert instructions to put Ops
together at the specified p Indices to form a larger register.
If the types of the input registers are uniform and cover the entirity of Res
then a G_MERGE_VALUES will be produced. Otherwise an IMPLICIT_DEF followed by a sequence of G_INSERT instructions.
Indices
must be in ascending order of bit position. Definition at line 428 of file MachineIRBuilder.cpp.
References assert(), llvm::ArrayRef< T >::begin(), buildInsert(), buildMerge(), buildUndef(), llvm::MachineRegisterInfo::createGenericVirtualRegister(), llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), getMRI(), llvm::LLT::getSizeInBits(), getType(), llvm::MachineRegisterInfo::getType(), and llvm::ArrayRef< T >::size().
Referenced by llvm::AArch64CallLowering::lowerCall().
MachineInstrBuilder MachineIRBuilder::buildSExt | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_SEXT Op
.
G_SEXT produces a register of the specified width, with bits 0 to sizeof(Ty
) * 8 set to Op
. The remaining bits are duplicated from the high bit of Op
(i.e. 2s-complement sign extended).
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type. Op
must be smaller than Res
Definition at line 337 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::CallLowering::ValueHandler::extendRegister(), and llvm::LegalizerHelper::lower().
MachineInstrBuilder MachineIRBuilder::buildSExtOrTrunc | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_SEXT Op
, Res
= G_TRUNC Op
, or Res
= COPY Op
depending on the differing sizes of Res
and Op
.
///
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type.Definition at line 371 of file MachineIRBuilder.cpp.
References buildExtOrTrunc().
Referenced by getOffsetFromIndices().
MachineInstrBuilder MachineIRBuilder::buildStore | ( | unsigned | Val, |
unsigned | Addr, | ||
MachineMemOperand & | MMO | ||
) |
Build and insert G_STORE Val, Addr, MMO
.
Stores the value Val
to Addr
.
Val
must be a generic virtual register. Addr
must be a generic virtual register with pointer type.Definition at line 312 of file MachineIRBuilder.cpp.
References llvm::MachineInstrBuilder::addMemOperand(), llvm::MachineInstrBuilder::addUse(), assert(), buildInstr(), getMRI(), and getType().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), computeValueLLTs(), llvm::LegalizerHelper::fewerElementsVector(), getOffsetFromIndices(), isSupportedType(), llvm::AArch64LegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::narrowScalar(), and llvm::X86CallLowering::X86CallLowering().
|
inline |
Build and insert Res
= G_SUB Op0
, Op1
.
G_SUB sets Res
to the sum of integer parameters Op0
and Op1
, truncated to their width.
Res
, Op0
and Op1
must be generic virtual registers with the same (scalar or vector) type).Definition at line 1105 of file MachineIRBuilder.h.
Referenced by llvm::LegalizerHelper::lower().
MachineInstrBuilder MachineIRBuilder::buildTrunc | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_TRUNC Op
.
G_TRUNC extracts the low bits of a type. For a vector type each element is truncated independently before being packed into the destination.
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type. Res
must be smaller than Op
Definition at line 558 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::X86CallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), and llvm::LegalizerHelper::widenScalar().
MachineInstrBuilder MachineIRBuilder::buildUAdde | ( | const DstOp & | Res, |
const DstOp & | CarryOut, | ||
const SrcOp & | Op0, | ||
const SrcOp & | Op1, | ||
const SrcOp & | CarryIn | ||
) |
Build and insert Res
, CarryOut
= G_UADDE Op0
, Op1
, CarryIn
.
G_UADDE sets Res
to Op0
+ Op1
+ CarryIn
(truncated to the bit width) and sets CarryOut
to 1 if the result overflowed in unsigned arithmetic.
Res
, Op0
and Op1
must be generic virtual registers with the same scalar type. CarryOut
and CarryIn
must be generic virtual registers with the same scalar type (typically s1)Definition at line 323 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::LegalizerHelper::narrowScalar().
MachineInstrBuilder MachineIRBuilder::buildUndef | ( | const DstOp & | Res | ) |
Build and insert Res
= IMPLICIT_DEF.
Definition at line 469 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by buildSequence(), llvm::LegalizerHelper::fewerElementsVector(), getOffsetFromIndices(), llvm::AArch64CallLowering::lowerFormalArguments(), and llvm::LegalizerHelper::narrowScalar().
MachineInstrBuilder MachineIRBuilder::buildUnmerge | ( | ArrayRef< LLT > | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res0
, ...
= G_UNMERGE_VALUES Op
G_UNMERGE_VALUES splits contiguous bits of the input into multiple
Res
(and no more) must be covered by the input registers. Res
registers must be identical.Definition at line 482 of file MachineIRBuilder.cpp.
References llvm::ArrayRef< T >::begin(), buildInstr(), and llvm::ArrayRef< T >::end().
Referenced by isSupportedType(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::legalizeInstrStep(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::X86CallLowering::lowerReturn(), llvm::LegalizerHelper::narrowScalar(), and llvm::LegalizationArtifactCombiner::tryCombineMerges().
MachineInstrBuilder MachineIRBuilder::buildUnmerge | ( | ArrayRef< unsigned > | Res, |
const SrcOp & | Op | ||
) |
Definition at line 491 of file MachineIRBuilder.cpp.
References llvm::ArrayRef< T >::begin(), buildInstr(), and llvm::ArrayRef< T >::end().
MachineInstrBuilder MachineIRBuilder::buildZExt | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_ZEXT Op
.
G_ZEXT produces a register of the specified width, with bits 0 to sizeof(Ty
) * 8 set to Op
. The remaining bits are 0. For a vector register, each element is extended individually.
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type. Op
must be smaller than Res
Definition at line 342 of file MachineIRBuilder.cpp.
References buildInstr().
Referenced by llvm::CallLowering::ValueHandler::extendRegister(), llvm::LegalizerHelper::lower(), llvm::AArch64CallLowering::lowerReturn(), and llvm::LegalizerHelper::widenScalar().
MachineInstrBuilder MachineIRBuilder::buildZExtOrTrunc | ( | const DstOp & | Res, |
const SrcOp & | Op | ||
) |
Build and insert Res
= G_ZEXT Op
, Res
= G_TRUNC Op
, or Res
= COPY Op
depending on the differing sizes of Res
and Op
.
///
Res
must be a generic virtual register with scalar or vector type. Op
must be a generic virtual register with scalar or vector type.Definition at line 376 of file MachineIRBuilder.cpp.
References buildExtOrTrunc().
Referenced by getOffsetFromIndices().
|
inline |
Definition at line 254 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::CSEInfo.
Referenced by llvm::CSEMIRBuilder::buildInstr().
|
inline |
Definition at line 255 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::CSEInfo.
|
inline |
Get the current instruction's debug location.
Definition at line 290 of file MachineIRBuilder.h.
References buildGEP(), C, llvm::MachineIRBuilderState::DL, and Reg.
Referenced by getOffsetFromIndices().
Getter for DebugLoc.
Definition at line 234 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::DL.
Referenced by buildConstDbgValue(), buildDirectDbgValue(), buildFIDbgValue(), buildIndirectDbgValue(), and buildInstrNoInsert().
|
inline |
Current insertion point for new instructions.
Definition at line 258 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::II, Info, llvm::MachineIRBuilderState::MBB, llvm::MachineIRBuilderState::MF, and llvm::MachineIRBuilderState::Observer.
Referenced by insertInstr(), and llvm::LegalizerHelper::narrowScalar().
|
inline |
Getter for the basic block we currently build.
Definition at line 244 of file MachineIRBuilder.h.
References assert(), and llvm::MachineIRBuilderState::MBB.
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), computeValueLLTs(), getOffsetFromIndices(), llvm::MipsCallLowering::MipsHandler::handle(), insertInstr(), llvm::X86CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), and llvm::LegalizerHelper::narrowScalar().
|
inline |
Definition at line 249 of file MachineIRBuilder.h.
|
inline |
Getter for the function we currently build.
Definition at line 228 of file MachineIRBuilder.h.
References assert(), and llvm::MachineIRBuilderState::MF.
Referenced by llvm::AArch64CallLowering::AArch64CallLowering(), buildConstant(), buildDirectDbgValue(), buildFConstant(), buildIndirectDbgValue(), buildInstrNoInsert(), llvm::createLibcall(), llvm::RegBankSelect::getAnalysisUsage(), llvm::CallLowering::handleAssignments(), isSupportedType(), llvm::AArch64LegalizerInfo::legalizeCustom(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::libcall(), llvm::LegalizerHelper::lower(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::X86CallLowering::lowerFormalArguments(), llvm::AMDGPUCallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::MipsCallLowering::lowerFormalArguments(), llvm::X86CallLowering::lowerReturn(), llvm::AMDGPUCallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), llvm::AArch64CallLowering::lowerReturn(), llvm::MipsCallLowering::lowerReturn(), llvm::LegalizerHelper::narrowScalar(), setInsertPt(), setMBB(), llvm::LegalizerHelper::widenScalar(), and llvm::X86CallLowering::X86CallLowering().
|
inline |
Getter for MRI.
Definition at line 237 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::MRI.
Referenced by buildAtomicCmpXchg(), buildAtomicCmpXchgWithSuccess(), buildAtomicRMW(), buildBlockAddress(), buildBrCond(), buildBrIndirect(), buildCast(), llvm::CSEMIRBuilder::buildConstant(), buildConstant(), buildExtOrTrunc(), buildExtract(), llvm::CSEMIRBuilder::buildFConstant(), buildFConstant(), buildFrameIndex(), buildGEP(), buildGlobalValue(), buildInsert(), llvm::ConstantFoldingMIRBuilder::buildInstr(), llvm::CSEMIRBuilder::buildInstr(), buildInstr(), buildLoadInstr(), buildPtrMask(), buildSequence(), buildStore(), and materializeGEP().
|
inline |
Definition at line 238 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::MRI.
|
inline |
Getter for the State.
Definition at line 241 of file MachineIRBuilder.h.
|
inline |
Definition at line 222 of file MachineIRBuilder.h.
References assert(), and llvm::MachineIRBuilderState::TII.
Referenced by buildDirectDbgValue(), buildIndirectDbgValue(), and buildInstrNoInsert().
MachineInstrBuilder MachineIRBuilder::insertInstr | ( | MachineInstrBuilder | MIB | ) |
Insert an existing instruction at the insertion point.
Definition at line 83 of file MachineIRBuilder.cpp.
References getInsertPt(), getMBB(), llvm::MachineBasicBlock::insert(), and recordInsertion().
Referenced by buildDirectDbgValue(), buildIndirectDbgValue(), buildInstr(), llvm::X86CallLowering::lowerCall(), llvm::ARMCallLowering::lowerCall(), llvm::AArch64CallLowering::lowerCall(), llvm::MipsCallLowering::lowerCall(), llvm::X86CallLowering::lowerReturn(), llvm::ARMCallLowering::lowerReturn(), llvm::AArch64CallLowering::lowerReturn(), and llvm::MipsCallLowering::lowerReturn().
Optional< MachineInstrBuilder > MachineIRBuilder::materializeGEP | ( | unsigned & | Res, |
unsigned | Op0, | ||
const LLT & | ValueTy, | ||
uint64_t | Value | ||
) |
Materialize and insert Res
= G_GEP Op0
, (G_CONSTANT Value
)
G_GEP adds Value
bytes to the pointer specified by Op0
, storing the resulting pointer in Res
. If Value
is zero then no G_GEP or G_CONSTANT will be created and
Res
.Op0
must be a generic virtual register with pointer type. ValueTy
must be a scalar type. Res
must be 0. This is to detect confusion between materializeGEP() and buildGEP(). Res
will either be a new generic virtual register of the same type as Op0
or Op0
itself.Definition at line 201 of file MachineIRBuilder.cpp.
References assert(), buildConstant(), buildGEP(), llvm::MachineRegisterInfo::createGenericVirtualRegister(), getMRI(), getType(), llvm::LLT::isScalar(), and llvm::None.
Referenced by computeValueLLTs(), llvm::LegalizerHelper::fewerElementsVector(), and llvm::LegalizerHelper::narrowScalar().
|
protected |
Definition at line 59 of file MachineIRBuilder.cpp.
References llvm::GISelChangeObserver::createdInstr(), and llvm::MachineIRBuilderState::Observer.
Referenced by insertInstr().
void MachineIRBuilder::setChangeObserver | ( | GISelChangeObserver & | Observer | ) |
Definition at line 64 of file MachineIRBuilder.cpp.
References llvm::MachineIRBuilderState::Observer.
Referenced by llvm::LegalizerHelper::LegalizerHelper().
void MachineIRBuilder::setCSEInfo | ( | GISelCSEInfo * | Info | ) |
Definition at line 49 of file MachineIRBuilder.cpp.
References llvm::MachineIRBuilderState::CSEInfo, and Info.
Set the debug location to DL
for all the next build instructions.
Definition at line 287 of file MachineIRBuilder.h.
References llvm::MachineIRBuilderState::DL.
void MachineIRBuilder::setInsertPt | ( | MachineBasicBlock & | MBB, |
MachineBasicBlock::iterator | II | ||
) |
Set the insertion point before the specified position.
Definition at line 51 of file MachineIRBuilder.cpp.
References assert(), getMF(), llvm::MachineBasicBlock::getParent(), llvm::MachineIRBuilderState::II, and llvm::MachineIRBuilderState::MBB.
Referenced by llvm::LegalizerHelper::narrowScalar(), and llvm::LegalizerHelper::widenScalar().
void MachineIRBuilder::setInstr | ( | MachineInstr & | MI | ) |
Set the insertion point to before MI.
Definition at line 43 of file MachineIRBuilder.cpp.
References assert(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getParent(), llvm::MachineIRBuilderState::II, and setMBB().
Referenced by llvm::LegalizerHelper::fewerElementsVector(), llvm::MipsLegalizerInfo::legalizeCustom(), llvm::AArch64LegalizerInfo::legalizeCustom(), llvm::ARMLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::libcall(), llvm::LegalizerHelper::lower(), llvm::X86CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::LegalizerHelper::narrowScalar(), llvm::LegalizationArtifactCombiner::tryCombineAnyExt(), llvm::LegalizationArtifactCombiner::tryCombineMerges(), llvm::LegalizationArtifactCombiner::tryCombineSExt(), llvm::LegalizationArtifactCombiner::tryCombineZExt(), llvm::LegalizationArtifactCombiner::tryFoldImplicitDef(), and llvm::LegalizerHelper::widenScalar().
void MachineIRBuilder::setMBB | ( | MachineBasicBlock & | MBB | ) |
Set the insertion point to the end of MBB
.
MBB
must be contained by getMF(). Definition at line 36 of file MachineIRBuilder.cpp.
References assert(), llvm::MachineBasicBlock::end(), getMF(), llvm::MachineBasicBlock::getParent(), llvm::MachineIRBuilderState::II, and llvm::MachineIRBuilderState::MBB.
Referenced by computeValueLLTs(), llvm::X86CallLowering::lowerFormalArguments(), llvm::ARMCallLowering::lowerFormalArguments(), llvm::AArch64CallLowering::lowerFormalArguments(), llvm::RegBankSelect::runOnMachineFunction(), and setInstr().
void MachineIRBuilder::setMF | ( | MachineFunction & | MF | ) |
Definition at line 26 of file MachineIRBuilder.cpp.
References llvm::MachineIRBuilderState::DL, llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), llvm::MachineIRBuilderState::II, llvm::MachineIRBuilderState::MBB, llvm::MachineIRBuilderState::MF, llvm::MachineIRBuilderState::MRI, llvm::MachineIRBuilderState::Observer, and llvm::MachineIRBuilderState::TII.
Referenced by INITIALIZE_PASS_END(), and llvm::LegalizerHelper::LegalizerHelper().
void MachineIRBuilder::stopObservingChanges | ( | ) |
Definition at line 68 of file MachineIRBuilder.cpp.
References llvm::MachineIRBuilderState::Observer.
|
protected |
Definition at line 182 of file MachineIRBuilder.cpp.
References assert(), llvm::LLT::isScalar(), and llvm::LLT::isVector().
Referenced by buildInstr().
|
protected |
Definition at line 773 of file MachineIRBuilder.cpp.
References assert(), llvm::LLT::getNumElements(), llvm::LLT::isPointer(), llvm::LLT::isScalar(), and llvm::LLT::isVector().
Referenced by buildInstr().
|
protected |
Definition at line 754 of file MachineIRBuilder.cpp.
References assert(), llvm::LLT::getNumElements(), llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), and llvm::LLT::isVector().
Referenced by buildInstr().