This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Use default attributes for intrinsics
ClosedPublic

Authored by nikic on Nov 7 2022, 7:00 AM.

Details

Summary

This switches wasm intrinsics to use default attributes, i.e. nofree, nosync, nocallback and willreturn. Especially willreturn is required to avoid optimization regressions in the future.

The attributes are omitted from the trapping fptoi intrinsics (where I assume trapping is considered well-defined, and as such these aren't willreturn) and the atomic intrinsics, which aren't nosync

Diff Detail

Event Timeline

nikic created this revision.Nov 7 2022, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 7:00 AM
nikic requested review of this revision.Nov 7 2022, 7:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 7:00 AM
tlively accepted this revision.Nov 7 2022, 7:15 AM

LGTM % comment. Thanks!

llvm/include/llvm/IR/IntrinsicsWebAssembly.td
112–113

These won't return, either.

This revision is now accepted and ready to land.Nov 7 2022, 7:15 AM
nikic updated this revision to Diff 473660.Nov 7 2022, 7:20 AM

Don't use default attributes for wasm.throw.

nikic marked an inline comment as done.Nov 7 2022, 7:21 AM
nikic added inline comments.
llvm/include/llvm/IR/IntrinsicsWebAssembly.td
112–113

Ooops, fixed.

tlively accepted this revision.Nov 7 2022, 7:44 AM
This revision was landed with ongoing or failed builds.Nov 7 2022, 8:09 AM
This revision was automatically updated to reflect the committed changes.
nikic marked an inline comment as done.