This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Enable atomic expansion for unsupported atomicrmws
ClosedPublic

Authored by aheejin on Jul 17 2018, 11:43 AM.

Details

Summary

Wasm does not have direct counterparts to some of LLVM IR's atomicrmw
instructions (min, max, umin, umax, and nand). This enables atomic
expansion using cmpxchg instruction within a loop for those atomicrmw
instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

aheejin created this revision.Jul 17 2018, 11:43 AM

For the same reason described here, in truncation/extension involving i64, we currently are not able to use the truncate/extend version of the cmpxchg instruction, so it is little suboptimal. Will solve this in a separate CL.

aheejin updated this revision to Diff 155991.Jul 17 2018, 4:47 PM
  • cosmetic change
aheejin updated this revision to Diff 159411.Aug 6 2018, 3:35 PM
  • Test case / comment fix about potential cmpxchg optimizations
dschuff accepted this revision.Aug 6 2018, 3:45 PM

Great that the atomicexpandpass just works for this.

This revision is now accepted and ready to land.Aug 6 2018, 3:45 PM
This revision was automatically updated to reflect the committed changes.