Download presentation
Presentation is loading. Please wait.
Published byMary McCarthy Modified over 11 years ago
1
Automatic Instruction Scheduler Retargeting by Reverse-Engineering Matthew J. Bridges, Neil Vachharajani, Guilherme Ottoni, David I. August Liberty Research Group Department of Computer Science Princeton University
2
2 Structural Hazards Add Shl Sub Xor Code Dynamic Schedule Add ShlSub Xor AddShlSub Static Schedule Xor Resource Usage Add Shl Sub Xor ALU0 ALU1 ALU0 ALU1ALU0 ALU1ALU0 Resources Time
3
Princeton University 3 Structural Hazards Add Shl Sub Xor Code Resource Usage Add Shl Sub Xor ALU0 ALU1 ALU0 ALU1ALU0 ALU1ALU0 Resources Time Add Shl Sub Xor Static Schedule Add Shl Sub Xor Dynamic Schedule
4
Princeton University 4 Encoding Structural Hazards Processor Manuals Machine Description Scheduler Hazard Detector Processor Manuals Pros: Easily Available Standard Methodology Cons: Processor manual does not describe the actual machine Takes several man-weeks to translate processor manual into machine description Machine description written incorrectly Compiler Offline
5
Princeton University 5 Processor Manuals IA64 Instructions Set Reference Vol. 3 ~370 pages of ISA description Itanium 2 Processor Reference Manual ~200 pages of microarchitecural details
6
Princeton University 6 Humans arent Perfect OP_SHIFT (alt(ALT_SHIFT_REG)); OP_SHIFT (alt||(ALT_SHIFT_IMM)); ALT_SHIFT_REG (format (OF_IREG_IREG resv(RL_Itype)); ALT_SHIFT_IMM (format (OF_IREG_IMM6 resv(RL_Itype)); Itanium Instruction Set Reference Vol. 3: Page 3:212 Itanium 2 Processor Reference Manual: Page 27 IMPACT Itanium 2 Machine Description
7
Princeton University 7 Encoding Structural Hazards Architecture Description Language [LISA][nML] Pros: Machine description accurately describes processor Cons: ADLs are limited Not used for general purpose processors Often unavailable ADL Machine Description Scheduler Hazard Detector Compiler Offline
8
Princeton University 8 Encoding Structural Hazards Query machine while scheduling [Baker `91][Dupre `04] Pros: Avoids human errors Easily available Cons: Increase in compile time Unable to cross-compile Scheduler Hazard Detector Compiler
9
Princeton University 9 Encoding Structural Hazards Machine Description Query machine a priori Pros: Avoids human errors Easily available Avoid scheduling overhead Cons: ? Scheduler Hazard Detector Compiler Offline Structural Hazard Determination Algo.
10
Princeton University 10 Limits of Querying Machine A Infinite Finite Machine B Infinite Finite Goal: Perfectly characterize the machine Goal: Characterize the machine
11
Princeton University 11 Identifying a Subspace to Explore III III III Width (w) Depth (p) Instructions (I) # Possible Instruction Schedules Millennia Myopia 230 Millennia Pipelined Itanium 2Time 1.3 Hours Categorization 100 Schedules/Second Assumption 3 No Order Millennia III Width (w) Instructions (I) Width (w) Instructions (I) Width (w) Categories (C) Width (w) Instructions (I)General
12
Princeton University 12 Cost of Assumptions
13
Princeton University 13 Reverse-Engineering Algorithm 1. All Instructions in a Single Category 2. Split Categories Perform a Random Walk Longer walk = more accurate categories 3. Extract Canonical Instructions 4. Exhaustive Exploration of Canonical Instructions … 5. Update machine description
14
Princeton University 14 Cost of Finding Categories
15
Princeton University 15 Conclusion Obtaining structural hazards for use in instruction scheduling is error prone Processors manuals wrong or confusing Manual translation is error prone ADLs arent available We can automatically extract structural hazards useful for scheduling It is impossible to determine all structural hazards a priori It is possible to find sufficient hazard information to produce good schedules Algorithm achieves 81-100% of manual resource map performance Greatly reduces the time needed to retarget the instruction scheduler of a compiler Facilitates Design Space Exploration
16
Princeton University 16 Thank You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.