Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(896)

Unified Diff: lib/Transforms/NaCl/PNaClABISimplify.cpp

Issue 22474008: Add the new @llvm.nacl.atomic.fence.all intrinsic (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Add note suggested by jvoung. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Transforms/NaCl/CMakeLists.txt ('k') | lib/Transforms/NaCl/RemoveAsmMemory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Transforms/NaCl/PNaClABISimplify.cpp
diff --git a/lib/Transforms/NaCl/PNaClABISimplify.cpp b/lib/Transforms/NaCl/PNaClABISimplify.cpp
index 4f8e0e4f877286a75b820e7da620fe30cb8a7f30..f662ada99a30d1bd13f4b5c4cfb640a09de4e201 100644
--- a/lib/Transforms/NaCl/PNaClABISimplify.cpp
+++ b/lib/Transforms/NaCl/PNaClABISimplify.cpp
@@ -30,10 +30,8 @@ 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 and inline assembly directives to
- // simpler and portable constructs.
+ // Rewrite unsupported intrinsics 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());
@@ -98,6 +96,10 @@ void llvm::PNaClABISimplifyAddPostOptPasses(PassManager &PM) {
PM.add(createExpandGetElementPtrPass());
// Rewrite atomic and volatile instructions with intrinsic calls.
PM.add(createRewriteAtomicsPass());
+ // Remove ``asm("":::"memory")``. This must occur after rewriting
+ // atomics: a ``fence seq_cst`` surrounded by ``asm("":::"memory")``
+ // has special meaning and is translated differently.
+ PM.add(createRemoveAsmMemoryPass());
// ReplacePtrsWithInts assumes that getelementptr instructions and
// ConstantExprs have already been expanded out.
PM.add(createReplacePtrsWithIntsPass());
« no previous file with comments | « lib/Transforms/NaCl/CMakeLists.txt ('k') | lib/Transforms/NaCl/RemoveAsmMemory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698