27 lines · plain
1; RUN: llc < %s -mtriple=i386-apple-darwin | FileCheck %s2; PR82973;4; On i386, i64 cmpxchg is lowered during legalize types to extract the5; 64-bit result into a pair of fixed regs. So creation of the DAG node6; happens in a different place. See7; X86TargetLowering::ReplaceNodeResults, case ATOMIC_CMP_SWAP.8;9; Neither Atomic-xx.ll nor atomic_op.ll cover this. Those tests were10; autogenerated from C source before 64-bit variants were supported.11;12; Note that this case requires a loop around the cmpxchg to force13; machine licm to query alias anlysis, exposing a bad14; MachineMemOperand.15define void @foo(ptr %ptr) nounwind inlinehint {16entry:17 br label %loop18loop:19; CHECK: lock cmpxchg8b20 %pair = cmpxchg ptr %ptr, i64 0, i64 1 monotonic monotonic21 %r = extractvalue { i64, i1 } %pair, 022 %stored1 = icmp eq i64 %r, 023 br i1 %stored1, label %loop, label %continue24continue:25 ret void26}27