
































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!

































Basic Block A
... ...
BEQ L1 if R3 ==
Basic Block C Basic Block B
...
Superblock
... ...
BNE L2 if R3 !=
Basic Block B L2:...
Compensation code
R3 ← 100 loop: R1 ← mem(R2) ; load from memory Br found if R1 == -1 ; look for - R2 ← R2 + 4 R3 ← R3 - Br loop if R3 != 0 ; loop closing branch . . found:
176.gcc 181.mcf 197.parser 252.eon 256.bzip2^ 171.swim 173.applu 177.mesa 187.facerec 189.lucas Percent Dynamic Branches Decided Same As Previous Time
0
All Add/Sub Load Logic^ Shift Set Instruction Type Fraction with Constant Value static dynamic
B C D E F A Compiler Front-end
Program Instrumented Code Optimizing Compiler Test Data Program Execution Compiler Back-end Program Statistics Optmized Binary intermediate form Instrumented Code
B D E A
Instruction function list . branch_conditional(inst) { BO = extract(inst,25,5); BI = extract(inst,20,5); displacement = extract(inst,15,14) * 4; . . // code to compute whether branch should be taken . . profile_addr = lookup(PC); if (branch_taken) profile_cnt(profile_addr, taken)++; PC = PC + displacement; Else profile_cnt(profile_addr, nottaken)++; PC = PC + 4; }
Zero Detect Interval Counter Instruction Address decrement for each instruction Program Counter Load PC Initialize Counter TRAP Sample PC
Br cond1 == true Br cond2 == false Br uncond Br cond3 == true Br uncond Br cond4 == true A B C D E F G Br cond1 == false A Br cond3 == true D E Br cond2 == false Br uncond B C Br cond4 == true G F Br uncond Br uncond