[PATCH] D134726: [AMDGPU][SetWavePriority] Fix dealing with MBBInfo records.
Ivan Kosarev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 27 03:41:52 PDT 2022
kosarev created this revision.
Herald added subscribers: foad, kerbowa, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: All.
kosarev requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D134726
Files:
llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
Index: llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUSetWavePriority.cpp
@@ -122,17 +122,16 @@
// executed provided no backedge is ever taken.
MBBInfoSet MBBInfos;
for (MachineBasicBlock *MBB : post_order(&MF)) {
- MBBInfo &Info = MBBInfos[MBB];
bool AtStart = true;
unsigned MaxNumVALUInstsInMiddle = 0;
unsigned NumVALUInstsAtEnd = 0;
for (MachineInstr &MI : *MBB) {
if (isVMEMLoad(MI)) {
AtStart = false;
- Info.NumVALUInstsAtStart = 0;
+ MBBInfos[MBB].NumVALUInstsAtStart = 0;
MaxNumVALUInstsInMiddle = 0;
NumVALUInstsAtEnd = 0;
- Info.LastVMEMLoad = &MI;
+ MBBInfos[MBB].LastVMEMLoad = &MI;
} else if (SIInstrInfo::isDS(MI)) {
AtStart = false;
MaxNumVALUInstsInMiddle =
@@ -140,7 +139,7 @@
NumVALUInstsAtEnd = 0;
} else if (SIInstrInfo::isVALU(MI)) {
if (AtStart)
- ++Info.NumVALUInstsAtStart;
+ ++MBBInfos[MBB].NumVALUInstsAtStart;
++NumVALUInstsAtEnd;
}
}
@@ -153,14 +152,14 @@
std::max(NumFollowingVALUInsts, MBBInfos[Succ].NumVALUInstsAtStart);
}
if (AtStart)
- Info.NumVALUInstsAtStart += NumFollowingVALUInsts;
+ MBBInfos[MBB].NumVALUInstsAtStart += NumFollowingVALUInsts;
NumVALUInstsAtEnd += NumFollowingVALUInsts;
unsigned MaxNumVALUInsts =
std::max(MaxNumVALUInstsInMiddle, NumVALUInstsAtEnd);
- Info.MayReachVMEMLoad =
+ MBBInfos[MBB].MayReachVMEMLoad =
SuccsMayReachVMEMLoad ||
- (Info.LastVMEMLoad && MaxNumVALUInsts >= VALUInstsThreshold);
+ (MBBInfos[MBB].LastVMEMLoad && MaxNumVALUInsts >= VALUInstsThreshold);
}
MachineBasicBlock &Entry = MF.front();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134726.463178.patch
Type: text/x-patch
Size: 1902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220927/9e0cbad3/attachment.bin>
More information about the llvm-commits
mailing list