1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -fast-isel -mtriple=x86_64-- < %s | FileCheck %s
4 define i32 @test(i64 %arg) nounwind {
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: subq $1, %rdi
9 ; CHECK-NEXT: xorl %eax, %eax
10 ; CHECK-NEXT: testb $1, %cl
11 ; CHECK-NEXT: movl %eax, {{[-0-9]+}}(%r{{[sb]}}p) # 4-byte Spill
12 ; CHECK-NEXT: jne .LBB0_2
13 ; CHECK-NEXT: # %bb.1: # %no_overflow
14 ; CHECK-NEXT: movl $1, %eax
15 ; CHECK-NEXT: movl %eax, {{[-0-9]+}}(%r{{[sb]}}p) # 4-byte Spill
16 ; CHECK-NEXT: jmp .LBB0_2
17 ; CHECK-NEXT: .LBB0_2: # %merge
18 ; CHECK-NEXT: movl {{[-0-9]+}}(%r{{[sb]}}p), %eax # 4-byte Reload
21 %usubo = tail call { i64, i1 } @llvm.usub.with.overflow.i64(i64 %arg, i64 1)
22 %overflow = extractvalue { i64, i1 } %usubo, 1
23 br i1 %overflow, label %merge, label %no_overflow
29 %phi = phi i32 [ 1, %no_overflow ], [ 0, %entry ]
33 declare { i64, i1 } @llvm.usub.with.overflow.i64(i64, i64)