[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / AArch64 / GlobalISel / prelegalizercombiner-binop-same-val.mir
blob3c70c41719839a2551b5c4c88565a15a613bf2fe
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
4 name:            or_same
5 tracksRegLiveness: true
6 body:             |
7   bb.0:
8     liveins: $x0
10     ; Fold: x or x -> x
11     ; CHECK-LABEL: name: or_same
12     ; CHECK: liveins: $x0
13     ; CHECK: %copy:_(s64) = COPY $x0
14     ; CHECK: $x0 = COPY %copy(s64)
15     ; CHECK: RET_ReallyLR implicit $x0
16     %copy:_(s64) = COPY $x0
17     %or:_(s64) = G_OR %copy, %copy
18     $x0 = COPY %or(s64)
19     RET_ReallyLR implicit $x0
21 ...
22 ---
23 name:            and_same
24 tracksRegLiveness: true
25 body:             |
26   bb.0:
27     liveins: $x0
29     ; Fold: x and x -> x
31     ; CHECK-LABEL: name: and_same
32     ; CHECK: liveins: $x0
33     ; CHECK: %copy:_(s64) = COPY $x0
34     ; CHECK: $x0 = COPY %copy(s64)
35     ; CHECK: RET_ReallyLR implicit $x0
36     %copy:_(s64) = COPY $x0
37     %and:_(s64) = G_AND %copy, %copy
38     $x0 = COPY %and(s64)
39     RET_ReallyLR implicit $x0
41 ...
42 ---
43 name:            and_same2
44 tracksRegLiveness: true
45 body:             |
46   bb.0:
47     liveins: $x0, $x1
49     ; We can fold when the LHS and RHS are guaranteed to be identical.
51     ; CHECK-LABEL: name: and_same2
52     ; CHECK: liveins: $x0, $x1
53     ; CHECK: %copy1:_(s64) = COPY $x0
54     ; CHECK: %copy2:_(s64) = COPY $x1
55     ; CHECK: %or:_(s64) = G_OR %copy1, %copy2
56     ; CHECK: $x0 = COPY %or(s64)
57     ; CHECK: RET_ReallyLR implicit $x0
58     %copy1:_(s64) = COPY $x0
59     %copy2:_(s64) = COPY $x1
60     %or:_(s64) = G_OR %copy1, %copy2
61     %same_as_or:_(s64) = COPY %or(s64)
62     %and:_(s64) = G_AND %or, %same_as_or
63     $x0 = COPY %and(s64)
64     RET_ReallyLR implicit $x0
66 ...
67 ---
68 name:            or_and_not_same
69 tracksRegLiveness: true
70 body:             |
71   bb.0:
72     liveins: $x0, $x1, $x2
74     ; None of the G_ORs or G_ANDs should be eliminated here, because their LHS
75     ; and RHS values are different.
77     ; CHECK-LABEL: name: or_and_not_same
78     ; CHECK: liveins: $x0, $x1, $x2
79     ; CHECK: %copy1:_(s64) = COPY $x0
80     ; CHECK: %copy2:_(s64) = COPY $x1
81     ; CHECK: %copy3:_(s64) = COPY $x2
82     ; CHECK: %or1:_(s64) = G_OR %copy1, %copy2
83     ; CHECK: %or2:_(s64) = G_OR %copy1, %copy3
84     ; CHECK: %and:_(s64) = G_AND %or1, %or2
85     ; CHECK: $x0 = COPY %and(s64)
86     ; CHECK: RET_ReallyLR implicit $x0
87     %copy1:_(s64) = COPY $x0
88     %copy2:_(s64) = COPY $x1
89     %copy3:_(s64) = COPY $x2
90     %or1:_(s64) = G_OR %copy1, %copy2
91     %or2:_(s64) = G_OR %copy1, %copy3
92     %and:_(s64) = G_AND %or1, %or2
93     $x0 = COPY %and(s64)
94     RET_ReallyLR implicit $x0
96 ...