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

Cranelift: Fix union node bitpacking #7465

Merged
merged 6 commits into from
Nov 7, 2023

Commits on Nov 7, 2023

  1. Cranelift: Fix union node bitpacking

    It turns out we have just been taking the newest rewrite's value for a eclass
    union and never actually comparing costs and taking the value with the minimum
    cost. Whoops!
    
    Fixing this made some test expectations fail, which we resolved by tweaking the
    cost function to give materializing constants nonzero cost. This way we prefer
    `-x` to `0 - x`.
    
    We also made elaboration function break ties between values with the same cost
    with the value index. It prefers larger value indices, since the original
    value's index will be lower than all of its rewritten values' indices. This
    heuristically prefers rewritten values because we hope our rewrites are all
    improvements even when the cost function can't show that.
    
    Co-Authored-By: Chris Fallin <chris@cfallin.org>
    Co-Authored-By: Trevor Elliott <telliott@fastly.com>
    3 people committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    1c45bd0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2e894b3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ee4d933 View commit details
    Browse the repository at this point in the history
  4. Limit number of matches consumed from ISLE

    We generally want to clamp down and avoid runaway behavior here.
    
    But there also seems to be some sort of rustc/llvm bug on Rust 1.71 that is
    causing iteration to wild here. This commit avoids that bug.
    fitzgen committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    71d8233 View commit details
    Browse the repository at this point in the history
  5. Update test expectation

    fitzgen committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    a1646b2 View commit details
    Browse the repository at this point in the history
  6. prtest:full

    fitzgen committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    55e882d View commit details
    Browse the repository at this point in the history