LLVM 19.0.0git
Macros | Functions
WebAssemblyArgumentMove.cpp File Reference

This file moves ARGUMENT instructions after ScheduleDAG scheduling. More...

#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssembly.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "WebAssemblyUtilities.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-argument-move"
 

Functions

 INITIALIZE_PASS (WebAssemblyArgumentMove, DEBUG_TYPE, "Move ARGUMENT instructions for WebAssembly", false, false) FunctionPass *llvm
 

Detailed Description

This file moves ARGUMENT instructions after ScheduleDAG scheduling.

Arguments are really live-in registers, however, since we use virtual registers and LLVM doesn't support live-in virtual registers, we're currently making do with ARGUMENT instructions which are placed at the top of the entry block. The trick is to get them to stay at the top of the entry block.

The ARGUMENTS physical register keeps these instructions pinned in place during liveness-aware CodeGen passes, however one thing which does not respect this is the ScheduleDAG scheduler. This pass is therefore run immediately after that.

This is all hopefully a temporary solution until we find a better solution for describing the live-in nature of arguments.

Definition in file WebAssemblyArgumentMove.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-argument-move"

Definition at line 40 of file WebAssemblyArgumentMove.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( WebAssemblyArgumentMove  ,
DEBUG_TYPE  ,
"Move ARGUMENT instructions for WebAssembly"  ,
false  ,
false   
)

Definition at line 62 of file WebAssemblyArgumentMove.cpp.