LLVM 17.0.0git
Classes | Macros | Functions
X86EvexToVex.cpp File Reference

This file defines the pass that goes over all AVX-512 instructions which are encoded using the EVEX prefix and if possible replaces them by their corresponding VEX encoding which is usually shorter by 2 bytes. More...

#include "MCTargetDesc/X86BaseInfo.h"
#include "MCTargetDesc/X86InstComments.h"
#include "X86.h"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Pass.h"
#include <atomic>
#include <cassert>
#include <cstdint>
#include "X86GenEVEX2VEXTables.inc"

Go to the source code of this file.

Classes

struct  X86EvexToVexCompressTableEntry
 

Macros

#define EVEX2VEX_DESC   "Compressing EVEX instrs to VEX encoding when possible"
 
#define EVEX2VEX_NAME   "x86-evex-to-vex-compress"
 
#define DEBUG_TYPE   EVEX2VEX_NAME
 

Functions

static bool usesExtendedRegister (const MachineInstr &MI)
 
static bool performCustomAdjustments (MachineInstr &MI, unsigned NewOpc, const X86Subtarget *ST)
 

Detailed Description

This file defines the pass that goes over all AVX-512 instructions which are encoded using the EVEX prefix and if possible replaces them by their corresponding VEX encoding which is usually shorter by 2 bytes.

EVEX instructions may be encoded via the VEX prefix when the AVX-512 instruction has a corresponding AVX/AVX2 opcode, when vector length accessed by instruction is less than 512 bits and when it does not use

Definition in file X86EvexToVex.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   EVEX2VEX_NAME

Definition at line 59 of file X86EvexToVex.cpp.

◆ EVEX2VEX_DESC

#define EVEX2VEX_DESC   "Compressing EVEX instrs to VEX encoding when possible"

Definition at line 56 of file X86EvexToVex.cpp.

◆ EVEX2VEX_NAME

#define EVEX2VEX_NAME   "x86-evex-to-vex-compress"

Definition at line 57 of file X86EvexToVex.cpp.

Function Documentation

◆ performCustomAdjustments()

static bool performCustomAdjustments ( MachineInstr MI,
unsigned  NewOpc,
const X86Subtarget ST 
)
static

Definition at line 150 of file X86EvexToVex.cpp.

References assert(), and MI.

◆ usesExtendedRegister()

static bool usesExtendedRegister ( const MachineInstr MI)
static

Definition at line 118 of file X86EvexToVex.cpp.

References assert(), and MI.