LLVM 22.0.0git
|
#include "LoongArch.h"
#include "LoongArchMachineFunctionInfo.h"
#include "LoongArchSubtarget.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 "loongarch-opt-w-instrs" |
#define | LOONGARCH_OPT_W_INSTRS_NAME "LoongArch Optimize W Instructions" |
Functions | |
STATISTIC (NumRemovedSExtW, "Number of removed sign-extensions") | |
STATISTIC (NumTransformedToWInstrs, "Number of instructions transformed to W-ops") | |
INITIALIZE_PASS (LoongArchOptWInstrs, DEBUG_TYPE, LOONGARCH_OPT_W_INSTRS_NAME, false, false) FunctionPass *llvm | |
static bool | hasAllNBitUsers (const MachineInstr &OrigMI, const LoongArchSubtarget &ST, const MachineRegisterInfo &MRI, unsigned OrigBits) |
static bool | hasAllWUsers (const MachineInstr &OrigMI, const LoongArchSubtarget &ST, const MachineRegisterInfo &MRI) |
static bool | isSignExtendingOpW (const MachineInstr &MI, const MachineRegisterInfo &MRI, unsigned OpNo) |
static bool | isSignExtendedW (Register SrcReg, const LoongArchSubtarget &ST, const MachineRegisterInfo &MRI, SmallPtrSetImpl< MachineInstr * > &FixableDef) |
static unsigned | getWOp (unsigned Opcode) |
Variables | |
static cl::opt< bool > | DisableSExtWRemoval ("loongarch-disable-sextw-removal", cl::desc("Disable removal of sign-extend insn"), cl::init(false), cl::Hidden) |
static cl::opt< bool > | DisableCvtToDSuffix ("loongarch-disable-cvt-to-d-suffix", cl::desc("Disable convert to D suffix"), cl::init(false), cl::Hidden) |
#define DEBUG_TYPE "loongarch-opt-w-instrs" |
Definition at line 42 of file LoongArchOptWInstrs.cpp.
#define LOONGARCH_OPT_W_INSTRS_NAME "LoongArch Optimize W Instructions" |
Definition at line 43 of file LoongArchOptWInstrs.cpp.
Referenced by INITIALIZE_PASS().
Definition at line 692 of file LoongArchOptWInstrs.cpp.
References llvm_unreachable.
|
static |
Definition at line 98 of file LoongArchOptWInstrs.cpp.
References llvm::bit_width(), llvm::SmallVectorTemplateCommon< T, typename >::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, OpIdx, P, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by hasAllWUsers().
|
static |
Definition at line 345 of file LoongArchOptWInstrs.cpp.
References hasAllNBitUsers(), and MRI.
Referenced by isSignExtendedW().
INITIALIZE_PASS | ( | LoongArchOptWInstrs | , |
DEBUG_TYPE | , | ||
LOONGARCH_OPT_W_INSTRS_NAME | , | ||
false | , | ||
false | ) |
Definition at line 88 of file LoongArchOptWInstrs.cpp.
References llvm::createLoongArchOptWInstrsPass(), DEBUG_TYPE, and LOONGARCH_OPT_W_INSTRS_NAME.
|
static |
Definition at line 508 of file LoongArchOptWInstrs.cpp.
References assert(), B(), llvm::BitWidth, D(), llvm::dyn_cast(), llvm::dyn_cast_if_present(), E(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::MachineFunction::front(), llvm::MachineOperand::getGlobal(), llvm::MachineFunction::getInfo(), llvm::MachineInstr::getOperand(), llvm::MachineFunction::getRegInfo(), hasAllWUsers(), I, II, llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallSet< T, N, C >::insert(), llvm::MachineInstr::isCall(), llvm::MachineOperand::isGlobal(), llvm::MachineRegisterInfo::isLiveIn(), llvm::LoongArchMachineFunctionInfo::isSExt32Register(), isSignExtendingOpW(), llvm::Register::isVirtual(), MBB, MI, MRI, llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and Reg.
|
static |
Definition at line 353 of file LoongArchOptWInstrs.cpp.
Referenced by isSignExtendedW().
STATISTIC | ( | NumRemovedSExtW | , |
"Number of removed sign-extensions" | ) |
STATISTIC | ( | NumTransformedToWInstrs | , |
"Number of instructions transformed to W-ops" | ) |
|
static |