2019-02-14 01:30:03 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
2017-08-02 08:28:10 +08:00
|
|
|
; RUN: llc < %s -mtriple=x86_64-- -verify-machineinstrs | FileCheck %s
|
|
|
|
; RUN: llc < %s -mtriple=x86_64-- -mattr=slow-incdec -verify-machineinstrs | FileCheck %s --check-prefix SLOW_INC
|
2009-07-30 16:33:02 +08:00
|
|
|
|
|
|
|
; rdar://7103704
|
|
|
|
|
|
|
|
define void @sub1(i32* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub1:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subl %esi, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub1:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subl %esi, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i32* %p, i32 %v monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @inc4(i64* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: inc4:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock incq (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: inc4:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addq $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i64* %p, i64 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add8(i64* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add8:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addq $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add8:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addq $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i64* %p, i64 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add4(i64* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add4:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: movslq %esi, %rax
|
|
|
|
; CHECK-NEXT: lock addq %rax, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add4:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: movslq %esi, %rax
|
|
|
|
; SLOW_INC-NEXT: lock addq %rax, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = sext i32 %v to i64 ; <i64> [#uses=1]
|
|
|
|
%1 = atomicrmw add i64* %p, i64 %0 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @inc3(i8* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: inc3:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock incb (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: inc3:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addb $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i8* %p, i8 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add7(i8* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add7:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addb $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add7:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addb $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i8* %p, i8 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add3(i8* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add3:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addb %sil, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add3:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addb %sil, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = trunc i32 %v to i8 ; <i8> [#uses=1]
|
|
|
|
%1 = atomicrmw add i8* %p, i8 %0 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @inc2(i16* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: inc2:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock incw (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: inc2:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addw $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i16* %p, i16 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add6(i16* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add6:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addw $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add6:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addw $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i16* %p, i16 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add2(i16* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add2:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addw %si, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add2:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addw %si, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2009-07-30 16:33:02 +08:00
|
|
|
%0 = trunc i32 %v to i16 ; <i16> [#uses=1]
|
2011-09-27 07:15:09 +08:00
|
|
|
%1 = atomicrmw add i16* %p, i16 %0 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @inc1(i32* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: inc1:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock incl (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: inc1:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addl $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i32* %p, i32 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add5(i32* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add5:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addl $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add5:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addl $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i32* %p, i32 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @add1(i32* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: add1:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock addl %esi, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: add1:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock addl %esi, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw add i32* %p, i32 %v monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @dec4(i64* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: dec4:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock decq (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: dec4:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subq $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i64* %p, i64 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub8(i64* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub8:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subq $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub8:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subq $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i64* %p, i64 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub4(i64* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub4:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: movslq %esi, %rax
|
|
|
|
; CHECK-NEXT: lock subq %rax, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub4:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: movslq %esi, %rax
|
|
|
|
; SLOW_INC-NEXT: lock subq %rax, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2009-07-30 16:33:02 +08:00
|
|
|
%0 = sext i32 %v to i64 ; <i64> [#uses=1]
|
2011-09-27 07:15:09 +08:00
|
|
|
%1 = atomicrmw sub i64* %p, i64 %0 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @dec3(i8* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: dec3:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock decb (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: dec3:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subb $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i8* %p, i8 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub7(i8* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub7:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subb $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub7:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subb $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i8* %p, i8 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub3(i8* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub3:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subb %sil, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub3:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subb %sil, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2009-07-30 16:33:02 +08:00
|
|
|
%0 = trunc i32 %v to i8 ; <i8> [#uses=1]
|
2011-09-27 07:15:09 +08:00
|
|
|
%1 = atomicrmw sub i8* %p, i8 %0 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @dec2(i16* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: dec2:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock decw (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: dec2:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subw $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i16* %p, i16 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub6(i16* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub6:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subw $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub6:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subw $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i16* %p, i16 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub2(i16* nocapture %p, i32 %v) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub2:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subw %si, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub2:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subw %si, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2009-07-30 16:33:02 +08:00
|
|
|
%0 = trunc i32 %v to i16 ; <i16> [#uses=1]
|
2011-09-27 07:15:09 +08:00
|
|
|
%1 = atomicrmw sub i16* %p, i16 %0 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @dec1(i32* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: dec1:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock decl (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
2014-10-09 07:16:23 +08:00
|
|
|
; SLOW_INC-LABEL: dec1:
|
2019-02-14 01:30:03 +08:00
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subl $1, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i32* %p, i32 1 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define void @sub5(i32* nocapture %p) nounwind ssp {
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: sub5:
|
2019-02-14 01:30:03 +08:00
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lock subl $2, (%rdi)
|
|
|
|
; CHECK-NEXT: retq
|
|
|
|
;
|
|
|
|
; SLOW_INC-LABEL: sub5:
|
|
|
|
; SLOW_INC: # %bb.0: # %entry
|
|
|
|
; SLOW_INC-NEXT: lock subl $2, (%rdi)
|
|
|
|
; SLOW_INC-NEXT: retq
|
|
|
|
entry:
|
2011-09-27 07:15:09 +08:00
|
|
|
%0 = atomicrmw sub i32* %p, i32 2 monotonic
|
|
|
|
ret void
|
2009-07-30 16:33:02 +08:00
|
|
|
}
|