LLVM 23.0.0git
Rematerializer.cpp File Reference

Implements helpers for target-independent rematerialization at the MIR level. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "rematerializer"

Typedefs

using RegisterIdx = Rematerializer::RegisterIdx

Functions

static bool isIdenticalAtUse (const VNInfo &OVNI, LaneBitmask Mask, SlotIndex UseIdx, const LiveInterval &LI)
 Checks whether the value in LI at UseIdx is identical to OVNI (this implies it is also live there).
static Register getRegDependency (const MachineOperand &MO)
 If MO is a virtual read register, returns it.

Detailed Description

Implements helpers for target-independent rematerialization at the MIR level.

Definition in file Rematerializer.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "rematerializer"

Definition at line 28 of file Rematerializer.cpp.

Typedef Documentation

◆ RegisterIdx

Definition at line 31 of file Rematerializer.cpp.

Function Documentation

◆ getRegDependency()

Register getRegDependency ( const MachineOperand & MO)
static

If MO is a virtual read register, returns it.

Otherwise returns the sentinel register.

Definition at line 60 of file Rematerializer.cpp.

References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), llvm::MachineOperand::readsReg(), Reg, and Register.

◆ isIdenticalAtUse()

bool isIdenticalAtUse ( const VNInfo & OVNI,
LaneBitmask Mask,
SlotIndex UseIdx,
const LiveInterval & LI )
static

Checks whether the value in LI at UseIdx is identical to OVNI (this implies it is also live there).

When LI has sub-ranges, checks that all sub-ranges intersecting with Mask are also live at UseIdx.

Definition at line 36 of file Rematerializer.cpp.

References llvm::LiveRange::getVNInfoAt(), llvm::LiveInterval::hasSubRanges(), and llvm::LiveInterval::subranges().

Referenced by llvm::Rematerializer::isMOIdenticalAtUses().