atomic.ll 372 B

123456789101112
  1. ; RUN: opt -mem2reg < %s -S | FileCheck %s
  2. ; mem2reg is allowed with arbitrary atomic operations (although we only support
  3. ; it for atomic load and store at the moment).
  4. define i32 @test1(i32 %x) {
  5. ; CHECK-LABEL: @test1(
  6. ; CHECK: ret i32 %x
  7. %a = alloca i32
  8. store atomic i32 %x, i32* %a seq_cst, align 4
  9. %r = load atomic i32, i32* %a seq_cst, align 4
  10. ret i32 %r
  11. }