; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-attributes --check-globals --version 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
; 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
; REQUIRES: asserts
@globalBytes = internal global [1024 x i8] zeroinitializer
; CHECK: Accesses by bin after update:
; CHECK: [8-12] : 2
; CHECK: - 9 - store i32 %0, ptr %field2, align 4
; CHECK: - c: %0 = load i32, ptr %val, align 4
; CHECK: - 6 - %ret = load i32, ptr %x, align 4
; CHECK: - c: <unknown>
; CHECK: [32-36] : 2
; CHECK: - 9 - store i32 %1, ptr %field8, align 4
; CHECK: - c: %1 = load i32, ptr %val2, align 4
; CHECK: - 6 - %ret = load i32, ptr %x, align 4
; CHECK: - c: <unknown>
define dso_local i32 @phi_different_offsets(ptr nocapture %val, ptr nocapture %val2, i1 %cmp) {
entry:
br i1 %cmp, label %then, label %else
then:
%field2 = getelementptr i32, ptr @globalBytes, i32 2
%1 = load i32, ptr %val
store i32 %1, ptr %field2
br label %end
else:
%field8 = getelementptr i32, ptr @globalBytes, i32 8
%2 = load i32, ptr %val2
store i32 %2, ptr %field8
br label %end
end:
%x = phi ptr [ %field2, %then ], [ %field8, %else ]
%ret = load i32, ptr %x
ret i32 %ret
}