aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AArch64/addcarry-crash.ll
blob: b4556c79865b596211cf722c7c01f0eac802bf8c (plain)
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
34
35
36
37
38
39
40
41
42
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s | FileCheck %s --check-prefixes=CHECK,CHECK-SD
; RUN: llc < %s -global-isel | FileCheck %s --check-prefixes=CHECK,CHECK-GI

target triple = "arm64-apple-ios7.0"

define i64 @foo(ptr nocapture readonly %ptr, i64 %a, i64 %b, i64 %c) local_unnamed_addr #0 {
; CHECK-SD-LABEL: foo:
; CHECK-SD:       ; %bb.0: ; %entry
; CHECK-SD-NEXT:    lsr x8, x1, #32
; CHECK-SD-NEXT:    ldr w9, [x0, #4]
; CHECK-SD-NEXT:    cmn x3, x2
; CHECK-SD-NEXT:    umull x8, w9, w8
; CHECK-SD-NEXT:    cinc x0, x8, hs
; CHECK-SD-NEXT:    ret
;
; CHECK-GI-LABEL: foo:
; CHECK-GI:       ; %bb.0: ; %entry
; CHECK-GI-NEXT:    ldr x8, [x0]
; CHECK-GI-NEXT:    lsr x9, x1, #32
; CHECK-GI-NEXT:    cmn x3, x2
; CHECK-GI-NEXT:    cset w10, hs
; CHECK-GI-NEXT:    lsr x8, x8, #32
; CHECK-GI-NEXT:    and x10, x10, #0x1
; CHECK-GI-NEXT:    umaddl x0, w8, w9, x10
; CHECK-GI-NEXT:    ret
entry:
  %0 = lshr i64 %a, 32
  %1 = load i64, ptr %ptr, align 8
  %2 = lshr i64 %1, 32
  %3 = mul nuw i64 %2, %0
  %4 = add i64 %c, %b
  %5 = icmp ult i64 %4, %c
  %6 = zext i1 %5 to i64
  %7 = add i64 %3, %6
  ret i64 %7
}

attributes #0 = { norecurse nounwind readonly }

;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}