LLVM 20.0.0git
|
#include "RISCV.h"
#include "RISCVSubtarget.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/InitializePasses.h"
Go to the source code of this file.
Classes | |
struct | OperandInfo |
Represents the EMUL and EEW of a MachineOperand. More... | |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
namespace | llvm::RISCVVType |
Macros | |
#define | DEBUG_TYPE "riscv-vl-optimizer" |
#define | PASS_NAME "RISC-V VL Optimizer" |
Functions | |
static bool | isVectorRegClass (Register R, const MachineRegisterInfo *MRI) |
Return true if R is a physical or virtual vector register, false otherwise. | |
static LLVM_ATTRIBUTE_UNUSED raw_ostream & | operator<< (raw_ostream &OS, const OperandInfo &OI) |
static RISCVII::VLMUL | llvm::RISCVVType::twoTimesVLMUL (RISCVII::VLMUL VLMul) |
Return the RISCVII::VLMUL that is two times VLMul. | |
static std::pair< unsigned, bool > | llvm::RISCVVType::getEMULEqualsEEWDivSEWTimesLMUL (unsigned Log2EEW, const MachineInstr &MI) |
Return EMUL = (EEW / SEW) * LMUL where EEW comes from Log2EEW and LMUL and SEW are from the TSFlags of MI. | |
static OperandInfo | getIntegerExtensionOperandInfo (unsigned Factor, const MachineInstr &MI, const MachineOperand &MO) |
Dest has EEW=SEW and EMUL=LMUL. | |
static bool | isMaskOperand (const MachineInstr &MI, const MachineOperand &MO, const MachineRegisterInfo *MRI) |
Check whether MO is a mask operand of MI. | |
static OperandInfo | getOperandInfo (const MachineOperand &MO, const MachineRegisterInfo *MRI) |
Return the OperandInfo for MO. | |
static bool | isSupportedInstr (const MachineInstr &MI) |
Return true if this optimization should consider MI for VL reduction. | |
static bool | isVectorOpUsedAsScalarOp (MachineOperand &MO) |
Return true if MO is a vector operand but is used as a scalar operand. | |
static bool | mayReadPastVL (const MachineInstr &MI) |
Return true if MI may read elements past VL. | |
#define DEBUG_TYPE "riscv-vl-optimizer" |
Definition at line 28 of file RISCVVLOptimizer.cpp.
#define PASS_NAME "RISC-V VL Optimizer" |
Definition at line 29 of file RISCVVLOptimizer.cpp.
|
static |
Dest has EEW=SEW and EMUL=LMUL.
Source EEW=SEW/Factor (i.e. F2 => EEW/2). Source has EMUL=(EEW/SEW)*LMUL. LMUL and SEW comes from TSFlags of MI.
Definition at line 185 of file RISCVVLOptimizer.cpp.
References llvm::RISCVVType::getEMULEqualsEEWDivSEWTimesLMUL(), llvm::RISCVII::getLMul(), llvm::MachineOperand::getOperandNo(), llvm::RISCVII::getSEWOpNum(), llvm::Log2_32(), and MI.
Referenced by getOperandInfo().
|
static |
Return the OperandInfo for MO.
Dest EEW encoded in the instruction and EMUL=(EEW/SEW)*LMUL
Definition at line 215 of file RISCVVLOptimizer.cpp.
References assert(), llvm::RISCVVType::getEMULEqualsEEWDivSEWTimesLMUL(), getIntegerExtensionOperandInfo(), llvm::RISCVII::getLMul(), llvm::MachineOperand::getOperandNo(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), llvm::RISCVII::getSEWOpNum(), llvm::RISCVII::isFirstDefTiedToFirstUse(), isMaskOperand(), llvm_unreachable, MI, MRI, llvm::RVV, and llvm::RISCVVType::twoTimesVLMUL().
|
static |
Check whether MO is a mask operand of MI.
Definition at line 204 of file RISCVVLOptimizer.cpp.
References llvm::MachineOperand::getOperandNo(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), isVectorRegClass(), MI, and MRI.
Referenced by getOperandInfo().
|
static |
Return true if this optimization should consider MI for VL reduction.
This white-list approach simplifies this optimization for instructions that may have more complex semantics with relation to how it uses VL.
Definition at line 627 of file RISCVVLOptimizer.cpp.
|
static |
Return true if MO is a vector operand but is used as a scalar operand.
Definition at line 811 of file RISCVVLOptimizer.cpp.
References llvm::MachineOperand::getOperandNo(), llvm::MachineOperand::getParent(), MI, and llvm::RVV.
|
static |
Return true if R is a physical or virtual vector register, false otherwise.
Definition at line 70 of file RISCVVLOptimizer.cpp.
References llvm::RISCVRI::isVRegClass(), MRI, and llvm::TargetRegisterClass::TSFlags.
Referenced by isMaskOperand().
|
static |
Return true if MI may read elements past VL.
Definition at line 844 of file RISCVVLOptimizer.cpp.
|
static |
Definition at line 125 of file RISCVVLOptimizer.cpp.
References OS, and OperandInfo::print().