Revert "Divide the primitive size in bits by eight so the initial load's alignment...
authorRenato Golin <renato.golin@linaro.org>
Thu, 6 Aug 2015 10:37:59 +0000 (10:37 +0000)
committerRenato Golin <renato.golin@linaro.org>
Thu, 6 Aug 2015 10:37:59 +0000 (10:37 +0000)
This reverts commit r244155, as it was breaking the buildbots for too long.
Should be reapplied with proper fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244205 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AtomicExpandPass.cpp
test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll [deleted file]

index c10648c6e3bcf2cc4333701f7884f78867dabd8f..03b0ff32f15c3a9f61274a1e80bd631d400635ff 100644 (file)
@@ -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() / 8);
+  InitLoaded->setAlignment(AI->getType()->getPrimitiveSizeInBits());
   Builder.CreateBr(LoopBB);
 
   // Start the main loop block now that we've taken care of the preliminaries.
diff --git a/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll b/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll
deleted file mode 100644 (file)
index 197250e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-; RUN: opt -S %s -atomic-expand -mtriple=i686-linux-gnu | FileCheck %s
-
-define i8 @test_initial_load(i8* %ptr, i8 %value) {
-  %res = atomicrmw nand i8* %ptr, i8 %value seq_cst
-  ret i8 %res
-}
-; CHECK-LABEL: @test_initial_load
-; CHECK-NEXT:    %1 = load i8, i8* %ptr, align 1