1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -global-isel -verify-machineinstrs %s -o - | FileCheck %s
7 tracksRegLiveness: true
10 ; CHECK-LABEL: name: test
11 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
12 ; CHECK-NEXT: $w0 = COPY [[C]](s32)
13 ; CHECK-NEXT: RET_ReallyLR implicit $w0
14 %0:_(s16) = G_CONSTANT i16 0
15 %2:_(s1) = G_CONSTANT i1 true
16 %1:_(s1) = G_ICMP intpred(sge), %0(s16), %0
17 %3:_(s8) = G_SEXT %2(s1)
18 %4:_(s32) = G_SEXT %3(s8)
19 %5:_(s32) = G_SEXT %1(s1)
20 %6:_(s32) = G_UDIV %4, %5
21 %7:_(s32) = COPY %5(s32)
22 %8:_(s32) = G_SEXT %2(s1)
23 %9:_(s32) = G_UREM %7, %8
24 %10:_(s8) = G_TRUNC %9(s32)
25 %11:_(s64) = G_ZEXT %6(s32)
26 %12:_(s64) = G_SEXT %10(s8)
27 %13:_(s64) = G_OR %11, %12
28 %14:_(s32) = G_TRUNC %13(s64)
30 RET_ReallyLR implicit $w0
34 # Check with the div and rem the other way around
36 name: test_inverted_div_rem
38 tracksRegLiveness: true
41 ; CHECK-LABEL: name: test_inverted_div_rem
42 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
43 ; CHECK-NEXT: $w0 = COPY [[C]](s32)
44 ; CHECK-NEXT: RET_ReallyLR implicit $w0
45 %0:_(s16) = G_CONSTANT i16 0
46 %2:_(s1) = G_CONSTANT i1 true
47 %1:_(s1) = G_ICMP intpred(sge), %0(s16), %0
48 %3:_(s8) = G_SEXT %2(s1)
49 %4:_(s32) = G_SEXT %3(s8)
50 %5:_(s32) = G_SEXT %1(s1)
51 %6:_(s32) = G_UREM %4, %5
52 %7:_(s32) = COPY %5(s32)
53 %8:_(s32) = G_SEXT %2(s1)
54 %9:_(s32) = G_UDIV %7, %8
55 %10:_(s8) = G_TRUNC %9(s32)
56 %11:_(s64) = G_ZEXT %6(s32)
57 %12:_(s64) = G_SEXT %10(s8)
58 %13:_(s64) = G_OR %11, %12
59 %14:_(s32) = G_TRUNC %13(s64)
61 RET_ReallyLR implicit $w0