LLVM 20.0.0git
Typedefs | Functions | Variables
MachineInstr.cpp File Reference
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryLocation.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineInstrBundle.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/Register.h"
#include "llvm/CodeGen/StackMaps.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGenTypes/LowLevelType.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/DebugLoc.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ModuleSlotTracker.h"
#include "llvm/IR/Operator.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <utility>

Go to the source code of this file.

Typedefs

using MMOList = SmallVector< const MachineMemOperand *, 2 >
 

Functions

static const MachineFunctiongetMFIfAvailable (const MachineInstr &MI)
 
static void tryToGetTargetInfo (const MachineInstr &MI, const TargetRegisterInfo *&TRI, const MachineRegisterInfo *&MRI, const TargetIntrinsicInfo *&IntrinsicInfo, const TargetInstrInfo *&TII)
 
static void moveOperands (MachineOperand *Dst, MachineOperand *Src, unsigned NumOps, MachineRegisterInfo *MRI)
 Move NumOps MachineOperands from Src to Dst, with support for overlapping ranges.
 
static bool hasIdenticalMMOs (ArrayRef< MachineMemOperand * > LHS, ArrayRef< MachineMemOperand * > RHS)
 Check to see if the MMOs pointed to by the two MemRefs arrays are identical.
 
static bool MemOperandsHaveAlias (const MachineFrameInfo &MFI, AAResults *AA, bool UseTBAA, const MachineMemOperand *MMOa, const MachineMemOperand *MMOb)
 
static const DIExpressioncomputeExprForSpill (const MachineInstr &MI, const SmallVectorImpl< const MachineOperand * > &SpilledOperands)
 Compute the new DIExpression to use with a DBG_VALUE for a spill slot.
 
static const DIExpressioncomputeExprForSpill (const MachineInstr &MI, Register SpillReg)
 
static LocationSize getSpillSlotSize (const MMOList &Accesses, const MachineFrameInfo &MFI)
 

Variables

const unsigned TiedMax = 15
 

Typedef Documentation

◆ MMOList

Definition at line 2425 of file MachineInstr.cpp.

Function Documentation

◆ computeExprForSpill() [1/2]

static const DIExpression * computeExprForSpill ( const MachineInstr MI,
const SmallVectorImpl< const MachineOperand * > &  SpilledOperands 
)
static

Compute the new DIExpression to use with a DBG_VALUE for a spill slot.

This prepends DW_OP_deref when spilling an indirect DBG_VALUE.

Definition at line 2299 of file MachineInstr.cpp.

References llvm::DIExpression::appendOpsToArg(), assert(), llvm::DIExpression::DerefBefore, MI, and llvm::DIExpression::prepend().

Referenced by llvm::buildDbgValueForSpill(), computeExprForSpill(), and llvm::updateDbgValueForSpill().

◆ computeExprForSpill() [2/2]

static const DIExpression * computeExprForSpill ( const MachineInstr MI,
Register  SpillReg 
)
static

◆ getMFIfAvailable()

static const MachineFunction * getMFIfAvailable ( const MachineInstr MI)
static

◆ getSpillSlotSize()

static LocationSize getSpillSlotSize ( const MMOList Accesses,
const MachineFrameInfo MFI 
)
static

◆ hasIdenticalMMOs()

static bool hasIdenticalMMOs ( ArrayRef< MachineMemOperand * >  LHS,
ArrayRef< MachineMemOperand * >  RHS 
)
static

Check to see if the MMOs pointed to by the two MemRefs arrays are identical.

Definition at line 414 of file MachineInstr.cpp.

References LHS, llvm::make_pointee_range(), and RHS.

Referenced by llvm::MachineInstr::cloneMergedMemRefs().

◆ MemOperandsHaveAlias()

static bool MemOperandsHaveAlias ( const MachineFrameInfo MFI,
AAResults AA,
bool  UseTBAA,
const MachineMemOperand MMOa,
const MachineMemOperand MMOb 
)
static

◆ moveOperands()

static void moveOperands ( MachineOperand Dst,
MachineOperand Src,
unsigned  NumOps,
MachineRegisterInfo MRI 
)
static

Move NumOps MachineOperands from Src to Dst, with support for overlapping ranges.

If MRI is non-null also update use-def chains.

Definition at line 191 of file MachineInstr.cpp.

References assert(), and MRI.

Referenced by llvm::MachineInstr::addOperand(), and llvm::MachineInstr::removeOperand().

◆ tryToGetTargetInfo()

static void tryToGetTargetInfo ( const MachineInstr MI,
const TargetRegisterInfo *&  TRI,
const MachineRegisterInfo *&  MRI,
const TargetIntrinsicInfo *&  IntrinsicInfo,
const TargetInstrInfo *&  TII 
)
static

Definition at line 74 of file MachineInstr.cpp.

References getMFIfAvailable(), MI, MRI, TII, and TRI.

Referenced by llvm::MachineOperand::print(), and llvm::MachineInstr::print().

Variable Documentation

◆ TiedMax

const unsigned TiedMax = 15