summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorRichard Diamond <wichard@vitalitystudios.com>2015-08-05 22:10:57 +0000
committerRichard Diamond <wichard@vitalitystudios.com>2015-08-05 22:10:57 +0000
commit559c1d72a94dcd7dba088438359422591aa3355b (patch)
treebfe3f69fe6cc8654636f99258447ca558dccf77c /llvm/lib/CodeGen
parent36e7e52aa4f8d79c898d74f93711c4a0c78e253f (diff)
downloadbcm5719-llvm-559c1d72a94dcd7dba088438359422591aa3355b.tar.gz
bcm5719-llvm-559c1d72a94dcd7dba088438359422591aa3355b.zip
Divide the primitive size in bits by eight so the initial load's alignment is in
bytes as expected. Tested with the included unit test. llvm-svn: 244155
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AtomicExpandPass.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index 03b0ff32f15..c10648c6e3b 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -550,7 +550,7 @@ bool llvm::expandAtomicRMWToCmpXchg(AtomicRMWInst *AI,
Builder.SetInsertPoint(BB);
LoadInst *InitLoaded = Builder.CreateLoad(Addr);
// Atomics require at least natural alignment.
- InitLoaded->setAlignment(AI->getType()->getPrimitiveSizeInBits());
+ InitLoaded->setAlignment(AI->getType()->getPrimitiveSizeInBits() / 8);
Builder.CreateBr(LoopBB);
// Start the main loop block now that we've taken care of the preliminaries.
OpenPOWER on IntegriCloud