Skip to content

Commit

Permalink
Auto merge of #30962 - Amanieu:non_volatile_atomic, r=alexcrichton
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Feb 4, 2016
2 parents 3c9442f + 01112d1 commit 1096e7a
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand Down

0 comments on commit 1096e7a

Please sign in to comment.