Skip to content

Commit ee1cee2

Browse files
committed
as
1 parent 0818ab4 commit ee1cee2

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -726,16 +726,7 @@ class SIInsertWaitcntsLegacy : public MachineFunctionPass {
726726
static char ID;
727727
SIInsertWaitcntsLegacy() : MachineFunctionPass(ID) {}
728728

729-
bool runOnMachineFunction(MachineFunction &MF) override {
730-
auto *MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
731-
auto *PDT =
732-
&getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
733-
AliasAnalysis *AA = nullptr;
734-
if (auto *AAR = getAnalysisIfAvailable<AAResultsWrapperPass>())
735-
AA = &AAR->getAAResults();
736-
737-
return SIInsertWaitcnts(MLI, PDT, AA).run(MF);
738-
}
729+
bool runOnMachineFunction(MachineFunction &MF) override;
739730

740731
StringRef getPassName() const override {
741732
return "SI insert wait instructions";
@@ -2411,6 +2402,17 @@ bool SIInsertWaitcnts::shouldFlushVmCnt(MachineLoop *ML,
24112402
return HasVMemLoad && UsesVgprLoadedOutside && ST->hasVmemWriteVgprInOrder();
24122403
}
24132404

2405+
bool SIInsertWaitcntsLegacy::runOnMachineFunction(MachineFunction &MF) {
2406+
auto *MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
2407+
auto *PDT =
2408+
&getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
2409+
AliasAnalysis *AA = nullptr;
2410+
if (auto *AAR = getAnalysisIfAvailable<AAResultsWrapperPass>())
2411+
AA = &AAR->getAAResults();
2412+
2413+
return SIInsertWaitcnts(MLI, PDT, AA).run(MF);
2414+
}
2415+
24142416
PreservedAnalyses
24152417
SIInsertWaitcntsPass::run(MachineFunction &MF,
24162418
MachineFunctionAnalysisManager &MFAM) {

llvm/test/CodeGen/AMDGPU/call-waw-waitcnt.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
22
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=si-insert-waitcnts %s -o - | FileCheck -check-prefix=GCN %s
3-
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -passes=si-insert-waitcnts %s -o - | FileCheck -check-prefix=GCN %s
3+
# RUN: llc -mtriple=amdgcn -mcpu=gfx900 -passes=si-insert-waitcnts %s -o - | FileCheck -check-prefix=GCN %s
44

55
# $sgpr30_sgpr31 will hold the return address. We need a waitcnt before SI_CALL so
66
# that the return address is not clobbered in the callee by the outstanding load.

0 commit comments

Comments
 (0)