1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
7 tracksRegLiveness: true
11 ; CHECK-LABEL: name: legalize_s32
12 ; CHECK: liveins: $s0, $s1
14 ; CHECK-NEXT: %val:_(s32) = COPY $s0
15 ; CHECK-NEXT: %sign:_(s32) = COPY $s1
16 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
17 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR %val(s32), [[DEF]](s32)
18 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR %sign(s32), [[DEF]](s32)
19 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
20 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[C]](s32), [[C]](s32)
21 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 2147483647
22 ; CHECK-NEXT: [[BUILD_VECTOR3:%[0-9]+]]:_(<2 x s32>) = G_BUILD_VECTOR [[C1]](s32), [[C1]](s32)
23 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(<2 x s32>) = G_AND [[BUILD_VECTOR]], [[BUILD_VECTOR3]]
24 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(<2 x s32>) = G_AND [[BUILD_VECTOR1]], [[BUILD_VECTOR2]]
25 ; CHECK-NEXT: %6:_(<2 x s32>) = disjoint G_OR [[AND]], [[AND1]]
26 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES %6(<2 x s32>)
27 ; CHECK-NEXT: %fcopysign:_(s32) = COPY [[UV]](s32)
28 ; CHECK-NEXT: $s0 = COPY %fcopysign(s32)
29 ; CHECK-NEXT: RET_ReallyLR implicit $s0
30 %val:_(s32) = COPY $s0
31 %sign:_(s32) = COPY $s1
32 %fcopysign:_(s32) = G_FCOPYSIGN %val, %sign(s32)
33 $s0 = COPY %fcopysign(s32)
34 RET_ReallyLR implicit $s0
39 tracksRegLiveness: true
43 ; CHECK-LABEL: name: legalize_s64
44 ; CHECK: liveins: $d0, $d1
46 ; CHECK-NEXT: %val:_(s64) = COPY $d0
47 ; CHECK-NEXT: %sign:_(s64) = COPY $d1
48 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
49 ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR %val(s64), [[DEF]](s64)
50 ; CHECK-NEXT: [[BUILD_VECTOR1:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR %sign(s64), [[DEF]](s64)
51 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -9223372036854775808
52 ; CHECK-NEXT: [[BUILD_VECTOR2:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[C]](s64), [[C]](s64)
53 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 9223372036854775807
54 ; CHECK-NEXT: [[BUILD_VECTOR3:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[C1]](s64), [[C1]](s64)
55 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(<2 x s64>) = G_AND [[BUILD_VECTOR]], [[BUILD_VECTOR3]]
56 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(<2 x s64>) = G_AND [[BUILD_VECTOR1]], [[BUILD_VECTOR2]]
57 ; CHECK-NEXT: %6:_(<2 x s64>) = disjoint G_OR [[AND]], [[AND1]]
58 ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES %6(<2 x s64>)
59 ; CHECK-NEXT: %fcopysign:_(s64) = COPY [[UV]](s64)
60 ; CHECK-NEXT: $d0 = COPY %fcopysign(s64)
61 ; CHECK-NEXT: RET_ReallyLR implicit $d0
62 %val:_(s64) = COPY $d0
63 %sign:_(s64) = COPY $d1
64 %fcopysign:_(s64) = G_FCOPYSIGN %val, %sign(s64)
65 $d0 = COPY %fcopysign(s64)
66 RET_ReallyLR implicit $d0