the attributor a versatile inter procedural fixpoint
play

THE ATTRIBUTOR: A VERSATILE INTER-PROCEDURAL FIXPOINT ITERATION - PowerPoint PPT Presentation

THE ATTRIBUTOR: A VERSATILE INTER-PROCEDURAL FIXPOINT ITERATION FRAMEWORK LLVM-Dev19 October 22, 2019 San Jose, CA, USA Johannes Doerfert*, Hideto Ueno, Stefan Stipanovic *Leadership Computing Facility *Argonne National Laboratory *


  1. THE ATTRIBUTOR: A VERSATILE INTER-PROCEDURAL FIXPOINT ITERATION FRAMEWORK LLVM-Dev’19 — October 22, 2019 — San Jose, CA, USA Johannes Doerfert*, Hideto Ueno, Stefan Stipanovic *Leadership Computing Facility *Argonne National Laboratory * https://www.alcf.anl.gov/

  2. ACKNOWLEDGMENT Two of the authors were supported by Google Summer of Code (GSoC)! This research was supported by the Exascale Computing Project (17-SC-20-SC), a collaborative efgort of two U.S. Department of Energy organizations (Offjce of Science and the National Nuclear Security Administration) responsible for the planning and preparation of a capable exascale ecosystem, including software, applications, hardware, advanced system engineering, and early testbed platforms, in support of the nation’s exascale computing imperative. 1/16

  3. I. BACKGROUND

  4. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (2) the returned value ? (3) the argument ? (1) the return type ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  5. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (3) the argument ? (1) the return type ? (2) the returned value ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  6. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  7. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (5) the return type ? (1) the return type ? (4) the returned value ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  8. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  9. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  10. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  11. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  12. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  13. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  14. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  15. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  16. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  17. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  18. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  19. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  20. FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE ( 16, 16 ) ⊙ ( 16, 16 ) ( 1, 16 ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, 16 ) ( 1, ∞ ) ( 16, 16 ) ( 1, ∞ ) ( 1, ∞ ) (1) the return type ? (4) the returned value ? (5) the return type ? (1) the return type ? (2) the returned value ? (3) the argument ? What is the alignment of: 2/16 int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  21. ABSTRACT STATES 3/16

  22. ABSTRACT STATES 3/16

  23. ABSTRACT STATES 3/16

  24. ABSTRACT STATES 3/16

  25. 4/16 FIXPOINT DATA FLOW ANALYSIS — ALIGNMENT EXAMPLE int * checkAndAdvance( int * __attribute__((aligned(16))) p ) { if (*p == 0) return checkAndAdvance(p + 4) ; return p ; }

  26. THE ATTRIBUTOR — USAGE 5/16 Attributor A; // Select what information is to be deduced. IRPosition IRPRet = IRPosition::returned(Fn) ; const auto &AA = A.getOrCreateAAFor< AAAlign >(IRPRet); // Deduce information and manifest it in the IR. auto Changed = A.run(*Fn->getParent());

Recommend


More recommend