diff options
author | Heejin Ahn <aheejin@gmail.com> | 2018-08-07 00:22:22 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2018-08-07 00:22:22 +0000 |
commit | e8653bb89a8e3159c920eb063cc28d1254474c66 (patch) | |
tree | 037ee5da83389c8b5ead12feb8d02fc73ac514fb /llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td | |
parent | f66d0ce10b1aea10bfdd52e5de2e0729d3827a0c (diff) | |
download | bcm5719-llvm-e8653bb89a8e3159c920eb063cc28d1254474c66.tar.gz bcm5719-llvm-e8653bb89a8e3159c920eb063cc28d1254474c66.zip |
[WebAssembly] Enable atomic expansion for unsupported atomicrmws
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.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D49440
llvm-svn: 339084
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td index ba6800e005d..2c66efe09d8 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td +++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrAtomics.td @@ -660,10 +660,11 @@ defm : BinRMWTruncExtPattern< // Atomic ternary read-modify-writes //===----------------------------------------------------------------------===// -// TODO LLVM IR's cmpxchg instruction returns a pair of {loaded value, -// success flag}. When we use a success flag or both values, we can't make use -// of truncate/extend versions of instructions for now, which is suboptimal. Add -// selection rules for those cases too. +// TODO LLVM IR's cmpxchg instruction returns a pair of {loaded value, success +// flag}. When we use the success flag or both values, we can't make use of i64 +// truncate/extend versions of instructions for now, which is suboptimal. +// Consider adding a pass after instruction selection that optimizes this case +// if it is frequent. let Defs = [ARGUMENTS] in { |