about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-04 02:46:44 +0000
committerbors <bors@rust-lang.org>2016-02-04 02:46:44 +0000
commit1096e7ab7afb14257798da82a1dd6aeadcb30100 (patch)
tree1061632d7f4fcf0181bfdec61223e088db4b3158 /src/rustllvm/RustWrapper.cpp
parent3c9442fc503fe397b8d3495d5a7f9e599ad63cf6 (diff)
parent01112d1ac496b3e8cf63459a6647b66baa8b5a26 (diff)
downloadrust-1096e7ab7afb14257798da82a1dd6aeadcb30100.tar.gz
rust-1096e7ab7afb14257798da82a1dd6aeadcb30100.zip
Auto merge of #30962 - Amanieu:non_volatile_atomic, r=alexcrichton
Rust currently emits atomic loads and stores with the LLVM `volatile` qualifier. This is unnecessary and prevents LLVM from performing optimization on these atomic operations.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 0c18051dac7..ecf9146a1d0 100644
--- a/src/rustllvm/RustWrapper.cpp
+++ b/src/rustllvm/RustWrapper.cpp
@@ -170,7 +170,6 @@ extern "C" LLVMValueRef LLVMBuildAtomicLoad(LLVMBuilderRef B,
                                             AtomicOrdering order,
                                             unsigned alignment) {
     LoadInst* li = new LoadInst(unwrap(source),0);
-    li->setVolatile(true);
     li->setAtomic(order);
     li->setAlignment(alignment);
     return wrap(unwrap(B)->Insert(li, Name));
@@ -182,7 +181,6 @@ extern "C" LLVMValueRef LLVMBuildAtomicStore(LLVMBuilderRef B,
                                              AtomicOrdering order,
                                              unsigned alignment) {
     StoreInst* si = new StoreInst(unwrap(val),unwrap(target));
-    si->setVolatile(true);
     si->setAtomic(order);
     si->setAlignment(alignment);
     return wrap(unwrap(B)->Insert(si));