generalized points to graph a new abstraction of memory
play

Generalized Points-to Graph: A New Abstraction of Memory in Presence - PowerPoint PPT Presentation

Generalized Points-to Graph: A New Abstraction of Memory in Presence of Pointers Pritam Gharat Department of Computer Science and Engineering, Indian Institute of Technology, Bombay September 2018 Disclaimer Some of the slides in Introduction


  1. Interprocedural Pointer Analysis over the Interprocedural Analysis call graph Top-down Approaches Bottom-up Approaches Caller’s information Reusable procedure summary Pros: available to callee is constructed Problems representing indirect Procedure is analyzed accesses of pointees Cons: multiple times defined in callers Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 11 / 50

  2. Interprocedural Pointer Analysis over the Interprocedural Analysis call graph Top-down Approaches Bottom-up Approaches Caller’s information Reusable procedure summary Pros: available to callee is constructed Problems representing indirect Procedure is analyzed accesses of pointees Cons: multiple times defined in callers We focus on bottom-up approaches and propose a compact representation of procedure summary for pointer analysis Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 11 / 50

  3. Interprocedural Pointer Analysis over the Interprocedural Analysis call graph Top-down Approaches Bottom-up Approaches Our language model is C. In this presentation, we focus only on pointers to scalars Caller’s information Reusable procedure summary Pros: available to callee is constructed Problems representing indirect Procedure is analyzed accesses of pointees Cons: multiple times defined in callers We focus on bottom-up approaches and propose a compact representation of procedure summary for pointer analysis Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 11 / 50

  4. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  5. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the 1. x = & a ; Control flow between the updates would be redundant 2. y = x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  6. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the 1. x = & a ; Control flow between the updates would be redundant 2. y = x ; ⇓ x = & a ; y = & a ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  7. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the 1. x = & a ; Control flow between the updates would be redundant 2. y = & b ; 3. x = & b ; Data dependence does not exist ⇒ Redundant memory updates can be eliminated Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  8. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the 1. x = & a ; Control flow between the updates would be redundant 2. y = & b ; 3. x = & b ; Data dependence does not exist ⇒ ⇓ Redundant memory updates can be eliminated y = & b ; x = & b ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  9. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the Control flow between the updates would be redundant 1. y = & b ; Data dependence does not exist ⇒ 2. ∗ x = & a ; Redundant memory updates can be eliminated Data dependence is unknown ⇒ More information is required Available when inlined at call sites Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  10. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the Control flow between the updates would be redundant 1. y = & b ; Data dependence does not exist ⇒ 2. ∗ x = & a ; Redundant memory updates can be eliminated Data dependence is unknown ⇒ More information is required Available when inlined at call sites ◮ Control flow between the updates required Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  11. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the Control flow between the updates would be redundant 1. y = & b ; Data dependence does not exist ⇒ 2. ∗ x = & a ; Redundant memory updates can be eliminated Data dependence is unknown ⇒ More information is required Available when inlined at call sites ◮ Control flow between the updates required ◮ Some accesses of pointees have definitions in the callers Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  12. Summarizing a Procedure for Points-to Analysis A flow-sensitive analysis requires control flow to be recorded between memory updates that share data dependence Data dependence exists ⇒ Can be eliminated and the Control flow between the updates would be redundant 1. y = & b ; 2. ∗ x = & a ; Data dependence does not exist ⇒ 3. z = y ; Redundant memory updates can be eliminated Data dependence is unknown ⇒ More information is required Available when inlined at call sites ◮ Control flow between the updates required ◮ Some accesses of pointees have definitions in the callers ◮ Some optimizations need to be postponed Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 12 / 50

  13. Memory and Memory Transformer Memory in absence Memory in presence Memory Transformer of pointers of pointers y a x x φ 1 a b c z Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 13 / 50

  14. Memory and Memory Transformer Memory in absence Memory in presence Memory Transformer of pointers of pointers y a x x φ 1 a b c z For memory transformer, ◮ Blue edges ⇒ information generated ◮ Black edges ⇒ carried forward input information Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 13 / 50

  15. Memory and Memory Transformer Memory in absence Memory in presence Memory Transformer of pointers of pointers y a x x φ 1 a b c z Input Memory y x z Output Memory y x a z Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 13 / 50

  16. Part II Motivation

  17. Bottom-up Approaches: The State of the Art Accesses of pointees that are defined in the callers are represented using placeholders Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 15 / 50

  18. Bottom-up Approaches: The State of the Art Accesses of pointees that are defined in the callers are represented using placeholders x e.g., x = y ⇒ φ 1 y φ 1 is a placeholder Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 15 / 50

  19. Bottom-up Approaches: The State of the Art Accesses of pointees that are defined in the callers are represented using placeholders x e.g., x = y ⇒ φ 1 y φ 1 is a placeholder Context based analysis [Zhang-PLDI-14, Wilson-PLDI-95] ◮ Use aliases present in the caller ◮ Construct a collection of partial transfer functions (PTFs) Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 15 / 50

  20. Bottom-up Approaches: The State of the Art Accesses of pointees that are defined in the callers are represented using placeholders x e.g., x = y ⇒ φ 1 y φ 1 is a placeholder Context based analysis [Zhang-PLDI-14, Wilson-PLDI-95] ◮ Use aliases present in the caller ◮ Construct a collection of partial transfer functions (PTFs) Context independent analysis [S˘ alcianu-VMCAI-05, Madhavan-SAS-12] ◮ No aliases assumed in the calling contexts ◮ Construct a single procedure summary Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 15 / 50

  21. Limitation of Placeholders Placeholders explicate the pointees defined in callers (Low level abstraction of memory) Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 16 / 50

  22. Limitation of Placeholders Placeholders explicate the pointees defined in callers (Low level abstraction of memory) This results in ◮ either multiple call-specific procedure summaries, or Reuse of a placeholder for a flow sensitive summary flow function depends on the aliases in the calling contexts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 16 / 50

  23. Limitation of Placeholders Placeholders explicate the pointees defined in callers (Low level abstraction of memory) This results in ◮ either multiple call-specific procedure summaries, or ◮ large number of placeholders Reuse of a placeholder for a flow sensitive summary flow function In absence of aliases depends on the aliases from the calling contexts, in the calling contexts every access is represented by a separate placeholder. Control flow is also required Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 16 / 50

  24. Part III Generalized Points-to Graphs

  25. Representing Basic Pointer Assignments using the Generalized Points-to Updates General Case Specific Examples Pointer Relevant memory graph GPU x i | j GPU − s y → assignment after the assignment x 1 | 0 y s : x = & y − − → y x s i − 1 x 1 | 1 y s : x = y − − → y x x s x 1 | 2 y s : x = ∗ y − − → y x s y x 2 | 1 j y s : ∗ x = y − − → y x s Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 18 / 50

  26. Representing Basic Pointer Assignments using the Generalized Points-to Updates General Case Specific Examples Pointer Relevant memory graph GPU x i | j GPU − → s y assignment after the assignment x 1 | 0 y s : x = & y − − → y x s i − 1 x 1 | 1 y s : x = y − − → y x x s x 1 | 2 y s : x = ∗ y − − → y x s y x 2 | 1 j y s : ∗ x = y − − → y x s The direction in a GPU is to distinguish between what is being defined to what is being read For pointer analysis, case i = 0 does not exist classical points-to update is a special case of generalized points-to update with i = 1 and j = 0 Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 18 / 50

  27. Representing Basic Pointer Assignments using the Generalized Points-to Updates General Case Specific Examples Pointer Relevant memory graph GPU x i | j GPU − → s y assignment after the assignment x 1 | 0 y s : x = & y − − → y x s i − 1 x 1 | 1 y s : x = y − − → y x x s x 1 | 2 y s : x = ∗ y − − → y x s y x 2 | 1 j y s : ∗ x = y − − → y x s The direction in a GPU is to distinguish between what is being defined to what is being read GPU represents both memory and For pointer analysis, case i = 0 does not exist memory transformer classical points-to update is a special case of generalized points-to update with i = 1 and j = 0 Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 18 / 50

  28. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x f() { *x = y y } All variables are global Red nodes are known named locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  29. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 φ 2 f() { *x = y y } All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  30. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 φ 2 f() { *x = y a y } Information from callers All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  31. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 φ 1 φ 2 f() { *x = y y a } All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  32. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 a φ 2 f() { *x = y y } All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  33. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 a φ 2 f() { *x = y y b } Information from callers All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  34. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 a φ 2 φ 2 f() { *x = y y b } All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  35. Classical Points-to Updates: A Low Level Abstraction of Memory for Points-to Analysis x φ 1 a φ 2 b f() { *x = y y } All variables are global Red nodes are known named locations Blue nodes are placeholders denoting unknown locations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 19 / 50

  36. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis x φ 1 φ 2 f() { *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  37. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis x φ 1 φ 2 f() { 2 | 1 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  38. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 x φ 1 a φ 2 f() { 2 | 1 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  39. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 x φ 1 a φ 2 f() { 2 | 1 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  40. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 x φ 1 a φ 2 f() { 1 | 1 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  41. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 x φ 1 a φ 2 b f() { 1 | 0 1 | 1 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  42. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 x φ 1 a φ 2 b f() { 1 | 0 1 | 1 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  43. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 1 | 0 x φ 1 a φ 2 b f() { 1 | 0 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  44. Generalized Points-to Updates: A High Level Abstraction of Memory for Points-to Analysis 1 | 0 1 | 0 x φ 1 a φ 2 b f() { 1 | 0 *x = y y } Blue arrows are low level view of memory in terms of classical points-to facts Black arrows are high level view of memory in terms of generalized points-to facts This abstraction does not introduce any imprecision over the classical points-to graph Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 20 / 50

  45. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  46. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot x = & y ; z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  47. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot GPG x = & y ; 1 | 0 y x p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  48. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot GPG x = & y ; 1 | 0 1 | 0 y x y x p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  49. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot GPG x = & y ; 1 | 0 1 | 0 y x y x p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  50. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot GPG x = & y ; 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  51. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot pivot x = & y ; 1 | 2 1 | 0 1 | 0 y z x x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  52. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge c ⇒ Consumer GPU, p ⇒ Producer GPU x = & y ; 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  53. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge c ⇒ Consumer GPU, p ⇒ Producer GPU r = c ◦ p x = & y ; 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  54. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same r = c ◦ p x = & y ; 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  55. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same Memory Graph r = c ◦ p z x = & y ; 1 | 2 1 | 0 1 | 0 y y z x x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  56. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same Memory Graph r = c ◦ p z x = & y ; 1 | 2 1+1 | 0+1 1 | 0 y y z x x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  57. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same Memory Graph r = c ◦ p z x = & y ; 1 | 2 2 | 1 1 | 0 y y z x x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  58. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same Memory Graph 1 | 1 z r x = & y ; 1 | 2 2 | 1 1 | 0 y y z x x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  59. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same p remains Memory Graph 1 | 1 unchanged z r x = & y ; 1 | 2 1 | 0 1 | 0 y y z x x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  60. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same Data dependence 1 | 1 through x is eliminated. r x = & y ; Control flow 1 | 2 1 | 0 1 | 0 y z x becomes redundant y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  61. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same 1 | 1 GPUs r and c are equivalent in the r x = & y ; context of p 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  62. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same 1 | 1 Strength reduction optimization replaces r x = & y ; c by r 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  63. GPU Composition Represented by c ◦ p ; performed only when they share a common node called the pivot Reduces the indlev of c by using information from p ◮ Eliminating pivot and creating a reduced GPU r between other two nodes by using pivot as a bridge Requires the indlev s of the pivot in both the GPUs to be made same 1 | 1 GPU reduction is a series of GPU r x = & y ; compositions 1 | 2 1 | 0 1 | 0 y z x y x c p z = ∗ x ; Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 21 / 50

  64. Generalized Points-to Graphs (GPGs) I A GPG is a graph with Nodes called as generalized points-to blocks (GPBs) A GPB contains a set of GPUs Edges representing control flow between GPBs Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 22 / 50

  65. Generalized Points-to Graphs (GPGs) I A GPG is a graph with Nodes called as generalized points-to blocks (GPBs) A GPB contains a set of GPUs Edges representing control flow between GPBs A GPG is analogous to a CFG of a procedure GPG CFG GPB BB Ptr. Assgn. GPU Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 22 / 50

  66. Generalized Points-to Graphs (GPGs) I A GPG is a graph with First difference: Nodes called as generalized points-to blocks (GPBs) GPUs in a GPB represent parallel assignments A GPB contains a set of GPUs Assignments in a basic block are sequential Edges representing control flow between GPBs A GPG is analogous to a CFG of a procedure GPG CFG GPB BB Ptr. Assgn. GPU Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 22 / 50

  67. Generalized Points-to Graphs (GPGs) I A GPG is a graph with Second difference: Nodes called as generalized points-to blocks (GPBs) CFGs contain call basic blocks A GPB contains a set of GPUs GPGs do not have call GPBs Edges representing control flow between GPBs A GPG is analogous to a CFG of a procedure GPG CFG GPB BB Ptr. Assgn. GPU Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 22 / 50

  68. Generalized Points-to Graphs (GPGs) II Construction of Initial GPGs: Non-pointer assignments and condition tests are removed Each pointer assignment s is transliterated to its GPU ( γ s ) A separate GPB is created for assignment in the CFG GPG edges are induced from the control flow of the CFG GPGs contain only variables that are shared across procedures GPGs then undergo extensive optimizations Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 23 / 50

  69. The Big Picture View of GPG Construction Optimizations Data Flow Analysis GPU Operations Abstractions Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 24 / 50

  70. The Big Picture View of GPG Construction Optimizations Inlining callee GPGs Data Flow Analysis GPU Operations Abstractions Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 24 / 50

  71. The Big Picture View of GPG Construction Optimizations Inlining Strength callee GPGs Reduction Data Flow Analysis Reaching GPUs Reaching GPUs Analysis without Analysis with Blocking Blocking GPU Operations Abstractions Pritam Gharat ( IIT Bombay) Generalized Points-to Graphs September 2018 24 / 50

Recommend


More recommend