Course: Computer Architectures
Professor: E. Sanchez
Source: Instruction Level Parallelism, Politecnico di Torino, ASE 2026/27, 50 slides.
Numbering: Local sequence after Lecture 06 - Exceptions and Interrupts; the PDF has no lecture number.
PDF: Instruction Level Parallelism.pdf
Lecture summary
With execution and recovery established, ask how much additional independent work can be exposed. Every transformation must keep the original program’s required results and observable behavior.
Once correctness under overlap is clear, the next goal is to expose more independent work. Instruction-level parallelism is the opportunity to overlap instructions without changing program behavior. Compilers and hardware can both find opportunities, but dependencies and resource limits bound the benefit. Instruction-Level Parallelism
Before rearranging instructions, identify which relationships must remain intact. True data dependencies connect a produced value to its consumers; name dependencies arise when distinct values reuse a register name. A dependence is a program constraint, while a hazard depends on how the pipeline executes it. Instruction Dependencies
When a shared register name is the only obstacle, give distinct values different storage names. Renaming removes WAR and WAW name dependencies while preserving true RAW data flow. It creates scheduling freedom without making a consumer independent of the value it actually needs. Register Renaming
Loops often supply independent work beyond one short instruction block. Unrolling exposes several iterations for scheduling; SIMD applies an operation across multiple data lanes. Both depend on whether iterations can safely run together, so aliasing and loop-carried dependencies must be checked. Loop Unrolling and SIMD
Branches create another limit: work may only be required on one execution path. Speculation begins work before the outcome is known, but must preserve data flow, exception behavior and observable effects. Recovery connects this performance technique back to precise architectural state. Control Dependencies and Speculation
A handler needs a coherent view of the interrupted program. Precise exceptions present state consistent with a defined instruction boundary: required older effects are complete and younger effects have not become visible. Internal execution order can vary only if that architectural view is preserved. Precise Exceptions
The detailed notes below retain the lecture’s examples, timing diagrams or comparisons, and source references.
Lecture map
| Slides | Material | Study note |
|---|---|---|
| 1-5 | ILP; dynamic and static approaches | Instruction-Level Parallelism |
| 6-7 | Basic blocks and loop control-flow example | Instruction-Level Parallelism > Basic blocks |
| 8-12 | Scheduling example: 14 cycles becomes 12 | Instruction-Level Parallelism > Worked scheduling example |
| 13-18 | Small blocks, loop-level parallelism, unrolling | Loop Unrolling and SIMD |
| 19-21 | SIMD/vector array addition | Loop Unrolling and SIMD > SIMD and vector processing |
| 22-27 | Data dependencies, hazards, stalls, memory aliasing | Instruction Dependencies |
| 28-32 | Name dependencies across repeated loop bodies | Instruction Dependencies > Repeated loop bodies |
| 33-38 | Static/dynamic renaming; temporary T and S | Register Renaming |
| 39-43 | RAW, WAW, WAR, and pipeline conditions | Instruction Dependencies > RAW WAW WAR and RAR |
| 44-46 | Control dependence and correctness | Control Dependencies and Speculation |
| 47-50 | Exception behavior, data flow, safe speculation | Control Dependencies and Speculation > Worked examples |
What the professor covered
Finding parallel work (slides 2-7)
Pipelines exploit independent instructions by overlapping execution. Hardware can discover parallelism dynamically, while compilers can expose it statically; a processor can combine the approaches.
The slide product lists are lecture examples, not a current market survey. RISC-V names an ISA, not a guarantee of a particular scheduling implementation. A basic block has one entry and one exit; a loop may contain several blocks because branches divide its body.
Scheduling (slides 8-12)
Two computations are implemented by eight instructions. In the original order, two immediate load-use dependencies require two stalls. Rearranging independent work fills those gaps: 14 cycles becomes 12 under the lecture’s five-stage pipeline and forwarding assumptions.
Source mismatch: Slide 8 says a = b + c; d = e - f;, but slides 9-12 use add x6, x3, x4. The concept note preserves the printed code and explains that sub x6, x3, x4 implements the stated second expression with the same scheduling pattern in this model.
Loop-level parallelism (slides 13-21)
Slide 13 reports typical basic blocks of 4-7 instructions; treat this as a lecture observation rather than a universal program property. Unrolling exposes more instructions and reduces loop-control overhead. SIMD applies an operation across multiple data elements.
Array iterations can overlap only when their data and memory relationships permit it. Real unrolled loops need correct indexing and tail handling. Slide 21’s vector/scalar equal-time claim is a simplifying assumption, not a general hardware guarantee.
Dependencies and renaming (slides 22-43)
The lecture distinguishes true data flow, reuse of names, and branch-controlled execution. A program dependence exists independently of the processor; whether it becomes a hazard or requires a stall depends on the pipeline.
Register renaming removes WAR/WAW constraints caused by shared register names. It cannot remove a true producer-consumer dependency. The worked T/S examples update both definitions and the consumers that need those definitions.
Memory access relationships depend on addresses. Slide 27’s “only at run time” claim is too broad: compilers can prove some accesses independent, and need conservative ordering or runtime checks where aliasing remains uncertain. Official LLVM clarification is linked in Instruction Dependencies > Memory dependencies.
Correct reordering and speculation (slides 44-50)
Ordinary motion across a branch can make a conditional instruction unconditional. Correctness requires preserving both exception behavior and data flow.
Slide 47 forbids hoisting a potentially faulting load. Slide 48 shows a value selected by branch outcome. Slides 49-50 allow moving a nontrapping subtraction because its result is dead on the path where it was originally skipped. See Control Dependencies and Speculation for path-by-path explanations.
Suggested reading order
- Instruction-Level Parallelism for the 14-to-12-cycle example.
- Loop Unrolling and SIMD for exposing independent iterations.
- Instruction Dependencies, then Register Renaming.
- Control Dependencies and Speculation, linked back to Precise Exceptions.
Quiz practice is deferred. Examples are explained directly in the concept notes.
Source and clarification policy
Primary source: linked PDF, slides 1-50; page and slide numbers coincide. Code marked as slide code preserves the source. Corrections, assumptions, extra examples, and official-reference qualifications are labeled separately. Existing RAW and WAW Hazards material is reused through links.