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: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
12 ; CHECK: $x0 = COPY [[COPY]](s64)
15 %2:_(s64) = G_SELECT %1, %0, %0
19 # select (undef, x, y) -> y
20 name: test_combine_select_undef_res0_res1
25 ; CHECK-LABEL: name: test_combine_select_undef_res0_res1
26 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
27 ; CHECK: $x0 = COPY [[COPY]](s64)
30 %2:_(s1) = G_IMPLICIT_DEF
31 %3:_(s64) = G_SELECT %2, %0, %1
35 # select (false, x, y) -> y
36 name: test_combine_select_false_res0_res1
41 ; CHECK-LABEL: name: test_combine_select_false_res0_res1
42 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x1
43 ; CHECK: $x0 = COPY [[COPY]](s64)
46 %2:_(s1) = G_CONSTANT i1 false
47 %3:_(s64) = G_SELECT %2, %0, %1
51 # select (true, x, y) -> x
52 name: test_combine_select_true_res0_res1
57 ; CHECK-LABEL: name: test_combine_select_true_res0_res1
58 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
59 ; CHECK: $x0 = COPY [[COPY]](s64)
62 %2:_(s1) = G_CONSTANT i1 true
63 %3:_(s64) = G_SELECT %2, %0, %1