[AIE2P] Implement lock no_fence scheduling semantics#856
Open
katerynamuts wants to merge 2 commits into
Open
Conversation
Add acqrel-scheduling.mir with scheduling tests covering memory (store/load vs ACQ/REL/DONE), scalar streams (SS/MS), cascade streams (SCD/MCD), and lock sequences (ACQ/ACQ, ACQ/REL, REL/ACQ, REL/REL). CHECK lines reflect the existing guarded-only scheduler behavior, before lock no_fence semantics are implemented.
The AIE2P spec defines two variants of the acquire/release lock instruction depending on context: - guarded: used when memory operations are in-flight before the lock. Enforces a minimum gap between the preceding memory op and any subsequent one. - no_fence: used when no memory is in-flight before the lock. Omits all memory lock token constraints, allowing subsequent memory ops to be scheduled immediately (0 cycles gap). Previously the scheduler always applied the guarded latency forward from any lock to subsequent memory, matching the guarded variant regardless of context. This patch implements no_fence semantics for AIE2P by: 1. Adding a virtual hasLockNoFenceSemantics() hook to AIEBaseInstrInfo (default: false), overridden to return true in AIE2PInstrInfo. 2. In LockDelays::apply, skipping the forward ACQ/REL->MEM latency when the target supports no_fence semantics. 3. In AIERegMemEventTracker::getSafeOperandsDistanceFromBottom, skipping the forward lock-to-mem distance for the same reason. The MEM->ACQ/REL direction (predecessor latencies) is unchanged. The fix is gated on hasLockNoFenceSemantics() and does not affect AIE1, AIE2, or AIE2PS. Update acqrel-scheduling.mir CHECK lines to reflect no_fence behavior.
2f2b0ed to
1c17bf7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AIE2P spec defines two variants of the acquire/release lock instruction depending on context:
subsequent one.
Previously the scheduler always applied the guarded latency forward from any lock to subsequent memory, matching the guarded variant regardless of context.
This patch implements no_fence semantics for AIE2P by:
The fix is gated on hasLockNoFenceSemantics() and does not affect AIE2, or AIE2PS.
Update acqrel-scheduling.mir CHECK lines to reflect no_fence behavior.