llvm-6502/test/CodeGen/X86/atomic-load-store.ll
Michael Liao c537f79dcd Fix PR15355
- Clear 'mayStore' flag when loading from the atomic variable before the
  spin loop
- Clear kill flag from one use to multiple use in registers forming the
  address to that atomic variable
- don't use a physical register as live-in register in BB (neither entry
  nor landing pad.) by copying it into virtual register

(patch by Cameron Zwarich)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 00:17:04 +00:00

24 lines
624 B
LLVM

; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-apple-macosx10.7.0 -verify-machineinstrs -O0 | FileCheck %s
define void @test1(i32* %ptr, i32 %val1) {
; CHECK: test1
; CHECK: xchgl %esi, (%rdi)
store atomic i32 %val1, i32* %ptr seq_cst, align 4
ret void
}
define void @test2(i32* %ptr, i32 %val1) {
; CHECK: test2
; CHECK: movl %esi, (%rdi)
store atomic i32 %val1, i32* %ptr release, align 4
ret void
}
define i32 @test3(i32* %ptr) {
; CHECK: test3
; CHECK: movl (%rdi), %eax
%val = load atomic i32* %ptr seq_cst, align 4
ret i32 %val
}