






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!































Homeworks^ Y^
scp mahlke.tgz [email protected]:/y/eecs583/hw1/.
Region Formation + If-conversion
branches » predicated operations
Often bad to apply in blanketmode » Selectively apply
Extend a superblock tocontain if-converted code » Convert off-trace transitionsto on-trace » A hyperblock is born » Superblock is a special caseHB where all guardingpredicates are True
When to Apply If-conversion^ Y^
y^ No disruption to sequential fetch y^ No prediction or mispredict y^ No use of branch resource» Increase potential for operationoverlap» Enable more aggressive compilerxforms y^ Software pipelining y^ Height reduction
Max or Sum function applied whenoverlap^ y^
Resource usage y Dependence height y Hazard presence »^ Executing useless operations
Negative 2: Dependence Height Dependence height is max of for all BBs that are if-converted (dep height = schedule length with infinite resources)
Case 1: height(bb1) = 1, height(bb2) = 3 Height(bb3) =
^9 , height(bb4) = 2 No IC: 11 + .63 + .49 + 12 = 8.4 IC: 11 + 1MAX(3,9) + 1*3 = 13
Case 2: height(bb1) = 1, height(bb2) = 3 Height(bb3) =
^3 , height(bb4) = 2 No IC: 11 + .63 + .43 + 12 = 6 IC: 11 + 1MAX(3,3) + 1*2 = 6 BB
BB2 if p BB^
BB3 if p2^ BB
100
Negative 3: Hazard Presence Hazard = operation that forces the compiler to be conservative, so limited reordering or optimization, e.g., subroutine call, pointer store, …
Case 1: Hazard in BB3 No IC : SB out of BB1, 2, 4, operations In BB4 free to overlap with those in BB1 and BB2 IC: operations in BB4 cannot overlap With those in BB1 (BB2 ok)
BB
BB2 if p BB^
BB3 if p2^ BB
100
The Hyperblock^ Y^
Block Selection
Select subset of BBs forinclusion in HB» Difficult problem» Weighted cost/benefitfunction^ y^
Height overhead y Resource overhead y Hazard overhead y Branch elimination benefit y Weighted by frequency
Example - Step 1 - Block Selection
main path = 1,2,4,
num_ops = 5 + 8 + 3 + 2 = 18 weight = 80 Calculate the BSVs for BB3, BB5 assuming no hazards, K = 4 BSV3 = 4 x (20 / 2) x (18 / 80) = 9 BSV5 = 4 x (10 / 5) x (18 / 80) = 1.8 If Threshold = 2.0, select BB3 along with main path 10 BB2 - 8
Example - Step 2 - Tail Duplication
Tail duplication same as with Superblock formation 10 BB
Hyperblock Performance Evaluation (1)^ Y^
Class Problem
Form the HB for this subgraph Assume K = 4, BSV Threshold = 2
55
10 10
35
BB7 -
100 80 BB1- 3 20
45
Block Selection – Try 2 (continued)^ Y^
Block Selection - Try 2 - Example
Enumerate all paths, rank by priority