Giter Club home page Giter Club logo

Comments (1)

ahueck avatar ahueck commented on June 12, 2024

Sections w.r.t. LLVM IR level will be removed from the main README, e.g.,

1.1.3 LLVM compiler pass - Analysis and instrumentation

The analysis pass finds all heap, stack and global allocations. An allocation data-flow filter discards all stack and
global allocations if they are not passed to a target API (default MPI calls). Subsequently, type layouts for
user-defined types (e.g., struct) of these allocations are serialized to a file and a so-called type-id number is
created for each such unique type.

The instrumentation pass adds the instrumentation callbacks to our runtime, passing 1) the memory pointer, 2) the
corresponding type-id and 3) the number of allocated elements (extent).

Example instrumentation in LLVM intermediate representation (IR)
  • C and corresponding LLVM IR code: A simple heap allocation with malloc of a double-array. It contains all
    information needed for TypeART:

    double* pointer = (double*) malloc(n * sizeof(double));
    ; Assume: %size == n * sizeof(double)
    %pointer = call i8* @malloc(i64 %size)
    %pointer_double = bitcast i8* %pointer to double*
  • Corresponding TypeART instrumentation:

    ; Assume: %size == n * sizeof(double)
    ; Heap allocation -- %pointer holds the returned pointer value:
    %pointer = call i8* @malloc(i64 %size)
    ; TypeART instrumentation -- compute the number of double-elements:
    %extent = udiv i64 %size, 8
    ; TypeART runtime callback (pointer, type-id, length) -- 6 is the type-id for double:
    call void @__typeart_alloc(i8* %pointer, i32 6, i64 %extent)
    ; Original bitcast:
    %pointer_double = bitcast i8* %pointer to double*

from typeart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.