[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / CodeGen / AArch64 / GlobalISel / prelegalizercombiner-not-really-equiv-insts.mir
blobb8187de6157bb253d84943ee0995cecac8f7e181
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 --- |
5   @g = external hidden unnamed_addr global i32, align 4
6   define void @not_necessarily_equiv_loads() { ret void }
7   define void @invariant_loads() { ret void }
8   define void @both_have_to_be_invariant() { ret void }
9 ...
10 ---
11 name:            not_necessarily_equiv_loads
12 tracksRegLiveness: true
13 machineFunctionInfo: {}
14 body:             |
15   bb.0:
17     ; %load1 || %load2 == %load1 is not necessarily true, even though they
18     ; both load from the same address. Whatever is in that address may be
19     ; changed by another instruction which appears between them.
20     ;
21     ; Check that we don't remove the G_OR.
23     ; CHECK-LABEL: name: not_necessarily_equiv_loads
24     ; CHECK: %ptr:_(p0) = G_GLOBAL_VALUE @g
25     ; CHECK: %load1:_(s32) = G_LOAD %ptr(p0) :: (load (s32) from @g)
26     ; CHECK: %load2:_(s32) = G_LOAD %ptr(p0) :: (load (s32) from @g)
27     ; CHECK: %or:_(s32) = G_OR %load2, %load1
28     ; CHECK: G_STORE %or(s32), %ptr(p0) :: (store (s32) into @g)
29     ; CHECK: RET_ReallyLR
30     %ptr:_(p0) = G_GLOBAL_VALUE @g
31     %load1:_(s32) = G_LOAD %ptr(p0) :: (load (s32) from @g)
32     %load2:_(s32) = G_LOAD %ptr(p0) :: (load (s32) from @g)
33     %or:_(s32) = G_OR %load2, %load1
34     G_STORE %or(s32), %ptr(p0) :: (store (s32) into @g)
35     RET_ReallyLR
37 ...
38 ---
39 name:            invariant_loads
40 tracksRegLiveness: true
41 machineFunctionInfo: {}
42 body:             |
43   bb.0:
45     ; %load1 || %load2 == %load1 is fine here, because the loads are invariant.
47     ; CHECK-LABEL: name: invariant_loads
48     ; CHECK: %ptr:_(p0) = G_GLOBAL_VALUE @g
49     ; CHECK: %load2:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable invariant load (s32) from @g)
50     ; CHECK: G_STORE %load2(s32), %ptr(p0) :: (store (s32) into @g)
51     ; CHECK: RET_ReallyLR
52     %ptr:_(p0) = G_GLOBAL_VALUE @g
53     %load1:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable invariant load (s32) from @g)
54     %load2:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable invariant load (s32) from @g)
55     %or:_(s32) = G_OR %load2, %load1
56     G_STORE %or(s32), %ptr(p0) :: (store (s32) into @g)
57     RET_ReallyLR
59 ...
60 ---
61 name:            both_have_to_be_invariant
62 tracksRegLiveness: true
63 machineFunctionInfo: {}
64 body:             |
65   bb.0:
67     ; We shouldn't combine here, because the loads both have to be invariant.
69     ; CHECK-LABEL: name: both_have_to_be_invariant
70     ; CHECK: %ptr:_(p0) = G_GLOBAL_VALUE @g
71     ; CHECK: %load1:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable invariant load (s32) from @g)
72     ; CHECK: %load2:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable load (s32) from @g)
73     ; CHECK: %or:_(s32) = G_OR %load2, %load1
74     ; CHECK: G_STORE %or(s32), %ptr(p0) :: (store (s32) into @g)
75     ; CHECK: RET_ReallyLR
76     %ptr:_(p0) = G_GLOBAL_VALUE @g
77     %load1:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable invariant load (s32) from @g)
78     %load2:_(s32) = G_LOAD %ptr(p0) :: (dereferenceable load (s32) from @g)
79     %or:_(s32) = G_OR %load2, %load1
80     G_STORE %or(s32), %ptr(p0) :: (store (s32) into @g)
81     RET_ReallyLR
82 ...