LLVM 20.0.0git
|
#include "RISCV.h"
#include "RISCVMachineFunctionInfo.h"
#include "RISCVSubtarget.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "riscv-opt-w-instrs" |
#define | RISCV_OPT_W_INSTRS_NAME "RISC-V Optimize W Instructions" |
Functions | |
STATISTIC (NumRemovedSExtW, "Number of removed sign-extensions") | |
STATISTIC (NumTransformedToWInstrs, "Number of instructions transformed to W-ops") | |
INITIALIZE_PASS (RISCVOptWInstrs, DEBUG_TYPE, RISCV_OPT_W_INSTRS_NAME, false, false) FunctionPass *llvm | |
static bool | vectorPseudoHasAllNBitUsers (const MachineOperand &UserOp, unsigned Bits) |
static bool | hasAllNBitUsers (const MachineInstr &OrigMI, const RISCVSubtarget &ST, const MachineRegisterInfo &MRI, unsigned OrigBits) |
static bool | hasAllWUsers (const MachineInstr &OrigMI, const RISCVSubtarget &ST, const MachineRegisterInfo &MRI) |
static bool | isSignExtendingOpW (const MachineInstr &MI, unsigned OpNo) |
static bool | isSignExtendedW (Register SrcReg, const RISCVSubtarget &ST, const MachineRegisterInfo &MRI, SmallPtrSetImpl< MachineInstr * > &FixableDef) |
static unsigned | getWOp (unsigned Opcode) |
Variables | |
static cl::opt< bool > | DisableSExtWRemoval ("riscv-disable-sextw-removal", cl::desc("Disable removal of sext.w"), cl::init(false), cl::Hidden) |
static cl::opt< bool > | DisableStripWSuffix ("riscv-disable-strip-w-suffix", cl::desc("Disable strip W suffix"), cl::init(false), cl::Hidden) |
#define DEBUG_TYPE "riscv-opt-w-instrs" |
Definition at line 45 of file RISCVOptWInstrs.cpp.
#define RISCV_OPT_W_INSTRS_NAME "RISC-V Optimize W Instructions" |
Definition at line 46 of file RISCVOptWInstrs.cpp.
Definition at line 617 of file RISCVOptWInstrs.cpp.
References llvm_unreachable.
|
static |
Definition at line 119 of file RISCVOptWInstrs.cpp.
References llvm::bit_width(), llvm::SmallVectorBase< Size_T >::empty(), llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::SmallSet< T, N, C >::insert(), llvm::Register::isVirtual(), llvm::Log2_32(), MI, MRI, P, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and vectorPseudoHasAllNBitUsers().
Referenced by hasAllWUsers().
|
static |
Definition at line 352 of file RISCVOptWInstrs.cpp.
References hasAllNBitUsers(), and MRI.
Referenced by isSignExtendedW().
INITIALIZE_PASS | ( | RISCVOptWInstrs | , |
DEBUG_TYPE | , | ||
RISCV_OPT_W_INSTRS_NAME | , | ||
false | , | ||
false | |||
) |
Definition at line 86 of file RISCVOptWInstrs.cpp.
|
static |
Definition at line 403 of file RISCVOptWInstrs.cpp.
References assert(), B, llvm::BitWidth, D, llvm::SmallVectorBase< Size_T >::empty(), llvm::MachineFunction::front(), llvm::MachineOperand::getGlobal(), llvm::MachineFunction::getInfo(), getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), hasAllWUsers(), I, II, llvm::SmallSet< T, N, C >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MachineBasicBlock::instr_begin(), llvm::MachineInstr::isCall(), llvm::MachineOperand::isGlobal(), llvm::MachineRegisterInfo::isLiveIn(), llvm::RISCVMachineFunctionInfo::isSExt32Register(), isSignExtendingOpW(), llvm::Register::isVirtual(), MBB, MI, MRI, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
|
static |
Definition at line 359 of file RISCVOptWInstrs.cpp.
References assert(), llvm::RISCVII::IsSignExtendingOpWMask, and MI.
Referenced by isSignExtendedW().
STATISTIC | ( | NumRemovedSExtW | , |
"Number of removed sign-extensions" | |||
) |
STATISTIC | ( | NumTransformedToWInstrs | , |
"Number of instructions transformed to W-ops" | |||
) |
|
static |
Definition at line 93 of file RISCVOptWInstrs.cpp.
References assert(), llvm::MachineOperand::getOperandNo(), llvm::MachineOperand::getParent(), llvm::RISCV::getRVVMCOpcode(), llvm::RISCVII::getSEWOpNum(), llvm::RISCV::getVectorLowDemandedScalarBits(), llvm::RISCVII::getVLOpNum(), llvm::RISCVII::hasSEWOp(), llvm::RISCVII::hasVLOp(), MI, and llvm::MCInstrDesc::TSFlags.
Referenced by hasAllNBitUsers().
|
static |