predicate execution 2008/01/10 presented by jinho

15
Predicate Execution 2008/01/10 Presented by Jinho

Upload: gervais-owen

Post on 14-Dec-2015

221 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Predicate Execution 2008/01/10 Presented by Jinho

Predicate Execution2008/01/10

Presented by Jinho

Page 2: Predicate Execution 2008/01/10 Presented by Jinho

If-conversion

Performance degradationmov r1 = 0;if( r2 == r3 ) mov r1 = 1;else mov r1 = 2;mov r4 = r1;

mov r1 = 0;cmp.eq p1,p2=r2,r3;(p1) mov r1 = 1;(p2) mov r1 = 2;mov r4 = r1;

ProblemMultiple definition

Performance degradation due to re-naming

Page 3: Predicate Execution 2008/01/10 Presented by Jinho

Phi-Predication for Light-Weight If-ConversionWeihaw Chuang, Brad Calder, Jeanne Ferrante - CGO’03

Page 4: Predicate Execution 2008/01/10 Presented by Jinho

Phi-Predication

Instructions

Page 5: Predicate Execution 2008/01/10 Presented by Jinho

Compiler Transformation

4 Classes

Page 6: Predicate Execution 2008/01/10 Presented by Jinho

Predicate Predication for Efficient Out-of-order ExecutionWeihaw Chuang, Brad Calder - ICS’03

Page 7: Predicate Execution 2008/01/10 Presented by Jinho

Main Idea

Predicate Predictor◦Predicates were branches before if-conversion◦Value prediction instead of branch prediction

Implementation◦Separate from branch predictor

Only for branch history table No needs for the return-address stack or the

branch target buffer

Page 8: Predicate Execution 2008/01/10 Presented by Jinho

Predicate Early Evaluation

REN1◦Predicate prediction is completed

REN2◦The predicted predicates and the true predicate

values are early-evaluated

Page 9: Predicate Execution 2008/01/10 Presented by Jinho

Predicate Misprediction Recovery

Flush Predicate Misprediction◦Naïve approach

Rename-Replay for Predicate Mispredic-tion◦Instructions on false predicates are not put into

the issue queue◦Replay from predicate early evaluation◦Instructions are stored in recovery queue(RecQ)

Selective-Replay for Predicate Mispredic-tions◦All instructions are put into the issue queue◦Replay selectively

Page 10: Predicate Execution 2008/01/10 Presented by Jinho

Pipeline comparison

Flush vs. Rename-replay

Page 11: Predicate Execution 2008/01/10 Presented by Jinho

Selective Replay

Examples

Page 12: Predicate Execution 2008/01/10 Presented by Jinho

Evaluation

Methodology◦Trace

David Mosberger’s “utrace.c”◦Simulator

Modified SimpleScalar 3.0 to handle IA64◦Benchmarks

Spec2000 Integer and Floating-Point

Page 13: Predicate Execution 2008/01/10 Presented by Jinho

Comparison

Speedups

Page 14: Predicate Execution 2008/01/10 Presented by Jinho

Wrap-up

Page 15: Predicate Execution 2008/01/10 Presented by Jinho

Multiple definition

Solution?

mov r1 = 0;if( r2 == r3 ) mov r1 = 1;else mov r1 = 2;mov r4 = r1;

mov r1 = 0;cmp.eq p1,p2=r2,r3;(p1) mov r1 = 1;(p2) mov r1 = 2;mov r4 = r1;

mov r1 = 0;mov r5 = 2;cmp.eq p1,p2=r2,r3;phi r4 = (p1)1,r5;

Phi-prediction

Doesn’t need to renameOnly for some operations

Predicate predictionGenerally better performanceProblem in hard-to-predict branch