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.
This commit is contained in:
bors 2016-02-04 02:46:44 +00:00
commit 1096e7ab7a

View File

@ -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));