Skip to content

Fix some egraph-related issues.#5088

Merged
cfallin merged 4 commits into
bytecodealliance:mainfrom
cfallin:fix-issue-5086
Oct 21, 2022
Merged

Fix some egraph-related issues.#5088
cfallin merged 4 commits into
bytecodealliance:mainfrom
cfallin:fix-issue-5086

Conversation

@cfallin
Copy link
Copy Markdown
Member

@cfallin cfallin commented Oct 21, 2022

This fixes #5086 by addressing two separate issues:

  • The ValueDataPacked::set_type() helper had an embarrassing bitfield-manipulation bug that would mangle the rest of a ValueDef when setting its type. This is not normally used, only when the egraph elaboration fills in types after-the-fact on a multi-value node.
  • The lowering rules for isplit on aarch64 and s390x were dispatching on the first output type, rather than the input type. When only the second output is used (as in the example in Cranelift: ushr+isplit miscompilation with egraphs #5086), the first output type actually remains INVALID (and this is fine because it's never used).

@cfallin cfallin requested review from elliottt and fitzgen October 21, 2022 02:44
@github-actions github-actions Bot added cranelift Issues related to the Cranelift code generator cranelift:area:aarch64 Issues related to AArch64 backend. labels Oct 21, 2022
Copy link
Copy Markdown
Member

@elliottt elliottt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Comment thread cranelift/filetests/filetests/egraph/isplit.clif
@cfallin cfallin merged commit 86e7795 into bytecodealliance:main Oct 21, 2022
@cfallin cfallin deleted the fix-issue-5086 branch October 21, 2022 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift:area:aarch64 Issues related to AArch64 backend. cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cranelift: ushr+isplit miscompilation with egraphs

2 participants