Skip to content
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

[AIE2/2P] Fix DONE latency at region end. #345

Open
wants to merge 1 commit into
base: aie-public
Choose a base branch
from

Conversation

SagarMaheshwari99
Copy link
Collaborator

No description provided.

@@ -176,6 +176,13 @@ struct AIEBaseInstrInfo : public TargetInstrInfo {
}
/// Check whether Opc represents a lock instruction
virtual bool isLock(unsigned Opc) const { return false; }

/// Check whether Opc represents a DONE instruction
virtual bool isDone(unsigned Opc) const { return false; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I hope no one needs to call this from outside. This one could go and instances could be private or inlined.

virtual bool isDone(unsigned Opc) const { return false; }

/// Get "implicit" latency for special instructions.
virtual unsigned getImplicitLatency(const MachineInstr &) const { return 0; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document what that means?

@@ -280,6 +280,10 @@ class RegionEndEdges : public ScheduleDAGMutation {
EdgeLatency = DelaySlots + 1;
}

// "Implicit" latency for special instructions.
const unsigned ImplicitLatency = TII->getImplicitLatency(MI);
EdgeLatency = std::max(EdgeLatency, ImplicitLatency);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @mludevid you might have done something similar when working on semaphores.

@@ -176,6 +176,13 @@ struct AIEBaseInstrInfo : public TargetInstrInfo {
}
/// Check whether Opc represents a lock instruction
virtual bool isLock(unsigned Opc) const { return false; }

/// Check whether Opc represents a DONE instruction
virtual bool isDone(unsigned Opc) const { return false; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can have a design where we need just one method to be reimplemented. Something like:

virtual std::optional<unsigned> getDoneLatency(...)

In this case, we can have a base implementation for getImplicitLatency that can be reimplemented by the target only if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants