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

Unified Diff: lib/Transforms/NaCl/ResolvePNaClIntrinsics.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/RemoveAsmMemory.cpp ('k') | lib/Transforms/NaCl/RewriteAsmDirectives.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
diff --git a/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp b/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
index 25e1a8620b9f78b5b06ed00f8a4b4280a5bb9e44..fc5138574d4d20812e8ad2966bcdfcd201891f79 100644
--- a/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
+++ b/lib/Transforms/NaCl/ResolvePNaClIntrinsics.cpp
@@ -18,6 +18,8 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Constant.h"
+#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/InlineAsm.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
@@ -242,6 +244,20 @@ private:
I = new FenceInst(M->getContext(),
thawMemoryOrder(Call->getArgOperand(0)), SS, Call);
break;
+ case Intrinsic::nacl_atomic_fence_all: {
+ FunctionType *FTy =
+ FunctionType::get(Type::getVoidTy(M->getContext()), false);
+ std::string AsmString; // Empty.
+ std::string Constraints("~{memory}");
+ bool HasSideEffect = true;
+ CallInst *Asm = CallInst::Create(
+ InlineAsm::get(FTy, AsmString, Constraints, HasSideEffect), "", Call);
+ Asm->setDebugLoc(Call->getDebugLoc());
+ I = new FenceInst(M->getContext(), SequentiallyConsistent, SS, Asm);
+ Asm = CallInst::Create(
+ InlineAsm::get(FTy, AsmString, Constraints, HasSideEffect), "", I);
+ Asm->setDebugLoc(Call->getDebugLoc());
+ } break;
}
I->setName(Call->getName());
I->setDebugLoc(Call->getDebugLoc());
« no previous file with comments | « lib/Transforms/NaCl/RemoveAsmMemory.cpp ('k') | lib/Transforms/NaCl/RewriteAsmDirectives.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698