summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-05-28 22:09:12 +0000
committerHeejin Ahn <aheejin@gmail.com>2019-05-28 22:09:12 +0000
commit551465859113a609e72b8de907f8977ff28c234a (patch)
treec6943d2e24fd92f76e957b7d41dcddb8cefef035 /llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
parent81748bae47fdaf280877dfa8d7d309b88b848de9 (diff)
downloadbcm5719-llvm-551465859113a609e72b8de907f8977ff28c234a.tar.gz
bcm5719-llvm-551465859113a609e72b8de907f8977ff28c234a.zip
[WebAssembly] Support for atomic fences
Summary: This adds support for translation of LLVM IR fence instruction. We convert a singlethread fence to a pseudo compiler barrier which becomes 0 instructions in final binary, and a thread fence to an idempotent atomicrmw instruction to a memory address. Reviewers: dschuff, jfb, sunfish, tlively Subscribers: sbc100, jgravelle-google, llvm-commits Differential Revision: https://reviews.llvm.org/D50277 llvm-svn: 361884
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
index 565438d7e0e..7f9d41da397 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
@@ -369,6 +369,10 @@ void WebAssemblyAsmPrinter::EmitInstruction(const MachineInstr *MI) {
OutStreamer->AddBlankLine();
}
break;
+ case WebAssembly::COMPILER_FENCE:
+ // This is a compiler barrier that prevents instruction reordering during
+ // backend compilation, and should not be emitted.
+ break;
case WebAssembly::EXTRACT_EXCEPTION_I32:
case WebAssembly::EXTRACT_EXCEPTION_I32_S:
// These are pseudo instructions that simulates popping values from stack.
OpenPOWER on IntegriCloud