1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals --version 2
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -debug-only=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s 2>&1 | FileCheck %s
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -debug-only=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s 2>&1 | FileCheck %s
7 @globalBytes = internal global [1024 x i8] zeroinitializer
9 ; CHECK: Accesses by bin after update:
11 ; CHECK: - 9 - store i32 %0, ptr %field2, align 4
12 ; CHECK: - c: %0 = load i32, ptr %val, align 4
13 ; CHECK: - 6 - %ret = load i32, ptr %x, align 4
14 ; CHECK: - c: <unknown>
16 ; CHECK: - 9 - store i32 %1, ptr %field8, align 4
17 ; CHECK: - c: %1 = load i32, ptr %val2, align 4
18 ; CHECK: - 6 - %ret = load i32, ptr %x, align 4
19 ; CHECK: - c: <unknown>
20 define dso_local i32 @phi_different_offsets(ptr nocapture %val, ptr nocapture %val2, i1 %cmp) {
22 br i1 %cmp, label %then, label %else
25 %field2 = getelementptr i32, ptr @globalBytes, i32 2
26 %1 = load i32, ptr %val
27 store i32 %1, ptr %field2
31 %field8 = getelementptr i32, ptr @globalBytes, i32 8
32 %2 = load i32, ptr %val2
33 store i32 %2, ptr %field8
37 %x = phi ptr [ %field2, %then ], [ %field8, %else ]
38 %ret = load i32, ptr %x