






















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
The concept of effective compiler support for predicated execution using hyperblocks. The authors discuss how to compute predicates, introduce cmpp action specifiers, and differentiate between or-type and and-type predicates. The document also covers the use of or-type predicates in generating predicated code and the importance of control dependence analysis in the process.
Typology: Papers
1 / 30
This page cannot be seen from the preview
Don't miss anything!























Reading Material^ ^ Today’s class
This is a long paper – the part we care about is the controldependence stuff. The PDG is interesting and you shouldskim it over, but we will not talk about it now
CMPP Action Specifiers
OR-type, AND-type Predicates^ p1 = 0^ p1 = cmpp_ON (r1 < r2) if T^ p1 = cmpp_OC (r3 < r4) if T^ p1 = cmpp_ON (r5 < r6) if T^ p1 = (r1 < r2) | (!(r3 < r4)) |^ (r5 < r5)^ Wired-OR into p
Generating predicated code for some source code requires OR-type predicates
Class Problem^ if (a > 0) {
If-conversion^ ^ Algorithm for generating predicated code
But, acyclic subgraph only!! y Need a branch to get you back to the top of a loop
Step 1: Backedge Coalescing^ ^ Recall – Loop backedge is branch from inside the loopback to the loop header^ ^ This step only applicable for a loop body
Running Example – Backedge Coalescing
BB1 b < 0 b >= 0^ BB3c <= 0^ BB c > 0
b <= 13
c <= 25^
c > 25 e < 34 d++ b++^
c++
b > 13
e >= 34 a++
e++^ BB
BB1 b < 0 b >= 0^ BB3c <= 0^ BB c > 0 b <= 13
c > 25c <= 25
b++^
c++
b > 13
e < 34
d++^ a++^ e >= 34
e++
Control Dependences^ ^ Recall
Control Dependence Example
Control dependences BB1: BB2: BB3: BB4: BB5: BB6: BB7:
Notation positive BB number = fallthru direction^ negative BB number = taken direction
Algorithm for Control Dependence Analysis^ for each
basic block x in region for each^ outgoing control flow edge e of x y = destination basic block of e if (y not in pdom(x)) then lub = ipdom(x) if^ (e corresponds to a taken branch) then^ x_id = -x.id else^ x_id = x.id endif t = y while^ (t != lub) do^ cd(t) += x_id;^ t = ipdom(t) endwhile endif endfor endfor
Notes Compute cd(x) which contains those BBs which x is control dependent on^ Iterate on per edge basis, adding^ edge to each cd set it is a member of
Running Example – Post Dominators
BB1 b < 0 b >= 0^ BB3c <= 0^ BB c > 0
b <= 13
c <= 25^
c > 25 e < 34 d++
c++
b > 13
a++
e++
b++
Entry
Exit
Running Example – CDs Via Algorithm (2)
BB1 b < 0 b >= 0^ BB3c <= 0^ BB c > 0
b <= 13
c <= 25^
c > 25 e < 34 d++
c++
b > 13
a++
e++
b++
Entry
Exit
x = 3e = taken edge 3
y = 8y not in pdom(x)lub = 9x_id = -3t = 88 != 9cd(8) += -3t = 99 == 9 3 Æ^ 8 edge (aka -3)^ Class Problem: 1
Æ^ 3 edge (aka 1)
Running Example – CDs Via Algorithm (3)
BB1 b < 0 b >= 0^ BB3c <= 0^ BB c > 0
b <= 13
c <= 25^
c > 25 e < 34 d++
c++
b > 13
a++
e++
b++
Entry
Exit