Skip to content

Commit caa13cc

Browse files
committed
as
1 parent 2b2152c commit caa13cc

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
@@ -742,16 +742,7 @@ class SIInsertWaitcntsLegacy : public MachineFunctionPass {
742742
static char ID;
743743
SIInsertWaitcntsLegacy() : MachineFunctionPass(ID) {}
744744

745-
bool runOnMachineFunction(MachineFunction &MF) override {
746-
auto *MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
747-
auto *PDT =
748-
&getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
749-
AliasAnalysis *AA = nullptr;
750-
if (auto *AAR = getAnalysisIfAvailable<AAResultsWrapperPass>())
751-
AA = &AAR->getAAResults();
752-
753-
return SIInsertWaitcnts(MLI, PDT, AA).run(MF);
754-
}
745+
bool runOnMachineFunction(MachineFunction &MF) override;
755746

756747
StringRef getPassName() const override {
757748
return "SI insert wait instructions";
@@ -2499,6 +2490,17 @@ bool SIInsertWaitcnts::shouldFlushVmCnt(MachineLoop *ML,
24992490
return HasVMemLoad && UsesVgprLoadedOutside && ST->hasVmemWriteVgprInOrder();
25002491
}
25012492

2493+
bool SIInsertWaitcntsLegacy::runOnMachineFunction(MachineFunction &MF) {
2494+
auto *MLI = &getAnalysis<MachineLoopInfoWrapperPass>().getLI();
2495+
auto *PDT =
2496+
&getAnalysis<MachinePostDominatorTreeWrapperPass>().getPostDomTree();
2497+
AliasAnalysis *AA = nullptr;
2498+
if (auto *AAR = getAnalysisIfAvailable<AAResultsWrapperPass>())
2499+
AA = &AAR->getAAResults();
2500+
2501+
return SIInsertWaitcnts(MLI, PDT, AA).run(MF);
2502+
}
2503+
25022504
PreservedAnalyses
25032505
SIInsertWaitcntsPass::run(MachineFunction &MF,
25042506
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)