From 7809bb2e9687e67dddef614902ee3f1af6955b24 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Thu, 6 Aug 2015 10:37:59 +0000 Subject: [PATCH] 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 --- lib/CodeGen/AtomicExpandPass.cpp | 2 +- .../AtomicExpand/expand-atomic-rmw-initial-load.ll | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll diff --git a/lib/CodeGen/AtomicExpandPass.cpp b/lib/CodeGen/AtomicExpandPass.cpp index c10648c6e3b..03b0ff32f15 100644 --- a/lib/CodeGen/AtomicExpandPass.cpp +++ b/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/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll b/test/Transforms/AtomicExpand/expand-atomic-rmw-initial-load.ll deleted file mode 100644 index 197250ef455..00000000000 --- a/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 -- 2.34.1