2017-03-04 00:34:35 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s
|
|
|
|
|
2017-03-13 02:28:48 +08:00
|
|
|
; These tests use adc/sbb in place of set+add/sub. Should this transform
|
|
|
|
; be enabled by micro-architecture rather than as part of generic lowering/isel?
|
|
|
|
|
2010-09-22 02:41:19 +08:00
|
|
|
; <rdar://problem/8449754>
|
|
|
|
|
2010-12-20 06:08:31 +08:00
|
|
|
define i32 @test1(i32 %sum, i32 %x) nounwind readnone ssp {
|
2013-07-14 04:38:47 +08:00
|
|
|
; CHECK-LABEL: test1:
|
2017-03-04 00:34:35 +08:00
|
|
|
; CHECK: # BB#0:
|
2017-06-01 18:42:39 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
2017-03-04 00:34:35 +08:00
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
|
2017-06-01 18:42:39 +08:00
|
|
|
; CHECK-NEXT: movl %eax, %edx
|
|
|
|
; CHECK-NEXT: addl %ecx, %edx
|
|
|
|
; CHECK-NEXT: adcl %ecx, %eax
|
2017-03-04 00:34:35 +08:00
|
|
|
; CHECK-NEXT: retl
|
2015-04-11 05:07:09 +08:00
|
|
|
%add4 = add i32 %x, %sum
|
|
|
|
%cmp = icmp ult i32 %add4, %x
|
2010-12-20 06:08:31 +08:00
|
|
|
%inc = zext i1 %cmp to i32
|
2015-04-11 05:07:09 +08:00
|
|
|
%z.0 = add i32 %add4, %inc
|
2010-12-20 06:08:31 +08:00
|
|
|
ret i32 %z.0
|
|
|
|
}
|
|
|
|
|
2012-11-01 07:11:48 +08:00
|
|
|
; <rdar://problem/12579915>
|
2017-03-04 00:34:35 +08:00
|
|
|
|
2015-04-11 05:07:09 +08:00
|
|
|
define i32 @test2(i32 %x, i32 %y, i32 %res) nounwind uwtable readnone ssp {
|
2017-03-04 00:34:35 +08:00
|
|
|
; CHECK-LABEL: test2:
|
|
|
|
; CHECK: # BB#0:
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
|
|
|
|
; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; CHECK-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
|
|
|
|
; CHECK-NEXT: sbbl $0, %eax
|
|
|
|
; CHECK-NEXT: retl
|
2012-11-01 07:11:48 +08:00
|
|
|
%cmp = icmp ugt i32 %x, %y
|
|
|
|
%dec = sext i1 %cmp to i32
|
|
|
|
%dec.res = add nsw i32 %dec, %res
|
|
|
|
ret i32 %dec.res
|
|
|
|
}
|
2017-03-04 00:34:35 +08:00
|
|
|
|