From: Renato Golin Date: Thu, 6 Aug 2015 10:37:59 +0000 (+0000) Subject: Revert "Divide the primitive size in bits by eight so the initial load's alignment... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a02ac60469be8bd488becde081d059dfc6081515;p=platform%2Fupstream%2Fllvm.git 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. llvm-svn: 244205 --- diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp index c10648c..03b0ff3 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() / 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/llvm/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll b/llvm/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll deleted file mode 100644 index 197250e..0000000 --- a/llvm/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll +++ /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