aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJF Bastien <jfb@chromium.org>2013-08-07 15:50:54 -0700
committerJF Bastien <jfb@chromium.org>2013-08-07 15:50:54 -0700
commit10c5d2cb2f5611441dae3114e3803526340e4b4b (patch)
tree4c2738773744746b2d690574e8f7663fc1e6bf10 /include
parent0791551c99b041c83413ff78c29cded7730cf601 (diff)
Add the new @llvm.nacl.atomic.fence.all intrinsic
This is a follow-up to: https://codereview.chromium.org/22240002/ And requires the Clang changes from: https://codereview.chromium.org/22294002/ This new intrinsic represents ``asm("":::"~{memory}")`` as well as ``__sync_synchronize()``, and in IR it corresponds to a sequentially-consistent fence surrounded by ``call void asm sideeffect "", "~{memory}"()``. R=jvoung@chromium.org TEST= ninja check-all BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475 Review URL: https://codereview.chromium.org/22474008
Diffstat (limited to 'include')
-rw-r--r--include/llvm/IR/InlineAsm.h7
-rw-r--r--include/llvm/IR/NaClAtomicIntrinsics.h2
-rw-r--r--include/llvm/InitializePasses.h2
-rw-r--r--include/llvm/Transforms/NaCl.h2
4 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/IR/InlineAsm.h b/include/llvm/IR/InlineAsm.h
index 33e4ab8522..2c4a558200 100644
--- a/include/llvm/IR/InlineAsm.h
+++ b/include/llvm/IR/InlineAsm.h
@@ -92,6 +92,13 @@ public:
///
static bool Verify(FunctionType *Ty, StringRef Constraints);
+ // @LOCALMOD-START
+ /// isAsmMemory - Returns true if the Instruction corresponds to
+ /// ``asm("":::"memory")``, which is often used as a compiler barrier.
+ ///
+ bool isAsmMemory() const;
+ // @LOCALMOD-END
+
// Constraint String Parsing
enum ConstraintPrefix {
isInput, // 'x'
diff --git a/include/llvm/IR/NaClAtomicIntrinsics.h b/include/llvm/IR/NaClAtomicIntrinsics.h
index 680c644024..b87c1ad77f 100644
--- a/include/llvm/IR/NaClAtomicIntrinsics.h
+++ b/include/llvm/IR/NaClAtomicIntrinsics.h
@@ -22,7 +22,7 @@ namespace llvm {
namespace NaCl {
-static const size_t NumAtomicIntrinsics = 5;
+static const size_t NumAtomicIntrinsics = 6;
static const size_t NumAtomicIntrinsicOverloadTypes = 4;
static const size_t MaxAtomicIntrinsicsParameters = 5;
diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h
index 8352868d89..fd59d14b54 100644
--- a/include/llvm/InitializePasses.h
+++ b/include/llvm/InitializePasses.h
@@ -295,10 +295,10 @@ void initializePNaClABIVerifyFunctionsPass(PassRegistry&);
void initializePNaClABIVerifyModulePass(PassRegistry&);
void initializePromoteI1OpsPass(PassRegistry&);
void initializePromoteIntegersPass(PassRegistry&);
+void initializeRemoveAsmMemoryPass(PassRegistry&);
void initializeReplacePtrsWithIntsPass(PassRegistry&);
void initializeResolveAliasesPass(PassRegistry&);
void initializeResolvePNaClIntrinsicsPass(PassRegistry&);
-void initializeRewriteAsmDirectivesPass(PassRegistry&);
void initializeRewriteAtomicsPass(PassRegistry&);
void initializeRewriteLLVMIntrinsicsPass(PassRegistry&);
void initializeRewritePNaClLibraryCallsPass(PassRegistry&);
diff --git a/include/llvm/Transforms/NaCl.h b/include/llvm/Transforms/NaCl.h
index 3cf306499e..e1be3cf85b 100644
--- a/include/llvm/Transforms/NaCl.h
+++ b/include/llvm/Transforms/NaCl.h
@@ -28,8 +28,8 @@ FunctionPass *createExpandConstantExprPass();
FunctionPass *createExpandStructRegsPass();
FunctionPass *createInsertDivideCheckPass();
FunctionPass *createPromoteIntegersPass();
+FunctionPass *createRemoveAsmMemoryPass();
FunctionPass *createResolvePNaClIntrinsicsPass();
-FunctionPass *createRewriteAsmDirectivesPass();
ModulePass *createAddPNaClExternalDeclsPass();
ModulePass *createCanonicalizeMemIntrinsicsPass();
ModulePass *createExpandArithWithOverflowPass();