-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[AMDGPU] Add target hook to isGlobalMemoryObject #112781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
#include "llvm/CodeGen/ScheduleDAG.h" | ||
#include "llvm/CodeGen/ScheduleDFS.h" | ||
#include "llvm/CodeGen/SlotIndexes.h" | ||
#include "llvm/CodeGen/TargetInstrInfo.h" | ||
#include "llvm/CodeGen/TargetRegisterInfo.h" | ||
#include "llvm/CodeGen/TargetSubtargetInfo.h" | ||
#include "llvm/Config/llvm-config.h" | ||
|
@@ -547,12 +548,6 @@ void ScheduleDAGInstrs::addVRegUseDeps(SUnit *SU, unsigned OperIdx) { | |
} | ||
} | ||
|
||
/// Returns true if MI is an instruction we are unable to reason about | ||
/// (like a call or something with unmodeled side effects). | ||
static inline bool isGlobalMemoryObject(MachineInstr *MI) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the difference between this and TII::isSchedulingBoundary? Also wondering if we could treat these like isPosition There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
isSchedulingBoundary creates divisions between scheduling regions, it separates and defines independent ScheduleDAGs. isGlobalMemoryObject controls dependency edges within a ScheduleDAG.
In what way? You mean treat these as debug info instead of instructions? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean make it an instruction property, rather than introducing a very specific override for this one case. Are you allowed to put other isLabel or isPosition instructions anywhere in the block? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know if an existing instruction property would work, isPosition makes an instruction a scheduling boundary and would split the block as far as the scheduler is concerned. |
||
return MI->isCall() || MI->hasUnmodeledSideEffects() || | ||
(MI->hasOrderedMemoryRef() && !MI->isDereferenceableInvariantLoad()); | ||
} | ||
|
||
void ScheduleDAGInstrs::addChainDependency (SUnit *SUa, SUnit *SUb, | ||
unsigned Latency) { | ||
|
@@ -899,8 +894,9 @@ void ScheduleDAGInstrs::buildSchedGraph(AAResults *AA, | |
// isLoadFromStackSLot are not usable after stack slots are lowered to | ||
// actual addresses). | ||
|
||
const TargetInstrInfo *TII = ST.getInstrInfo(); | ||
// This is a barrier event that acts as a pivotal node in the DAG. | ||
if (isGlobalMemoryObject(&MI)) { | ||
if (TII->isGlobalMemoryObject(&MI)) { | ||
|
||
// Become the barrier chain. | ||
if (BarrierChain) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should follow the pattern that isCopyInstr uses. Have the virtual overridable Impl function, with the generic cases handled directly