LLVM 19.0.0git
Macros | Functions | Variables
WebAssemblyPeephole.cpp File Reference

Late peephole optimizations for WebAssembly. More...

#include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
#include "WebAssembly.h"
#include "WebAssemblyMachineFunctionInfo.h"
#include "WebAssemblySubtarget.h"
#include "WebAssemblyUtilities.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "wasm-peephole"
 

Functions

 INITIALIZE_PASS (WebAssemblyPeephole, DEBUG_TYPE, "WebAssembly peephole optimizations", false, false) FunctionPass *llvm
 
static bool maybeRewriteToDrop (unsigned OldReg, unsigned NewReg, MachineOperand &MO, WebAssemblyFunctionInfo &MFI, MachineRegisterInfo &MRI)
 If desirable, rewrite NewReg to a drop register.
 
static bool maybeRewriteToFallthrough (MachineInstr &MI, MachineBasicBlock &MBB, const MachineFunction &MF, WebAssemblyFunctionInfo &MFI, MachineRegisterInfo &MRI, const WebAssemblyInstrInfo &TII)
 

Variables

static cl::opt< boolDisableWebAssemblyFallthroughReturnOpt ("disable-wasm-fallthrough-return-opt", cl::Hidden, cl::desc("WebAssembly: Disable fallthrough-return optimizations."), cl::init(false))
 

Detailed Description

Late peephole optimizations for WebAssembly.

Definition in file WebAssemblyPeephole.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "wasm-peephole"

Definition at line 25 of file WebAssemblyPeephole.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( WebAssemblyPeephole  ,
DEBUG_TYPE  ,
"WebAssembly peephole optimizations"  ,
false  ,
false   
)

Definition at line 53 of file WebAssemblyPeephole.cpp.

◆ maybeRewriteToDrop()

static bool maybeRewriteToDrop ( unsigned  OldReg,
unsigned  NewReg,
MachineOperand MO,
WebAssemblyFunctionInfo MFI,
MachineRegisterInfo MRI 
)
static

If desirable, rewrite NewReg to a drop register.

Definition at line 61 of file WebAssemblyPeephole.cpp.

References MRI, llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setReg(), and llvm::WebAssemblyFunctionInfo::stackifyVReg().

◆ maybeRewriteToFallthrough()

static bool maybeRewriteToFallthrough ( MachineInstr MI,
MachineBasicBlock MBB,
const MachineFunction MF,
WebAssemblyFunctionInfo MFI,
MachineRegisterInfo MRI,
const WebAssemblyInstrInfo TII 
)
static

Variable Documentation

◆ DisableWebAssemblyFallthroughReturnOpt

cl::opt< bool > DisableWebAssemblyFallthroughReturnOpt("disable-wasm-fallthrough-return-opt", cl::Hidden, cl::desc("WebAssembly: Disable fallthrough-return optimizations."), cl::init(false)) ( "disable-wasm-fallthrough-return-opt"  ,
cl::Hidden  ,
cl::desc("WebAssembly: Disable fallthrough-return optimizations.")  ,
cl::init(false)   
)
static