LLVM 22.0.0git
WebAssemblyPeephole.cpp File Reference

Late peephole optimizations for WebAssembly. More...

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.

References llvm::createWebAssemblyPeephole(), and DEBUG_TYPE.

◆ maybeRewriteToDrop()

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 Changed, MRI, llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setReg(), and llvm::WebAssemblyFunctionInfo::stackifyVReg().

◆ maybeRewriteToFallthrough()

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