Revert "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."

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
This commit is contained in:
Renato Golin 2015-08-06 10:37:59 +00:00
parent 47e91a8102
commit 7809bb2e96
2 changed files with 1 additions and 9 deletions

View 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.

View File

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