Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Arm64 "constructed" constants in SuperPMI asm diffs #76616

Merged

Commits on Oct 4, 2022

  1. Support Arm64 "constructed" constants in SuperPMI asm diffs

    SuperPMI asm diffs tries to ignore constants that can change between
    multiple replays, such as addresses that the replay engine must generate
    and not simply hand back from the collected data.
    
    Often, addresses have associated relocations generated during replay.
    SuperPMI can use these relocations to adjust the constants to allow
    two replays to match. However, there are cases on Arm64 where an address
    both doesn't report a relocation and is "constructed" using multiple
    `mov`/`movk` instructions.
    
    One case is the `allocPgoInstrumentationBySchema()`
    API which returns a pointer to a PGO data buffer. An address within this
    buffer is constructed via a sequence such as:
    ```
    mov     x0, dotnet#63408
    movk    x0, dotnet#23602, lsl dotnet#16
    movk    x0, dotnet#606, lsl dotnet#32
    ```
    
    When SuperPMI replays this API, it constructs a new buffer and returns that
    pointer, which is used to construct various actual addresses that are
    generated as "constructed" constants, shown above.
    
    This change "de-constructs" the constants and looks them up in the replay
    address map. If base and diff match the mapped constants, there is no asm diff.
    BruceForstall committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    3902454 View commit details
    Browse the repository at this point in the history
  2. Fix 32-bit build

    I don't think we fully support 64-bit replay on 32-bit host, but this
    fix at least makes it possible for this case.
    BruceForstall committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    9104a84 View commit details
    Browse the repository at this point in the history
  3. Support more general mov/movk sequence

    Allow JIT1 and JIT2 to have a different sequence of
    mov/movk[/movk[/movk]] that map to the same address in the
    address map. That is, the replay constant might require a different
    set of instructions (e.g., if a `movk` is missing because its constant
    is zero).
    BruceForstall committed Oct 4, 2022
    Configuration menu
    Copy the full SHA
    7141e27 View commit details
    Browse the repository at this point in the history