• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -disable-basicaa -cfl-steens-aa -aa-eval -print-all-alias-modref-info 2>&1 | FileCheck %s
2; When merging MustAlias and PartialAlias, merge to PartialAlias
3; instead of MayAlias.
4
5
6target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
7
8; FIXME: This could be PartialAlias but CFLSteensAA can't currently prove it
9; CHECK: MayAlias:  i16* %bigbase0, i8* %phi
10define i8 @test0(i1 %x) {
11entry:
12  %base = alloca i8, align 4
13  %baseplusone = getelementptr i8, i8* %base, i64 1
14  br i1 %x, label %red, label %green
15red:
16  br label %green
17green:
18  %phi = phi i8* [ %baseplusone, %red ], [ %base, %entry ]
19  store i8 0, i8* %phi
20
21  %bigbase0 = bitcast i8* %base to i16*
22  store i16 -1, i16* %bigbase0
23
24  %loaded = load i8, i8* %phi
25  ret i8 %loaded
26}
27
28; FIXME: This could be PartialAlias but CFLSteensAA can't currently prove it
29; CHECK: MayAlias:  i16* %bigbase1, i8* %sel
30define i8 @test1(i1 %x) {
31entry:
32  %base = alloca i8, align 4
33  %baseplusone = getelementptr i8, i8* %base, i64 1
34  %sel = select i1 %x, i8* %baseplusone, i8* %base
35  store i8 0, i8* %sel
36
37  %bigbase1 = bitcast i8* %base to i16*
38  store i16 -1, i16* %bigbase1
39
40  %loaded = load i8, i8* %sel
41  ret i8 %loaded
42}
43
44; Incoming pointer arguments should not be PartialAlias because we do not know their initial state
45; even if they are nocapture
46; CHECK: MayAlias:  double* %A, double* %Index
47define void @testr2(double* nocapture readonly %A, double* nocapture readonly %Index) {
48  %arrayidx22 = getelementptr inbounds double, double* %Index, i64 2
49  %1 = load double, double* %arrayidx22
50  %arrayidx25 = getelementptr inbounds double, double* %A, i64 2
51  %2 = load double, double* %arrayidx25
52  %mul26 = fmul double %1, %2
53  ret void
54}
55