LLVM 19.0.0git
Macros | Functions | Variables
RISCVInsertVSETVLI.cpp File Reference
#include "RISCV.h"
#include "RISCVSubtarget.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include <queue>

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "riscv-insert-vsetvli"
 
#define RISCV_INSERT_VSETVLI_NAME   "RISC-V Insert VSETVLI pass"
 

Functions

 STATISTIC (NumInsertedVSETVL, "Number of VSETVL inst inserted")
 
 STATISTIC (NumRemovedVSETVL, "Number of VSETVL inst removed")
 
 INITIALIZE_PASS (RISCVInsertVSETVLI, DEBUG_TYPE, RISCV_INSERT_VSETVLI_NAME, false, false) static VSETVLIInfo getInfoForVSETVLI(const MachineInstr &MI)
 
static unsigned computeVLMAX (unsigned VLEN, unsigned SEW, RISCVII::VLMUL VLMul)
 
static VSETVLIInfo computeInfoForInstr (const MachineInstr &MI, uint64_t TSFlags, const RISCVSubtarget &ST, const MachineRegisterInfo *MRI)
 
static bool isLMUL1OrSmaller (RISCVII::VLMUL LMUL)
 
static VSETVLIInfo adjustIncoming (VSETVLIInfo PrevInfo, VSETVLIInfo NewInfo, DemandedFields &Demanded)
 
static void doUnion (DemandedFields &A, DemandedFields B)
 
static bool canMutatePriorConfig (const MachineInstr &PrevMI, const MachineInstr &MI, const DemandedFields &Used, const MachineRegisterInfo &MRI)
 

Variables

static cl::opt< boolDisableInsertVSETVLPHIOpt ("riscv-disable-insert-vsetvl-phi-opt", cl::init(false), cl::Hidden, cl::desc("Disable looking through phis when inserting vsetvlis."))
 
static cl::opt< boolUseStrictAsserts ("riscv-insert-vsetvl-strict-asserts", cl::init(true), cl::Hidden, cl::desc("Enable strict assertion checking for the dataflow algorithm"))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "riscv-insert-vsetvli"

Definition at line 35 of file RISCVInsertVSETVLI.cpp.

◆ RISCV_INSERT_VSETVLI_NAME

#define RISCV_INSERT_VSETVLI_NAME   "RISC-V Insert VSETVLI pass"

Definition at line 36 of file RISCVInsertVSETVLI.cpp.

Function Documentation

◆ adjustIncoming()

static VSETVLIInfo adjustIncoming ( VSETVLIInfo  PrevInfo,
VSETVLIInfo  NewInfo,
DemandedFields &  Demanded 
)
static

Definition at line 1073 of file RISCVInsertVSETVLI.cpp.

References llvm::RISCVVType::getSameRatioLMUL(), and Info.

◆ canMutatePriorConfig()

static bool canMutatePriorConfig ( const MachineInstr PrevMI,
const MachineInstr MI,
const DemandedFields &  Used,
const MachineRegisterInfo MRI 
)
static

◆ computeInfoForInstr()

static VSETVLIInfo computeInfoForInstr ( const MachineInstr MI,
uint64_t  TSFlags,
const RISCVSubtarget ST,
const MachineRegisterInfo MRI 
)
static

◆ computeVLMAX()

static unsigned computeVLMAX ( unsigned  VLEN,
unsigned  SEW,
RISCVII::VLMUL  VLMul 
)
static

Definition at line 811 of file RISCVInsertVSETVLI.cpp.

References llvm::RISCVVType::decodeVLMUL().

Referenced by computeInfoForInstr().

◆ doUnion()

static void doUnion ( DemandedFields &  A,
DemandedFields  B 
)
static

Definition at line 1480 of file RISCVInsertVSETVLI.cpp.

References A, and B.

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( RISCVInsertVSETVLI  ,
DEBUG_TYPE  ,
RISCV_INSERT_VSETVLI_NAME  ,
false  ,
false   
) const &

Definition at line 789 of file RISCVInsertVSETVLI.cpp.

References assert(), and MI.

◆ isLMUL1OrSmaller()

static bool isLMUL1OrSmaller ( RISCVII::VLMUL  LMUL)
static

Definition at line 999 of file RISCVInsertVSETVLI.cpp.

References llvm::RISCVVType::decodeVLMUL().

◆ STATISTIC() [1/2]

STATISTIC ( NumInsertedVSETVL  ,
"Number of VSETVL inst inserted"   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumRemovedVSETVL  ,
"Number of VSETVL inst removed"   
)

Variable Documentation

◆ DisableInsertVSETVLPHIOpt

cl::opt< bool > DisableInsertVSETVLPHIOpt("riscv-disable-insert-vsetvl-phi-opt", cl::init(false), cl::Hidden, cl::desc("Disable looking through phis when inserting vsetvlis.")) ( "riscv-disable-insert-vsetvl-phi-opt"  ,
cl::init(false)  ,
cl::Hidden  ,
cl::desc("Disable looking through phis when inserting vsetvlis.")   
)
static

◆ UseStrictAsserts

cl::opt< bool > UseStrictAsserts("riscv-insert-vsetvl-strict-asserts", cl::init(true), cl::Hidden, cl::desc("Enable strict assertion checking for the dataflow algorithm")) ( "riscv-insert-vsetvl-strict-asserts"  ,
cl::init(true ,
cl::Hidden  ,
cl::desc("Enable strict assertion checking for the dataflow algorithm")   
)
static