trace scheduling
TRANSCRIPT
Trace SchedulingBy Stefan M. Freudenberger
Encyclopedia Of Parallel Computing
Bekket McClane @ Advanced Programming Language Jenq-Kuen Lee, NTHU CS, 2016 Spring
SYLLABUS• Instruction Scheduling Recap
• Trace Formation
• Scheduling
• Code Motion
• Compensation Code
• Summary
In Muti Issues Processors…
• Help resolving dependencies of instructions
• More operations running at the same time. Smarter scheduling algorithm is needed.
Local vs Global Scheduling - Local
• Boundary is usually within one basic block
• Pros: Easy to implement
• Cons: Instruction count is too small to apply some optimizations
Local vs Global Scheduling - Global
• Boundary across several basic blocks
• E.g. Extended Basic Blocks, Trace
• Pros: Larger region brings more optimization opportunities
• Cons: Take times determining best scheduling region
BB
BB
BB
Single Entry
Single Exit
BB
BB
BB
(Single Entry)
Multi Exits
Extended Basic Blocks Trace
Allow Enter After
First Instruction
Control Dependency• Split Dependency: Prevent operations
from moving below the exit of a BB
• Join Dependency: Prevent operations from moving above the entry of a BB
Suppression of Compensation
Aka. No need to insert compensation code in some situations
E.g. After loop unrolling
SUMMARY• Bigger regions have advantages over single
basic blocks in instruction scheduling
• Can use branch related code motions to construct better trace regions
• Need compensation codes to fix program semantics