LLVM 24.0.0git
WebAssemblyRegColoring.cpp File Reference

This file implements a virtual register coloring pass. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-reg-coloring"

Functions

 INITIALIZE_PASS (WebAssemblyRegColoringLegacy, DEBUG_TYPE, "Minimize number of registers used", false, false) FunctionPass *llvm
static float computeWeight (const MachineRegisterInfo *MRI, const MachineBlockFrequencyInfo *MBFI, unsigned VReg)
static DenseMap< Register, std::vector< std::pair< SlotIndex, MachineInstr * > > > buildVRegToDbgValueMap (MachineFunction &MF, const LiveIntervals *Liveness)
static void undefInvalidDbgValues (const LiveIntervals *Liveness, ArrayRef< SmallVector< LiveInterval *, 4 > > Assignments, DenseMap< Register, std::vector< std::pair< SlotIndex, MachineInstr * > > > &DbgVRegToValues)
static bool regColoring (MachineFunction &MF, LiveIntervals *Liveness, const MachineBlockFrequencyInfo *MBFI)

Detailed Description

This file implements a virtual register coloring pass.

WebAssembly doesn't have a fixed number of registers, but it is still desirable to minimize the total number of registers used in each function.

This code is modeled after lib/CodeGen/StackSlotColoring.cpp.

Definition in file WebAssemblyRegColoring.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-reg-coloring"

Definition at line 33 of file WebAssemblyRegColoring.cpp.

Function Documentation

◆ buildVRegToDbgValueMap()

◆ computeWeight()

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( WebAssemblyRegColoringLegacy ,
DEBUG_TYPE ,
"Minimize number of registers used" ,
false ,
false  )

◆ regColoring()

◆ undefInvalidDbgValues()

void undefInvalidDbgValues ( const LiveIntervals * Liveness,
ArrayRef< SmallVector< LiveInterval *, 4 > > Assignments,
DenseMap< Register, std::vector< std::pair< SlotIndex, MachineInstr * > > > & DbgVRegToValues )
static