This patch really just extends D39946 towards stores as well as loads. While the patch is in SelectionDAGBuilder, it only applies to AVR (the only target that supports unaligned atomic operations). Differential Revision: https://reviews.llvm.org/D128483
21 lines
604 B
LLVM
21 lines
604 B
LLVM
; RUN: llc -mattr=addsubiw < %s -march=avr | FileCheck %s
|
|
|
|
; This verifies that the backend can handle an unaligned atomic load and store.
|
|
;
|
|
; In the past, an assertion inside the SelectionDAGBuilder would always
|
|
; hit an assertion for unaligned loads and stores.
|
|
|
|
%AtomicI16 = type { %CellI16, [0 x i8] }
|
|
%CellI16 = type { i16, [0 x i8] }
|
|
|
|
; CHECK-LABEL: foo
|
|
; CHECK: ret
|
|
define void @foo(%AtomicI16* %self) {
|
|
start:
|
|
%a = getelementptr inbounds %AtomicI16, %AtomicI16* %self, i16 0, i32 0, i32 0
|
|
load atomic i16, i16* %a seq_cst, align 1
|
|
store atomic i16 5, i16* %a seq_cst, align 1
|
|
ret void
|
|
}
|
|
|