LLVM 22.0.0git
X86VZeroUpper.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-vzeroupper"

Functions

 STATISTIC (NumVZU, "Number of vzeroupper instructions inserted")
static bool isYmmOrZmmReg (MCRegister Reg)
 VZEROUPPER cleans state that is related to Y/ZMM0-15 only.
static bool checkFnHasLiveInYmmOrZmm (MachineRegisterInfo &MRI)
static bool clobbersAllYmmAndZmmRegs (const MachineOperand &MO)
static bool hasYmmOrZmmReg (MachineInstr &MI)
static bool callHasRegMask (MachineInstr &MI)
 Check if given call instruction has a RegMask operand.

Variables

static cl::opt< boolUseVZeroUpper ("x86-use-vzeroupper", cl::Hidden, cl::desc("Minimize AVX to SSE transition penalty"), cl::init(true))

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-vzeroupper"

Definition at line 40 of file X86VZeroUpper.cpp.

Function Documentation

◆ callHasRegMask()

bool callHasRegMask ( MachineInstr & MI)
static

Check if given call instruction has a RegMask operand.

Definition at line 172 of file X86VZeroUpper.cpp.

References assert(), and MI.

◆ checkFnHasLiveInYmmOrZmm()

bool checkFnHasLiveInYmmOrZmm ( MachineRegisterInfo & MRI)
static

Definition at line 137 of file X86VZeroUpper.cpp.

References isYmmOrZmmReg(), and MRI.

◆ clobbersAllYmmAndZmmRegs()

bool clobbersAllYmmAndZmmRegs ( const MachineOperand & MO)
static

Definition at line 145 of file X86VZeroUpper.cpp.

References llvm::MachineOperand::clobbersPhysReg().

Referenced by hasYmmOrZmmReg().

◆ hasYmmOrZmmReg()

bool hasYmmOrZmmReg ( MachineInstr & MI)
static

Definition at line 157 of file X86VZeroUpper.cpp.

References clobbersAllYmmAndZmmRegs(), isYmmOrZmmReg(), and MI.

◆ isYmmOrZmmReg()

bool isYmmOrZmmReg ( MCRegister Reg)
static

VZEROUPPER cleans state that is related to Y/ZMM0-15 only.

Thus, there is no need to check for Y/ZMM16 and above.

Definition at line 132 of file X86VZeroUpper.cpp.

References Reg.

Referenced by checkFnHasLiveInYmmOrZmm(), and hasYmmOrZmmReg().

◆ STATISTIC()

STATISTIC ( NumVZU ,
"Number of vzeroupper instructions inserted"  )

Variable Documentation

◆ UseVZeroUpper

cl::opt< bool > UseVZeroUpper("x86-use-vzeroupper", cl::Hidden, cl::desc("Minimize AVX to SSE transition penalty"), cl::init(true)) ( "x86-use-vzeroupper" ,
cl::Hidden ,
cl::desc("Minimize AVX to SSE transition penalty") ,
cl::init(true)  )
static