1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes --check-globals
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
3 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,CGSCC
5 define void @_ZN6openmc13FilterBinIterC1ERKNS_5TallyERNS_8ParticleE(i1 %c1, i1 %c2) {
6 ; CHECK: Function Attrs: nofree norecurse nosync nounwind
7 ; CHECK-LABEL: define {{[^@]+}}@_ZN6openmc13FilterBinIterC1ERKNS_5TallyERNS_8ParticleE
8 ; CHECK-SAME: (i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR0:[0-9]+]] {
10 ; CHECK-NEXT: [[D_I_I_I_I:%.*]] = alloca [3 x double], align 8
11 ; CHECK-NEXT: br i1 [[C1]], label [[FOR_BODY_LR_PH_I:%.*]], label [[_ZN6OPENMC13FILTERBINITERC2ERKNS_5TALLYERNS_8PARTICLEE_INTERNALIZED_EXIT:%.*]]
12 ; CHECK: for.body.lr.ph.i:
13 ; CHECK-NEXT: [[PHI_CAST_I_I_I_I:%.*]] = ptrtoint ptr [[D_I_I_I_I]] to i64
14 ; CHECK-NEXT: br label [[FOR_BODY_I:%.*]]
16 ; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr inttoptr (i64 4 to ptr), align 4
17 ; CHECK-NEXT: [[CMP1_NOT_PEEL_I_I_I_I_I_I:%.*]] = icmp eq i32 [[TMP0]], 1
18 ; CHECK-NEXT: br i1 [[CMP1_NOT_PEEL_I_I_I_I_I_I]], label [[_ZNK6OPENMC6FILTER12GET_ALL_BINSERKNS_8PARTICLEENS_14TALLYESTIMATORERNS_11FILTERMATCHE_INTERNALIZED_EXIT_I:%.*]], label [[WHILE_COND_PEEL_NEXT_I_I_I_I_I_I:%.*]]
19 ; CHECK: while.cond.peel.next.i.i.i.i.i.i:
20 ; CHECK-NEXT: br label [[_ZNK6OPENMC6FILTER12GET_ALL_BINSERKNS_8PARTICLEENS_14TALLYESTIMATORERNS_11FILTERMATCHE_INTERNALIZED_EXIT_I]]
21 ; CHECK: _ZNK6openmc6Filter12get_all_binsERKNS_8ParticleENS_14TallyEstimatorERNS_11FilterMatchE.internalized.exit.i:
22 ; CHECK-NEXT: [[DOTLCSSA_I_I_I_I_I_I:%.*]] = phi i64 [ 0, [[FOR_BODY_I]] ], [ [[PHI_CAST_I_I_I_I]], [[WHILE_COND_PEEL_NEXT_I_I_I_I_I_I]] ]
23 ; CHECK-NEXT: store ptr null, ptr [[D_I_I_I_I]], align 8
24 ; CHECK-NEXT: [[ARRAYIDX92_I_I_I_I:%.*]] = getelementptr inbounds [3 x double], ptr [[D_I_I_I_I]], i64 0, i64 [[DOTLCSSA_I_I_I_I_I_I]]
25 ; CHECK-NEXT: [[TMP1:%.*]] = load double, ptr [[ARRAYIDX92_I_I_I_I]], align 8
26 ; CHECK-NEXT: store double [[TMP1]], ptr inttoptr (i64 16 to ptr), align 16
27 ; CHECK-NEXT: br i1 [[C2]], label [[FOR_BODY_I]], label [[_ZN6OPENMC13FILTERBINITERC2ERKNS_5TALLYERNS_8PARTICLEE_INTERNALIZED_EXIT]]
28 ; CHECK: _ZN6openmc13FilterBinIterC2ERKNS_5TallyERNS_8ParticleE.internalized.exit:
29 ; CHECK-NEXT: ret void
32 %d.i.i.i.i = alloca [3 x double], align 8
33 br i1 %c1, label %for.body.lr.ph.i, label %_ZN6openmc13FilterBinIterC2ERKNS_5TallyERNS_8ParticleE.internalized.exit
35 for.body.lr.ph.i: ; preds = %entry
36 %phi.cast.i.i.i.i = ptrtoint ptr %d.i.i.i.i to i64
40 %0 = load i32, ptr inttoptr (i64 4 to ptr), align 4
41 %idx.ext87.i.i.i.i = sext i32 %0 to i64
42 %add.ptr88.i.i.i.i = getelementptr inbounds double, ptr %d.i.i.i.i, i64 %idx.ext87.i.i.i.i
43 %cmp1.not.peel.i.i.i.i.i.i = icmp eq i32 %0, 1
44 br i1 %cmp1.not.peel.i.i.i.i.i.i, label %_ZNK6openmc6Filter12get_all_binsERKNS_8ParticleENS_14TallyEstimatorERNS_11FilterMatchE.internalized.exit.i, label %while.cond.peel.next.i.i.i.i.i.i
46 while.cond.peel.next.i.i.i.i.i.i: ; preds = %for.body.i
47 br label %_ZNK6openmc6Filter12get_all_binsERKNS_8ParticleENS_14TallyEstimatorERNS_11FilterMatchE.internalized.exit.i
49 _ZNK6openmc6Filter12get_all_binsERKNS_8ParticleENS_14TallyEstimatorERNS_11FilterMatchE.internalized.exit.i: ; preds = %while.cond.peel.next.i.i.i.i.i.i, %for.body.i
50 %.lcssa.i.i.i.i.i.i = phi i64 [ 0, %for.body.i ], [ %phi.cast.i.i.i.i, %while.cond.peel.next.i.i.i.i.i.i ]
51 store ptr null, ptr %d.i.i.i.i, align 8
52 %arrayidx92.i.i.i.i = getelementptr inbounds [3 x double], ptr %d.i.i.i.i, i64 0, i64 %.lcssa.i.i.i.i.i.i
53 %1 = load double, ptr %arrayidx92.i.i.i.i, align 8
54 store double %1, ptr inttoptr (i64 16 to ptr), align 16
55 br i1 %c2, label %for.body.i, label %_ZN6openmc13FilterBinIterC2ERKNS_5TallyERNS_8ParticleE.internalized.exit
57 _ZN6openmc13FilterBinIterC2ERKNS_5TallyERNS_8ParticleE.internalized.exit:
61 ; CHECK: attributes #[[ATTR0]] = { nofree norecurse nosync nounwind }
63 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: