~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/CodeGen/X86/2010-10-08-cmpxchg8b.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: llc < %s -march=x86 -mtriple=i386-apple-darwin | FileCheck %s
 
2
; PR8297
 
3
;
 
4
; On i386, i64 cmpxchg is lowered during legalize types to extract the
 
5
; 64-bit result into a pair of fixed regs. So creation of the DAG node
 
6
; happens in a different place. See
 
7
; X86TargetLowering::ReplaceNodeResults, case ATOMIC_CMP_SWAP.
 
8
;
 
9
; Neither Atomic-xx.ll nor atomic_op.ll cover this. Those tests were
 
10
; autogenerated from C source before 64-bit variants were supported.
 
11
;
 
12
; Note that this case requires a loop around the cmpxchg to force
 
13
; machine licm to query alias anlysis, exposing a bad
 
14
; MachineMemOperand.
 
15
define void @foo(i64* %ptr) nounwind inlinehint {
 
16
entry:
 
17
  br label %loop
 
18
loop:
 
19
; CHECK: lock cmpxchg8b
 
20
  %pair = cmpxchg i64* %ptr, i64 0, i64 1 monotonic monotonic
 
21
  %r = extractvalue { i64, i1 } %pair, 0
 
22
  %stored1  = icmp eq i64 %r, 0
 
23
  br i1 %stored1, label %loop, label %continue
 
24
continue:
 
25
  ret void
 
26
}