EmitAnyX86InstComments(MI, *CommentStream, getRegisterName);
if (TSFlags & X86II::LOCK)
- OS << "\tlock\n";
+ OS << "\tlock\t";
// Output CALLpcrel32 as "callq" in 64-bit mode.
// In Intel annotation it's always emitted as "call".
%4 = call i64 @llvm.readcyclecounter() nounwind ; <i64> [#uses=1]
%5 = sub i64 %4, %2 ; <i64> [#uses=1]
%6 = atomicrmw add i64* getelementptr inbounds ([1216 x i64], [1216 x i64]* @__profiling_callsite_timestamps_live, i32 0, i32 51), i64 %5 monotonic
-;CHECK: lock
-;CHECK-NEXT: {{xadd|addq}} %rdx, __profiling_callsite_timestamps_live
+;CHECK: lock {{xadd|addq}} %rdx, __profiling_callsite_timestamps_live
;CHECK-NEXT: cmpl $0,
;CHECK-NEXT: jne
%cmp = icmp eq i32 %3, 0 ; <i1> [#uses=1]
; CHECK: addl $1, %ebx
; CHECK: movl %edx, %ecx
; CHECK: adcl $0, %ecx
-; CHECK: lock
-; CHECK-NEXT: cmpxchg8b ([[REG]])
+; CHECK: lock cmpxchg8b ([[REG]])
; CHECK-NEXT: jne
%0 = atomicrmw add i64* %p, i64 1 seq_cst
ret void
entry:
br label %loop
loop:
-; CHECK: lock
-; CHECK-NEXT: cmpxchg8b
+; 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
; Make sure the fence comes before the comparison, since it
; clobbers EFLAGS.
-; CHECK: lock
-; CHECK-NEXT: orl {{.*}}, (%esp)
+; CHECK: lock orl {{.*}}, (%esp)
; CHECK-NEXT: testl [[REG:%e[a-z]+]], [[REG]]
if.then: ; preds = %entry
define void @test1(i64* %ptr, i64 %val1) {
; CHECK-LABEL: test1
-; CHECK: lock
-; CHECK-NEXT: cmpxchg8b
+; CHECK: lock cmpxchg8b
; CHECK-NEXT: jne
store atomic i64 %val1, i64* %ptr seq_cst, align 8
ret void
define i64 @test2(i64* %ptr) {
; CHECK-LABEL: test2
-; CHECK: lock
-; CHECK-NEXT: cmpxchg8b
+; CHECK: lock cmpxchg8b
%val = load atomic i64, i64* %ptr seq_cst, align 8
ret i64 %val
}
; LINUX: seta
; LINUX: cmovne
; LINUX: cmovne
-; LINUX: lock
-; LINUX-NEXT: cmpxchg8b
+; LINUX: lock cmpxchg8b
; LINUX: jne [[LABEL]]
%2 = atomicrmw min i64* @sc64, i64 6 acquire
; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]]
; LINUX: setb
; LINUX: cmovne
; LINUX: cmovne
-; LINUX: lock
-; LINUX-NEXT: cmpxchg8b
+; LINUX: lock cmpxchg8b
; LINUX: jne [[LABEL]]
%3 = atomicrmw umax i64* @sc64, i64 7 acquire
; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]]
; LINUX: seta
; LINUX: cmovne
; LINUX: cmovne
-; LINUX: lock
-; LINUX-NEXT: cmpxchg8b
+; LINUX: lock cmpxchg8b
; LINUX: jne [[LABEL]]
%4 = atomicrmw umin i64* @sc64, i64 8 acquire
; LINUX: [[LABEL:.LBB[0-9]+_[0-9]+]]
; LINUX: setb
; LINUX: cmovne
; LINUX: cmovne
-; LINUX: lock
-; LINUX-NEXT: cmpxchg8b
+; LINUX: lock cmpxchg8b
; LINUX: jne [[LABEL]]
ret void
}
%tmp = load i64*, i64** %p.addr, align 8
; CHECK-LABEL: t1:
; CHECK: movl $2147483648, %eax
-; CHECK: lock
-; CHECK-NEXT: orq %r{{.*}}, (%r{{.*}})
+; CHECK: lock orq %r{{.*}}, (%r{{.*}})
%0 = atomicrmw or i64* %tmp, i64 2147483648 seq_cst
ret void
}
store i64* %p, i64** %p.addr, align 8
%tmp = load i64*, i64** %p.addr, align 8
; CHECK-LABEL: t2:
-; CHECK: lock
-; CHECK-NEXT: orq $2147483644, (%r{{.*}})
+; CHECK: lock orq $2147483644, (%r{{.*}})
%0 = atomicrmw or i64* %tmp, i64 2147483644 seq_cst
ret void
}
define void @t1(i128* nocapture %p) nounwind ssp {
entry:
; CHECK: movl $1, %ebx
-; CHECK: lock
-; CHECK-NEXT: cmpxchg16b
+; CHECK: lock cmpxchg16b
%r = cmpxchg i128* %p, i128 0, i128 1 seq_cst seq_cst
ret void
}
define void @gst_atomic_queue_push(i32* %addr) {
; CHECK-LABEL: gst_atomic_queue_push:
; CHECK: movl (%eax), [[LHS:%e[a-z]+]]
-; CHECK: lock
-; CHECK-NEXT: orl
+; CHECK: lock orl
; CHECK: movl (%eax), [[RHS:%e[a-z]+]]
; CHECK: cmpl [[LHS]], [[RHS]]
define void @pr21099(i64* %p) {
; CHECK-LABEL: pr21099
-; CHECK: lock
-; CHECK-NEXT: addq $-2147483648
+; CHECK: lock addq $-2147483648
; This number is INT32_MIN: 0x80000000UL
%1 = atomicrmw add i64* %p, i64 -2147483648 seq_cst
ret void
; CHECK: [[LABEL1:\.?LBB[0-9]+_[0-9]+]]:
; CHECK: movsbl
; CHECK: cmpl
-; CHECK: lock
-; CHECK-NEXT: cmpxchgb
+; CHECK: lock cmpxchgb
; CHECK: jne [[LABEL1]]
%2 = atomicrmw min i8* @sc8, i8 6 acquire
; CHECK: [[LABEL3:\.?LBB[0-9]+_[0-9]+]]:
; CHECK: movsbl
; CHECK: cmpl
-; CHECK: lock
-; CHECK-NEXT: cmpxchgb
+; CHECK: lock cmpxchgb
; CHECK: jne [[LABEL3]]
%3 = atomicrmw umax i8* @sc8, i8 7 acquire
; CHECK: [[LABEL5:\.?LBB[0-9]+_[0-9]+]]:
; CHECK: movzbl
; CHECK: cmpl
-; CHECK: lock
-; CHECK-NEXT: cmpxchgb
+; CHECK: lock cmpxchgb
; CHECK: jne [[LABEL5]]
%4 = atomicrmw umin i8* @sc8, i8 8 acquire
; CHECK: [[LABEL7:\.?LBB[0-9]+_[0-9]+]]:
; CHECK: movzbl
; CHECK: cmpl
-; CHECK: lock
-; CHECK-NEXT: cmpxchgb
+; CHECK: lock cmpxchgb
; CHECK: jne [[LABEL7]]
ret void
}