1 ; RUN: llc < %s -march=x86-64 -verify-machineinstrs | FileCheck %s
2 ; RUN: llc < %s -march=x86-64 -mattr=slow-incdec -verify-machineinstrs | FileCheck %s --check-prefix SLOW_INC
6 define void @sub1(i32* nocapture %p, i32 %v) nounwind ssp {
10 %0 = atomicrmw sub i32* %p, i32 %v monotonic
14 define void @inc4(i64* nocapture %p) nounwind ssp {
18 ; SLOW_INC-LABEL: inc4:
20 %0 = atomicrmw add i64* %p, i64 1 monotonic
24 define void @add8(i64* nocapture %p) nounwind ssp {
28 %0 = atomicrmw add i64* %p, i64 2 monotonic
32 define void @add4(i64* nocapture %p, i32 %v) nounwind ssp {
36 %0 = sext i32 %v to i64 ; <i64> [#uses=1]
37 %1 = atomicrmw add i64* %p, i64 %0 monotonic
41 define void @inc3(i8* nocapture %p) nounwind ssp {
45 ; SLOW_INC-LABEL: inc3:
47 %0 = atomicrmw add i8* %p, i8 1 monotonic
51 define void @add7(i8* nocapture %p) nounwind ssp {
55 %0 = atomicrmw add i8* %p, i8 2 monotonic
59 define void @add3(i8* nocapture %p, i32 %v) nounwind ssp {
63 %0 = trunc i32 %v to i8 ; <i8> [#uses=1]
64 %1 = atomicrmw add i8* %p, i8 %0 monotonic
68 define void @inc2(i16* nocapture %p) nounwind ssp {
72 ; SLOW_INC-LABEL: inc2:
74 %0 = atomicrmw add i16* %p, i16 1 monotonic
78 define void @add6(i16* nocapture %p) nounwind ssp {
82 %0 = atomicrmw add i16* %p, i16 2 monotonic
86 define void @add2(i16* nocapture %p, i32 %v) nounwind ssp {
90 %0 = trunc i32 %v to i16 ; <i16> [#uses=1]
91 %1 = atomicrmw add i16* %p, i16 %0 monotonic
95 define void @inc1(i32* nocapture %p) nounwind ssp {
99 ; SLOW_INC-LABEL: inc1:
101 %0 = atomicrmw add i32* %p, i32 1 monotonic
105 define void @add5(i32* nocapture %p) nounwind ssp {
109 %0 = atomicrmw add i32* %p, i32 2 monotonic
113 define void @add1(i32* nocapture %p, i32 %v) nounwind ssp {
117 %0 = atomicrmw add i32* %p, i32 %v monotonic
121 define void @dec4(i64* nocapture %p) nounwind ssp {
125 ; SLOW_INC-LABEL: dec4:
127 %0 = atomicrmw sub i64* %p, i64 1 monotonic
131 define void @sub8(i64* nocapture %p) nounwind ssp {
135 %0 = atomicrmw sub i64* %p, i64 2 monotonic
139 define void @sub4(i64* nocapture %p, i32 %v) nounwind ssp {
143 %0 = sext i32 %v to i64 ; <i64> [#uses=1]
144 %1 = atomicrmw sub i64* %p, i64 %0 monotonic
148 define void @dec3(i8* nocapture %p) nounwind ssp {
152 ; SLOW_INC-LABEL: dec3:
154 %0 = atomicrmw sub i8* %p, i8 1 monotonic
158 define void @sub7(i8* nocapture %p) nounwind ssp {
162 %0 = atomicrmw sub i8* %p, i8 2 monotonic
166 define void @sub3(i8* nocapture %p, i32 %v) nounwind ssp {
170 %0 = trunc i32 %v to i8 ; <i8> [#uses=1]
171 %1 = atomicrmw sub i8* %p, i8 %0 monotonic
175 define void @dec2(i16* nocapture %p) nounwind ssp {
179 ; SLOW_INC-LABEL: dec2:
181 %0 = atomicrmw sub i16* %p, i16 1 monotonic
185 define void @sub6(i16* nocapture %p) nounwind ssp {
189 %0 = atomicrmw sub i16* %p, i16 2 monotonic
193 define void @sub2(i16* nocapture %p, i32 %v) nounwind ssp {
198 %0 = trunc i32 %v to i16 ; <i16> [#uses=1]
199 %1 = atomicrmw sub i16* %p, i16 %0 monotonic
203 define void @dec1(i32* nocapture %p) nounwind ssp {
207 ; SLOW_INC-LABEL: dec1:
209 %0 = atomicrmw sub i32* %p, i32 1 monotonic
213 define void @sub5(i32* nocapture %p) nounwind ssp {
217 %0 = atomicrmw sub i32* %p, i32 2 monotonic