brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · fe38a57 Raw
80 lines · plain
1; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s2@G = global [10 x i32] zeroinitializer, align 43 4define void @select_in_gep1(i1 %c, i64 %x) {5entry:6; CHECK-LABEL: Function: select_in_gep17; CHECK: NoAlias: i32* %arrayidx1, i32* %arrayidx28  %add1_ = add nsw i64 %x, 19  %add2_ = add nsw i64 %x, 210  %select_ = select i1 %c, i64 %add1_, i64 %add2_11  %arrayidx1 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select_12  store i32 42, ptr %arrayidx1, align 413  %arrayidx2 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %x14  store i32 43, ptr %arrayidx2, align 415  ret void16}17 18define void @select_in_gep2(i1 %c, i64 %x) {19entry:20  ; TODO: should be "NoAlias" here as well.21; CHECK-LABEL: Function: select_in_gep222; CHECK: MayAlias:     i32* %arrayidx1, i32* %arrayidx223  %add1_ = add nsw i64 %x, 124  %add2_ = add nsw i64 %x, 225  %add3_ = add nsw i64 %x, 326  %select_ = select i1 %c, i64 %add1_, i64 %add2_27  %arrayidx1 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select_28  store i32 42, ptr %arrayidx1, align 429  %arrayidx2 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %add3_30  store i32 43, ptr %arrayidx2, align 431  ret void32}33 34define void @two_selects_in_gep_same_cond(i1 %c, i64 %x) {35entry:36; CHECK-LABEL: Function: two_selects_in_gep_same_cond37; CHECK: NoAlias: i32* %arrayidx1, i32* %arrayidx238  %add1_ = add nsw i64 %x, 139  %add2_ = add nsw i64 %x, 240  %select1_ = select i1 %c, i64 %x, i64 %add1_41  %select2_ = select i1 %c, i64 %add2_, i64 %x42  %arrayidx1 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select1_43  store i32 42, ptr %arrayidx1, align 444  %arrayidx2 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select2_45  store i32 43, ptr %arrayidx2, align 446  ret void47}48 49define void @two_selects_in_gep_different_cond1(i1 %c1, i1 %c2, i64 %x) {50entry:51; CHECK-LABEL: Function: two_selects_in_gep_different_cond152; CHECK: NoAlias: i32* %arrayidx1, i32* %arrayidx253  %add1_ = add nsw i64 %x, 154  %add2_ = add nsw i64 %x, 255  %add3_ = add nsw i64 %x, 356  %add4_ = add nsw i64 %x, 457  %select1_ = select i1 %c1, i64 %add1_, i64 %add2_58  %select2_ = select i1 %c2, i64 %add3_, i64 %add4_59  %arrayidx1 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select1_60  store i32 42, ptr %arrayidx1, align 461  %arrayidx2 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select2_62  store i32 43, ptr %arrayidx2, align 463  ret void64}65 66define void @two_selects_in_gep_different_cond2(i1 %c1, i1 %c2, i64 %x) {67entry:68; CHECK-LABEL: Function: two_selects_in_gep_different_cond269; CHECK: MayAlias: i32* %arrayidx1, i32* %arrayidx270  %add1_ = add nsw i64 %x, 171  %add2_ = add nsw i64 %x, 272  %select1_ = select i1 %c1, i64 %x, i64 %add1_73  %select2_ = select i1 %c2, i64 %x, i64 %add2_74  %arrayidx1 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select1_75  store i32 42, ptr %arrayidx1, align 476  %arrayidx2 = getelementptr inbounds [10 x i32], ptr @G, i64 0, i64 %select2_77  store i32 43, ptr %arrayidx2, align 478  ret void79}80