Home | History | Annotate | Download | only in X86
      1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
      2 ;RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mattr=slow-incdec | FileCheck %s
      3 
      4 @var_21 = external constant i32, align 4
      5 @var_29 = external constant i8, align 1
      6 @var_390 = external global i32, align 4
      7 @var_11 = external constant i8, align 1
      8 @var_370 = external global i8, align 1
      9 
     10 ; Function Attrs: noinline nounwind optnone uwtable
     11 define void @_Z3foov() {
     12 ; CHECK-LABEL: _Z3foov:
     13 ; CHECK:       # %bb.0: # %entry
     14 ; CHECK-NEXT:    movsbl {{.*}}(%rip), %eax
     15 ; CHECK-NEXT:    negl %eax
     16 ; CHECK-NEXT:    cmpl %eax, {{.*}}(%rip)
     17 ; CHECK-NEXT:    setb %al
     18 ; CHECK-NEXT:    xorl %ecx, %ecx
     19 ; CHECK-NEXT:    addb $-1, %al
     20 ; CHECK-NEXT:    sete %cl
     21 ; CHECK-NEXT:    movl %ecx, {{.*}}(%rip)
     22 ; CHECK-NEXT:    movb {{.*}}(%rip), %al
     23 ; CHECK-NEXT:    movb %al, {{.*}}(%rip)
     24 ; CHECK-NEXT:    retq
     25 entry:
     26   %0 = load i32, i32* @var_21, align 4
     27   %1 = load i8, i8* @var_29, align 1
     28   %conv = sext i8 %1 to i32
     29   %sub = sub nsw i32 0, %conv
     30   %cmp = icmp ult i32 %0, %sub
     31   %conv1 = zext i1 %cmp to i32
     32   %add = add nsw i32 %conv1, -1
     33   %conv2 = trunc i32 %add to i8
     34   %tobool = icmp ne i8 %conv2, 0
     35   %lnot = xor i1 %tobool, true
     36   %conv3 = zext i1 %lnot to i32
     37   store i32 %conv3, i32* @var_390, align 4
     38   %2 = load i8, i8* @var_11, align 1
     39   %conv4 = sext i8 %2 to i16
     40   %conv5 = trunc i16 %conv4 to i8
     41   store i8 %conv5, i8* @var_370, align 1
     42   ret void
     43 }
     44