brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 27f5bbe Raw
52 lines · plain
1; RUN: opt -passes=print-alias-sets -alias-set-saturation-threshold=4 -S -o - < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=NOSAT2; RUN: opt -passes=print-alias-sets -alias-set-saturation-threshold=3 -S -o - < %s 2>&1 | FileCheck %s --check-prefix=CHECK --check-prefix=SAT3 4; CHECK-LABEL: 'nomerge'5; CHECK: AliasSet[{{.*}}, 1] must alias, Mod Memory locations: (ptr %a, LocationSize::precise(4))6; CHECK: AliasSet[{{.*}}, 2] may alias, Mod Memory locations: (ptr %b, LocationSize::precise(4)), (ptr %b1, LocationSize::precise(4))7define void @nomerge(i32 %k) {8  %a = alloca i329  %b = alloca [10 x i32]10  store i32 1, ptr %a11  store i32 2, ptr %b12  %b1 = getelementptr i32, ptr %b, i32 %k13  store i32 3, ptr %b114  ret void15}16 17; CHECK-LABEL: 'mergemay'18; NOSAT: AliasSet[{{.*}}, 3] may alias, Mod Memory locations: (ptr %a, LocationSize::precise(4)), (ptr %a1, LocationSize::precise(4)), (ptr %a2, LocationSize::precise(4))19; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Memory locations: (ptr %b, LocationSize::precise(4))20; SAT: AliasSet[{{.*}}, 3] may alias, Mod forwarding to 0x[[FWD:[0-9a-f]*]]21; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD]]22; SAT: AliasSet[0x[[FWD]], 2] may alias, Mod/Ref Memory locations: (ptr %a, LocationSize::precise(4)), (ptr %a1, LocationSize::precise(4)), (ptr %a2, LocationSize::precise(4)), (ptr %b, LocationSize::precise(4))23define void @mergemay(i32 %k, i32 %l) {24  %a = alloca i3225  %b = alloca i3226  store i32 1, ptr %a27  store i32 2, ptr %b28  %a1 = getelementptr i32, ptr %a, i32 %k29  store i32 2, ptr %a130  %a2 = getelementptr i32, ptr %a, i32 %l31  store i32 2, ptr %a232  ret void33}34 35; CHECK-LABEL: 'mergemust'36; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Memory locations: (ptr %a, LocationSize::precise(4))37; NOSAT: AliasSet[{{.*}}, 1] must alias, Mod Memory locations: (ptr %b, LocationSize::precise(4))38; NOSAT: AliasSet[{{.*}}, 2] may alias,  Mod Memory locations: (ptr %c, LocationSize::precise(4)), (ptr %d, LocationSize::precise(4))39; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD:[0-9a-f]*]]40; SAT: AliasSet[{{.*}}, 1] must alias, Mod forwarding to 0x[[FWD]]41; SAT: AliasSet[{{.*}}, 2] may alias,  Mod forwarding to 0x[[FWD]]42; SAT: AliasSet[0x[[FWD]], 3] may alias, Mod/Ref Memory locations: (ptr %a, LocationSize::precise(4)), (ptr %b, LocationSize::precise(4)), (ptr %c, LocationSize::precise(4)), (ptr %d, LocationSize::precise(4))43define void @mergemust(ptr %c, ptr %d) {44  %a = alloca i3245  %b = alloca i3246  store i32 1, ptr %a47  store i32 2, ptr %b48  store i32 3, ptr %c49  store i32 4, ptr %d50  ret void51}52