This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Add target feature for atomics
ClosedPublic

Authored by dschuff on Aug 30 2017, 9:06 AM.

Details

Summary

This tracks the WebAssembly threads feature proposal at
https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md

This change simply add the target feature and basic support for a single instruction i32.atomic.load.

Event Timeline

dschuff created this revision.Aug 30 2017, 9:06 AM
dschuff edited the summary of this revision. (Show Details)Aug 30 2017, 9:07 AM
dschuff updated this revision to Diff 113274.Aug 30 2017, 9:09 AM
  • revert extra change
jgravelle-google accepted this revision.Aug 30 2017, 9:39 AM

Nits aside lgtm

lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
14–15

Should this surround the //==--- Atomic loads ---===// header? Looks odd to me that it starts outside it, but ends inside it.

test/CodeGen/WebAssembly/atomics.ll
17

This would probably be easier to read as @load_i32_atomic or something, especially as we get more atomic operations.

This revision is now accepted and ready to land.Aug 30 2017, 9:39 AM
dschuff marked an inline comment as done.Aug 30 2017, 9:56 AM
dschuff added inline comments.
lib/Target/WebAssembly/WebAssemblyInstrAtomics.td
14–15

Should probably be after the header it since it only applies to the instruction defs, but i guess the header refers to the patterns too.

dschuff updated this revision to Diff 113280.Aug 30 2017, 9:56 AM
  • address review comments
This revision was automatically updated to reflect the committed changes.