Go to the documentation of this file.
25 #define DEBUG_TYPE "aarch64-stp-suppress"
27 #define STPSUPPRESS_PASS_NAME "AArch64 Store Pair Suppression"
67 return new AArch64StorePairSuppress();
85 unsigned SCIdx =
TII->get(AArch64::STPDi).getSchedClass();
87 SchedModel.getMCSchedModel()->getSchedClassDesc(SCIdx);
92 if (ResLenWithSTP > ResLength) {
94 <<
" resources " << ResLength <<
" -> " << ResLenWithSTP
109 bool AArch64StorePairSuppress::isNarrowFPStore(
const MachineInstr &
MI) {
110 switch (
MI.getOpcode()) {
113 case AArch64::STRSui:
114 case AArch64::STRDui:
115 case AArch64::STURSi:
116 case AArch64::STURDi:
121 bool AArch64StorePairSuppress::runOnMachineFunction(
MachineFunction &MF) {
127 TRI =
ST.getRegisterInfo();
129 SchedModel.init(&
ST);
130 Traces = &getAnalysis<MachineTraceMetrics>();
135 if (!SchedModel.hasInstrSchedModel()) {
136 LLVM_DEBUG(
dbgs() <<
" Skipping pass: no machine model present.\n");
144 for (
auto &
MBB : MF) {
145 bool SuppressSTP =
false;
146 unsigned PrevBaseReg = 0;
147 for (
auto &
MI :
MBB) {
148 if (!isNarrowFPStore(
MI))
152 bool OffsetIsScalable;
153 if (
TII->getMemOperandWithOffset(
MI, BaseOp,
Offset, OffsetIsScalable,
157 if (PrevBaseReg == BaseReg) {
159 if (!SuppressSTP && shouldAddSTPToBlock(
MI.getParent()))
164 TII->suppressLdStPair(
MI);
166 PrevBaseReg = BaseReg;
INITIALIZE_PASS(AArch64StorePairSuppress, "aarch64-stp-suppress", STPSUPPRESS_PASS_NAME, false, false) FunctionPass *llvm
This is an optimization pass for GlobalISel generic memory operations.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
@ TS_MinInstrCount
Select the trace through a block that has the fewest instructions.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
unsigned const TargetRegisterInfo * TRI
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
void initializeAArch64StorePairSuppressPass(PassRegistry &)
Summarize the scheduling resources required for an instruction of a particular scheduling class.
Represent the analysis usage information of a pass.
FunctionPass * createAArch64StorePairSuppressPass()
const HexagonInstrInfo * TII
MachineOperand class - Representation of each machine instruction operand.
A trace represents a plausible sequence of executed basic blocks that passes through the current basi...
#define STPSUPPRESS_PASS_NAME
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Provide an instruction scheduling machine model to CodeGen passes.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Representation of each machine instruction.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
unsigned getResourceLength(ArrayRef< const MachineBasicBlock * > Extrablocks=std::nullopt, ArrayRef< const MCSchedClassDesc * > ExtraInstrs=std::nullopt, ArrayRef< const MCSchedClassDesc * > RemoveInstrs=std::nullopt) const
Return the resource length of the trace.
Register getReg() const
getReg - Returns the register number.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
StringRef - Represent a constant reference to a string, i.e.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
TargetSubtargetInfo - Generic base class for all target subtargets.
unsigned const MachineRegisterInfo * MRI
Wrapper class representing virtual and physical registers.
bool hasOptSize() const
Optimize this function for size (-Os) or minimum size (-Oz).
A trace ensemble is a collection of traces selected using the same strategy, for example 'minimum res...
Function & getFunction()
Return the LLVM function that this machine code represents.
FunctionPass class - This class is used to implement most global optimizations.
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
AnalysisUsage & addRequired()