1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -run-pass=aarch64-postlegalizer-combiner -verify-machineinstrs -mtriple aarch64-unknown-unknown %s -o - | FileCheck %s
4 # select (c, x, x) -> x
5 name: test_combine_select_same_res
10 ; CHECK-LABEL: name: test_combine_select_same_res
11 ; CHECK: liveins: $x0, $x1
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
14 ; CHECK-NEXT: $x0 = COPY [[COPY]](s64)
17 %2:_(s64) = G_SELECT %1, %0, %0
21 # select (undef, x, y) -> y
22 name: test_combine_select_undef_res0_res1
27 ; CHECK-LABEL: name: test_combine_select_undef_res0_res1
28 ; CHECK: liveins: $x0, $x1
30 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1
31 ; CHECK-NEXT: $x0 = COPY [[COPY]](s64)
34 %2:_(s1) = G_IMPLICIT_DEF
35 %3:_(s64) = G_SELECT %2, %0, %1
39 # select (false, x, y) -> y
40 name: test_combine_select_false_res0_res1
45 ; CHECK-LABEL: name: test_combine_select_false_res0_res1
46 ; CHECK: liveins: $x0, $x1
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x1
49 ; CHECK-NEXT: $x0 = COPY [[COPY]](s64)
52 %2:_(s1) = G_CONSTANT i1 false
53 %3:_(s64) = G_SELECT %2, %0, %1
57 # select (true, x, y) -> x
58 name: test_combine_select_true_res0_res1
63 ; CHECK-LABEL: name: test_combine_select_true_res0_res1
64 ; CHECK: liveins: $x0, $x1
66 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
67 ; CHECK-NEXT: $x0 = COPY [[COPY]](s64)
70 %2:_(s1) = G_CONSTANT i1 true
71 %3:_(s64) = G_SELECT %2, %0, %1