aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/NaCl/PNaClABISimplify.cpp
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2013-07-30 16:38:26 -0700
committerJF Bastien <jfb@chromium.org>2013-07-30 16:38:26 -0700
commitf75fd0a9f95109b9cb13a74aad6dcc98c3d5d625 (patch)
tree652c465d76008ef58f5c8d55827050a6f1d875e1 /lib/Transforms/NaCl/PNaClABISimplify.cpp
parent423b3bb89c78e96c59843aa7c6e55d01bde174d1 (diff)
Rewrite ``asm("":::"memory")`` to ``fence seq_cst``
This is often used as a compiler barrier and should "just work" in user code. BUG= https://code.google.com/p/nativeclient/issues/detail?id=2345 R=eliben@chromium.org TEST= (cd ./pnacl/build/llvm_x86_64 && ninja check-all) Review URL: https://codereview.chromium.org/21178002
Diffstat (limited to 'lib/Transforms/NaCl/PNaClABISimplify.cpp')
-rw-r--r--lib/Transforms/NaCl/PNaClABISimplify.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp
index 189d87f2cb..4f8e0e4f87 100644
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp
@@ -30,8 +30,10 @@ void llvm::PNaClABISimplifyAddPreOptPasses(PassManager &PM) {
// LowerExpect converts Intrinsic::expect into branch weights,
// which can then be removed after BlockPlacement.
PM.add(createLowerExpectIntrinsicPass());
- // Rewrite unsupported intrinsics to simpler constructs.
+ // Rewrite unsupported intrinsics and inline assembly directives to
+ // simpler and portable constructs.
PM.add(createRewriteLLVMIntrinsicsPass());
+ PM.add(createRewriteAsmDirectivesPass());
// LowerInvoke prevents use of C++ exception handling, which is not
// yet supported in the PNaCl ABI.
PM.add(createLowerInvokePass());