1; RUN: opt -basicaa -print-alias-sets -alias-set-saturation-threshold=2 -S -o - < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=NOSAT 2; RUN: opt -basicaa -print-alias-sets -alias-set-saturation-threshold=1 -S -o - < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=SAT 3 4; CHECK-LABEL: 'allmust' 5; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %a, 4) 6; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %b, 4) 7; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %c, 4) 8; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %d, 4) 9define void @allmust() { 10 %a = alloca i32 11 %b = alloca i32 12 %c = alloca i32 13 %d = alloca i32 14 store i32 1, i32* %a 15 store i32 2, i32* %b 16 store i32 3, i32* %c 17 store i32 4, i32* %d 18 ret void 19} 20 21; CHECK-LABEL :'mergemay' 22; NOSAT: AliasSet[{{.*}}, 2] may alias, Mod Pointers: (i32* %a, 4), (i32* %a1, 4) 23; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %b, 4) 24; SAT: AliasSet[{{.*}}, 2] may alias, Mod forwarding to 0x[[FWD:[0-9a-f]*]] 25; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD]] 26; SAT: AliasSet[0x[[FWD]], 2] may alias, Mod/Ref Pointers: (i32* %a, 4), (i32* %a1, 4), (i32* %b, 4) 27define void @mergemay(i32 %k) { 28 %a = alloca i32 29 %b = alloca i32 30 store i32 1, i32* %a 31 store i32 2, i32* %b 32 %a1 = getelementptr i32, i32 *%a, i32 %k 33 store i32 2, i32* %a1 34 ret void 35} 36 37; CHECK-LABEL: 'mergemust' 38; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %a, 4) 39; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Pointers: (i32* %b, 4) 40; NOSAT: AliasSet[{{.*}}, 2] may alias, Mod Pointers: (i32* %c, 4), (i32* %d, 4) 41; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD:[0-9a-f]*]] 42; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD]] 43; SAT: AliasSet[{{.*}}, 2] may alias, Mod forwarding to 0x[[FWD]] 44; SAT: AliasSet[0x[[FWD]], 3] may alias, Mod/Ref Pointers: (i32* %a, 4), (i32* %b, 4), (i32* %c, 4), (i32* %d, 4) 45define void @mergemust(i32* %c, i32* %d) { 46 %a = alloca i32 47 %b = alloca i32 48 store i32 1, i32* %a 49 store i32 2, i32* %b 50 store i32 3, i32* %c 51 store i32 4, i32* %d 52 ret void 53} 54