Skip to content

[Wasm GC] Optimize RefCast + ignore-implicit-traps - #3748

Merged
kripken merged 7 commits into
mainfrom
optrefcast
Mar 31, 2021
Merged

kripken merged 7 commits into
mainfrom
optrefcast

Conversation

@kripken

@kripken kripken commented Mar 29, 2021

Copy link
Copy Markdown
Member

If we are ignoring implicit traps, and if the cast is from a subtype to a supertype,
then we ignore the possible RTT-related inconsistency and can just drop the
cast.

See #3636

cc @askeksa-google

@kripken
kripken requested review from aheejin and tlively March 29, 2021 20:19

@askeksa-google askeksa-google left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good.

Comment on lines +6 to +8
(type $A (struct (field i32)))
(type $B (struct (field i32) (field f64)))
(type $C (struct (field i64) (field f32)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about parent, child, and other rather than A, B, and C?

Comment on lines +108 to +114
(param $a (ref $A))
(param $b (ref $B))
(param $c (ref $C))

(param $a-rtt (rtt $A))
(param $b-rtt (rtt $B))
(param $c-rtt (rtt $C))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like this only uses $a and $a-rtt. Removing the extra params would make the test output shorter.

@kripken
kripken merged commit f034dc6 into main Mar 31, 2021
@kripken
kripken deleted the optrefcast branch March 31, 2021 01:50
martianboy pushed a commit to martianboy/binaryen that referenced this pull request Mar 31, 2021
If we are ignoring implicit traps, and if the cast is from a subtype to a supertype,
then we ignore the possible RTT-related inconsistency and can just drop the
cast.

See WebAssembly#3636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants