Schedule a Basic Block to Hide Load Latency on an In-Order Core
Last updated: November 29, 2026
Quick Overview
Given a basic block of instructions with latencies and data dependencies, compute the cycles needed when issued in program order on a single-issue in-order core, then produce a reordered schedule using list scheduling that reduces the total.
Arm
November 29, 20260
0
0 solved
Given a basic block of instructions with latencies and data dependencies, compute the cycles needed when issued in program order on a single-issue in-order core, then produce a reordered schedule using list scheduling that reduces the total.
Small in-order cores like Cortex-A520 and Cortex-M parts depend heavily on the compiler to hide latency, so Arm's code generation teams care about instruction scheduling. The interviewer checks dependency reasoning, a sensible priority function, and the ability to compare against the naive order.
What the Interviewer Expects
- Model ready time as issue cycle plus latency
- Compute the in-order baseline correctly including stalls
- Build the reverse dependency graph and a critical-path height
- Greedily issue the highest priority ready instruction each cycle
- Explain why this is a heuristic and where it fails
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you extend this to a dual-issue core with separate load and ALU pipes?
- How does scheduling interact with register pressure, and what happens if you hoist every load?
- How would you handle memory dependencies between a load and a store whose addresses may alias?
- Why do out-of-order Neoverse cores care less about this, and where do they still benefit?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Each instruction has a name, latency, and list of producers it depends on (true data dependencies only). The core issues at most one instruction per cycle; an instruction can issue at cycle c only i...
High-Level Design
Baseline: walk program order, issue each instruction at max(previous issue + 1, ready time of its producers). Improved: classic list scheduling. Priority is the height of an instruction, the longest...