Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Nov 13, 2025

The cost of "4" earlier was in place because call costs don't really matter
(the effects prevent removing/replacing them), but there are calls without
effects, like with the proper intrinsic. Model call costs as very expensive.

The monomorphize test change is because it has hardcoded costs, and
calls are now too "heavy" for what it wants. The calls are replaced by
other code that does a bunch of work.

Fixes #8044

@kripken kripken requested a review from tlively November 13, 2025 19:23
src/ir/cost.h Outdated
}
CostType visitCallIndirect(CallIndirect* curr) {
CostType ret = 6 + visit(curr->target);
// Model indirect calls as more expensive than call_refs.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is accurate on V8, at least, because function tables are privileged in some special way that actually makes call_indirect faster than call_ref even though it does more work semantically. Let's just give them the same cost here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@kripken kripken merged commit 7b817d6 into WebAssembly:main Nov 14, 2025
16 checks passed
@kripken kripken deleted the call.cost branch November 14, 2025 01:14
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.

Functions with call.without.effects should preserve their conditions.

2 participants