Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions llvm/lib/Target/AIE/AIEBaseSubtarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,16 @@ class EmitFixedSUnits : public ScheduleDAGMutation {
SDep Dep(&FreeSU, SDep::Artificial);
auto Latency =
AIE::maxLatency(&MI, *TII, *ItinData, /*IncludeStages=*/true);
if (TII->isLock(MI.getOpcode())) {
Dep.setLatency(std::max(
TII->getCoreResumeCycleAfterLock() -
*TII->getFirstMemoryCycle(FixedDepMI->getDesc().SchedClass) + 1,
Latency));
} else if (TII->isLock(FixedDepMI->getOpcode())) {
auto OptFirstMemCycle =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please include a test.

TII->getFirstMemoryCycle(FixedDepMI->getDesc().SchedClass);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, would be nice to know which SchedClass does not get this info

auto OptLastMemCycle = TII->getLastMemoryCycle(MI.getDesc().SchedClass);
if (TII->isLock(MI.getOpcode()) && OptFirstMemCycle) {
Dep.setLatency(
std::max(*TII->getLastMemoryCycle(MI.getDesc().SchedClass) -
TII->getCoreStallCycleAfterLock() + 1,
std::max(TII->getCoreResumeCycleAfterLock() - *OptFirstMemCycle + 1,
Latency));
} else if (TII->isLock(FixedDepMI->getOpcode()) && OptLastMemCycle) {
Dep.setLatency(std::max(
*OptLastMemCycle - TII->getCoreStallCycleAfterLock() + 1, Latency));
} else {
Dep.setLatency(Latency);
}
Expand Down