Skip to content

No effects for string builtins#8687

Draft
stevenfontanella wants to merge 1 commit into
mainfrom
string-builtin-effects
Draft

No effects for string builtins#8687
stevenfontanella wants to merge 1 commit into
mainfrom
string-builtin-effects

Conversation

@stevenfontanella
Copy link
Copy Markdown
Member

No description provided.


} // namespace wasm

#endif // wasm_ir_string_builtin_names_h
Copy link
Copy Markdown
Member

@kripken kripken May 11, 2026

Choose a reason for hiding this comment

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

Perhaps this could be in intrinsics.h?

Could have a method there isStringBuiltin parallel to isCallWithoutEffects.

In fact, isCallWithoutEffects might just identify the string builtins too - they are, after all, calls without effects. This generalizes the meaning of that method to not just handle one import but several, though I think this might just work?

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 would work perfectly in effects.h, and hopefully elsewhere)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Got it, adding isStringBuiltin sounds good. Putting this into isCallWithoutEffects seems misleading to me since it refers to the intrinsic rather than the property of not having effects in practice (and I see that some cases like wasm-interpreter.h and SignatureRefining.cpp do care specifically about the intrinsic). If we want to know whether a call has no effects, then using EffectAnalyzer seems like the canonical way rather than isCallWithoutEffects, so maybe we can just zero out the effects in EffectAnalyzer?

We'd still need a check in GlobalEffects.cpp since we're not looking at a call expression but instead skipping the effects computation for the whole body.

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.

2 participants