|
LLVM 24.0.0git
|
This pass performs the peephole optimizations before code emission. More...
#include "AMDGPU.h"#include "GCNHazardRecognizer.h"#include "GCNSubtarget.h"#include "SIMachineFunctionInfo.h"#include "llvm/ADT/SmallPtrSet.h"#include "llvm/ADT/Statistic.h"#include "llvm/CodeGen/MachineDominators.h"#include "llvm/CodeGen/MachineFunctionPass.h"#include "llvm/CodeGen/MachineLoopInfo.h"#include "llvm/CodeGen/TargetSchedule.h"#include "llvm/Support/BranchProbability.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "si-pre-emit-peephole" |
Functions | |
| STATISTIC (NumModeWritesRemoved, "Number of redundant mode register writes removed") | |
| static bool | canCoissueVALUs (VALUCoexecClass Younger, VALUCoexecClass Older) |
| static bool | hasVectorOperandOf64Bits (const MachineInstr &MI) |
| static VALUCoexecClass | getVALUCoexecClass (const MachineInstr &MI, const GCNSubtarget &ST, bool Younger) |
| static VALUCoexecClass | getYoungerVALUClass (const MachineInstr &MI, const GCNSubtarget &ST) |
| static VALUCoexecClass | getOlderVALUClass (const MachineInstr &MI, const GCNSubtarget &ST) |
| static unsigned | getAllocatedOccupancy (const MachineFunction &MF, const GCNSubtarget &ST) |
| static std::optional< bool > | isCrossWaveVALUCoexecLoop (const MachineLoop &L, const GCNSubtarget &ST) |
Variables | |
| static constexpr unsigned | MinBlockingVALUs = 10 |
| static constexpr unsigned | MinOlderABPct = 70 |
| static constexpr unsigned | MinYoungerAPct = 50 |
| static constexpr unsigned | MaxLoopInstrs = 500 |
This pass performs the peephole optimizations before code emission.
Additionally, this pass also unpacks packed instructions (V_PK_MUL_F32/F16, V_PK_ADD_F32/F16, V_PK_FMA_F32) adjacent to MFMAs such that they can be co-issued. This helps with overlapping MFMA and certain vector instructions in machine schedules and is expected to improve performance. Only those packed instructions are unpacked that are overlapped by the MFMA latency. Rest should remain untouched. TODO: Add support for F16 packed instructions
Definition in file SIPreEmitPeephole.cpp.
| #define DEBUG_TYPE "si-pre-emit-peephole" |
Definition at line 34 of file SIPreEmitPeephole.cpp.
|
static |
Definition at line 965 of file SIPreEmitPeephole.cpp.
Referenced by isCrossWaveVALUCoexecLoop().
|
static |
Definition at line 1021 of file SIPreEmitPeephole.cpp.
References llvm::SIMachineFunctionInfo::getDynamicVGPRBlockSize(), llvm::MachineFunction::getInfo(), llvm::SIMachineFunctionInfo::getOccupancy(), llvm::MachineFunction::getRegInfo(), llvm::AMDGPU::getTotalNumVGPRs(), MRI, llvm::Total, and TRI.
|
static |
Definition at line 1003 of file SIPreEmitPeephole.cpp.
References getVALUCoexecClass(), hasVectorOperandOf64Bits(), llvm::SIInstrInfo::isDOT(), llvm::SIInstrInfo::isTRANS(), llvm::SIInstrInfo::isVOP3P(), and MI.
Referenced by isCrossWaveVALUCoexecLoop().
|
static |
Definition at line 977 of file SIPreEmitPeephole.cpp.
References MI.
Referenced by getOlderVALUClass(), and getYoungerVALUClass().
|
static |
Definition at line 993 of file SIPreEmitPeephole.cpp.
References getVALUCoexecClass(), llvm::SIInstrInfo::isDOT(), llvm::SIInstrInfo::isDPP(), llvm::SIInstrInfo::isSDWA(), llvm::SIInstrInfo::isTRANS(), llvm::SIInstrInfo::isVOP3P(), and MI.
Referenced by isCrossWaveVALUCoexecLoop().
|
static |
Definition at line 969 of file SIPreEmitPeephole.cpp.
References llvm::any_of(), and MI.
Referenced by getOlderVALUClass().
|
static |
Definition at line 1048 of file SIPreEmitPeephole.cpp.
References canCoissueVALUs(), getOlderVALUClass(), getYoungerVALUClass(), llvm::SIInstrInfo::isMFMA(), llvm::SIInstrInfo::isVALU(), MaxLoopInstrs, MBB, MI, MinOlderABPct, and MinYoungerAPct.
| STATISTIC | ( | NumModeWritesRemoved | , |
| "Number of redundant mode register writes removed" | ) |
|
staticconstexpr |
Definition at line 1042 of file SIPreEmitPeephole.cpp.
Referenced by isCrossWaveVALUCoexecLoop().
|
staticconstexpr |
Definition at line 1039 of file SIPreEmitPeephole.cpp.
|
staticconstexpr |
Definition at line 1040 of file SIPreEmitPeephole.cpp.
Referenced by isCrossWaveVALUCoexecLoop().
|
staticconstexpr |
Definition at line 1041 of file SIPreEmitPeephole.cpp.
Referenced by isCrossWaveVALUCoexecLoop().