reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
; RUN: opt < %s -basicaa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s

; CHECK: Function: t1
; CHECK: NoAlias: i32* %gep1, i32* %gep2
define void @t1([8 x i32]* %p, i32 %addend, i32* %q) {
  %knownnonzero = load i32, i32* %q, !range !0
  %add = add nsw nuw i32 %addend, %knownnonzero
  %gep1 = getelementptr [8 x i32], [8 x i32]* %p, i32 2, i32 %addend
  %gep2 = getelementptr [8 x i32], [8 x i32]* %p, i32 2, i32 %add
  ret void
}

; CHECK: Function: t2
; CHECK: MayAlias: i32* %gep1, i32* %gep2
define void @t2([8 x i32]* %p, i32 %addend, i32* %q) {
  %knownnonzero = load i32, i32* %q, !range !0
  %add = add nsw nuw i32 %addend, %knownnonzero
  %gep1 = getelementptr [8 x i32], [8 x i32]* %p, i32 1, i32 %addend
  %gep2 = getelementptr [8 x i32], [8 x i32]* %p, i32 0, i32 %add
  ret void
}

; CHECK: Function: t3
; CHECK: MustAlias: i32* %gep1, i32* %gep2
define void @t3([8 x i32]* %p, i32 %addend, i32* %q) {
  %knownnonzero = load i32, i32* %q, !range !0
  %add = add nsw nuw i32 %addend, %knownnonzero
  %gep1 = getelementptr [8 x i32], [8 x i32]* %p, i32 0, i32 %add
  %gep2 = getelementptr [8 x i32], [8 x i32]* %p, i32 0, i32 %add
  ret void
}

; CHECK: Function: t4
; CHECK: MayAlias: i32* %gep1, i32* %gep2
define void @t4([8 x i32]* %p, i32 %addend, i32* %q) {
  %knownnonzero = load i32, i32* %q, !range !0
  %add = add nsw nuw i32 %addend, %knownnonzero
  %gep1 = getelementptr [8 x i32], [8 x i32]* %p, i32 1, i32 %addend
  %gep2 = getelementptr [8 x i32], [8 x i32]* %p, i32 %add, i32 %add
  ret void
}

; CHECK: Function: t5
; CHECK: MayAlias: i32* %gep2, i64* %bc
define void @t5([8 x i32]* %p, i32 %addend, i32* %q) {
  %knownnonzero = load i32, i32* %q, !range !0
  %add = add nsw nuw i32 %addend, %knownnonzero
  %gep1 = getelementptr [8 x i32], [8 x i32]* %p, i32 2, i32 %addend
  %gep2 = getelementptr [8 x i32], [8 x i32]* %p, i32 2, i32 %add
  %bc = bitcast i32* %gep1 to i64*
  ret void
}

!0 = !{ i32 1, i32 5 }