LLVM 24.0.0git
X86CompressEVEX.cpp File Reference
#include "MCTargetDesc/X86BaseInfo.h"
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionAnalysisManager.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachinePassManager.h"
#include "llvm/IR/Analysis.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Pass.h"
#include <atomic>
#include <cassert>
#include <cstdint>
#include "X86GenInstrMapping.inc"

Go to the source code of this file.

Macros

#define COMP_EVEX_DESC   "Compressing EVEX instrs when possible"
#define COMP_EVEX_NAME   "x86-compress-evex"
#define DEBUG_TYPE   COMP_EVEX_NAME
#define GET_X86_COMPRESS_EVEX_TABLE

Functions

static bool usesExtendedRegister (const MachineInstr &MI)
static bool performCustomAdjustments (MachineInstr &MI, unsigned NewOpc)
static unsigned getMovMskBits (unsigned Opc)
static bool isKMovNarrowing (unsigned MaskBits, unsigned KMOVOpc)
static bool isZeroVector (const MachineInstr &MI)
static bool isAllOnesVector (const MachineInstr &MI, bool Is256Bit)
static MachineInstrgetSignMaskConstantDef (MachineInstr &MI, Register Reg, bool IsZero, bool Is256Bit, const TargetRegisterInfo *TRI)
static bool isCompressibleBlendVUse (unsigned BlendOpc, unsigned UseOpc)
static bool tryCompressMaskProducer (MachineInstr &MI, MachineBasicBlock &MBB, const X86Subtarget &ST, SmallVectorImpl< MachineInstr * > &ToErase)
static bool CompressEVEXImpl (MachineInstr &MI, MachineBasicBlock &MBB, const X86Subtarget &ST, SmallVectorImpl< MachineInstr * > &ToErase)
static bool runOnMF (MachineFunction &MF)
 INITIALIZE_PASS (CompressEVEXLegacy, COMP_EVEX_NAME, COMP_EVEX_DESC, false, false) FunctionPass *llvm

Variables

cl::opt< boolX86EnableAPXForRelocation

Macro Definition Documentation

◆ COMP_EVEX_DESC

#define COMP_EVEX_DESC   "Compressing EVEX instrs when possible"

Definition at line 63 of file X86CompressEVEX.cpp.

Referenced by INITIALIZE_PASS().

◆ COMP_EVEX_NAME

#define COMP_EVEX_NAME   "x86-compress-evex"

Definition at line 64 of file X86CompressEVEX.cpp.

Referenced by INITIALIZE_PASS().

◆ DEBUG_TYPE

#define DEBUG_TYPE   COMP_EVEX_NAME

Definition at line 66 of file X86CompressEVEX.cpp.

◆ GET_X86_COMPRESS_EVEX_TABLE

#define GET_X86_COMPRESS_EVEX_TABLE

Definition at line 72 of file X86CompressEVEX.cpp.

Function Documentation

◆ CompressEVEXImpl()

◆ getMovMskBits()

unsigned getMovMskBits ( unsigned Opc)
static

Definition at line 184 of file X86CompressEVEX.cpp.

References llvm_unreachable, and Opc.

Referenced by tryCompressMaskProducer().

◆ getSignMaskConstantDef()

MachineInstr * getSignMaskConstantDef ( MachineInstr & MI,
Register Reg,
bool IsZero,
bool Is256Bit,
const TargetRegisterInfo * TRI )
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( CompressEVEXLegacy ,
COMP_EVEX_NAME ,
COMP_EVEX_DESC ,
false ,
false  )

◆ isAllOnesVector()

bool isAllOnesVector ( const MachineInstr & MI,
bool Is256Bit )
static

Definition at line 239 of file X86CompressEVEX.cpp.

References MI.

Referenced by getSignMaskConstantDef().

◆ isCompressibleBlendVUse()

bool isCompressibleBlendVUse ( unsigned BlendOpc,
unsigned UseOpc )
static

Definition at line 266 of file X86CompressEVEX.cpp.

Referenced by tryCompressMaskProducer().

◆ isKMovNarrowing()

bool isKMovNarrowing ( unsigned MaskBits,
unsigned KMOVOpc )
static

Definition at line 208 of file X86CompressEVEX.cpp.

References llvm_unreachable.

Referenced by tryCompressMaskProducer().

◆ isZeroVector()

bool isZeroVector ( const MachineInstr & MI)
static

Definition at line 227 of file X86CompressEVEX.cpp.

References MI.

Referenced by getSignMaskConstantDef().

◆ performCustomAdjustments()

bool performCustomAdjustments ( MachineInstr & MI,
unsigned NewOpc )
static

Definition at line 124 of file X86CompressEVEX.cpp.

References assert(), Imm, MI, and Opc.

Referenced by CompressEVEXImpl().

◆ runOnMF()

◆ tryCompressMaskProducer()

◆ usesExtendedRegister()

bool usesExtendedRegister ( const MachineInstr & MI)
static

Variable Documentation

◆ X86EnableAPXForRelocation