1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s
4 ; These tests use adc/sbb in place of set+add/sub. Should this transform
5 ; be enabled by micro-architecture rather than as part of generic lowering/isel?
7 ; <rdar://problem/8449754>
9 define i32 @test1(i32 %sum, i32 %x) nounwind readnone ssp {
12 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
13 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
14 ; CHECK-NEXT: movl %eax, %edx
15 ; CHECK-NEXT: addl %ecx, %edx
16 ; CHECK-NEXT: adcl %ecx, %eax
18 %add4 = add i32 %x, %sum
19 %cmp = icmp ult i32 %add4, %x
20 %inc = zext i1 %cmp to i32
21 %z.0 = add i32 %add4, %inc
25 ; <rdar://problem/12579915>
27 define i32 @test2(i32 %x, i32 %y, i32 %res) nounwind uwtable readnone ssp {
30 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax
31 ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx
32 ; CHECK-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
33 ; CHECK-NEXT: sbbl $0, %eax
35 %cmp = icmp ugt i32 %x, %y
36 %dec = sext i1 %cmp to i32
37 %dec.res = add nsw i32 %dec, %res