























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various optimization techniques for compiler control flow, including the use of regions, traces, superblocks, and predicated execution. It includes region types, region formation, tail duplication, and the implementation of predicated execution using hardware mechanisms.
Typology: Study notes
1 / 31
This page cannot be seen from the preview
Don't miss anything!
























Reading Material^ Y^
Regions^ Y^
Hard to extract sufficient parallelism
Plus only parts of a procedure are important (90/10 rule)
Regions (2)^ Y^
Linearizing a Trace
10 (entry count) BB1 BB2 BB4 BB 80
20 (side exit) 10 (side exit) 80 90
20 (side entrance)10 (side entrance)
90 (entry/ exit count)
10 (exit count)
Intelligent Trace Layout for Icache Performance
Intraprocedural code placement Procedure positioning Procedure splitting
trace
Trace Selection Algorithm^ i = 0;^ mark all BBs unvisited^ while
(there are unvisited nodes) do seed = unvisited BB with largest execution freq trace[i] += seed mark seed visited current = seed /* Grow trace forward */ while^ (1) do^ next = best_successor_of(current)^ if^ (next == 0) then
break
trace[i] += next mark next visited current = next endwhile /* Grow trace backward analogously */ i++ endwhile
Best Successor/Predecessor^ Y^
best_successor_of(BB)e = control flow edge with highest
probability leaving BBif (e is a backedge) then return 0endif if (probability(e) <= THRESHOLD) then return 0endif d = destination of eif (d is visited) then return 0endif return d endprocedure
Class Problem 2
Find the traces. Assume a threshold probability of 60%.
(^100) BB (^60) BB^
BB BB^
BB
BB
BB7 BB (^25 )
(^403515) 50
10 5
135 100 (^75100)
Traces are Nice, But …^ Y^
y^ aka bookkeeping » Side entrance fixup is morepainful » Sometimes not possible sotransform not allowed
Eliminate side entrances » The superblock
is born
Tail Duplication^ Y^
Superblock Formation
Class Problem 3
49
10 10
41
BB
100 80
Create the superblocks, trace threshold is 60%
51
450
Predicated Execution^ Y^
y^ if (p1 is True), r1 = r2 + r3 y^ else if (p1 is False), do nothing (Add treated like a NOP) y^ p1 referred to as the guarding predicate y^ Predicated on True means always executed y^ Omitted predicated also means always executed