FSU DEPARTMENT OF COMPUTER SCIENCE Depa rtment of Computer - - PowerPoint PPT Presentation

fsu
SMART_READER_LITE
LIVE PREVIEW

FSU DEPARTMENT OF COMPUTER SCIENCE Depa rtment of Computer - - PowerPoint PPT Presentation

Ecient On-the-y Analysis of Program Behavio r and Static Cache Simulati on F rank Mueller, David Whalley FSU DEPARTMENT OF COMPUTER SCIENCE Depa rtment of Computer Science Flo rida State Universit y T allahassee,


slide-1
SLIDE 1

FSU

DEPARTMENT OF COMPUTER SCIENCE

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulati
  • n
F rank Mueller, David Whalley Depa rtment
  • f
Computer Science Flo rida State Universit y T allahassee, FL 32304-4019 e-mail: mueller@cs.fsu.edu WWW: http://www.cs.fsu. edu /~mueller Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 1
slide-2
SLIDE 2

FSU

DEPARTMENT OF COMPUTER SCIENCE

Objective
  • p
rovide faster cache p erfo rmance evaluation
  • determine
numb er
  • f
hits and misses
  • f
a p rogram execution
  • used
to evaluate new cache designs
  • used
to analyze new
  • ptimizati
  • n
techniques
  • p
redict the caching b ehavio r (fo r real-time systems) Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 2
slide-3
SLIDE 3

FSU

DEPARTMENT OF COMPUTER SCIENCE

Metho ds in Contrast
  • Goal:
faster cache p erfo rmance evaluation
  • traditional
app roach: inline tracing
  • instrument
p rogram
  • n
complement
  • f
min. spanning tree
  • generate
trace addresses
  • simulate
caches based
  • n
trace
  • ur
app roach:
  • n-the-y
analysis
  • analyze
p rogram statically (static cache simulation)
  • instrument
p rogram
  • n
\unique paths"
  • do
NOT generate trace addresses
  • simulate
remaining cache b ehavio r within p rogram execution Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 3
slide-4
SLIDE 4

FSU

DEPARTMENT OF COMPUTER SCIENCE

Small Set
  • f
Measurement P
  • ints
  • covers
all events and p reserves their
  • rder
during execution
  • applicable
fo r any
  • n-the-y
analysis
  • f
p rogram b ehavio r
  • cannot
use min. spanning tree if
  • rder
  • f
events critical
  • need
new metho d to nd a small set
  • f
measure p
  • ints
  • pa
rtition control-o w graph into unique paths:
  • unique
transition fo r each path to place instrumentation co de
  • path
contains sequence
  • f
basic blo cks in control
  • w
  • blo
cks in path not necessa rily consecutive co de
  • set
  • f
blo cks determines p
  • rtion
  • f
p rogram fo r static anal- ysis Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 4
slide-5
SLIDE 5

FSU

DEPARTMENT OF COMPUTER SCIENCE

Denition
  • f
Unique P ath P a rtitioning (UPP A) 1. all vertices covered b y paths 2. edges a re either in paths
  • r
connect paths 3. each path has unique edge
  • r
vertex 4. paths
  • verlap
  • nly
in initial
  • r
nal subpaths 5. paths a re chained p rop erly 6. calls terminate paths (op erational) 7. paths do not cross lo
  • p
b
  • unda
ries (op erational) Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 5
slide-6
SLIDE 6

FSU

DEPARTMENT OF COMPUTER SCIENCE

Prop erties
  • f
UPP As
  • basic
blo ck pa rtitioning is a UPP A
  • Let
jU P P Aj denote numb er
  • f
paths in pa rtitioning
  • rdering:
U P P A a < U P P A b := jU P P A a j < jU P P A b j
  • goal:
nd minimal UPP A fo r a given control-o w graph Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 6
slide-7
SLIDE 7

FSU

DEPARTMENT OF COMPUTER SCIENCE

1 2 3 4 5 6 7 8 path 3 path 2 path 1 path 5 path 4

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 7
slide-8
SLIDE 8

FSU

DEPARTMENT OF COMPUTER SCIENCE

Computation
  • f
a Small UPP A 1. ma rk initial head and tail vertices 2. WHILE change DO (a) p ropagate heads and tails (b) fo r each new head vertex, nd fo rk after join 3. UPP A = collect each path b et w een a head and a tail vertex Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 8
slide-9
SLIDE 9

FSU

DEPARTMENT OF COMPUTER SCIENCE

Example: Join follo w ed b y F
  • rk

join fork head tail head

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 9
slide-10
SLIDE 10

FSU

DEPARTMENT OF COMPUTER SCIENCE

Example 1: Algo rithmic Construction
  • f
a Small UPP A

head tail head tail 1 2 4 3 5 6 7 1 2 4 3 5 6 7 head tail 1 2 4 3 5 6 7 head tail head tail head tail head tail head tail

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 10
slide-11
SLIDE 11

FSU

DEPARTMENT OF COMPUTER SCIENCE

Example 2: Algo rithmic Construction
  • f
a Small UPP A

tail head 6 1 2 3 4 5 6 tail tail head 1 2 3 4 5 6 tail tail head tail 1 2 3 4 5 tail head tail head tail head tail

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 11
slide-12
SLIDE 12

FSU

DEPARTMENT OF COMPUTER SCIENCE

Prop erties
  • f
the Algo rithm
  • co
rrectness p roved
  • minimal
UPP A )
  • ptimal
  • n-the-y
analysis ??
  • dene
equivalence class
  • f
same-o rder UPP As
  • sho
w that algo rithm constructs
  • ne
such UPP A
  • sho
w that no smaller UPP As exist Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 12
slide-13
SLIDE 13

FSU

DEPARTMENT OF COMPUTER SCIENCE

F unction-Instance Graph
  • decomp
  • sition
  • f
call graph acco rding to call sites
  • useful
fo r inter-p ro cedural analysis in general
  • used
here fo r static cache simulation
  • p
rovides mo re detailed info rmation ab
  • ut
a function instance
  • many
applications: alias analysis, caller-save, inlining
  • sp
ecial transitions to recognize recursion Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 13
slide-14
SLIDE 14

FSU

DEPARTMENT OF COMPUTER SCIENCE

Example
  • f
F unction-Instance Graph

f g h Call Graph i k f k g h h k k i Function Instance Graph

1 1 2

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 14
slide-15
SLIDE 15

FSU

DEPARTMENT OF COMPUTER SCIENCE

P erfo rmance Evaluation
  • UPP
As and function instances vs. basic blo ck pa rtitioning
  • static
savings: 24% few er measurement p
  • ints
  • dynamic
savings: 31% few er measurement p
  • ints
Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 15
slide-16
SLIDE 16

FSU

DEPARTMENT OF COMPUTER SCIENCE

What is Static Cache Simulation?
  • new
app roach to analyze cache b ehavio r
  • f
p rograms statically
  • applied
to instruction caches (w
  • rking
  • n
data caches)
  • addresses
  • f
instructions kno wn statically
  • uses
data-o w analysis
  • f
call graph and control
  • w
  • catego
rizes each instruction
  • p
redicts la rge p
  • rtion
  • f
instruction cache references Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 16
slide-17
SLIDE 17

FSU

DEPARTMENT OF COMPUTER SCIENCE

Instruction Catego rization
  • transfo
rms call graph into function-instance graph (FIG)
  • p
erfo rms analysis
  • n
FIG and UPP As
  • uses
data-o w analysis algo rithms fo r p rediction
  • abstract
cache state: p
  • tentially
cached p rogram lines
  • reaching
state: reachable p rogram lines
  • catego
ries based
  • n
these states:
  • alw
a ys hit
  • alw
a ys miss
  • rst
miss: miss
  • n
rst reference, hit
  • n
consecutive
  • nes
  • conict:
either hit
  • r
miss (dynamic) Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 17
slide-18
SLIDE 18

FSU

DEPARTMENT OF COMPUTER SCIENCE

return return program line 5 4 7 8 3 program line 3 a-hit a-hit a-hit a-hit a-hit a-hit a-hit a-hit a-hit a-hit a-hit a-miss a-miss

foo() (a) (b)

program line 1 program line 2 program line 4 f-miss

main()

1 a-miss a-miss conflict a-hit a-miss 2 call foo() a-hit program line 0 a-hit a-hit 5 f-miss a-hit f-miss 6 call foo()

Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 18
slide-19
SLIDE 19 F rank Mueller, David Whalley SAS'94
  • 4
cache lines
  • 16
b ytes p er line (4 instructions)
  • instances
fo
  • (a)
blo ck 8a and (b) blo ck 8b
  • 7(1):
alw a ys hit, spacial lo calit y
  • 8b(1):
alw a ys hit, temp
  • ral
lo calit y
  • 3(3):
rst miss
  • 5(1)
and 6(1): group rst miss
  • 3(1):
conict with 8b(2) conditionally executed Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation (notes) 18-1
slide-20
SLIDE 20

FSU

DEPARTMENT OF COMPUTER SCIENCE

F ast Instruction Cache P erfo rmance Analysis
  • uses
ecient
  • n-the-y
analysis
  • p
erfo rms static instruction cache simulation
  • instruments
p rogram
  • p
rovides accurate cache p erfo rmance measurements
  • instrumented
p rogram has
  • nly
1.2 to 2.2 execution
  • verhead
  • faster
than any
  • ther
cache analysis metho d published so fa r Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 19
slide-21
SLIDE 21

FSU

DEPARTMENT OF COMPUTER SCIENCE

Conclusion
  • general
framew
  • rk
fo r ecient
  • n-the-y
analysis (path pa rti- tioning)
  • static
cache simulation: new w a y to analyze caching b ehavio r
  • function-instance
graph
  • faster
instruction cache p erfo rmance analysis
  • ther
applications Ecient On-the-y Analysis
  • f
Program Behavio r and Static Cache Simulation SAS'94 20