Symbolic Bounds Analysis of Pointers, Array Indices, and Accessed Memory Regions Radu Rugina and Martin Rinard - PowerPoint PPT Presentation

About This Presentation
Title:

Symbolic Bounds Analysis of Pointers, Array Indices, and Accessed Memory Regions Radu Rugina and Martin Rinard

Description:

Symbolic Bounds Analysis of Pointers, Array Indices, and Accessed Memory Regions Radu Rugina and Martin Rinard 6/6 AMO M1 – PowerPoint PPT presentation

Number of Views:199
Avg rating:3.0/5.0
Slides: 37
Provided by: shio150
Category:

less

Transcript and Presenter's Notes

Title: Symbolic Bounds Analysis of Pointers, Array Indices, and Accessed Memory Regions Radu Rugina and Martin Rinard


1
Symbolic Bounds Analysis of Pointers, Array
Indices, and Accessed Memory RegionsRadu Rugina
and Martin Rinard
  • 6/6
  • AMO????????
  • M1 ?? ??

2
Introduction
  • ????????????????????????????????
  • ???????????????????????????????????
  • Symbolic ??????
  • ??????????????????
  • ???????????
  • ????????????
  • ???????
  • ????????????????

3
?????
  • ??????????
  • ???????????
  • ?????????
  • ??
  • ??????????
  • ??

4
???????
  • ????????????????????????
  • ????????
  • Cilk (C?????????) ???

5
?????
  • ?Procedure ??????????????????
  • ?????????????????
  • allocation blocks
  • ????????????
  • symbolic regions
  • ??block?????????
  • ????????
  • ?????????????(??????)

6
????
  • dcInc ( int q, int m) ???
  • allocation block a (l.24)???? symbolic
    region????p0, p0 n0 - 1 ?????
  • ???? l.15 ? l.16 ??????????????????
  • top-level ???????(l.26) ???A ???? A, A size -
    1 ??????????????????????????????

7
?????????
  • ?????
  • ???????????????????????????????????
  • ??????allocation block ???symbolic region ????
  • ?????????????????????????
  • ?????????????????????????????????????

8
????????
9
Pointer and Read-Write Sets Analysis
  • R. Rugina and M. Rinard 99
  • ??????????????????Procedure ????????
    ?????(????????)????????

10
Symbolic Analysis
  • ?????????????????????????????
  • ???????? allocation block ???????????????????
  • Symbolic Analysis ????3?????????
  • Intraprocedural Bounds Analysis
  • Intraprocedural Region Analysis
  • Interprocedural Region Analysis

11
Symbolic Analysis ???
  • Intraprocedural Bounds Analysis
  • ???????????????????????????????
  • Intraprocedural Region Analysis
  • 1. ?????????procedure ? allocation block
    ?????????????????
  • Interprocedural Region Analysis
  • ????????????????procedure ????????????????????????
    ????????

12
Intraprocedural Bounds Analysis (1/4)????
  • ???procedure f ????? B Bj 1 ? j ? L
    ?????
  • ?????????????? ?? uv,j ? ?? lv,j ??????

13
Intraprocedural Bounds Analysis (2/4)?????????
  • ????????????????????????
  • ???????????????
  • ????????
  • ????????????????????????

14
Intraprocedural Bounds Analysis (3/4)????????
  • ?????
  • ???????B1????????????? v ????????
    v0(??????)??????????????
  • ??????????
  • ????????????????????????????????????????????????
    ??
  • ????
  • ????????????????????????
  • min ?v?lj2 (uv,j - lv,j )

15
????????????
16
Intraprocedural Bounds Analysis (4/4)????????
  • ??????????????????????
  • li,2 c1q0 c2m0 c3 li,3 c4q0 c5m0 c6
  • ???????????????????
  • ??????? li,2 lt li,3 ?? c1ltc4, c2ltc5, c3ltc6
  • ??????????????????????????????????????????????
  • ??????????????????
  • ????? Cn ????????
  • ????????????????????

17
???????????
  • ????????????? li,3 0 ui, 3 m0-1??? ?l.7
    ???? i ?????? 0,m0 - 1?????

18
Region Analysis
  • Intraprocedural Region Analysis
  • ??????????????????? f ? allocation block a
    ????????RRlocalf,a ?RWlocalf,a ????
  • ????????????????????????????????????????
  • Interprocedural Region Analysis
  • ????????????(call site)????????????????????????
  • ???????????????????????(Symbolic Unmapping)

19
symbolic unmapping ??
  • l.13?????(cs1 call site 1???)?unmapping???SUcs1
    (RWbaseInc,a) p0, p0 n0 - 1 ???

20
???Symbolic Unmapping(1/2)
  • ???????????????
  • ?????????????????????????????????????????
  • ???????????????????????????????????
  • Symbolic Bounds Analysis ???????????????
  • ???????????????????????????????????????????

21
???Symbolic Unmapping(2/2)
  • ??????? f ??????? RRlocalf,a ?RWlocalf,a ?????
  • ??????????????????
  • RRf,a lrd f,a,1, urd f,a,1... lrd f,a,j,
    urd f,a,j
  • RWf,a lwr f,a,1, urd f,a,1... lwr f,a,j,
    urd f,a,j
  • ???????
  • RRlocalf,a ? RRf,a
  • ?????????????????????
  • SUcs(RRg,a )? RRf,a
  • ??????????????????
  • ????????????????????????????????????

22
???Symbolic Unmapping??
  • dcInc ??
  • l13, l15, l16 ????????????????
  • dcInc ??? allocated block ????????????????????????
    ????
  • lwrdcInc,a p0, uwrdcInc,a P0 n0 - 1???

23
???????
  • ??????????????allocation blocks
    ???????????????????????????????
  • RRbaseInc,a RRbaseInc,a q0, q0 m0 - 1
  • RRdcInc,a RRdcInc,a p0, p0 n0 - 1
  • RRmain,a RRmain,a -8, 8
  • ????????????????????????????

24
?????????
  • ????
  • ???????????????????????????????????????????
  • ???????
  • ???????????????????????????????????????????
  • ????????
  • ??????????????????????????????
  • ?????????????????????????????

25
????????
  • ????????????????
  • ????????????????????????
  • ????????????????
  • ?????????????????????????
  • ??????????????????????
  • ??????????????????????????????????????????

26
?????
  • ?????????????????????????????
  • ?????????????????????????
  • ????????????????Ghost allocation blocks
    ??????????????
  • ????????????????????????

27
??
  • SUIF ?????????????
  • Cilk ? C ??????????
  • Cilk ?????????????
  • C ??????????????
  • ?????????????????????
  • ??????????????????????????????????????????????????
    ??

28
???????
  • Fibonacci
  • QuickSort
  • MergeSort
  • Heat(?????????)
  • Knapsack
  • BlockMul (??????????????????)
  • NoTempMul(?????????????)
  • LU

29
??(1/3)
  • Knapsack ?????????????????????????????????????????
  • Knapsack ??????????????????????
  • ?????
  • Sun Ultra Enterprize (8CPUs)
  • 8,000,000 numbers ????
  • 10241024?????
  • ??????????????????

30
??(2/3)
(????????????????????????????)
31
??(3/3)
  • ???????
  • ??????????????????????????????????????????????
  • ??????????????????????????????????

32
????(1/4)
  • Symbolic Memory Access Region Analysis
  • ?????
  • ?????????????????????????? ad hoc ?????????
  • ??????????
  • ????????????????
  • ??????????????????????????????????????
  • ????????????????????????????????????????

33
????(2/4)
  • Array Bounds Check Elimination
  • ?????
  • ?????????????
  • ?????????????????
  • ???????????????????????????????????
  • ???????????????????
  • ?????????????????????????????????????????
  • ???????????????????
  • ?????????????????????

34
????(3/4)
  • Race Detection
  • ?????
  • ??????????????????????????????
  • ?????Signal/wait ???????????????
  • Lock ??????????????????????????????????
  • ??????????
  • ??????????????????????????????????????????

35
????(4/4)
  • Parallelizing Compiler
  • ??????????????????????????????
  • ??????????????????????????????????
  • ?????????????????????????????????????
  • ???Shape analysis ??Commutativity analysis
    ?????????

36
??Reference
  • R. Rugina and M. Rinard. Pointer analysis for
    multithreaded programs. In Proceedings of the
    SIGPLAN '99 Conference on Program Language Design
    and Implementation, Atlanta, GA, May 1999.
  • F. Gustavson. Recursion leads to automatic
    variable blocking for dense linear-algebra
    algorithms. IBM Journal of Research and
    Development, 41(6)737-755, November 1997.
  • J. Frens and D. Wise. Auto-blocking
    matrix-multiplication or tracking BLAS3
    performance from source code. In Proceedings of
    the 6th ACM SIGPLAN Symposium on Principles and
    Practice of Parallel Programming, Las Vegas, NV,
    June 1997.
  • S. Chatterjee, A. Lebeck, P. Patnala, and M.
    Thottethodi. Recursive array layouts and fast
    matrix multiplication. In Proceedings of the 11th
    Annual ACM Symposium on Parallel Algorithms and
    Architectures, Saint Malo, France, June 1999.
Write a Comment
User Comments (0)
About PowerShow.com