[PATCH] D30153: AMDGPU/SI: Detect dependency types between blocks
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 21 15:24:35 PST 2017
arsenm added inline comments.
================
Comment at: lib/Target/AMDGPU/SIMachineScheduler.cpp:541-544
+ for (std::pair<SIScheduleBlock*, enum SIScheduleBlockLinkKind> S : Succs) {
+ if (PredID == S.first->getID())
+ assert(!"Loop in the Block Graph!\n");
+ }
----------------
Factor into predicate function and assert on that condition
================
Comment at: lib/Target/AMDGPU/SIMachineScheduler.cpp:562-563
++NumHighLatencySuccessors;
- Succs.push_back(Succ);
+ Succs.push_back(std::pair<SIScheduleBlock*,
+ enum SIScheduleBlockLinkKind> (Succ, Kind));
+
----------------
std::make_pair
================
Comment at: lib/Target/AMDGPU/SIMachineScheduler.cpp:586
+ if (S.second == SIScheduleBlockLinkKind::Data)
+ dbgs() << "(Data Dep) ";
+ S.first->printDebug(false);
----------------
Debug printing not guarded by DEBUG. Looks like this problem existed already, so this whole block should be under DEBUG
================
Comment at: lib/Target/AMDGPU/SIMachineScheduler.h:101
+ // All blocks successors, and the kind of link
+ std::vector<std::pair<SIScheduleBlock*, enum SIScheduleBlockLinkKind>> Succs;
unsigned NumHighLatencySuccessors = 0;
----------------
Don't need enum keyword
================
Comment at: lib/Target/AMDGPU/SIMachineScheduler.h:124
const std::vector<SIScheduleBlock*>& getPreds() const { return Preds; }
- const std::vector<SIScheduleBlock*>& getSuccs() const { return Succs; }
+ const std::vector<std::pair<SIScheduleBlock*, enum SIScheduleBlockLinkKind>>&
+ getSuccs() const { return Succs; }
----------------
Return ArrayRef
Repository:
rL LLVM
https://reviews.llvm.org/D30153
More information about the llvm-commits
mailing list