LLVM 20.0.0git
|
This file implements a virtual register coloring pass. More...
#include "WebAssembly.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "wasm-reg-coloring" |
Functions | |
INITIALIZE_PASS (WebAssemblyRegColoring, 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) |
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.
#define DEBUG_TYPE "wasm-reg-coloring" |
Definition at line 29 of file WebAssemblyRegColoring.cpp.
|
static |
Definition at line 80 of file WebAssemblyRegColoring.cpp.
References llvm::any_of(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::clear(), llvm::SlotIndexes::getInstructionIndex(), llvm::SlotIndexes::getMBBEndIdx(), llvm::SlotIndexes::getMBBStartIdx(), llvm::LiveIntervals::getSlotIndexes(), MBB, MI, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::sort(), and X.
|
static |
Definition at line 65 of file WebAssemblyRegColoring.cpp.
References llvm::LiveIntervals::getSpillWeight(), and MRI.
INITIALIZE_PASS | ( | WebAssemblyRegColoring | , |
DEBUG_TYPE | , | ||
"Minimize number of registers used" | , | ||
false | , | ||
false | |||
) |
Definition at line 57 of file WebAssemblyRegColoring.cpp.
|
static |
Definition at line 130 of file WebAssemblyRegColoring.cpp.
References assert(), llvm::dbgs(), llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and LLVM_DEBUG.