1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-postlegalizer-combiner --aarch64postlegalizercombiner-only-enable-rule="mutate_anyext_to_zext" -verify-machineinstrs %s -o - | FileCheck %s
9 tracksRegLiveness: true
13 ; Scalars have 0 or 1, so we want a ZExt.
15 ; CHECK-LABEL: name: scalar_icmp
18 ; CHECK-NEXT: %copy:_(s64) = COPY $x0
19 ; CHECK-NEXT: %cst_1:_(s64) = G_CONSTANT i64 1
20 ; CHECK-NEXT: %icmp:_(s32) = G_ICMP intpred(eq), %copy(s64), %cst_1
21 ; CHECK-NEXT: %ext:_(s64) = G_ZEXT %icmp(s32)
22 ; CHECK-NEXT: $x0 = COPY %ext(s64)
23 ; CHECK-NEXT: RET_ReallyLR implicit $x0
24 %copy:_(s64) = COPY $x0
25 %cst_1:_(s64) = G_CONSTANT i64 1
26 %icmp:_(s32) = G_ICMP intpred(eq), %copy(s64), %cst_1
27 %ext:_(s64) = G_ANYEXT %icmp(s32)
29 RET_ReallyLR implicit $x0
36 tracksRegLiveness: true
40 ; Vectors have 0 or negative 1, so we don't produce a zext.
42 ; CHECK-LABEL: name: vector_icmp
43 ; CHECK: liveins: $x0, $d0
45 ; CHECK-NEXT: %copy:_(<2 x s32>) = COPY $d0
46 ; CHECK-NEXT: %cst_1:_(s32) = G_CONSTANT i32 1
47 ; CHECK-NEXT: %vec_cst_1:_(<2 x s32>) = G_BUILD_VECTOR %cst_1(s32), %cst_1(s32)
48 ; CHECK-NEXT: %icmp:_(<2 x s32>) = G_ICMP intpred(eq), %copy(<2 x s32>), %vec_cst_1
49 ; CHECK-NEXT: %ext:_(<2 x s64>) = G_ANYEXT %icmp(<2 x s32>)
50 ; CHECK-NEXT: $q0 = COPY %ext(<2 x s64>)
51 ; CHECK-NEXT: RET_ReallyLR implicit $q0
52 %copy:_(<2 x s32>) = COPY $d0
53 %cst_1:_(s32) = G_CONSTANT i32 1
54 %vec_cst_1:_(<2 x s32>) = G_BUILD_VECTOR %cst_1, %cst_1
55 %icmp:_(<2 x s32>) = G_ICMP intpred(eq), %copy(<2 x s32>), %vec_cst_1
56 %ext:_(<2 x s64>) = G_ANYEXT %icmp(<2 x s32>)
57 $q0 = COPY %ext(<2 x s64>)
58 RET_ReallyLR implicit $q0
64 tracksRegLiveness: true
68 ; Scalars have 0 or 1, so we want a ZExt.
70 ; CHECK-LABEL: name: scalar_fcmp
71 ; CHECK: liveins: $x0, $d0
73 ; CHECK-NEXT: %copy:_(s64) = COPY $d0
74 ; CHECK-NEXT: %cst_1:_(s64) = G_FCONSTANT double 1.000000e+00
75 ; CHECK-NEXT: %fcmp:_(s32) = G_FCMP intpred(eq), %copy(s64), %cst_1
76 ; CHECK-NEXT: %ext:_(s64) = G_ZEXT %fcmp(s32)
77 ; CHECK-NEXT: $x0 = COPY %ext(s64)
78 ; CHECK-NEXT: RET_ReallyLR implicit $x0
79 %copy:_(s64) = COPY $d0
80 %cst_1:_(s64) = G_FCONSTANT double 1.0
81 %fcmp:_(s32) = G_FCMP intpred(eq), %copy(s64), %cst_1
82 %ext:_(s64) = G_ANYEXT %fcmp(s32)
84 RET_ReallyLR implicit $x0