mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-28 07:05:11 +00:00
890a876e0e
This gets gas and llc -filetype=obj to agree on the order of prefixes. For llvm-mc we need to fix the asm parser to know that it makes a difference on which line the "lock" is in. Part of pr23594. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238232 91177308-0d34-0410-b5e6-96231b3b80d8
27 lines
913 B
LLVM
27 lines
913 B
LLVM
; RUN: llc < %s -march=x86 -mtriple=i386-apple-darwin | FileCheck %s
|
|
; PR8297
|
|
;
|
|
; On i386, i64 cmpxchg is lowered during legalize types to extract the
|
|
; 64-bit result into a pair of fixed regs. So creation of the DAG node
|
|
; happens in a different place. See
|
|
; X86TargetLowering::ReplaceNodeResults, case ATOMIC_CMP_SWAP.
|
|
;
|
|
; Neither Atomic-xx.ll nor atomic_op.ll cover this. Those tests were
|
|
; autogenerated from C source before 64-bit variants were supported.
|
|
;
|
|
; Note that this case requires a loop around the cmpxchg to force
|
|
; machine licm to query alias anlysis, exposing a bad
|
|
; MachineMemOperand.
|
|
define void @foo(i64* %ptr) nounwind inlinehint {
|
|
entry:
|
|
br label %loop
|
|
loop:
|
|
; CHECK: lock cmpxchg8b
|
|
%pair = cmpxchg i64* %ptr, i64 0, i64 1 monotonic monotonic
|
|
%r = extractvalue { i64, i1 } %pair, 0
|
|
%stored1 = icmp eq i64 %r, 0
|
|
br i1 %stored1, label %loop, label %continue
|
|
continue:
|
|
ret void
|
|
}
|