With opaque pointers, we cannot use the pointer element type to determine the LocationSize for the AA query. Instead, -aa-eval tests are now required to have an explicit load or store for any pointer they want to compute alias results for, and the load/store types are used to determine the location size. This may affect ordering of results, and sorting within one result, as the type is not considered part of the sorted string anymore. To somewhat minimize the churn, printing still uses faux typed pointer notation.
35 lines
788 B
LLVM
35 lines
788 B
LLVM
; This testcase ensures that CFL AA handles trivial cases with storing
|
|
; pointers in pointers appropriately.
|
|
; Derived from:
|
|
; char a, b;
|
|
; char *m = &a, *n = &b;
|
|
; *m;
|
|
; *n;
|
|
|
|
; RUN: opt < %s -aa-pipeline=cfl-steens-aa -passes=aa-eval -print-may-aliases -disable-output 2>&1 | FileCheck %s
|
|
|
|
%T = type { i32, [10 x i8] }
|
|
|
|
; CHECK: Function: test
|
|
|
|
define void @test() {
|
|
; CHECK: 15 Total Alias Queries Performed
|
|
; CHECK: 13 no alias responses
|
|
%M = alloca %T*, align 8
|
|
%N = alloca %T*, align 8
|
|
%A = alloca %T, align 8
|
|
%B = alloca %T, align 8
|
|
|
|
store %T* %A, %T** %M
|
|
store %T* %B, %T** %N
|
|
|
|
%AP = load %T*, %T** %M ; PartialAlias with %A
|
|
%BP = load %T*, %T** %N ; PartialAlias with %B
|
|
load %T, %T* %A
|
|
load %T, %T* %B
|
|
load %T, %T* %AP
|
|
load %T, %T* %BP
|
|
|
|
ret void
|
|
}
|