1test alias-analysis
2set opt_level=speed
3target aarch64
4
5;; Test that extension modes are properly accounted for when deciding
6;; whether loads alias.
7
8function %f0(i64 vmctx, i32) -> i32, i32, i32, i64, i64, i64 {
9    gv0 = vmctx
10    gv1 = load.i64 notrap readonly aligned gv0+8
11
12block0(v0: i64, v1: i32):
13    v2 = global_value.i64 gv1
14
15    ;; Initial load. This will not be reused by anything below, even
16    ;; though it does access the same address.
17    v3 = load.i32 v2+8
18
19    ;; These loads must remain (must not be removed as redundant).
20    v4 = uload8.i32 v2+8
21    ; check: v4 = uload8.i32 v2+8
22    v5 = sload8.i32 v2+8
23    ; check: v5 = sload8.i32 v2+8
24    v6 = load.i64 v2+8
25    ; check: v6 = load.i64 v2+8
26
27    ;; 8-bit store only partially overwrites the address.
28    istore8 v6, v2+8
29
30    ;; This must not pick up the store data.
31    v7 = load.i64 v2+8
32    ; check: v7 = load.i64 v2+8
33
34    ;; Another store, this one non-truncating but actually using an
35    ;; `i8` value.
36    v8 = iconst.i8 123
37    store.i8 v8, v2+8
38
39    v9 = load.i64 v2+8
40    ; check: v9 = load.i64 v2+8
41
42    return v3, v4, v5, v6, v7, v9
43}
44