File: pr49587.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (33 lines) | stat: -rw-r--r-- 1,100 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -O0 -fast-isel -mtriple=x86_64-- < %s | FileCheck %s

define i32 @test(i64 %arg) nounwind {
; CHECK-LABEL: test:
; CHECK:       # %bb.0: # %entry
; CHECK-NEXT:    subq $1, %rdi
; CHECK-NEXT:    setb %cl
; CHECK-NEXT:    xorl %eax, %eax
; CHECK-NEXT:    testb $1, %cl
; CHECK-NEXT:    movl %eax, {{[-0-9]+}}(%r{{[sb]}}p) # 4-byte Spill
; CHECK-NEXT:    jne .LBB0_2
; CHECK-NEXT:  # %bb.1: # %no_overflow
; CHECK-NEXT:    movl $1, %eax
; CHECK-NEXT:    movl %eax, {{[-0-9]+}}(%r{{[sb]}}p) # 4-byte Spill
; CHECK-NEXT:    jmp .LBB0_2
; CHECK-NEXT:  .LBB0_2: # %merge
; CHECK-NEXT:    movl {{[-0-9]+}}(%r{{[sb]}}p), %eax # 4-byte Reload
; CHECK-NEXT:    retq
entry:
  %usubo = tail call { i64, i1 } @llvm.usub.with.overflow.i64(i64 %arg, i64 1)
  %overflow = extractvalue { i64, i1 } %usubo, 1
  br i1 %overflow, label %merge, label %no_overflow

no_overflow:
  br label %merge

merge:
  %phi = phi i32 [ 1, %no_overflow ], [ 0, %entry ]
  ret i32 %phi
}

declare { i64, i1 } @llvm.usub.with.overflow.i64(i64, i64)