bytes as expected. Tested with the included unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244155
91177308-0d34-0410-b5e6-
96231b3b80d8
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.
--- /dev/null
+; 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