|
LLVM 24.0.0git
|
#include "LoongArch.h"#include "LoongArchMachineFunctionInfo.h"#include "LoongArchSubtarget.h"#include "llvm/ADT/SmallSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/CodeGen/MachineFunctionAnalysisManager.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachinePassManager.h"#include "llvm/CodeGen/TargetInstrInfo.h"#include "llvm/IR/Analysis.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" |
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 45 of file LoongArchOptWInstrs.cpp.
| #define LOONGARCH_OPT_W_INSTRS_NAME "LoongArch Optimize W Instructions" |
Definition at line 46 of file LoongArchOptWInstrs.cpp.
Referenced by INITIALIZE_PASS().
|
static |
Definition at line 760 of file LoongArchOptWInstrs.cpp.
References hasAllWUsers(), MBB, MI, MRI, Opc, and TII.
Referenced by optWInstrsInMF().
|
static |
Definition at line 786 of file LoongArchOptWInstrs.cpp.
References llvm::dbgs(), hasAllWUsers(), llvm::MachineInstr::IsExact, LLVM_DEBUG, MBB, MI, MRI, llvm::MachineInstr::NoSWrap, llvm::MachineInstr::NoUWrap, and TII.
Referenced by optWInstrsInMF().
Definition at line 686 of file LoongArchOptWInstrs.cpp.
References llvm_unreachable.
Referenced by removeSExtWInstrs().
|
static |
Definition at line 92 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(), Imm, 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 uint64_t.
Referenced by hasAllWUsers().
|
static |
Definition at line 339 of file LoongArchOptWInstrs.cpp.
References hasAllNBitUsers(), and MRI.
Referenced by convertToDSuffixes(), convertToWSuffixes(), isSignExtendedW(), isSignExtendedW(), and removeSExtWInstrs().
| INITIALIZE_PASS | ( | LoongArchOptWInstrsLegacy | , |
| DEBUG_TYPE | , | ||
| LOONGARCH_OPT_W_INSTRS_NAME | , | ||
| false | , | ||
| false | ) |
Definition at line 82 of file LoongArchOptWInstrs.cpp.
References llvm::createLoongArchOptWInstrsLegacyPass(), DEBUG_TYPE, and LOONGARCH_OPT_W_INSTRS_NAME.
|
static |
Definition at line 502 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.
Referenced by removeSExtWInstrs().
|
static |
Definition at line 347 of file LoongArchOptWInstrs.cpp.
Referenced by isSignExtendedW().
|
static |
Definition at line 838 of file LoongArchOptWInstrs.cpp.
References convertToDSuffixes(), convertToWSuffixes(), DisableCvtToDSuffix, llvm::MachineFunction::getRegInfo(), llvm::MachineFunction::getSubtarget(), MRI, removeSExtWInstrs(), and TII.
Referenced by llvm::LoongArchOptWInstrsPass::run().
|
static |
Definition at line 708 of file LoongArchOptWInstrs.cpp.
References llvm::dbgs(), DisableSExtWRemoval, getWOp(), hasAllWUsers(), llvm::MachineInstr::IsExact, llvm::LoongArch::isSEXT_W(), isSignExtendedW(), llvm::Register::isVirtual(), LLVM_DEBUG, llvm::make_early_inc_range(), MBB, MI, MRI, llvm::MachineInstr::NoSWrap, llvm::MachineInstr::NoUWrap, and TII.
Referenced by optWInstrsInMF().
| STATISTIC | ( | NumRemovedSExtW | , |
| "Number of removed sign-extensions" | ) |
| STATISTIC | ( | NumTransformedToWInstrs | , |
| "Number of instructions transformed to W-ops" | ) |
|
static |
Referenced by optWInstrsInMF().
|
static |
Referenced by removeSExtWInstrs().