Skip to content

Resolve value aliases in disas tests#8239

Merged
jameysharp merged 1 commit intobytecodealliance:mainfrom
jameysharp:resolve-disas-aliases
Mar 26, 2024
Merged

Resolve value aliases in disas tests#8239
jameysharp merged 1 commit intobytecodealliance:mainfrom
jameysharp:resolve-disas-aliases

Conversation

@jameysharp
Copy link
Contributor

This reverts commit 6c51848, "Cranelift: resolve value aliases when printing CLIF functions (#8214)", then applies the same effect a different way.

In discussion on #8223, we decided to handle this a different way. So I've introduced a method on DataFlowGraph which eliminates all value aliases, and we can call it when necessary. If that function is not called then the CLIF printer should print value aliases the same way it did before #8214.

In this PR, I've specifically called it in disas tests. The changes to write.rs and frontend.rs are from the revert, while the changes to disas.rs are new.

In these tests, value aliases are just clutter that distracts from understanding what code will actually be generated. They may change due to changes in legalization, but that doesn't signal anything about whatever the test was intended to check.

Because the new helper deletes aliases after it's done resolving them, those aliases now disappear from the test expectations. Aside from that, the test expectations are unchanged compared to what #8214 did.

@jameysharp jameysharp requested review from a team as code owners March 26, 2024 01:00
@jameysharp jameysharp requested review from alexcrichton and elliottt and removed request for a team March 26, 2024 01:00
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Mar 26, 2024
Copy link
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.

Awesome! 🎉

This reverts commit 6c51848,
"Cranelift: resolve value aliases when printing CLIF functions (bytecodealliance#8214)",
then applies the same effect a different way.

In discussion on bytecodealliance#8223, we decided to handle this a different way. So
I've introduced a method on DataFlowGraph which eliminates all value
aliases, and we can call it when necessary. If that function is not
called then the CLIF printer should print value aliases the same way it
did before bytecodealliance#8214.

In this PR, I've specifically called it in disas tests. The changes to
write.rs and frontend.rs are from the revert, while the changes to
disas.rs are new.

In these tests, value aliases are just clutter that distracts from
understanding what code will actually be generated. They may change due
to changes in legalization, but that doesn't signal anything about
whatever the test was intended to check.

Because the new helper deletes aliases after it's done resolving them,
those aliases now disappear from the test expectations. Aside from that,
the test expectations are unchanged compared to what bytecodealliance#8214 did.
@jameysharp jameysharp force-pushed the resolve-disas-aliases branch from 231dae2 to 0160919 Compare March 26, 2024 06:21
@jameysharp jameysharp enabled auto-merge March 26, 2024 06:21
@jameysharp jameysharp added this pull request to the merge queue Mar 26, 2024
Merged via the queue into bytecodealliance:main with commit 138148a Mar 26, 2024
@jameysharp jameysharp deleted the resolve-disas-aliases branch March 26, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants