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

Optimize representation of sequences in Useless pass #569

Merged
merged 8 commits into from
May 22, 2024

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    2d07f55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    30629e7 View commit details
    Browse the repository at this point in the history
  3. Simplify forcing of usefulness of Array_alloc argument

    Rather than always forcing a `Value.Array`'s length to be useful whenever an
    array element exists, only force the `Array_alloc`'s argument to be useful
    whenever an array element exists.
    MatthewFluet committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ee544e1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a39ded View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    81bf18f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    f557f13 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7475813 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2024

  1. Optimize representation of sequences in Useless pass

    The `Useless` optimization pass may determine that the contents of a
    sequence (array or vector) is useless; similarly, it may determine that the
    length of a sequence is useless; finally, it may determine that the identity of
    an array is useless.
    
    However, the transformation performed by the `Useless` optimization pass would,
    at most, change a `t array` or `t vector` to `unit array` or `unit vector`.
    
    This commit allows the `Useless` optimization pass to change sequences with
    useless contents to simpler types.  In particular:
    
     * a `t array` with useless contents, useless length, and useless identity
       becomes a `unit`
     * a `t array` with useless contents, useless length, and useful identity
       becomes a `unit ref`
     * a `t array` with useless contents, useful length, and useless identity
       becomes a `word64` (or a `word32` on 32-bit platforms)
     * a `t array` with useless contents, useful length, and useful identity
       becomes a `word64 ref` (or a `word32 ref` on 32-bit platforms)
     * a `t vector` with useless contents and useless length
       becomes a `unit`
     * a `t vector` with useless contents and useful length
       becomes a `word64` (or a `word32` on 32-bit platforms)
    
    Such optimizations do not happen frequently, but there are a few instances in a
    self-compile.
    MatthewFluet committed May 22, 2024
    Configuration menu
    Copy the full SHA
    1aad5fe View commit details
    Browse the repository at this point in the history