diff --git a/bench/abc/optimized/abcRec3.ll b/bench/abc/optimized/abcRec3.ll index 178fa224991..3eb0f096790 100644 --- a/bench/abc/optimized/abcRec3.ll +++ b/bench/abc/optimized/abcRec3.ll @@ -2744,16 +2744,14 @@ define void @Lms_ManPrintFuncStats(ptr noundef captures(none) %0) local_unnamed_ %.val32 = load ptr, ptr %20, align 8, !tbaa !42 %21 = getelementptr i8, ptr %17, i64 8 %.val34 = load ptr, ptr %21, align 8, !tbaa !48 - %22 = add nsw i32 %.val30, -1 + %22 = zext nneg i32 %.val30 to i64 + %.pre43 = load i32, ptr %.val32, align 4, !tbaa !43 %23 = add nsw i32 %.val30, -2 - %umin = tail call i32 @llvm.umin.i32(i32 %22, i32 %23) - %24 = add nuw nsw i32 %umin, 1 - %wide.trip.count = zext nneg i32 %24 to i64 - %.pre44 = load i32, ptr %.val32, align 4, !tbaa !43 + %umin = zext i32 %23 to i64 br label %25 25: ; preds = %.lr.ph, %25 - %26 = phi i32 [ %.pre44, %.lr.ph ], [ %28, %25 ] + %26 = phi i32 [ %.pre43, %.lr.ph ], [ %28, %25 ] %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %25 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %27 = getelementptr inbounds nuw i32, ptr %.val32, i64 %indvars.iv.next @@ -2771,8 +2769,10 @@ define void @Lms_ManPrintFuncStats(ptr noundef captures(none) %0) local_unnamed_ %38 = load i32, ptr %37, align 4, !tbaa !43 %39 = add nsw i32 %36, %38 store i32 %39, ptr %37, align 4, !tbaa !43 - %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond, label %.critedge.preheader.preheader, label %25, !llvm.loop !112 + %exitcond = icmp samesign uge i64 %indvars.iv.next, %22 + %41 = icmp eq i64 %indvars.iv, %24 + %or.cond = select i1 %40, i1 true, i1 %41 + br i1 %or.cond, label %.critedge.preheader.preheader, label %25, !llvm.loop !112 .critedge.preheader.preheader: ; preds = %25, %15 br label %.critedge.preheader diff --git a/bench/abc/optimized/bmcFx.ll b/bench/abc/optimized/bmcFx.ll index abec619b893..e7962705177 100644 --- a/bench/abc/optimized/bmcFx.ll +++ b/bench/abc/optimized/bmcFx.ll @@ -1008,12 +1008,9 @@ Vec_IntPush.exit.i: ; preds = %Vec_IntPush.exit.si br i1 %or.cond41.i, label %._crit_edge45.i, label %.lr.ph44.preheader.i .lr.ph44.preheader.i: ; preds = %._crit_edge.i - %217 = add nsw i32 %.val37.i, -1 - %218 = add i32 %2, -1 - %umin.i = tail call i32 @llvm.umin.i32(i32 %217, i32 %218) - %219 = add nuw nsw i32 %umin.i, 1 - %wide.trip.count.i = zext nneg i32 %219 to i64 - %220 = load ptr, ptr %16, align 8, !tbaa !32 + %217 = zext i32 %2 to i64 + %218 = zext nneg i32 %.val37.i to i64 + %umin.i = load ptr, ptr %16, align 8, !tbaa !32 br label %.lr.ph44.i .lr.ph44.i: ; preds = %229, %.lr.ph44.preheader.i @@ -1021,7 +1018,7 @@ Vec_IntPush.exit.i: ; preds = %Vec_IntPush.exit.si %221 = getelementptr inbounds nuw i32, ptr %214, i64 %indvars.iv.i %222 = load i32, ptr %221, align 4, !tbaa !11 %223 = sext i32 %222 to i64 - %224 = getelementptr inbounds %struct.Tab_Obj_t_, ptr %220, i64 %223, i32 2 + %224 = getelementptr inbounds %struct.Tab_Obj_t_, ptr %219, i64 %223, i32 2 %225 = load i64, ptr %224, align 4 %226 = trunc i64 %225 to i32 %227 = and i32 %226, 131071 @@ -1055,8 +1052,10 @@ Vec_IntPush.exit.i: ; preds = %Vec_IntPush.exit.si %252 = and i32 %251, 32767 tail call fastcc void @Vec_IntPushTwo(ptr noundef nonnull %168, i32 noundef %249, i32 noundef %252) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 - %exitcond.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i - br i1 %exitcond.i, label %._crit_edge45.i, label %.lr.ph44.i, !llvm.loop !41 + %exitcond.i = icmp samesign uge i64 %indvars.iv.next.i, %218 + %253 = icmp eq i64 %indvars.iv.next.i, %217 + %or.cond.i = or i1 %252, %253 + br i1 %or.cond.i, label %._crit_edge45.i, label %.lr.ph44.i, !llvm.loop !41 ._crit_edge45.i: ; preds = %229, %.lr.ph44.i, %._crit_edge.i %.not.i39.i = icmp eq ptr %.val38.i, null @@ -3035,9 +3034,6 @@ declare i32 @llvm.smax.i32(i32, i32) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #15 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.umin.i32(i32, i32) #15 - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.scmp.i32.i32(i32, i32) #15 diff --git a/bench/abc/optimized/wlcAbc.ll b/bench/abc/optimized/wlcAbc.ll index 403bf693850..466adf47adc 100644 --- a/bench/abc/optimized/wlcAbc.ll +++ b/bench/abc/optimized/wlcAbc.ll @@ -59,14 +59,12 @@ define void @Wlc_NtkPrintInputInfo(ptr noundef %0) local_unnamed_addr #0 { %.val67 = load i32, ptr %17, align 8, !tbaa !21 %18 = getelementptr i8, ptr %16, i64 12 %.val68 = load i32, ptr %18, align 4, !tbaa !23 - %19 = sub i32 %.val67, %.val68 + %19 = sub nsw i32 %.val67, %.val68 %20 = tail call i32 @llvm.abs.i32(i32 %19, i1 true) %. = tail call i32 @llvm.smin.i32(i32 %.val67, i32 %.val68) %21 = ptrtoint ptr %16 to i64 %22 = zext nneg i32 %.05680 to i64 - %smax = tail call i32 @llvm.abs.i32(i32 %19, i1 false) - %23 = add nuw i32 %smax, 1 - %wide.trip.count = zext i32 %23 to i64 + %smax = zext nneg i32 %20 to i64 br label %24 24: ; preds = %12, %33 @@ -96,8 +94,8 @@ define void @Wlc_NtkPrintInputInfo(ptr noundef %0) local_unnamed_addr #0 { %41 = add i32 %., %40 %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.2, ptr noundef %39, i32 noundef %41, i32 noundef %34) #11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond.not, label %43, label %24, !llvm.loop !26 + %exitcond.not = icmp samesign ult i64 %indvars.iv, %23 + br i1 %exitcond.not, label %24, label %43, !llvm.loop !26 43: ; preds = %33 %44 = add nuw nsw i32 %20, 1 @@ -206,14 +204,12 @@ define void @Wlc_NtkPrintInvStats(ptr noundef %0, ptr noundef readonly captures( %.val44 = load i32, ptr %17, align 8, !tbaa !21 %18 = getelementptr i8, ptr %13, i64 12 %.val45 = load i32, ptr %18, align 4, !tbaa !23 - %19 = sub i32 %.val44, %.val45 + %19 = sub nsw i32 %.val44, %.val45 %20 = tail call i32 @llvm.abs.i32(i32 %19, i1 true) %21 = add nuw nsw i32 %20, 1 %.val40 = load ptr, ptr %8, align 8, !tbaa !10 %22 = zext nneg i32 %.053 to i64 - %smax = tail call i32 @llvm.abs.i32(i32 %19, i1 false) - %23 = add nuw i32 %smax, 1 - %wide.trip.count = zext i32 %23 to i64 + %smax = zext nneg i32 %20 to i64 %invariant.gep = getelementptr inbounds nuw i32, ptr %.val40, i64 %22 br label %24 @@ -226,8 +222,8 @@ define void @Wlc_NtkPrintInvStats(ptr noundef %0, ptr noundef readonly captures( 26: ; preds = %24 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond.not, label %27, label %24, !llvm.loop !31 + %exitcond.not = icmp samesign ult i64 %indvars.iv, %23 + br i1 %exitcond.not, label %24, label %27, !llvm.loop !31 27: ; preds = %24, %26 %.034.lcssa.in = phi i64 [ %indvars.iv, %24 ], [ %indvars.iv.next, %26 ] @@ -262,8 +258,8 @@ define void @Wlc_NtkPrintInvStats(ptr noundef %0, ptr noundef readonly captures( 44: ; preds = %36, %41 %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1 - %exitcond61.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count - br i1 %exitcond61.not, label %45, label %36, !llvm.loop !32 + %exitcond61.not = icmp samesign ult i64 %indvars.iv55, %23 + br i1 %exitcond61.not, label %36, label %45, !llvm.loop !32 45: ; preds = %44 %putchar = tail call i32 @putchar(i32 10) @@ -426,14 +422,12 @@ define ptr @Wlc_NtkGetInv(ptr noundef %0, ptr noundef %1, ptr noundef readonly % %.val105 = load i32, ptr %66, align 8, !tbaa !21 %67 = getelementptr i8, ptr %62, i64 12 %.val106 = load i32, ptr %67, align 4, !tbaa !23 - %68 = sub i32 %.val105, %.val106 + %68 = sub nsw i32 %.val105, %.val106 %69 = call i32 @llvm.abs.i32(i32 %68, i1 true) %70 = add nuw nsw i32 %69, 1 %.val101 = load ptr, ptr %16, align 8, !tbaa !10 %71 = zext nneg i32 %.085121 to i64 - %smax = call i32 @llvm.abs.i32(i32 %68, i1 false) - %72 = add nuw i32 %smax, 1 - %wide.trip.count = zext i32 %72 to i64 + %smax = zext nneg i32 %69 to i64 %invariant.gep = getelementptr inbounds nuw i32, ptr %.val101, i64 %71 br label %73 @@ -446,8 +440,8 @@ define ptr @Wlc_NtkGetInv(ptr noundef %0, ptr noundef %1, ptr noundef readonly % 75: ; preds = %73 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond.not, label %76, label %73, !llvm.loop !55 + %exitcond.not = icmp samesign ult i64 %indvars.iv, %72 + br i1 %exitcond.not, label %73, label %76, !llvm.loop !55 76: ; preds = %73, %75 %.087.lcssa.in = phi i64 [ %indvars.iv, %73 ], [ %indvars.iv.next, %75 ] @@ -487,8 +481,8 @@ define ptr @Wlc_NtkGetInv(ptr noundef %0, ptr noundef %1, ptr noundef readonly % 96: ; preds = %81, %86 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 - %exitcond139.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count - br i1 %exitcond139.not, label %97, label %81, !llvm.loop !56 + %exitcond139.not = icmp samesign ult i64 %indvars.iv133, %72 + br i1 %exitcond139.not, label %81, label %97, !llvm.loop !56 97: ; preds = %96 %98 = add nuw nsw i32 %70, %.085121 diff --git a/bench/abc/optimized/wlnWlc.ll b/bench/abc/optimized/wlnWlc.ll index 44f75dea424..6a35c70fafe 100644 --- a/bench/abc/optimized/wlnWlc.ll +++ b/bench/abc/optimized/wlnWlc.ll @@ -378,13 +378,11 @@ Wln_NtkCleanNameId.exit: ; preds = %Vec_IntGrow.exit.i. %.val269 = load i32, ptr %138, align 8, !tbaa !38 %139 = getelementptr i8, ptr %134, i64 12 %.val270 = load i32, ptr %139, align 4, !tbaa !40 - %140 = sub i32 %.val269, %.val270 + %140 = sub nsw i32 %.val269, %.val270 %141 = call i32 @llvm.abs.i32(i32 %140, i1 true) %142 = load ptr, ptr %91, align 8, !tbaa !42 %143 = sext i32 %.0220391 to i64 - %smax = call i32 @llvm.abs.i32(i32 %140, i1 false) - %144 = add nuw i32 %smax, 1 - %wide.trip.count = zext i32 %144 to i64 + %smax = zext nneg i32 %141 to i64 %invariant.gep = getelementptr i8, ptr %142, i64 %143 br label %145 @@ -397,8 +395,8 @@ Wln_NtkCleanNameId.exit: ; preds = %Vec_IntGrow.exit.i. 148: ; preds = %145 %indvars.iv.next423 = add nuw nsw i64 %indvars.iv422, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next423, %wide.trip.count - br i1 %exitcond.not, label %149, label %145, !llvm.loop !43 + %exitcond.not = icmp samesign ult i64 %indvars.iv422, %144 + br i1 %exitcond.not, label %145, label %149, !llvm.loop !43 149: ; preds = %145, %148 %.0219.lcssa.in = phi i64 [ %indvars.iv422, %145 ], [ %indvars.iv.next423, %148 ] diff --git a/bench/arrow/optimized/UriParse.ll b/bench/arrow/optimized/UriParse.ll index 25a8496fcfd..60f7fba72a0 100644 --- a/bench/arrow/optimized/UriParse.ll +++ b/bench/arrow/optimized/UriParse.ll @@ -5311,8 +5311,6 @@ if.end17: ; preds = %if.end12 br i1 %cmp.not16.i, label %if.end.preheader.i, label %uriParseIpFutLoopA.exit if.end.preheader.i: ; preds = %if.end17 - %afterLast20.i = ptrtoint ptr %afterLast to i64 - %scevgep.i = getelementptr i8, ptr inttoptr (i64 -1 to ptr), i64 %afterLast20.i %.pre.i = load i8, ptr %add.ptr21, align 1 br label %if.end.i46 @@ -5402,8 +5400,8 @@ if.end.i46: ; preds = %if.end.i46.backedge sw.bb.i47: ; preds = %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46, %if.end.i46 %add.ptr.i48 = getelementptr inbounds nuw i8, ptr %first.tr17.i, i64 1 - %exitcond.not.i49 = icmp eq ptr %first.tr17.i, %scevgep.i - br i1 %exitcond.not.i49, label %if.end26, label %if.end.i.i + %exitcond.not.i49 = icmp ult ptr %add.ptr.i48, %afterLast + br i1 %exitcond.not.i49, label %if.end.i.i, label %if.end26 if.end.i.i: ; preds = %sw.bb.i47 %8 = load i8, ptr %add.ptr.i48, align 1 diff --git a/bench/boost/optimized/args_cmd.ll b/bench/boost/optimized/args_cmd.ll index 4f38e375d2d..8058c5144ca 100644 --- a/bench/boost/optimized/args_cmd.ll +++ b/bench/boost/optimized/args_cmd.ll @@ -147861,11 +147861,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignIN9__gnu_cxx17__norm br i1 %.not2835.i.i.i, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.thread.i.i, label %.lr.ph.preheader.i.i.i .lr.ph.preheader.i.i.i: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignIN9__gnu_cxx17__normal_iteratorIPKcS4_EEvEERS4_T_SC_.exit, %.critedge15.i.i.i - %indvars.iv.in = phi i64 [ %indvars.iv, %.critedge15.i.i.i ], [ %29, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignIN9__gnu_cxx17__normal_iteratorIPKcS4_EEvEERS4_T_SC_.exit ] %.sroa.018.036.i.i.i = phi ptr [ %37, %.critedge15.i.i.i ], [ %28, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignIN9__gnu_cxx17__normal_iteratorIPKcS4_EEvEERS4_T_SC_.exit ] - %indvars.iv = add i64 %indvars.iv.in, -1 - %.not = icmp eq i64 %indvars.iv, 0 - %31 = select i1 %.not, i64 1, i64 2 br label %.lr.ph.i.i.i .lr.ph.i.i.i: ; preds = %35, %.lr.ph.preheader.i.i.i @@ -147880,12 +147876,14 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6assignIN9__gnu_cxx17__norm 35: ; preds = %.lr.ph.i.i.i %36 = getelementptr inbounds nuw i8, ptr %.sroa.0.029.i.i.i, i64 1 %.01230.i.i.i.add = add nuw nsw i64 %.01230.i.i.i.idx, 1 - %exitcond = icmp eq i64 %.01230.i.i.i.add, %31 - br i1 %exitcond, label %.critedge.i.i.i, label %.lr.ph.i.i.i, !llvm.loop !2555 + %exitcond = icmp eq ptr %35, %30 + %.not.i.i.i = icmp eq i64 %.01230.i.i.i.add, 2 + %or.cond.i.i.i = select i1 %36, i1 true, i1 %.not.i.i.i + br i1 %or.cond.i.i.i, label %.critedge.i.i.i, label %.lr.ph.i.i.i, !llvm.loop !2555 .critedge.i.i.i: ; preds = %35, %.lr.ph.i.i.i %.sroa.0.0.lcssa.ph.i.i.i = phi ptr [ %.sroa.0.029.i.i.i, %.lr.ph.i.i.i ], [ %36, %35 ] - %.012.lcssa.ph.i.i.i.idx = phi i64 [ %.01230.i.i.i.idx, %.lr.ph.i.i.i ], [ %31, %35 ] + %.012.lcssa.ph.i.i.i.idx = phi i64 [ %.01230.i.i.i.idx, %.lr.ph.i.i.i ], [ %.01230.i.i.i.add, %35 ] %.not13.i.i.i = icmp eq i64 %.012.lcssa.ph.i.i.i.idx, 2 br i1 %.not13.i.i.i, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.i.i, label %.critedge15.i.i.i diff --git a/bench/bullet3/optimized/btSoftBodyHelpers.ll b/bench/bullet3/optimized/btSoftBodyHelpers.ll index ac7a1ec193a..14f33786a92 100644 --- a/bench/bullet3/optimized/btSoftBodyHelpers.ll +++ b/bench/bullet3/optimized/btSoftBodyHelpers.ll @@ -5280,12 +5280,8 @@ for.body11.preheader: ; preds = %if.then.i.i.i60 store ptr %call.i.i.i.i83, ptr %m_data.i.i36, align 8 store i32 %maxidx.0.lcssa, ptr %m_capacity.i.i38, align 8 store i32 %maxidx.0.lcssa, ptr %m_size.i.i37, align 4 - %mul8 = mul i32 %maxidx.0.lcssa, 3 - %smax151 = tail call i32 @llvm.smax.i32(i32 %mul8, i32 3) - %2 = add nsw i32 %smax151, -1 - %3 = udiv i32 %2, 3 - %4 = add nuw nsw i32 %3, 1 - %wide.trip.count152 = zext nneg i32 %4 to i64 + %mul8 = mul nsw i32 %maxidx.0.lcssa, 3 + %smax151 = zext nneg i32 %mul8 to i64 br label %for.body11 for.body11: ; preds = %for.body11.preheader, %for.body11 @@ -5307,8 +5303,8 @@ for.body11: ; preds = %for.body11.preheade store float 0.000000e+00, ptr %ref.tmp12.sroa.4.0.arrayidx.i.sroa_idx, align 4 %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1 %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 3 - %exitcond153.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count152 - br i1 %exitcond153.not, label %for.end26, label %for.body11, !llvm.loop !45 + %exitcond153.not = icmp samesign ult i64 %indvars.iv.next145, %2 + br i1 %exitcond153.not, label %for.body11, label %for.end26, !llvm.loop !45 lpad3.loopexit: ; preds = %if.then %lpad.loopexit = landingpad { ptr, i32 } diff --git a/bench/cmake/optimized/cmHexFileConverter.ll b/bench/cmake/optimized/cmHexFileConverter.ll index 25d9928e46a..93ad87ab3ec 100644 --- a/bench/cmake/optimized/cmHexFileConverter.ll +++ b/bench/cmake/optimized/cmHexFileConverter.ll @@ -257,35 +257,31 @@ _ZL11ChompStrlenPKc.exit.i.us: ; preds = %46, %41 .lr.ph.i.i.us: ; preds = %54 %57 = zext nneg i32 %.0.i.us to i64 - %58 = xor i32 %.0.i.us, -1 - %59 = add nsw i32 %55, %58 - %60 = lshr i32 %59, 1 - %61 = add nuw i32 %60, 1 - %wide.trip.count.i.i.us = zext i32 %61 to i64 - br label %62 - -62: ; preds = %68, %.lr.ph.i.i.us - %indvars.iv30.i.i.us = phi i64 [ 0, %.lr.ph.i.i.us ], [ %indvars.iv.next31.i.i.us, %68 ] - %indvars.iv.i.i.us = phi i64 [ %57, %.lr.ph.i.i.us ], [ %indvars.iv.next.i.i.us, %68 ] - %63 = getelementptr inbounds nuw i8, ptr %9, i64 %indvars.iv.i.i.us - %64 = load i8, ptr %63, align 2, !tbaa !4 - store i8 %64, ptr %6, align 1, !tbaa !4 - %65 = getelementptr inbounds nuw i8, ptr %63, i64 1 - %66 = load i8, ptr %65, align 1, !tbaa !4 - store i8 %66, ptr %30, align 1, !tbaa !4 + %58 = zext nneg i32 %55 to i64 + br label %59 + +59:; preds = %65, %.lr.ph.i.i.us + %wide.trip.count.i.i.us = phi i64 [ 0, %.lr.ph.i.i.us ], [ %indvars.iv.next31.i.i.us, %65 ] + %indvars.iv.i.i.us = phi i64 [ %57, %.lr.ph.i.i.us ], [ %indvars.iv.next.i.i.us, %65 ] + %60 = getelementptr inbounds nuw i8, ptr %9, i64 %indvars.iv.i.i.us + %61 = load i8, ptr %60, align 2, !tbaa !4 + store i8 %61, ptr %6, align 1, !tbaa !4 + %indvars.iv.i.i.us = getelementptr inbounds nuw i8, ptr %60, i64 1 + %63 = load i8, ptr %indvars.iv.i.i.us, align 1, !tbaa !4 + store i8 %63, ptr %30, align 1, !tbaa !4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9 store i32 0, ptr %8, align 4, !tbaa !10 %67 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %6, ptr noundef nonnull @.str.2, ptr noundef nonnull %8) #9 %.not.i.i.us = icmp eq i32 %67, 1 br i1 %.not.i.i.us, label %68, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78 -_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78: ; preds = %62 +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78: ; preds = %59 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #9 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %6) #9 br label %.split54.us -68: ; preds = %62 +68: ; preds = %59 %69 = load i32, ptr %8, align 4, !tbaa !10 %70 = trunc i32 %69 to i8 %71 = getelementptr inbounds nuw [256 x i8], ptr %7, i64 0, i64 %indvars.iv30.i.i.us @@ -293,21 +289,25 @@ _ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78: ; preds = %62 %indvars.iv.next31.i.i.us = add nuw nsw i64 %indvars.iv30.i.i.us, 1 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9 %indvars.iv.next.i.i.us = add nuw nsw i64 %indvars.iv.i.i.us, 2 - %exitcond.not.i.i.us = icmp eq i64 %indvars.iv.next31.i.i.us, %wide.trip.count.i.i.us - br i1 %exitcond.not.i.i.us, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us, label %62, !llvm.loop !12 + %exitcond.not.i.i.us = icmp samesign ult i64 %indvars.iv.next.i.i.us, %58 + br i1 %exitcond.not.i.i.us, label %59, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us, !llvm.loop !12 -_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us: ; preds = %68, %54 - %.016.lcssa.i.i.us = phi i64 [ 0, %54 ], [ %wide.trip.count.i.i.us, %68 ] - %72 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 1, i64 noundef %.016.lcssa.i.i.us, ptr noundef nonnull %14) - %73 = icmp eq i64 %72, %.016.lcssa.i.i.us +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us: ; preds = %65 + %.016.lcssa.i.i.us = and i64 %indvars.iv.next31.i.i.us, 4294967295 + br label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us + +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us: ; preds = %54, %._crit_edge.loopexit.i.i.us + %.016.lcssa.i.i.us = phi i64 [ 0, %54 ], [ %70, %._crit_edge.loopexit.i.i.us ] + %71 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 1, i64 noundef %.016.lcssa.i.i.us, ptr noundef nonnull %14) + %72 = icmp eq i64 %71, %.016.lcssa.i.i.us call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #9 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %6) #9 - br i1 %73, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread75, label %.split54.us, !llvm.loop !9 + br i1 %72, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread75, label %.split54.us, !llvm.loop !9 .split.us55: ; preds = %23 br i1 %.not.us62, label %.split54.us, label %.lr.ph65 -_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83: ; preds = %94, %94, %94, %94, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58 +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83: ; preds = %94, %94, %94, %94, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us57 %74 = call ptr @fgets(ptr noundef nonnull %9, i32 noundef 1024, ptr noundef nonnull %13) %.not.us57 = icmp eq ptr %74, null br i1 %.not.us57, label %.split54.us, label %.lr.ph65, !llvm.loop !9 @@ -374,56 +374,61 @@ _ZL11ChompStrlenPKc.exit.i28.us: ; preds = %88, %83 call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #9 %97 = add nsw i32 %.1.i.i29.us, -12 %98 = icmp ult i32 %97, -10 - br i1 %98, label %.lr.ph.i.i38.us, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58 + br i1 %98, label %.lr.ph.i.i38.us, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us57 .lr.ph.i.i38.us: ; preds = %96 - %99 = lshr i32 %97, 1 - %100 = add nuw nsw i32 %99, 1 - %wide.trip.count.i.i39.us = zext nneg i32 %100 to i64 - br label %101 - -101: ; preds = %107, %.lr.ph.i.i38.us - %indvars.iv30.i.i40.us = phi i64 [ 0, %.lr.ph.i.i38.us ], [ %indvars.iv.next31.i.i44.us, %107 ] - %indvars.iv.i.i41.us = phi i64 [ 9, %.lr.ph.i.i38.us ], [ %indvars.iv.next.i.i45.us, %107 ] - %102 = getelementptr inbounds nuw i8, ptr %9, i64 %indvars.iv.i.i41.us - %103 = load i8, ptr %102, align 1, !tbaa !4 - store i8 %103, ptr %3, align 1, !tbaa !4 - %104 = getelementptr inbounds nuw i8, ptr %102, i64 1 - %105 = load i8, ptr %104, align 1, !tbaa !4 - store i8 %105, ptr %27, align 1, !tbaa !4 + %99 = zext nneg i32 %.1.i.i29.us to i64 + %100 = add nsw i64 %99, -12 + %wide.trip.count.i.i39.us = lshr i64 %100, 1 + %101 = add nuw nsw i64 %100, 1 + br label %102 + +102:; preds = %108, %.lr.ph.i.i38.us + %indvars.iv.i.i41.us = phi i64 [ 0, %.lr.ph.i.i38.us ], [ %indvars.iv.next31.i.i43.us, %107 ] + %102 = phi i64 [ 9, %.lr.ph.i.i38.us ], [ %indvars.iv.next.i.i44.us, %108 ] + %103 = getelementptr inbounds nuw i8, ptr %9, i64 %102 + %104 = load i8, ptr %103, align 1, !tbaa !4 + store i8 %104, ptr %3, align 1, !tbaa !4 + %105 = getelementptr inbounds nuw i8, ptr %103, i64 1 + %106 = load i8, ptr %105, align 1, !tbaa !4 + store i8 %106, ptr %27, align 1, !tbaa !4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9 store i32 0, ptr %5, align 4, !tbaa !10 %106 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %3, ptr noundef nonnull @.str.2, ptr noundef nonnull %5) #9 %.not.i.i42.us = icmp eq i32 %106, 1 br i1 %.not.i.i42.us, label %107, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86 -_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86: ; preds = %101 +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86: ; preds = %102 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9 call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #9 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #9 br label %.split54.us -107: ; preds = %101 +107: ; preds = %102 %108 = load i32, ptr %5, align 4, !tbaa !10 %109 = trunc i32 %108 to i8 - %110 = getelementptr inbounds nuw [256 x i8], ptr %4, i64 0, i64 %indvars.iv30.i.i40.us + %110 = getelementptr inbounds nuw [256 x i8], ptr %4, i64 0, i64 %indvars.iv30.i.i39.us store i8 %109, ptr %110, align 1, !tbaa !4 - %indvars.iv.next31.i.i44.us = add nuw nsw i64 %indvars.iv30.i.i40.us, 1 + %indvars.iv.next31.i.i44.us = add nuw nsw i64 %indvars.iv30.i.i39.us, 1 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9 - %indvars.iv.next.i.i45.us = add nuw nsw i64 %indvars.iv.i.i41.us, 2 - %exitcond.not.i.i46.us = icmp eq i64 %indvars.iv.next31.i.i44.us, %wide.trip.count.i.i39.us - br i1 %exitcond.not.i.i46.us, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58, label %101, !llvm.loop !12 - -_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58: ; preds = %107, %96 - %.016.lcssa.i.i35.us = phi i64 [ 0, %96 ], [ %wide.trip.count.i.i39.us, %107 ] - %111 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 1, i64 noundef %.016.lcssa.i.i35.us, ptr noundef nonnull %14) - %112 = icmp eq i64 %111, %.016.lcssa.i.i35.us + %indvars.iv.next.i.i45.us = add nuw nsw i64 %indvars.iv.i.i40.us, 2 + %exitcond.not.i.i46.us = icmp eq i64 %indvars.iv.i.i41.us, %wide.trip.count.i.i39.us + br i1 %exitcond.not.i.i46.us, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58, label %102, !llvm.loop !12 + +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58: ; preds = %107 + %.016.lcssa.i.i35.us = and i64 %101, 4294967295 + br label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us57 + +_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us57: ; preds = %95, %._crit_edge.loopexit.i.i45.us + %.016.lcssa.i.i35.us = phi i64 [ 0, %95 ], [ %112, %._crit_edge.loopexit.i.i45.us ] + %113 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 1, i64 noundef %.016.lcssa.i.i35.us, ptr noundef nonnull %14) + %114 = icmp eq i64 %113, %.016.lcssa.i.i35.us call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #9 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #9 - br i1 %112, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83, label %.split54.us, !llvm.loop !9 + br i1 %114, label %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83, label %.split54.us, !llvm.loop !9 -.split54.us: ; preds = %94, %_ZL11ChompStrlenPKc.exit.i28.us, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58, %50, %_ZL11ChompStrlenPKc.exit.i.us, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread75, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78, %.split.us55, %.split.us - %.us-phi = phi i1 [ false, %.split.us ], [ false, %.split.us55 ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78 ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86 ], [ false, %50 ], [ false, %_ZL11ChompStrlenPKc.exit.i.us ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us ], [ true, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread75 ], [ false, %94 ], [ false, %_ZL11ChompStrlenPKc.exit.i28.us ], [ true, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83 ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58 ] +.split54.us: ; preds = %94, %_ZL11ChompStrlenPKc.exit.i28.us, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us57, %50, %_ZL11ChompStrlenPKc.exit.i.us, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread75, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78, %.split.us55, %.split.us + %.us-phi = phi i1 [ false, %.split.us ], [ false, %.split.us55 ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread78 ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread86 ], [ false, %50 ], [ false, %_ZL11ChompStrlenPKc.exit.i.us ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us ], [ true, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us.thread75 ], [ false, %94 ], [ false, %_ZL11ChompStrlenPKc.exit.i28.us ], [ true, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us58.thread83 ], [ false, %_ZL23ConvertMotorolaSrecLinePKcP8_IO_FILE.exit.us57 ] %113 = call i32 @fclose(ptr noundef nonnull %13) %114 = call i32 @fclose(ptr noundef nonnull %14) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %9) #9 diff --git a/bench/cvc5/optimized/bags_utils.ll b/bench/cvc5/optimized/bags_utils.ll index 9d96e3a63e4..026b96fb131 100644 --- a/bench/cvc5/optimized/bags_utils.ll +++ b/bench/cvc5/optimized/bags_utils.ll @@ -16608,9 +16608,6 @@ for.body.preheader: ; preds = %if.end.i.i.i.i.i.i. %__first.addr.0.i.i.i.i.i30.ph = phi ptr [ %add.ptr.i.i.i25, %if.end.i.i.i.i.i.i.i29 ], [ %incdec.ptr.i.i.i.i.i27, %call5.i.i.i.i2.i.i.noexc35 ] %_M_finish.i.i7.i3166 = getelementptr inbounds nuw i8, ptr %indices2, i64 8 store ptr %__first.addr.0.i.i.i.i.i30.ph, ptr %_M_finish.i.i7.i3166, align 8 - %umax = call i64 @llvm.umax.i64(i64 %div10, i64 2) - %11 = add nsw i64 %umax, -1 - %12 = lshr i64 %11, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.body @@ -16628,8 +16625,8 @@ for.body: ; preds = %for.body.preheader, store i32 %15, ptr %add.ptr.i40, align 4 %add16 = add nuw i64 %i.057, 2 %inc = add nuw nsw i64 %index.058, 1 - %exitcond.not = icmp eq i64 %index.058, %12 - br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !344 + %exitcond.not = icmp ult i64 %add16, %div10 + br i1 %exitcond.not, label %for.body, label %for.end, !llvm.loop !344 lpad: ; preds = %_ZNSt16allocator_traitsISaIjEE8allocateERS0_m.exit.i.i.i.i.i, %if.then3.i.i.i.i.i.i.i, %entry %16 = landingpad { ptr, i32 } diff --git a/bench/darktable/optimized/introspection_sharpen.ll b/bench/darktable/optimized/introspection_sharpen.ll index 7b6375cf06a..c5d38fbeabc 100644 --- a/bench/darktable/optimized/introspection_sharpen.ll +++ b/bench/darktable/optimized/introspection_sharpen.ll @@ -298,18 +298,15 @@ define void @process(ptr noundef %0, ptr noundef readonly captures(none) %1, ptr %83 = icmp sgt i32 %25, 0 %84 = getelementptr inbounds nuw i8, ptr %15, i64 8 %85 = getelementptr inbounds nuw i8, ptr %15, i64 4 - %umax = call i64 @llvm.umax.i64(i64 %81, i64 4) - %86 = add i64 %umax, -1 - %87 = lshr i64 %86, 2 - %88 = shl nsw i64 %76, 2 - %89 = and i64 %88, -16 - %scevgep270 = getelementptr i8, ptr %80, i64 %89 - %90 = or disjoint i64 %81, 1 - %umax271 = call i64 @llvm.umax.i64(i64 %90, i64 %76) - %91 = shl i64 %umax271, 2 - %92 = sub i64 %91, %89 - %93 = or disjoint i32 %28, 1 - %94 = sext i32 %25 to i64 + %umax = shl nsw i64 %76, 2 + %86 = and i64 %umax, -16 + %87 = getelementptr i8, ptr %80, i64 %86 + %88 = or disjoint i64 %81, 1 + %89 = call i64 @llvm.umax.i64(i64 %88, i64 %76) + %scevgep270 = shl i64 %89, 2 + %90 = sub i64 %89, %87 + %umax271 = or disjoint i32 %28, 1 + %91 = sext i32 %25 to i64 %wide.trip.count = zext nneg i32 %25 to i64 %95 = shl i32 %25, 1 br label %97 @@ -323,7 +320,7 @@ define void @process(ptr noundef %0, ptr noundef readonly captures(none) %1, ptr 97: ; preds = %.lr.ph262, %.loopexit %98 = phi i32 [ %77, %.lr.ph262 ], [ %207, %.loopexit ] %indvars.iv293 = phi i64 [ 0, %.lr.ph262 ], [ %indvars.iv.next294, %.loopexit ] - %99 = icmp sge i64 %indvars.iv293, %94 + %99 = icmp sge i64 %indvars.iv293, %92 %100 = sub nsw i32 %98, %25 %101 = sext i32 %100 to i64 %.not216 = icmp slt i64 %indvars.iv293, %101 @@ -342,8 +339,8 @@ define void @process(ptr noundef %0, ptr noundef readonly captures(none) %1, ptr 107: ; preds = %97 %indvars295 = trunc i64 %indvars.iv293 to i32 call void @llvm.assume(i1 true) [ "align"(ptr %80, i64 64) ] - %108 = sub nsw i64 %indvars.iv293, %94 - %109 = add nsw i64 %indvars.iv293, %94 + %108 = sub nsw i64 %indvars.iv293, %92 + %109 = add nsw i64 %indvars.iv293, %92 %110 = add nsw i32 %indvars295, %25 br i1 %.not264, label %.preheader224, label %.lr.ph234 @@ -361,7 +358,7 @@ define void @process(ptr noundef %0, ptr noundef readonly captures(none) %1, ptr br i1 %.not219235, label %.preheader.us.preheader, label %.preheader .preheader.us.preheader: ; preds = %.preheader.lr.ph - call void @llvm.memset.p0.i64(ptr align 16 %scevgep270, i8 0, i64 %92, i1 false), !tbaa !47 + call void @llvm.memset.p0.i64(ptr align 16 %scevgep269, i8 0, i64 %90, i1 false), !tbaa !47 br label %._crit_edge241 113: ; preds = %.lr.ph234, %._crit_edge @@ -373,42 +370,42 @@ define void @process(ptr noundef %0, ptr noundef readonly captures(none) %1, ptr call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %9, i8 0, i64 16, i1 false) br i1 %.not221229, label %._crit_edge, label %.lr.ph -._crit_edge: ; preds = %121, %113 +._crit_edge: ; preds = %120, %113 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep, ptr noundef nonnull align 16 dereferenceable(16) %9, i64 16, i1 false), !tbaa !47 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #20 %115 = add nuw i64 %.0191232, 4 + %114 = icmp ult i64 %113, %81 %indvar.next = add nuw nsw i64 %indvar, 1 - %exitcond269.not = icmp eq i64 %indvar, %87 - br i1 %exitcond269.not, label %.preheader224, label %113 - -.lr.ph: ; preds = %113, %121 - %.0192230 = phi i64 [ %122, %121 ], [ %108, %113 ] - %116 = sub i64 %.0192230, %108 - %117 = getelementptr inbounds nuw float, ptr %55, i64 %116 - %118 = load float, ptr %117, align 4, !tbaa !47 - %119 = mul i64 %.0192230, %76 - %120 = add i64 %119, %.0191232 - br label %123 - -121: ; preds = %123 - %122 = add i64 %.0192230, 1 - %.not221 = icmp ugt i64 %122, %109 + br i1 %114, label %111, label %.preheader224 + +.lr.ph: ; preds = %111, %120 + %.0192230 = phi i64 [ %121, %120 ], [ %106, %111 ] + %.0192230 = sub i64 %.0192230, %108 + %116 = getelementptr inbounds nuw float, ptr %55, i64 %.0192230 + %117 = load float, ptr %116, align 4, !tbaa !47 + %118 = mul i64 %.0192230, %76 + %119 = add i64 %118, %.0191232 + br label %122 + +120: ; preds = %122 + %121 = add i64 %.0192230, 1 + %122 = icmp ugt i64 %121, %107 br i1 %.not221, label %._crit_edge, label %.lr.ph 123: ; preds = %.lr.ph, %123 %.0193228 = phi i64 [ 0, %.lr.ph ], [ %131, %123 ] - %124 = add i64 %120, %.0193228 + %124 = add i64 %119, %.0193228 %.idx222 = shl i64 %124, 4 %125 = getelementptr inbounds nuw i8, ptr %2, i64 %.idx222 %126 = load float, ptr %125, align 4, !tbaa !47 - %127 = fmul reassoc nsz arcp contract afn float %126, %118 + %127 = fmul reassoc nsz arcp contract afn float %126, %117 %128 = getelementptr inbounds nuw [4 x float], ptr %9, i64 0, i64 %.0193228 %129 = load float, ptr %128, align 4, !tbaa !47 %130 = fadd reassoc nsz arcp contract afn float %129, %127 store float %130, ptr %128, align 4, !tbaa !47 %131 = add nuw nsw i64 %.0193228, 1 %exitcond.not = icmp eq i64 %131, 4 - br i1 %exitcond.not, label %121, label %123 + br i1 %exitcond.not, label %120, label %123 .preheader: ; preds = %.preheader.lr.ph, %._crit_edge239 %.0198240 = phi i64 [ %136, %._crit_edge239 ], [ %81, %.preheader.lr.ph ] @@ -482,11 +479,11 @@ define void @process(ptr noundef %0, ptr noundef readonly captures(none) %1, ptr br label %202 163: ; preds = %.lr.ph255, %186 - %indvars.iv286 = phi i64 [ %94, %.lr.ph255 ], [ %indvars.iv.next287, %186 ] - %indvars.iv283 = phi i32 [ %93, %.lr.ph255 ], [ %indvars.iv.next284, %186 ] + %indvars.iv286 = phi i64 [ %92, %.lr.ph255 ], [ %indvars.iv.next287, %186 ] + %indvars.iv283 = phi i32 [ %91, %.lr.ph255 ], [ %indvars.iv.next284, %186 ] %indvars.iv278 = phi i32 [ 0, %.lr.ph255 ], [ %indvars.iv.next279, %186 ] - %164 = sub nsw i64 %indvars.iv286, %94 - %165 = add nsw i64 %indvars.iv286, %94 + %164 = sub nsw i64 %indvars.iv286, %92 + %165 = add nsw i64 %indvars.iv286, %92 %.not217246 = icmp sgt i64 %164, %165 br i1 %.not217246, label %._crit_edge251, label %.lr.ph250.preheader diff --git a/bench/eastl/optimized/EAMemory.ll b/bench/eastl/optimized/EAMemory.ll index e2742d7f8bd..e06a8d4876a 100644 --- a/bench/eastl/optimized/EAMemory.ll +++ b/bench/eastl/optimized/EAMemory.ll @@ -968,32 +968,32 @@ while.cond18.preheader.i: ; preds = %sw.default for.cond21.preheader.lr.ph.i: ; preds = %while.cond18.preheader.i %cmp2227.not.i = icmp ne i64 %sourceByteCount, 0 tail call void @llvm.assume(i1 %cmp2227.not.i) - %29 = add i64 %sourceByteCount, -1 - br label %for.cond21.preheader.us.i - -for.cond21.preheader.us.i: ; preds = %for.cond21.while.cond18.loopexit_crit_edge.us.i, %for.cond21.preheader.lr.ph.i - %d.sroa.0.335.us.i = phi ptr [ %incdec.ptr28.us.i, %for.cond21.while.cond18.loopexit_crit_edge.us.i ], [ %pDestination, %for.cond21.preheader.lr.ph.i ] - %destByteCount.addr.334.us.i = phi i64 [ %32, %for.cond21.while.cond18.loopexit_crit_edge.us.i ], [ %destByteCount, %for.cond21.preheader.lr.ph.i ] - %30 = add i64 %destByteCount.addr.334.us.i, -1 - %umin.i = tail call i64 @llvm.umin.i64(i64 %30, i64 %29) br label %for.body26.us.i -for.body26.us.i: ; preds = %for.body26.us.i, %for.cond21.preheader.us.i - %i20.031.us.i = phi i64 [ 0, %for.cond21.preheader.us.i ], [ %inc.us.i, %for.body26.us.i ] - %s.sroa.0.230.us.i = phi ptr [ %pSource, %for.cond21.preheader.us.i ], [ %incdec.ptr27.us.i, %for.body26.us.i ] - %d.sroa.0.429.us.i = phi ptr [ %d.sroa.0.335.us.i, %for.cond21.preheader.us.i ], [ %incdec.ptr28.us.i, %for.body26.us.i ] +for.body26.us.i: ; preds = %for.body26.us.i.backedge, %for.cond21.preheader.lr.ph.i + %i20.031.us.i = phi i64 [ 0, %for.cond21.preheader.lr.ph.i ], [ %i20.031.us.i.be, %for.body26.us.i.backedge ] + %s.sroa.0.230.us.i = phi ptr [ %pSource, %for.cond21.preheader.lr.ph.i ], [ %s.sroa.0.230.us.i.be, %for.body26.us.i.backedge ] + %d.sroa.0.429.us.i = phi ptr [ %pDestination, %for.cond21.preheader.lr.ph.i ], [ %incdec.ptr28.us.i, %for.body26.us.i.backedge ] + %destByteCount.addr.428.us.i = phi i64 [ %destByteCount, %for.cond21.preheader.lr.ph.i ], [ %dec29.us.i, %for.body26.us.i.backedge ] %incdec.ptr27.us.i = getelementptr inbounds nuw i8, ptr %s.sroa.0.230.us.i, i64 1 %31 = load i8, ptr %s.sroa.0.230.us.i, align 1 %incdec.ptr28.us.i = getelementptr inbounds nuw i8, ptr %d.sroa.0.429.us.i, i64 1 store i8 %31, ptr %d.sroa.0.429.us.i, align 1 + %dec29.us.i = add i64 %destByteCount.addr.428.us.i, -1 %inc.us.i = add nuw i64 %i20.031.us.i, 1 - %exitcond.not.i = icmp eq i64 %i20.031.us.i, %umin.i - br i1 %exitcond.not.i, label %for.cond21.while.cond18.loopexit_crit_edge.us.i, label %for.body26.us.i, !llvm.loop !15 + %exitcond.not.i = icmp ult i64 %inc.us.i, %sourceByteCount + %tobool24.us.i = icmp ne i64 %dec29.us.i, 0 + %30 = select i1 %cmp22.us.i, i1 %tobool24.us.i, i1 false + br i1 %30, label %for.body26.us.i.backedge, label %for.cond21.while.cond18.loopexit_crit_edge.us.i + +for.body26.us.i.backedge: ; preds = %for.body26.us.i, %for.cond21.while.cond18.loopexit_crit_edge.us.i + %i20.031.us.i.be = phi i64 [ %inc.us.i, %for.body26.us.i ], [ 0, %for.cond21.while.cond18.loopexit_crit_edge.us.i ] + %s.sroa.0.230.us.i.be = phi ptr [ %incdec.ptr27.us.i, %for.body26.us.i ], [ %pSource, %for.cond21.while.cond18.loopexit_crit_edge.us.i ] + br label %for.body26.us.i, !llvm.loop !15 for.cond21.while.cond18.loopexit_crit_edge.us.i: ; preds = %for.body26.us.i - %32 = sub i64 %30, %umin.i - %tobool.not.us.i = icmp eq i64 %32, 0 - br i1 %tobool.not.us.i, label %sw.epilog, label %for.cond21.preheader.us.i, !llvm.loop !16 + %32 = icmp eq i64 %dec29.us.i, 0 + br i1 %tobool.not.us.i, label %sw.epilog, label %for.body26.us.i.backedge while.cond.preheader.i: ; preds = %sw.default %cmp643.i = icmp ugt i64 %destByteCount, 3 @@ -1021,7 +1021,7 @@ for.body.us.i: ; preds = %for.body.us.i, %for %brmerge = select i1 %34, i1 true, i1 %cmp8.us.i %add.us.i.mux = select i1 %34, i64 %add.us.i, i64 0 %incdec.ptr.us.i.mux = select i1 %34, ptr %incdec.ptr.us.i, ptr %pSource - br i1 %brmerge, label %for.body.us.i, label %while.end.i29, !llvm.loop !17 + br i1 %brmerge, label %for.body.us.i, label %while.end.i29, !llvm.loop !16 while.end.i29: ; preds = %for.body.us.i, %while.cond.preheader.i %destByteCount.addr.0.lcssa.i = phi i64 [ %destByteCount, %while.cond.preheader.i ], [ %sub.us.i, %for.body.us.i ] @@ -1046,7 +1046,7 @@ while.body14.i: ; preds = %while.body14.i, %wh store i8 %35, ptr %d.sroa.0.254.i, align 1 %dec.i31 = add nsw i64 %destByteCount.addr.253.i, -1 %cmp13.not.i = icmp eq i64 %dec.i31, 0 - br i1 %cmp13.not.i, label %sw.epilog, label %while.body14.i, !llvm.loop !18 + br i1 %cmp13.not.i, label %sw.epilog, label %while.body14.i, !llvm.loop !17 sw.bb7: ; preds = %entry %v4.0.in.i = getelementptr inbounds nuw i8, ptr %pSource, i64 12 @@ -1088,7 +1088,7 @@ while.body.i40: ; preds = %while.cond.preheade %cmp71.i = icmp ne i64 %and70.i, 0 %cmp72.i = icmp ne i64 %dec.i41, 0 %39 = select i1 %cmp71.i, i1 %cmp72.i, i1 false - br i1 %39, label %while.body.i40, label %while.end.i33, !llvm.loop !19 + br i1 %39, label %while.body.i40, label %while.end.i33, !llvm.loop !18 while.end.i33: ; preds = %while.body.i40, %while.cond.preheader.i32 %v1.2.lcssa.i = phi i32 [ %v1.0.i, %while.cond.preheader.i32 ], [ %add74.i, %while.body.i40 ] @@ -1170,7 +1170,7 @@ while.body101.i: ; preds = %while.body101.i, %w %sub105.i = add i64 %byteCount.addr.2108.i, -16 %add.ptr106.i = getelementptr inbounds nuw i8, ptr %pDestination.2107.i, i64 16 %cmp100.i = icmp ugt i64 %sub105.i, 15 - br i1 %cmp100.i, label %while.body101.i, label %while.end107.i, !llvm.loop !20 + br i1 %cmp100.i, label %while.body101.i, label %while.end107.i, !llvm.loop !19 while.end107.i: ; preds = %while.body101.i, %if.end98.i %v4.1140.i = phi i32 [ %v4.1.i, %if.end98.i ], [ %v4.1139.i, %while.body101.i ] @@ -1206,7 +1206,7 @@ while.body112.i: ; preds = %while.cond110.prehe %add.ptr113.i = getelementptr inbounds nuw i8, ptr %pDestination.3115.i, i64 4 %sub114.i = add nsw i64 %byteCount.addr.3116.i, -4 %cmp111.i = icmp ugt i64 %sub114.i, 3 - br i1 %cmp111.i, label %while.body112.i, label %for.cond.preheader.i, !llvm.loop !21 + br i1 %cmp111.i, label %while.body112.i, label %for.cond.preheader.i, !llvm.loop !20 for.body.i: ; preds = %for.body.i.preheader, %for.body.i %i.0124.i = phi i32 [ %inc.i, %for.body.i ], [ 0, %for.body.i.preheader ] @@ -1222,7 +1222,7 @@ for.body.i: ; preds = %for.body.i.preheade %cmp116.i = icmp samesign ult i32 %i.0124.i, 3 %cmp118.i = icmp ne i64 %dec123.i, 0 %41 = select i1 %cmp116.i, i1 %cmp118.i, i1 false - br i1 %41, label %for.body.i, label %sw.epilog, !llvm.loop !22 + br i1 %41, label %for.body.i, label %sw.epilog, !llvm.loop !21 sw.epilog: ; preds = %for.body.i, %while.body46.i, %while.body53.i, %while.body46.i.i, %for.cond21.while.cond18.loopexit_crit_edge.us.i, %while.body14.i, %for.cond.preheader.i, %while.end107.i, %while.end.i29, %while.cond18.preheader.i, %if.end43.i, %while.cond51.preheader.i, %if.end43.i.i, %sw.bb ret void @@ -1244,7 +1244,7 @@ while.body: ; preds = %while.cond.preheade %incdec.ptr = getelementptr inbounds nuw i8, ptr %p.sroa.0.022, i64 2 store i16 %c, ptr %p.sroa.0.022, align 2 %cmp1 = icmp ult ptr %incdec.ptr, %add.ptr - br i1 %cmp1, label %while.body, label %if.end14, !llvm.loop !23 + br i1 %cmp1, label %while.body, label %if.end14, !llvm.loop !22 if.else: ; preds = %entry %0 = ptrtoint ptr %pDest to i64 @@ -1273,7 +1273,7 @@ while.body8: ; preds = %while.body8.prehead %incdec.ptr9 = getelementptr inbounds nuw i8, ptr %p.sroa.0.219, i64 4 store i32 %or, ptr %p.sroa.0.219, align 4 %tobool7.not = icmp eq i64 %dec6, 0 - br i1 %tobool7.not, label %while.end10, label %while.body8, !llvm.loop !24 + br i1 %tobool7.not, label %while.end10, label %while.body8, !llvm.loop !23 while.end10: ; preds = %while.body8 %cmp11 = icmp ult ptr %incdec.ptr9, %add.ptr @@ -1303,7 +1303,7 @@ while.body: ; preds = %while.cond.preheade %incdec.ptr = getelementptr inbounds nuw i8, ptr %pDest32.024, i64 4 store i32 %c, ptr %pDest32.024, align 4 %cmp1 = icmp ult ptr %incdec.ptr, %add.ptr - br i1 %cmp1, label %while.body, label %if.end15, !llvm.loop !25 + br i1 %cmp1, label %while.body, label %if.end15, !llvm.loop !24 if.else: ; preds = %entry %0 = ptrtoint ptr %pDest to i64 @@ -1332,7 +1332,7 @@ while.body7: ; preds = %while.body7.prehead store i64 %or, ptr %pDest64.022, align 8 %dec9 = add nsw i64 %count.addr.121, -1 %tobool6.not = icmp eq i64 %dec9, 0 - br i1 %tobool6.not, label %while.end10, label %while.body7, !llvm.loop !26 + br i1 %tobool6.not, label %while.end10, label %while.body7, !llvm.loop !25 while.end10: ; preds = %while.body7 %cmp11 = icmp ult ptr %incdec.ptr8, %add.ptr @@ -1358,7 +1358,7 @@ while.body: ; preds = %entry, %while.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %cur.05, i64 8 store i64 %c, ptr %cur.05, align 8 %cmp = icmp ult ptr %incdec.ptr, %add.ptr - br i1 %cmp, label %while.body, label %while.end, !llvm.loop !27 + br i1 %cmp, label %while.body, label %while.end, !llvm.loop !26 while.end: ; preds = %while.body, %entry ret ptr %pDest @@ -1382,33 +1382,32 @@ while.cond18.preheader: ; preds = %entry for.cond22.preheader.lr.ph: ; preds = %while.cond18.preheader %cmp2328.not = icmp ne i64 %sourceBytes, 0 tail call void @llvm.assume(i1 %cmp2328.not) - %5 = add i64 %sourceBytes, -1 - br label %for.cond22.preheader.us - -for.cond22.preheader.us: ; preds = %for.cond22.preheader.lr.ph, %for.cond22.while.cond18.loopexit_crit_edge.us - %count.addr.336.us = phi i64 [ %dec31.us, %for.cond22.while.cond18.loopexit_crit_edge.us ], [ %count, %for.cond22.preheader.lr.ph ] - %pDestination8.335.us = phi ptr [ %incdec.ptr29.us, %for.cond22.while.cond18.loopexit_crit_edge.us ], [ %pDestination, %for.cond22.preheader.lr.ph ] - %6 = add i64 %count.addr.336.us, -1 - %umin = tail call i64 @llvm.umin.i64(i64 %6, i64 %5) br label %for.body27.us -for.body27.us: ; preds = %for.cond22.preheader.us, %for.body27.us - %i21.032.us = phi i64 [ 0, %for.cond22.preheader.us ], [ %inc.us, %for.body27.us ] - %pSource8Temp.231.us = phi ptr [ %pSource, %for.cond22.preheader.us ], [ %incdec.ptr28.us, %for.body27.us ] - %count.addr.430.us = phi i64 [ %count.addr.336.us, %for.cond22.preheader.us ], [ %dec31.us, %for.body27.us ] - %pDestination8.429.us = phi ptr [ %pDestination8.335.us, %for.cond22.preheader.us ], [ %incdec.ptr29.us, %for.body27.us ] +for.body27.us: ; preds = %for.body27.us.backedge, %for.cond22.preheader.lr.ph + %i21.032.us = phi i64 [ 0, %for.cond22.preheader.lr.ph ], [ %i21.032.us.be, %for.body27.us.backedge ] + %pSource8Temp.231.us = phi ptr [ %pSource, %for.cond22.preheader.lr.ph ], [ %pSource8Temp.231.us.be, %for.body27.us.backedge ] + %count.addr.430.us = phi i64 [ %count, %for.cond22.preheader.lr.ph ], [ %dec31.us, %for.body27.us.backedge ] + %pDestination8.429.us = phi ptr [ %pDestination, %for.cond22.preheader.lr.ph ], [ %incdec.ptr29.us, %for.body27.us.backedge ] %incdec.ptr28.us = getelementptr inbounds nuw i8, ptr %pSource8Temp.231.us, i64 1 %7 = load i8, ptr %pSource8Temp.231.us, align 1 %incdec.ptr29.us = getelementptr inbounds nuw i8, ptr %pDestination8.429.us, i64 1 store i8 %7, ptr %pDestination8.429.us, align 1 %inc.us = add nuw i64 %i21.032.us, 1 %dec31.us = add i64 %count.addr.430.us, -1 - %exitcond.not = icmp eq i64 %i21.032.us, %umin - br i1 %exitcond.not, label %for.cond22.while.cond18.loopexit_crit_edge.us, label %for.body27.us, !llvm.loop !28 + %exitcond.not = icmp ult i64 %inc.us, %sourceBytes + %cmp25.us = icmp ne i64 %dec31.us, 0 + %6 = select i1 %cmp23.us, i1 %cmp25.us, i1 false + br i1 %6, label %for.body27.us.backedge, label %for.cond22.while.cond18.loopexit_crit_edge.us + +for.body27.us.backedge: ; preds = %for.body27.us, %for.cond22.while.cond18.loopexit_crit_edge.us + %i21.032.us.be = phi i64 [ %inc.us, %for.body27.us ], [ 0, %for.cond22.while.cond18.loopexit_crit_edge.us ] + %pSource8Temp.231.us.be = phi ptr [ %incdec.ptr28.us, %for.body27.us ], [ %pSource, %for.cond22.while.cond18.loopexit_crit_edge.us ] + br label %for.body27.us, !llvm.loop !27 for.cond22.while.cond18.loopexit_crit_edge.us: ; preds = %for.body27.us %cmp19.not.us = icmp eq i64 %dec31.us, 0 - br i1 %cmp19.not.us, label %if.end34, label %for.cond22.preheader.us, !llvm.loop !29 + br i1 %cmp19.not.us, label %if.end34, label %for.body27.us.backedge while.cond.preheader: ; preds = %entry %cmp644 = icmp ugt i64 %count, 3 @@ -1436,7 +1435,7 @@ for.body.us: ; preds = %for.body.us, %for.c %brmerge = select i1 %9, i1 true, i1 %cmp8.us %add.us.mux = select i1 %9, i64 %add.us, i64 0 %add.ptr9.us.mux = select i1 %9, ptr %add.ptr9.us, ptr %pSource - br i1 %brmerge, label %for.body.us, label %while.end, !llvm.loop !30 + br i1 %brmerge, label %for.body.us, label %while.end, !llvm.loop !28 while.end: ; preds = %for.body.us, %while.cond.preheader %pDestination8.0.lcssa = phi ptr [ %pDestination, %while.cond.preheader ], [ %add.ptr.us, %for.body.us ] @@ -1461,7 +1460,7 @@ while.body15: ; preds = %while.body15.prehea %incdec.ptr16 = getelementptr inbounds nuw i8, ptr %pDestination8.254, i64 1 store i8 %10, ptr %pDestination8.254, align 1 %cmp14.not = icmp eq i64 %dec, 0 - br i1 %cmp14.not, label %if.end34, label %while.body15, !llvm.loop !31 + br i1 %cmp14.not, label %if.end34, label %while.body15, !llvm.loop !29 if.end34: ; preds = %for.cond22.while.cond18.loopexit_crit_edge.us, %while.body15, %while.cond18.preheader, %while.end ret ptr %pDestination @@ -1484,7 +1483,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %p8.06, i64 1 %dec = add i64 %byteCount.addr.05, -1 %cmp.not = icmp eq i64 %dec, 0 - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !32 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !30 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %p8.06, %for.body ] @@ -1518,7 +1517,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %p8.09, i64 1 %xor = xor i64 %i.08, 1 %cmp.not = icmp eq ptr %incdec.ptr, %add.ptr - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !33 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !31 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %p8.09, %for.body ] @@ -1552,7 +1551,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %p8.09, i64 1 %add = add nuw nsw i64 %i.010, 1 %cmp.not = icmp eq ptr %incdec.ptr, %add.ptr - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !34 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !32 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %p8.09, %for.body ] @@ -1586,7 +1585,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %p8.09, i64 1 %add = add nuw nsw i64 %i.010, 1 %cmp.not = icmp eq ptr %incdec.ptr, %add.ptr - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !35 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !33 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %p8.09, %for.body ] @@ -1610,7 +1609,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %p8.06, i64 1 %dec = add i64 %nCharCount.addr.05, -1 %cmp.not = icmp eq i64 %dec, 0 - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !36 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !34 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %p8.06, %for.body ] @@ -1634,7 +1633,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %pString.addr.05, i64 2 %dec = add i64 %nCharCount.addr.06, -1 %cmp.not = icmp eq i64 %dec, 0 - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !37 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !35 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %pString.addr.05, %for.body ] @@ -1658,7 +1657,7 @@ for.inc: ; preds = %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %pString.addr.05, i64 4 %dec = add i64 %nCharCount.addr.06, -1 %cmp.not = icmp eq i64 %dec, 0 - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !38 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !36 return: ; preds = %for.body, %for.inc, %entry %retval.0 = phi ptr [ null, %entry ], [ null, %for.inc ], [ %pString.addr.05, %for.body ] @@ -1690,7 +1689,7 @@ for.inc: ; preds = %for.body %incdec.ptr6 = getelementptr inbounds nuw i8, ptr %p2.010, i64 1 %dec = add i64 %nCharCount.addr.08, -1 %cmp.not = icmp eq i64 %dec, 0 - br i1 %cmp.not, label %return, label %for.body, !llvm.loop !39 + br i1 %cmp.not, label %return, label %for.body, !llvm.loop !37 return: ; preds = %for.inc, %entry, %if.then %retval.0 = phi i32 [ %cond, %if.then ], [ 0, %entry ], [ 0, %for.inc ] @@ -1731,7 +1730,7 @@ for.body.us: ; preds = %for.body.lr.ph, %fo for.inc.us: ; preds = %for.body.us %incdec.ptr.us = getelementptr inbounds nuw i8, ptr %pCurrent8.018.us, i64 1 %cmp4.not.us = icmp ugt ptr %incdec.ptr.us, %add.ptr1 - br i1 %cmp4.not.us, label %return, label %for.body.us, !llvm.loop !40 + br i1 %cmp4.not.us, label %return, label %for.body.us, !llvm.loop !38 for.body: ; preds = %for.body.lr.ph, %for.inc %pCurrent8.018 = phi ptr [ %incdec.ptr, %for.inc ], [ %pMemory, %for.body.lr.ph ] @@ -1753,12 +1752,12 @@ for.body.i: ; preds = %for.body, %for.inc. for.inc.i: ; preds = %for.body.i %dec.i = add i64 %nCharCount.addr.08.i, -1 %cmp.not.i = icmp eq i64 %dec.i, 0 - br i1 %cmp.not.i, label %return, label %for.body.i, !llvm.loop !39 + br i1 %cmp.not.i, label %return, label %for.body.i, !llvm.loop !37 for.inc: ; preds = %for.body.i, %for.body %incdec.ptr = getelementptr inbounds nuw i8, ptr %pCurrent8.018, i64 1 %cmp4.not = icmp ugt ptr %incdec.ptr, %add.ptr1 - br i1 %cmp4.not, label %return, label %for.body, !llvm.loop !40 + br i1 %cmp4.not, label %return, label %for.body, !llvm.loop !38 return: ; preds = %for.inc, %for.inc.i, %for.inc.us, %for.body.us, %for.cond.preheader, %entry, %if.then %retval.0 = phi ptr [ %pMemory, %if.then ], [ null, %entry ], [ null, %for.cond.preheader ], [ null, %for.inc.us ], [ %pCurrent8.018.us, %for.body.us ], [ %pCurrent8.018, %for.inc.i ], [ null, %for.inc ] @@ -1893,7 +1892,7 @@ while.cond18.preheader.i: ; preds = %entry for.cond21.preheader.us.i: ; preds = %while.cond18.preheader.i, %for.cond21.while.cond18.loopexit_crit_edge.us.i %d.sroa.0.335.us.i = phi ptr [ %incdec.ptr28.us.i, %for.cond21.while.cond18.loopexit_crit_edge.us.i ], [ %pDestination, %while.cond18.preheader.i ] - %destByteCount.addr.334.us.i = phi i64 [ %4, %for.cond21.while.cond18.loopexit_crit_edge.us.i ], [ %byteCount, %while.cond18.preheader.i ] + %destByteCount.addr.334.us.i = phi i64 [ %dec29.us.i, %for.cond21.while.cond18.loopexit_crit_edge.us.i ], [ %byteCount, %while.cond18.preheader.i ] %2 = add i64 %destByteCount.addr.334.us.i, -1 %umin.i = tail call i64 @llvm.umin.i64(i64 %2, i64 7) br label %for.body26.us.i @@ -1902,18 +1901,19 @@ for.body26.us.i: ; preds = %for.body26.us.i, %f %i20.031.us.i = phi i64 [ 0, %for.cond21.preheader.us.i ], [ %inc.us.i, %for.body26.us.i ] %s.sroa.0.230.us.i = phi ptr [ %c.addr, %for.cond21.preheader.us.i ], [ %incdec.ptr27.us.i, %for.body26.us.i ] %d.sroa.0.429.us.i = phi ptr [ %d.sroa.0.335.us.i, %for.cond21.preheader.us.i ], [ %incdec.ptr28.us.i, %for.body26.us.i ] + %destByteCount.addr.428.us.i = phi i64 [ %destByteCount.addr.334.us.i, %for.cond21.preheader.us.i ], [ %dec29.us.i, %for.body26.us.i ] %incdec.ptr27.us.i = getelementptr inbounds nuw i8, ptr %s.sroa.0.230.us.i, i64 1 %3 = load i8, ptr %s.sroa.0.230.us.i, align 1 %incdec.ptr28.us.i = getelementptr inbounds nuw i8, ptr %d.sroa.0.429.us.i, i64 1 store i8 %3, ptr %d.sroa.0.429.us.i, align 1 + %dec29.us.i = add i64 %destByteCount.addr.428.us.i, -1 %inc.us.i = add nuw nsw i64 %i20.031.us.i, 1 %exitcond.not.i = icmp eq i64 %i20.031.us.i, %umin.i - br i1 %exitcond.not.i, label %for.cond21.while.cond18.loopexit_crit_edge.us.i, label %for.body26.us.i, !llvm.loop !15 + br i1 %exitcond.not.i, label %for.cond21.while.cond18.loopexit_crit_edge.us.i, label %for.body26.us.i, !llvm.loop !39 for.cond21.while.cond18.loopexit_crit_edge.us.i: ; preds = %for.body26.us.i - %4 = sub i64 %2, %umin.i - %tobool.not.us.i = icmp eq i64 %4, 0 - br i1 %tobool.not.us.i, label %_ZN2EA4StdCL10MemfillAnyEPvPKvmm.exit, label %for.cond21.preheader.us.i, !llvm.loop !16 + %4 = icmp eq i64 %dec29.us.i, 0 + br i1 %tobool.not.us.i, label %_ZN2EA4StdCL10MemfillAnyEPvPKvmm.exit, label %for.cond21.preheader.us.i, !llvm.loop !15 while.cond.preheader.i: ; preds = %entry %cmp643.i = icmp ugt i64 %byteCount, 3 @@ -1938,7 +1938,7 @@ for.body.us.i: ; preds = %for.body.us.i, %whi %brmerge = select i1 %.not.not, i1 true, i1 %cmp8.us.i.not %.mux = select i1 %.not.not, i64 8, i64 4 %incdec.ptr.us.i.mux = select i1 %.not.not, ptr %incdec.ptr.us.i, ptr %c.addr - br i1 %brmerge, label %for.body.us.i, label %while.end.i, !llvm.loop !17 + br i1 %brmerge, label %for.body.us.i, label %while.end.i, !llvm.loop !16 while.end.i: ; preds = %for.body.us.i, %while.cond.preheader.i %destByteCount.addr.0.lcssa.i = phi i64 [ %byteCount, %while.cond.preheader.i ], [ %sub.us.i, %for.body.us.i ] @@ -1963,7 +1963,7 @@ while.body14.i: ; preds = %while.body14.i, %wh store i8 %6, ptr %d.sroa.0.254.i, align 1 %dec.i = add nsw i64 %destByteCount.addr.253.i, -1 %cmp13.not.i = icmp eq i64 %dec.i, 0 - br i1 %cmp13.not.i, label %_ZN2EA4StdCL10MemfillAnyEPvPKvmm.exit, label %while.body14.i, !llvm.loop !18 + br i1 %cmp13.not.i, label %_ZN2EA4StdCL10MemfillAnyEPvPKvmm.exit, label %while.body14.i, !llvm.loop !17 _ZN2EA4StdCL10MemfillAnyEPvPKvmm.exit: ; preds = %for.cond21.while.cond18.loopexit_crit_edge.us.i, %while.body14.i, %while.cond18.preheader.i, %while.end.i ret void @@ -1995,7 +1995,7 @@ for.body: ; preds = %entry, %for.body %incdec.ptr4 = getelementptr inbounds nuw i8, ptr %p2.010, i64 1 %dec = add i64 %byteCount.addr.08, -1 %cmp.not = icmp eq i64 %dec, 0 - br i1 %cmp.not, label %for.end.loopexit, label %for.body, !llvm.loop !41 + br i1 %cmp.not, label %for.end.loopexit, label %for.body, !llvm.loop !40 for.end.loopexit: ; preds = %for.body %2 = icmp eq i8 %or6, 0 @@ -2029,7 +2029,7 @@ while.body: ; preds = %entry, %while.body %sub3 = sub nsw i32 %conv, %conv2 %add = add nsw i32 %sub3, %and %tobool.not = icmp eq i64 %dec, 0 - br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !42 + br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !41 while.end: ; preds = %while.body, %entry %result.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] @@ -2052,7 +2052,7 @@ while.body: ; preds = %entry, %while.body %conv = zext i8 %0 to i32 %or = or i32 %mask.04, %conv %tobool.not = icmp eq i64 %dec, 0 - br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !43 + br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !42 while.end.loopexit: ; preds = %while.body %1 = icmp eq i32 %or, 0 @@ -2069,15 +2069,15 @@ declare void @llvm.memset.p0.i64(ptr writeonly captures(none), i8, i64, i1 immar ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.fshl.i32(i32, i32, i32) #7 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umin.i64(i64, i64) #7 - ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.bswap.i32(i32) #7 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i64 @llvm.umin.i64(i64, i64) #7 + attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(write, inaccessiblemem: none) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind memory(write, argmem: readwrite) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nofree norecurse nosync nounwind memory(argmem: write) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -2133,4 +2133,3 @@ attributes #8 = { nocallback nofree nosync nounwind willreturn memory(inaccessib !40 = distinct !{!40, !6} !41 = distinct !{!41, !6} !42 = distinct !{!42, !6} -!43 = distinct !{!43, !6} diff --git a/bench/graphviz/optimized/excontext.ll b/bench/graphviz/optimized/excontext.ll index 3a701a96108..50e758d63e1 100644 --- a/bench/graphviz/optimized/excontext.ll +++ b/bench/graphviz/optimized/excontext.ll @@ -10,13 +10,12 @@ define noundef ptr @excontext(ptr noundef %0, ptr noundef %1, i32 noundef %2) lo %4 = ptrtoint ptr %0 to i64 %5 = getelementptr inbounds nuw i8, ptr %0, i64 848 %6 = load ptr, ptr %5, align 8 - %7 = ptrtoint ptr %6 to i64 - %8 = getelementptr inbounds nuw i8, ptr %0, i64 336 - %9 = icmp ugt ptr %6, %8 + %7 = getelementptr inbounds nuw i8, ptr %0, i64 336 + %8 = icmp ugt ptr %6, %7 %.phi.trans.insert = getelementptr inbounds nuw i8, ptr %0, i64 868 %.pre = load i32, ptr %.phi.trans.insert, align 4 %10 = icmp eq i32 %.pre, 0 - br i1 %9, label %15, label %11 + br i1 %8, label %15, label %11 11: ; preds = %3 br i1 %10, label %.loopexit, label %.thread @@ -40,16 +39,10 @@ define noundef ptr @excontext(ptr noundef %0, ptr noundef %1, i32 noundef %2) lo %21 = icmp ult ptr %.070, %5 br i1 %21, label %.lr.ph.preheader, label %.critedge -.lr.ph.preheader: ; preds = %.preheader69 - %22 = add i64 %4, 848 - %23 = sub i64 %22, %7 - %scevgep = getelementptr i8, ptr %6, i64 %23 - br label %.lr.ph - -.lr.ph: ; preds = %.lr.ph.preheader, %gv_isspace.exit - %.071 = phi ptr [ %.0, %gv_isspace.exit ], [ %.070, %.lr.ph.preheader ] - %24 = load i8, ptr %.071, align 1 - switch i8 %24, label %.critedge [ +.lr.ph.preheader: ; preds = %.preheader69, %gv_isspace.exit + %22 = phi ptr [ %.0, %gv_isspace.exit ], [ %.070, %.preheader69 ] + %23 = load i8, ptr %22, align 1 + switch i8 %23, label %.critedge [ i8 9, label %gv_isspace.exit i8 10, label %gv_isspace.exit i8 11, label %gv_isspace.exit @@ -60,11 +53,11 @@ define noundef ptr @excontext(ptr noundef %0, ptr noundef %1, i32 noundef %2) lo gv_isspace.exit: ; preds = %.lr.ph, %.lr.ph, %.lr.ph, %.lr.ph, %.lr.ph, %.lr.ph %.0 = getelementptr inbounds nuw i8, ptr %.071, i64 1 - %exitcond.not = icmp eq ptr %.0, %scevgep - br i1 %exitcond.not, label %.critedge, label %.lr.ph + %exitcond.not = icmp ult ptr %.0, %5 + br i1 %exitcond.not, label %.lr.ph, label %.critedge .critedge: ; preds = %gv_isspace.exit, %.lr.ph, %.preheader69 - %.0.lcssa = phi ptr [ %.070, %.preheader69 ], [ %.071, %.lr.ph ], [ %scevgep, %gv_isspace.exit ] + %.0.lcssa = phi ptr [ %.070, %.preheader69 ], [ %.071, %.lr.ph ], [ %.0, %gv_isspace.exit ] %25 = ptrtoint ptr %.0.lcssa to i64 %26 = ptrtoint ptr %.070 to i64 %27 = ptrtoint ptr %19 to i64 @@ -85,22 +78,15 @@ gv_isspace.exit: ; preds = %.lr.ph, %.lr.ph, %. %38 = icmp ult ptr %.1, %5 br i1 %38, label %.lr.ph76.preheader, label %thread-pre-split.thread107 -.lr.ph76.preheader: ; preds = %.critedge - %.191 = ptrtoint ptr %.1 to i64 - %39 = add i64 %4, 848 - %40 = sub i64 %39, %.191 - %scevgep92 = getelementptr i8, ptr %.1, i64 %40 - br label %.lr.ph76 - -.lr.ph76: ; preds = %.lr.ph76.preheader, %.lr.ph76 - %.275 = phi ptr [ %41, %.lr.ph76 ], [ %.1, %.lr.ph76.preheader ] - %.25374 = phi ptr [ %43, %.lr.ph76 ], [ %1, %.lr.ph76.preheader ] - %41 = getelementptr inbounds nuw i8, ptr %.275, i64 1 - %42 = load i8, ptr %.275, align 1 - %43 = getelementptr inbounds nuw i8, ptr %.25374, i64 1 - store i8 %42, ptr %.25374, align 1 - %exitcond93.not = icmp eq ptr %41, %scevgep92 - br i1 %exitcond93.not, label %thread-pre-split, label %.lr.ph76 +.lr.ph76.preheader: ; preds = %.critedge, %.lr.ph76 + %.191 = phi ptr [ %37, %.lr.ph76 ], [ %.1, %.critedge ] + %39 = phi ptr [ %39, %.lr.ph76 ], [ %1, %.critedge ] + %40 = getelementptr inbounds nuw i8, ptr %.191, i64 1 + %scevgep92 = load i8, ptr %.191, align 1 + %39 = getelementptr inbounds nuw i8, ptr %.25374, i64 1 + store i8 %38, ptr %.25374, align 1 + %40 = icmp ult ptr %37, %5 + br i1 %40, label %.lr.ph76.preheader, label %thread-pre-split thread-pre-split: ; preds = %.lr.ph76 %.pr.pre = load i32, ptr %20, align 4 @@ -108,11 +94,11 @@ thread-pre-split: ; preds = %.lr.ph76 br i1 %44, label %.preheader, label %thread-pre-split.thread107 .preheader: ; preds = %15, %thread-pre-split - %.152106 = phi ptr [ %43, %thread-pre-split ], [ %1, %15 ] + %.152106 = phi ptr [ %39, %thread-pre-split ], [ %1, %15 ] %45 = phi ptr [ %19, %thread-pre-split ], [ %18, %15 ] %46 = load ptr, ptr %5, align 8 %47 = ptrtoint ptr %46 to i64 - %48 = icmp ult ptr %8, %46 + %48 = icmp ult ptr %7, %46 br i1 %48, label %.lr.ph79.preheader, label %.critedge2 .lr.ph79.preheader: ; preds = %.preheader @@ -121,14 +107,14 @@ thread-pre-split: ; preds = %.lr.ph76 br label %.lr.ph79 thread-pre-split.thread107: ; preds = %.critedge, %thread-pre-split - %.152110 = phi ptr [ %43, %thread-pre-split ], [ %1, %.critedge ] + %.152110 = phi ptr [ %39, %thread-pre-split ], [ %1, %.critedge ] store i32 0, ptr %20, align 4 %.pre100 = load ptr, ptr %5, align 8 %.pre101 = ptrtoint ptr %.pre100 to i64 br label %.critedge2 .lr.ph79: ; preds = %.lr.ph79.preheader, %51 - %.478 = phi ptr [ %52, %51 ], [ %8, %.lr.ph79.preheader ] + %.478 = phi ptr [ %52, %51 ], [ %7, %.lr.ph79.preheader ] %50 = load i8, ptr %.478, align 1 switch i8 %50, label %.critedge2 [ i8 9, label %51 @@ -149,7 +135,7 @@ thread-pre-split.thread107: ; preds = %.critedge, %thread- %53 = phi ptr [ %45, %.preheader ], [ %19, %thread-pre-split.thread107 ], [ %45, %.lr.ph79 ], [ %45, %51 ] %.pre-phi = phi i64 [ %47, %.preheader ], [ %.pre101, %thread-pre-split.thread107 ], [ %47, %.lr.ph79 ], [ %47, %51 ] %54 = phi ptr [ %46, %.preheader ], [ %.pre100, %thread-pre-split.thread107 ], [ %46, %.lr.ph79 ], [ %46, %51 ] - %.3 = phi ptr [ %8, %.preheader ], [ %8, %thread-pre-split.thread107 ], [ %scevgep94, %51 ], [ %.478, %.lr.ph79 ] + %.3 = phi ptr [ %7, %.preheader ], [ %7, %thread-pre-split.thread107 ], [ %scevgep94, %51 ], [ %.478, %.lr.ph79 ] %55 = ptrtoint ptr %.3 to i64 %56 = sub i64 %.pre-phi, %55 %57 = ptrtoint ptr %53 to i64 @@ -177,7 +163,7 @@ thread-pre-split.thread107: ; preds = %.critedge, %thread- ._crit_edge: ; preds = %.lr.ph85, %.critedge2 %.354.lcssa = phi ptr [ %.152105, %.critedge2 ], [ %66, %.lr.ph85 ] - store ptr %8, ptr %5, align 8 + store ptr %7, ptr %5, align 8 store i8 60, ptr %.354.lcssa, align 1 br label %69 diff --git a/bench/graphviz/optimized/partition.ll b/bench/graphviz/optimized/partition.ll index 54be1b2040c..fc920f32ac0 100644 --- a/bench/graphviz/optimized/partition.ll +++ b/bench/graphviz/optimized/partition.ll @@ -439,10 +439,9 @@ store.exit.preheader: ; preds = %31 %wide.trip.count = zext nneg i32 %1 to i64 br label %.lr.ph -.lr.ph: ; preds = %.lr.ph.preheader, %store.exit29 - %indvars.iv42 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next43, %store.exit29 ] - %indvars.iv = phi i64 [ 5, %.lr.ph.preheader ], [ %indvars.iv.next, %store.exit29 ] - %indvars44 = trunc i64 %indvars.iv to i32 +.lr.ph: ; preds = %.lr.ph.preheader, %store.exit28 + %indvars.iv42 = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next43, %store.exit28 ] + %indvars.iv = phi i64 [ 5, %.lr.ph.preheader ], [ %indvars.iv.next, %store.exit28 ] %40 = getelementptr inbounds nuw %struct.cell, ptr %0, i64 %indvars.iv42, i32 5 %.sroa.033.0.copyload = load double, ptr %40, align 1 %.sroa.535.0..sroa_idx = getelementptr inbounds nuw i8, ptr %40, i64 8 @@ -475,80 +474,75 @@ store.exit.preheader: ; preds = %31 br i1 %exitcond.not.i22, label %convert.exit23, label %.preheader.i19 convert.exit23: ; preds = %.preheader.i19, %.lr.ph - %46 = add nuw i32 %indvars44, 3 - %47 = trunc i64 %indvars.iv to i32 - %48 = add i32 %47, 3 - %sext.i = sext i32 %48 to i64 - %smax.i = tail call i32 @llvm.smax.i32(i32 %indvars44, i32 %46) - %reass.sub = sub nsw i32 %smax.i, %indvars44 - %49 = add i32 %reass.sub, 1 - %wide.trip.count.i = zext i32 %49 to i64 - %50 = getelementptr inbounds %struct.segment_t, ptr %3, i64 %sext.i + %46 = add nuw nsw i64 %indvars.iv, 3 + %47 = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %46 + %48 = getelementptr inbounds nuw i8, ptr %47, i64 44 + %sext.i = getelementptr inbounds nuw i8, ptr %47, i64 48 + %smax.i = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %indvars.iv %51 = getelementptr inbounds nuw i8, ptr %50, i64 44 %52 = getelementptr inbounds nuw i8, ptr %50, i64 48 - %53 = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %indvars.iv - %54 = getelementptr inbounds nuw i8, ptr %53, i64 44 - %55 = getelementptr inbounds nuw i8, ptr %53, i64 48 + %53 = trunc nuw nsw i64 %indvars.iv to i32 + %54 = trunc i64 %indvars.iv to i32 + %55 = add i32 %54, 2 %56 = trunc i64 %indvars.iv to i32 - %57 = add i32 %56, 2 - %58 = trunc i64 %indvars.iv to i32 - %59 = add i32 %58, 1 - br label %60 - -60: ; preds = %73, %convert.exit23 - %indvars.iv42.i24 = phi i64 [ %indvars.iv, %convert.exit23 ], [ %indvars.iv.next43.i26, %73 ] - %indvars.iv.i25 = phi i64 [ 0, %convert.exit23 ], [ %indvars.iv.next.i27, %73 ] - %61 = icmp eq i64 %indvars.iv42.i24, %indvars.iv - br i1 %61, label %62, label %63 - -62: ; preds = %60 - store i32 %59, ptr %54, align 4 - store i32 %48, ptr %55, align 8 - br label %73 - -63: ; preds = %60 - %64 = icmp eq i64 %indvars.iv42.i24, %sext.i - br i1 %64, label %65, label %66 - -65: ; preds = %63 - store i32 %indvars44, ptr %51, align 4 - store i32 %57, ptr %52, align 8 - br label %73 - -66: ; preds = %63 - %67 = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %indvars.iv42.i24 - %68 = getelementptr inbounds nuw i8, ptr %67, i64 44 - %69 = trunc i64 %indvars.iv42.i24 to i32 - %70 = add i32 %69, 1 - store i32 %70, ptr %68, align 4 - %71 = getelementptr inbounds nuw i8, ptr %67, i64 48 - %72 = add i32 %69, -1 - store i32 %72, ptr %71, align 8 - br label %73 - -73: ; preds = %66, %65, %62 - %74 = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %indvars.iv42.i24 - %75 = getelementptr inbounds nuw i8, ptr %74, i64 32 - store i8 0, ptr %75, align 8 - %76 = getelementptr inbounds nuw i8, ptr %74, i64 48 - %77 = load i32, ptr %76, align 8 - %78 = sext i32 %77 to i64 - %79 = getelementptr inbounds %struct.segment_t, ptr %3, i64 %78, i32 1 - %80 = getelementptr inbounds nuw %struct.pointf_s, ptr %6, i64 %indvars.iv.i25 - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull readonly align 16 dereferenceable(16) %80, i64 16, i1 false) - call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %79, ptr noundef nonnull readonly align 16 dereferenceable(16) %80, i64 16, i1 false) + %57 = add i32 %56, 1 + %58 = trunc nuw i64 %46 to i32 + br label %59 + +59: ; preds = %72, %convert.exit22 + %indvars.iv42.i23 = phi i64 [ %indvars.iv, %convert.exit22 ], [ %indvars.iv.next43.i25, %72 ] + %indvars.iv42.i24 = phi i64 [ 0, %convert.exit23 ], [ %indvars.iv.next43.i26, %72 ] + %indvars.iv.i25 = icmp eq i64 %indvars.iv42.i23, %indvars.iv + br i1 %indvars.iv.i25, label %61, label %62 + +61: ; preds = %59 + store i32 %57, ptr %51, align 4 + store i32 %58, ptr %52, align 8 + br label %72 + +62: ; preds = %59 + %63 = icmp eq i64 %indvars.iv42.i23, %46 + br i1 %63, label %64, label %65 + +64: ; preds = %62 + store i32 %53, ptr %48, align 4 + store i32 %55, ptr %49, align 8 + br label %72 + +65: ; preds = %62 + %66 = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %indvars.iv42.i23 + %67 = getelementptr inbounds nuw i8, ptr %66, i64 44 + %68 = trunc i64 %indvars.iv42.i23 to i32 + %69 = add i32 %68, 1 + store i32 %69, ptr %67, align 4 + %70 = getelementptr inbounds nuw i8, ptr %66, i64 48 + %71 = add i32 %68, -1 + store i32 %71, ptr %70, align 8 + br label %72 + +72: ; preds = %65, %64, %61 + %73 = getelementptr inbounds nuw %struct.segment_t, ptr %3, i64 %indvars.iv42.i23 + %74 = getelementptr inbounds nuw i8, ptr %73, i64 32 + store i8 0, ptr %74, align 8 + %75 = getelementptr inbounds nuw i8, ptr %73, i64 48 + %76 = load i32, ptr %75, align 8 + %77 = sext i32 %76 to i64 + %78 = getelementptr inbounds %struct.segment_t, ptr %3, i64 %77, i32 1 + %79 = getelementptr inbounds nuw %struct.pointf_s, ptr %6, i64 %indvars.iv.i24 + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull readonly align 16 dereferenceable(16) %79, i64 16, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %78, ptr noundef nonnull readonly align 16 dereferenceable(16) %79, i64 16, i1 false) + %indvars.iv.next43.i25 = add nuw nsw i64 %indvars.iv42.i23, 1 %indvars.iv.next43.i26 = add nuw nsw i64 %indvars.iv42.i24, 1 - %indvars.iv.next.i27 = add nuw nsw i64 %indvars.iv.i25, 1 - %exitcond.not.i28 = icmp eq i64 %indvars.iv.next.i27, %wide.trip.count.i - br i1 %exitcond.not.i28, label %store.exit29, label %60 + %indvars.iv.next.i27 = icmp eq i64 %indvars.iv.next43.i26, 4 + br i1 %indvars.iv.next.i27, label %store.exit28, label %59 -store.exit29: ; preds = %73 +store.exit28: ; preds = %72 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 4 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %store.exit._crit_edge, label %.lr.ph -store.exit._crit_edge: ; preds = %store.exit29, %store.exit.preheader +store.exit._crit_edge: ; preds = %store.exit28, %store.exit.preheader ret void } @@ -1720,9 +1714,6 @@ declare noalias noundef ptr @realloc(ptr allocptr noundef captures(none), i64 no ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #16 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.smax.i32(i32, i32) #16 - ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #17 diff --git a/bench/hermes/optimized/hbc-attribute.ll b/bench/hermes/optimized/hbc-attribute.ll index 6b723e1ffd7..e0cb087934e 100644 --- a/bench/hermes/optimized/hbc-attribute.ll +++ b/bench/hermes/optimized/hbc-attribute.ll @@ -4515,9 +4515,6 @@ for.body.lr.ph: ; preds = %while.body %keyTag.sroa.3.0.extract.trunc = trunc nuw i64 %keyTag.sroa.3.0.extract.shift to i32 %conv3.i = and i32 %keyTag.sroa.3.0.extract.trunc, 255 %2 = call i32 @llvm.fshl.i32(i32 %conv3.i, i32 %conv3.i, i32 28) - %3 = add i32 %count.addr.093, -1 - %4 = add nsw i32 %keyTag.sroa.0.0.extract.trunc, -1 - %umin = call i32 @llvm.umin.i32(i32 %3, i32 %4) br label %for.body for.body: ; preds = %for.body.lr.ph, %_ZN12_GLOBAL__N_112UsageCounter22countSerializedLiteralEhPKhPj.exit @@ -4572,19 +4569,19 @@ _ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS %retval.0.i.i.i78 = phi ptr [ %call.i2.i.i.i74, %if.end.i.i.i73 ], [ %7, %if.end3.i71 ] %second.i7.i79 = getelementptr inbounds nuw i8, ptr %retval.0.i.i.i78, i64 24 store i32 1, ptr %second.i7.i79, align 4 + %7 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %7) #22 + %8 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %8, ptr nonnull @.str.28, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %8, ptr nonnull @.str.43, i64 29) #22 %9 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %9) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %9, ptr nonnull @.str.29, i64 8) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %9, i32 noundef %conv.i) #22 %10 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr nonnull @.str.28, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr nonnull @.str.43, i64 29) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %10, ptr nonnull @.str.30, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %10, i32 noundef 1) #22 %11 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %11, ptr nonnull @.str.29, i64 8) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %11, i32 noundef %conv.i) #22 - %12 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %12, ptr nonnull @.str.30, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %12, i32 noundef 1) #22 - %13 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %13) #22 + call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %11) #22 br label %_ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit81 _ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit81: ; preds = %sw.bb.i, %_ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS4_EENS_6detail12DenseMapPairIS4_jEEEES4_jS6_S9_EixERKS4_.exit.i77 @@ -4626,19 +4623,19 @@ _ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS %retval.0.i.i.i60 = phi ptr [ %call.i2.i.i.i56, %if.end.i.i.i55 ], [ %14, %if.end3.i53 ] %second.i7.i61 = getelementptr inbounds nuw i8, ptr %retval.0.i.i.i60, i64 24 store i32 2, ptr %second.i7.i61, align 4 + %14 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %14) #22 + %15 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %15, ptr nonnull @.str.28, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %15, ptr nonnull @.str.44, i64 30) #22 %16 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %16) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %16, ptr nonnull @.str.29, i64 8) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %16, i32 noundef %conv.i) #22 %17 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %17, ptr nonnull @.str.28, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %17, ptr nonnull @.str.44, i64 30) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %17, ptr nonnull @.str.30, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %17, i32 noundef 2) #22 %18 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %18, ptr nonnull @.str.29, i64 8) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %18, i32 noundef %conv.i) #22 - %19 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %19, ptr nonnull @.str.30, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %19, i32 noundef 2) #22 - %20 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %20) #22 + call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %18) #22 br label %_ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit63 _ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit63: ; preds = %sw.bb7.i, %_ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS4_EENS_6detail12DenseMapPairIS4_jEEEES4_jS6_S9_EixERKS4_.exit.i59 @@ -4680,19 +4677,19 @@ _ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS %retval.0.i.i.i42 = phi ptr [ %call.i2.i.i.i38, %if.end.i.i.i37 ], [ %21, %if.end3.i35 ] %second.i7.i43 = getelementptr inbounds nuw i8, ptr %retval.0.i.i.i42, i64 24 store i32 4, ptr %second.i7.i43, align 4 + %21 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %21) #22 + %22 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %22, ptr nonnull @.str.28, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %22, ptr nonnull @.str.45, i64 29) #22 %23 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %23) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %23, ptr nonnull @.str.29, i64 8) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %23, i32 noundef %conv.i) #22 %24 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %24, ptr nonnull @.str.28, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %24, ptr nonnull @.str.45, i64 29) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %24, ptr nonnull @.str.30, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %24, i32 noundef 4) #22 %25 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %25, ptr nonnull @.str.29, i64 8) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %25, i32 noundef %conv.i) #22 - %26 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %26, ptr nonnull @.str.30, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %26, i32 noundef 4) #22 - %27 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %27) #22 + call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %25) #22 br label %_ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit45 _ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit45: ; preds = %sw.bb15.i, %_ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS4_EENS_6detail12DenseMapPairIS4_jEEEES4_jS6_S9_EixERKS4_.exit.i41 @@ -4731,19 +4728,19 @@ _ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS %retval.0.i.i.i24 = phi ptr [ %call.i2.i.i.i20, %if.end.i.i.i19 ], [ %28, %if.end3.i17 ] %second.i7.i25 = getelementptr inbounds nuw i8, ptr %retval.0.i.i.i24, i64 24 store i32 8, ptr %second.i7.i25, align 4 + %28 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %28) #22 + %29 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %29, ptr nonnull @.str.28, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %29, ptr nonnull @.str.46, i64 25) #22 %30 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %30) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %30, ptr nonnull @.str.29, i64 8) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %30, i32 noundef %conv.i) #22 %31 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %31, ptr nonnull @.str.28, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %31, ptr nonnull @.str.46, i64 25) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %31, ptr nonnull @.str.30, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %31, i32 noundef 8) #22 %32 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %32, ptr nonnull @.str.29, i64 8) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %32, i32 noundef %conv.i) #22 - %33 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %33, ptr nonnull @.str.30, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %33, i32 noundef 8) #22 - %34 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %34) #22 + call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %32) #22 br label %_ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit27 _ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit27: ; preds = %_ZN4llvh9StringRefC2EPKc.exit58.i, %_ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS4_EENS_6detail12DenseMapPairIS4_jEEEES4_jS6_S9_EixERKS4_.exit.i23 @@ -4781,19 +4778,19 @@ _ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS %retval.0.i.i.i = phi ptr [ %call.i2.i.i.i, %if.end.i.i.i ], [ %35, %if.end3.i ] %second.i7.i = getelementptr inbounds nuw i8, ptr %retval.0.i.i.i, i64 24 store i32 4, ptr %second.i7.i, align 4 + %35 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %35) #22 + %36 = load ptr, ptr %emitter_.i, align 8 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %36, ptr nonnull @.str.28, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %36, ptr nonnull @.str.47, i64 22) #22 %37 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter8openDictEv(ptr noundef nonnull align 8 dereferenceable(72) %37) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %37, ptr nonnull @.str.29, i64 8) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %37, i32 noundef %conv.i) #22 %38 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %38, ptr nonnull @.str.28, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %38, ptr nonnull @.str.47, i64 22) #22 + call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %38, ptr nonnull @.str.30, i64 4) #22 + call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %38, i32 noundef 4) #22 %39 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %39, ptr nonnull @.str.29, i64 8) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %39, i32 noundef %conv.i) #22 - %40 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter7emitKeyEN4llvh9StringRefE(ptr noundef nonnull align 8 dereferenceable(72) %40, ptr nonnull @.str.30, i64 4) #22 - call void @_ZN6hermes11JSONEmitter9emitValueEj(ptr noundef nonnull align 8 dereferenceable(72) %40, i32 noundef 4) #22 - %41 = load ptr, ptr %emitter_.i, align 8 - call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %41) #22 + call void @_ZN6hermes11JSONEmitter9closeDictEv(ptr noundef nonnull align 8 dereferenceable(72) %39) #22 br label %_ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit _ZN12_GLOBAL__N_112UsageCounter12appendRecordEN4llvh9StringRefEjj.exit: ; preds = %_ZN4llvh9StringRefC2EPKc.exit68.i, %_ZN4llvh12DenseMapBaseINS_8DenseMapISt4pairINS_9StringRefEjEjNS_12DenseMapInfoIS4_EENS_6detail12DenseMapPairIS4_jEEEES4_jS6_S9_EixERKS4_.exit.i @@ -4809,8 +4806,10 @@ _ZN12_GLOBAL__N_112UsageCounter22countSerializedLiteralEhPKhPj.exit: ; preds = % %keyInd.2 = phi i32 [ %keyInd.187, %for.body ], [ %add27.i, %sw.epilog.sink.split.i ] %dec = add nsw i32 %count.addr.188, -1 %inc = add nuw nsw i32 %i.089, 1 - %exitcond.not = icmp eq i32 %i.089, %umin - br i1 %exitcond.not, label %while.cond.loopexit, label %for.body, !llvm.loop !37 + %exitcond.not = icmp slt i32 %inc, %keyTag.sroa.0.0.extract.trunc + %tobool = icmp ne i32 %dec, 0 + %40 = select i1 %cmp8, i1 %tobool, i1 false + br i1 %40, label %for.body, label %while.cond.loopexit, !llvm.loop !37 while.end: ; preds = %while.cond.loopexit, %entry ret void @@ -5014,9 +5013,6 @@ declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #21 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #21 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.umin.i32(i32, i32) #18 - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #18 diff --git a/bench/icu/optimized/msgfmt.ll b/bench/icu/optimized/msgfmt.ll index a2427f1c956..dafd8c6b383 100644 --- a/bench/icu/optimized/msgfmt.ll +++ b/bench/icu/optimized/msgfmt.ll @@ -1530,8 +1530,8 @@ if.end38: ; preds = %for.body for.inc: ; preds = %if.end38 %inc = add nuw nsw i32 %idx.023, 1 - %exitcond.not = icmp eq i32 %inc, %call22 - br i1 %exitcond.not, label %return, label %for.body, !llvm.loop !7 + %exitcond.not = icmp slt i32 %inc, %call22 + br i1 %exitcond.not, label %for.body, label %return, !llvm.loop !7 return: ; preds = %for.body, %if.end38, %for.inc, %if.end27, %if.end9, %if.end20, %if.end3, %lor.lhs.false, %if.end, %entry %retval.0 = phi i1 [ true, %entry ], [ false, %if.end ], [ false, %lor.lhs.false ], [ false, %if.end3 ], [ %not.cmp14.not.not, %if.end9 ], [ false, %if.end20 ], [ true, %if.end27 ], [ false, %for.body ], [ false, %if.end38 ], [ true, %for.inc ] diff --git a/bench/icu/optimized/ubidi_props.ll b/bench/icu/optimized/ubidi_props.ll index e4cfbe42d1e..d9482ff8d23 100644 --- a/bench/icu/optimized/ubidi_props.ll +++ b/bench/icu/optimized/ubidi_props.ll @@ -50,18 +50,10 @@ for.cond4: ; preds = %for.cond4.preheader %cmp517 = icmp samesign ult i32 %start.0, %limit.0 br i1 %cmp517, label %while.body.preheader, label %if.end18 -while.body.preheader: ; preds = %for.cond4 - %scevgep = getelementptr i8, ptr %jgArray.0, i64 3 - %4 = add nsw i32 %limit.0, -4 - %5 = sub nsw i32 %4, %start.0 - %6 = zext i32 %5 to i64 - %scevgep22 = getelementptr i8, ptr %scevgep, i64 %6 - br label %while.body - -while.body: ; preds = %while.body.preheader, %if.end11 - %prev.020 = phi i8 [ %prev.1, %if.end11 ], [ 0, %while.body.preheader ] - %jgArray.119 = phi ptr [ %incdec.ptr, %if.end11 ], [ %jgArray.0, %while.body.preheader ] - %start.118 = phi i32 [ %inc12, %if.end11 ], [ %start.0, %while.body.preheader ] +while.body.preheader: ; preds = %for.cond4, %if.end11 + %scevgep = phi i8 [ %prev.1, %if.end11 ], [ 0, %for.cond4 ] + %4 = phi ptr [ %incdec.ptr, %if.end11 ], [ %jgArray.0, %for.cond4 ] + %5 = phi i32 [ %inc12, %if.end11 ], [ %start.0, %for.cond4 ] %incdec.ptr = getelementptr inbounds nuw i8, ptr %jgArray.119, i64 1 %7 = load i8, ptr %jgArray.119, align 1 %cmp7.not = icmp eq i8 %7, %prev.020 @@ -70,14 +62,14 @@ while.body: ; preds = %while.body.preheade if.then8: ; preds = %while.body %8 = load ptr, ptr %add9, align 8 %9 = load ptr, ptr %sa, align 8 - tail call void %8(ptr noundef %9, i32 noundef %start.118) + tail call void %5(ptr noundef %9, i32 noundef %start.118) br label %if.end11 if.end11: ; preds = %if.then8, %while.body %prev.1 = phi i8 [ %7, %if.then8 ], [ %prev.020, %while.body ] %inc12 = add nuw nsw i32 %start.118, 1 - %exitcond23.not = icmp eq ptr %jgArray.119, %scevgep22 - br i1 %exitcond23.not, label %while.end, label %while.body, !llvm.loop !6 + %exitcond23.not = icmp samesign ult i32 %inc12, %limit.0 + br i1 %exitcond23.not, label %while.body, label %while.end, !llvm.loop !6 while.end: ; preds = %if.end11 %10 = icmp eq i8 %prev.1, 0 @@ -86,7 +78,7 @@ while.end: ; preds = %if.end11 if.then15: ; preds = %while.end %11 = load ptr, ptr %add9, align 8 %12 = load ptr, ptr %sa, align 8 - tail call void %11(ptr noundef %12, i32 noundef %limit.0) + tail call void %8(ptr noundef %12, i32 noundef %limit.0) br label %if.end18 if.end18: ; preds = %for.cond4, %if.then15, %while.end diff --git a/bench/libevent/optimized/http.ll b/bench/libevent/optimized/http.ll index ab78346ff11..75e98639750 100644 --- a/bench/libevent/optimized/http.ll +++ b/bench/libevent/optimized/http.ll @@ -9314,8 +9314,6 @@ return: ; preds = %land.lhs.true10.i, ; Function Attrs: nounwind uwtable define internal fastcc range(i32 0, 3) i32 @bracket_addr_ok(ptr noundef nonnull %s, ptr noundef nonnull %eos) unnamed_addr #0 { entry: - %eos43 = ptrtoint ptr %eos to i64 - %s42 = ptrtoint ptr %s to i64 %buf = alloca [64 x i8], align 16 %in6 = alloca %struct.in6_addr, align 4 %add.ptr = getelementptr inbounds nuw i8, ptr %s, i64 3 @@ -9350,12 +9348,8 @@ while.cond.preheader: ; preds = %if.then11 %cmp1531 = icmp ult ptr %add.ptr12, %add.ptr4 br i1 %cmp1531, label %land.rhs.preheader, label %while.endthread-pre-split -land.rhs.preheader: ; preds = %while.cond.preheader - %scevgep = getelementptr i8, ptr inttoptr (i64 -1 to ptr), i64 %eos43 - br label %land.rhs - -land.rhs: ; preds = %land.rhs.preheader, %if.then22 - %s.addr.032 = phi ptr [ %incdec.ptr23, %if.then22 ], [ %add.ptr12, %land.rhs.preheader ] +land.rhs.preheader: ; preds = %while.cond.preheader, %if.then22 + %scevgep = phi ptr [ %incdec.ptr23, %if.then22 ], [ %add.ptr12, %while.cond.preheader ] %4 = load i8, ptr %s.addr.032, align 1 %cmp18.not = icmp eq i8 %4, 46 br i1 %cmp18.not, label %while.cond31.preheader, label %while.body @@ -9367,11 +9361,11 @@ while.body: ; preds = %land.rhs if.then22: ; preds = %while.body %incdec.ptr23 = getelementptr inbounds nuw i8, ptr %s.addr.032, i64 1 - %exitcond.not = icmp eq ptr %incdec.ptr23, %scevgep - br i1 %exitcond.not, label %while.endthread-pre-split, label %land.rhs, !llvm.loop !43 + %exitcond.not = icmp ult ptr %incdec.ptr23, %add.ptr4 + br i1 %exitcond.not, label %land.rhs, label %while.endthread-pre-split, !llvm.loop !43 while.endthread-pre-split: ; preds = %if.then22, %while.cond.preheader - %s.addr.0.lcssa = phi ptr [ %add.ptr12, %while.cond.preheader ], [ %scevgep, %if.then22 ] + %s.addr.0.lcssa = phi ptr [ %add.ptr12, %while.cond.preheader ], [ %incdec.ptr23, %if.then22 ] %.pr = load i8, ptr %s.addr.0.lcssa, align 1 %5 = icmp eq i8 %.pr, 46 br i1 %5, label %while.cond31.preheader, label %return @@ -9382,12 +9376,8 @@ while.cond31.preheader: ; preds = %land.rhs, %while.en %cmp3234 = icmp ult ptr %s.addr.133, %add.ptr4 br i1 %cmp3234, label %while.body34.preheader, label %return -while.body34.preheader: ; preds = %while.cond31.preheader - %scevgep45 = getelementptr i8, ptr inttoptr (i64 -1 to ptr), i64 %eos43 - br label %while.body34 - -while.body34: ; preds = %while.body34.preheader, %if.then46 - %s.addr.135 = phi ptr [ %s.addr.1, %if.then46 ], [ %s.addr.133, %while.body34.preheader ] +while.body34.preheader: ; preds = %while.cond31.preheader, %if.then46 + %scevgep45 = phi ptr [ %s.addr.1, %if.then46 ], [ %s.addr.133, %while.cond31.preheader ] %6 = load i8, ptr %s.addr.135, align 1 %idxprom = zext i8 %6 to i64 %arrayidx35 = getelementptr inbounds nuw [256 x i8], ptr @uri_chars, i64 0, i64 %idxprom @@ -9407,11 +9397,13 @@ lor.lhs.false38: ; preds = %while.body34 if.then46: ; preds = %lor.lhs.false38, %while.body34 %s.addr.1 = getelementptr inbounds nuw i8, ptr %s.addr.135, i64 1 - %exitcond46.not = icmp eq ptr %s.addr.1, %scevgep45 - br i1 %exitcond46.not, label %return, label %while.body34, !llvm.loop !44 + %exitcond46.not = icmp ult ptr %s.addr.1, %add.ptr4 + br i1 %exitcond46.not, label %while.body34, label %return, !llvm.loop !44 if.else51: ; preds = %if.end - %sub.ptr.sub = sub i64 %eos43, %s42 + %sub.ptr.sub = ptrtoint ptr %eos to i64 + %sub.ptr.rhs.cast = ptrtoint ptr %s to i64 + %sub.ptr.sub = sub i64 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast %cmp52 = icmp sgt i64 %sub.ptr.sub, 65 br i1 %cmp52, label %return, label %if.end55 diff --git a/bench/linux/optimized/indirect.ll b/bench/linux/optimized/indirect.ll index 12ce1a7a284..4c01a20b356 100644 --- a/bench/linux/optimized/indirect.ll +++ b/bench/linux/optimized/indirect.ll @@ -74,17 +74,17 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no to label %35 [label %15], !srcloc !7 15: ; preds = %4 - %16 = tail call i32 asm sideeffect "movl %gs:$1, $0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 12)) #12, !srcloc !8 + %16 = tail call i32 asm sideeffect "movl %gs:$1, $0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 12)) #11, !srcloc !8 %17 = zext i32 %16 to i64 - %18 = tail call i8 asm sideeffect " btq $2,$1\0A\09/* output condition code c*/\0A", "={@ccc},*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) @__cpu_online_mask, i64 %17) #12, !srcloc !9 + %18 = tail call i8 asm sideeffect " btq $2,$1\0A\09/* output condition code c*/\0A", "={@ccc},*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) @__cpu_online_mask, i64 %17) #11, !srcloc !9 %19 = icmp ult i8 %18, 2 tail call void @llvm.assume(i1 %19) %20 = icmp eq i8 %18, 0 br i1 %20, label %35, label %21 21: ; preds = %15 - tail call void asm "incl %gs:$0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #12, !srcloc !10 - tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #12, !srcloc !11 + tail call void asm "incl %gs:$0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #11, !srcloc !10 + tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #11, !srcloc !11 %22 = load volatile ptr, ptr getelementptr inbounds nuw (i8, ptr @__tracepoint_ext4_ind_map_blocks_enter, i64 72), align 8 %23 = icmp eq ptr %22, null br i1 %23, label %28, label %24 @@ -96,8 +96,8 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no br label %28 28: ; preds = %24, %21 - tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #12, !srcloc !12 - %29 = tail call i8 asm sideeffect "decl %gs:$0\0A\09/* output condition code e*/\0A", "=*m,={@cce},*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #12, !srcloc !13 + tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #11, !srcloc !12 + %29 = tail call i8 asm sideeffect "decl %gs:$0\0A\09/* output condition code e*/\0A", "=*m,={@cce},*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #11, !srcloc !13 %30 = icmp ult i8 %29, 2 tail call void @llvm.assume(i1 %30) %31 = icmp eq i8 %29, 0 @@ -105,7 +105,7 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no 32: ; preds = %28 %33 = tail call i64 @llvm.read_register.i64(metadata !0) - %34 = tail call i64 asm sideeffect "call __SCT__preempt_schedule_notrace", "={rsp},{rsp},~{dirflag},~{fpsr},~{flags}"(i64 %33) #12, !srcloc !15 + %34 = tail call i64 asm sideeffect "call __SCT__preempt_schedule_notrace", "={rsp},{rsp},~{dirflag},~{fpsr},~{flags}"(i64 %33) #11, !srcloc !15 tail call void @llvm.write_register.i64(metadata !0, i64 %34) br label %35 @@ -118,8 +118,8 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no 40: ; preds = %35 %41 = tail call i32 (ptr, ...) @_printk(ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ext4_ind_map_blocks, ptr noundef nonnull @.str.1, i32 noundef 546, ptr noundef nonnull @.str.2) #13 - tail call void asm sideeffect "2048: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2048b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2048) #12, !srcloc !16 - tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 546, i32 0, i64 12) #12, !srcloc !17 + tail call void asm sideeffect "2048: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2048b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2048) #11, !srcloc !16 + tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 546, i32 0, i64 12) #11, !srcloc !17 unreachable 42: ; preds = %35 @@ -131,8 +131,8 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no 47: ; preds = %42 %48 = tail call i32 (ptr, ...) @_printk(ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ext4_ind_map_blocks, ptr noundef nonnull @.str.1, i32 noundef 547, ptr noundef nonnull @.str.3) #13 - tail call void asm sideeffect "2049: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2049b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2049) #12, !srcloc !19 - tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 547, i32 0, i64 12) #12, !srcloc !20 + tail call void asm sideeffect "2049: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2049b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2049) #11, !srcloc !19 + tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 547, i32 0, i64 12) #11, !srcloc !20 unreachable 49: ; preds = %42 @@ -431,7 +431,7 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no %240 = add i32 %239, -1 %241 = load i32, ptr %13, align 4 %242 = icmp sgt i32 %240, 0 - br i1 %242, label %254, label %243 + br i1 %242, label %251, label %243 243: ; preds = %229 %244 = icmp ult i32 %241, 2 @@ -443,36 +443,34 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no %248 = load ptr, ptr %107, align 8 %249 = zext i32 %241 to i64 %250 = zext i32 %106 to i64 - %251 = add nsw i64 %250, -1 - %252 = add nsw i64 %249, -2 - %umin = call i64 @llvm.umin.i64(i64 %251, i64 %252) - %253 = add nuw nsw i64 %umin, 2 - br label %257 - -254: ; preds = %229 - %255 = sub i32 %.ph32, %104 - %256 = call i32 @llvm.umin.i32(i32 %255, i32 %241) - br label %267 - -257: ; preds = %262, %247 - %258 = phi i64 [ %263, %262 ], [ 1, %247 ] - %259 = getelementptr i32, ptr %248, i64 %258 - %260 = load i32, ptr %259, align 4 - %261 = icmp eq i32 %260, 0 - br i1 %261, label %262, label %264 + br label %254 -262: ; preds = %257 - %263 = add nuw nsw i64 %258, 1 - %exitcond = icmp eq i64 %263, %253 - br i1 %exitcond, label %264, label %257, !llvm.loop !25 +262: ; preds = %229 + %263 = sub i32 %.ph32, %104 + %exitcond = call i32 @llvm.umin.i32(i32 %263, i32 %241) + br label %267 -264: ; preds = %262, %257 - %265 = phi i64 [ %258, %257 ], [ %253, %262 ] +264: ; preds = %259, %247 + %265 = phi i64 [ %260, %259 ], [ 1, %247 ] + %256 = getelementptr i32, ptr %248, i64 %255 + %257 = load i32, ptr %256, align 4 + %258 = icmp eq i32 %257, 0 + br i1 %258, label %259, label %264 + +259: ; preds = %254 + %260 = add nuw nsw i64 %255, 1 + %261 = icmp samesign uge i64 %260, %249 + %262 = icmp samesign uge i64 %255, %250 + %263 = or i1 %262, %261 + br i1 %263, label %264, label %254, !llvm.loop !25 + +264: ; preds = %259, %254 + %265 = phi i64 [ %255, %254 ], [ %260, %259 ] %266 = trunc i64 %265 to i32 br label %267 -267: ; preds = %264, %254, %243 - %268 = phi i32 [ %256, %254 ], [ 1, %243 ], [ %266, %264 ] +267: ; preds = %264, %251, %243 + %268 = phi i32 [ %253, %251 ], [ 1, %243 ], [ %266, %264 ] %269 = getelementptr inbounds nuw i8, ptr %7, i64 8 store i32 %268, ptr %269, align 8 %270 = ptrtoint ptr %10 to i64 @@ -572,7 +570,7 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no 334: ; preds = %309 %335 = call i32 @__SCT__might_resched() #12 - %336 = call i8 asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; btsq $2, $0\0A\09/* output condition code c*/\0A", "=*m,={@ccc},Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) %330, i64 2, ptr nonnull elementtype(i64) %330) #12, !srcloc !26 + %336 = call i8 asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; btsq $2, $0\0A\09/* output condition code c*/\0A", "=*m,={@ccc},Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) %330, i64 2, ptr nonnull elementtype(i64) %330) #11, !srcloc !26 %337 = icmp ult i8 %336, 2 call void @llvm.assume(i1 %337) %338 = icmp eq i8 %336, 0 @@ -631,7 +629,7 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no br i1 %370, label %371, label %372 371: ; preds = %.loopexit40 - call void asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; orb ${1:b},$0", "=*m,iq,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i8) %330, i32 1, ptr nonnull elementtype(i8) %330) #12, !srcloc !28 + call void asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; orb ${1:b},$0", "=*m,iq,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i8) %330, i32 1, ptr nonnull elementtype(i8) %330) #11, !srcloc !28 br label %372 372: ; preds = %371, %.loopexit40 @@ -777,17 +775,17 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no to label %466 [label %446], !srcloc !7 446: ; preds = %.loopexit - %447 = call i32 asm sideeffect "movl %gs:$1, $0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 12)) #12, !srcloc !32 + %447 = call i32 asm sideeffect "movl %gs:$1, $0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 12)) #11, !srcloc !32 %448 = zext i32 %447 to i64 - %449 = call i8 asm sideeffect " btq $2,$1\0A\09/* output condition code c*/\0A", "={@ccc},*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) @__cpu_online_mask, i64 %448) #12, !srcloc !9 + %449 = call i8 asm sideeffect " btq $2,$1\0A\09/* output condition code c*/\0A", "={@ccc},*m,Ir,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i64) @__cpu_online_mask, i64 %448) #11, !srcloc !9 %450 = icmp ult i8 %449, 2 call void @llvm.assume(i1 %450) %451 = icmp eq i8 %449, 0 br i1 %451, label %466, label %452 452: ; preds = %446 - call void asm "incl %gs:$0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #12, !srcloc !10 - call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #12, !srcloc !33 + call void asm "incl %gs:$0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #11, !srcloc !10 + call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #11, !srcloc !33 %453 = load volatile ptr, ptr getelementptr inbounds nuw (i8, ptr @__tracepoint_ext4_ind_map_blocks_exit, i64 72), align 8 %454 = icmp eq ptr %453, null br i1 %454, label %459, label %455 @@ -799,8 +797,8 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no br label %459 459: ; preds = %455, %452 - call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #12, !srcloc !34 - %460 = call i8 asm sideeffect "decl %gs:$0\0A\09/* output condition code e*/\0A", "=*m,={@cce},*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #12, !srcloc !13 + call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"() #11, !srcloc !34 + %460 = call i8 asm sideeffect "decl %gs:$0\0A\09/* output condition code e*/\0A", "=*m,={@cce},*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8), ptr nonnull elementtype(i32) getelementptr inbounds nuw (i8, ptr @pcpu_hot, i64 8)) #11, !srcloc !13 %461 = icmp ult i8 %460, 2 call void @llvm.assume(i1 %461) %462 = icmp eq i8 %460, 0 @@ -808,7 +806,7 @@ define dso_local i32 @ext4_ind_map_blocks(ptr noundef %0, ptr noundef %1, ptr no 463: ; preds = %459 %464 = call i64 @llvm.read_register.i64(metadata !0) - %465 = call i64 asm sideeffect "call __SCT__preempt_schedule_notrace", "={rsp},{rsp},~{dirflag},~{fpsr},~{flags}"(i64 %464) #12, !srcloc !35 + %465 = call i64 asm sideeffect "call __SCT__preempt_schedule_notrace", "={rsp},{rsp},~{dirflag},~{fpsr},~{flags}"(i64 %464) #11, !srcloc !35 call void @llvm.write_register.i64(metadata !0, i64 %465) br label %466 @@ -918,7 +916,7 @@ define internal fastcc noundef ptr @ext4_get_branch(ptr noundef %0, i32 noundef 69: ; preds = %66 %70 = getelementptr inbounds nuw i8, ptr %61, i64 96 - tail call void asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; decl $0", "=*m,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) %70, ptr nonnull elementtype(i32) %70) #12, !srcloc !36 + tail call void asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; decl $0", "=*m,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) %70, ptr nonnull elementtype(i32) %70) #11, !srcloc !36 br label %.loopexit3 71: ; preds = %66 @@ -935,7 +933,7 @@ define internal fastcc noundef ptr @ext4_get_branch(ptr noundef %0, i32 noundef 81: ; preds = %71 %82 = getelementptr inbounds nuw i8, ptr %61, i64 96 - tail call void asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; decl $0", "=*m,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) %82, ptr nonnull elementtype(i32) %82) #12, !srcloc !36 + tail call void asm sideeffect ".pushsection .smp_locks,\22a\22\0A.balign 4\0A.long 671f - .\0A.popsection\0A671:\0A\09lock; decl $0", "=*m,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) %82, ptr nonnull elementtype(i32) %82) #11, !srcloc !36 br label %.loopexit3 83: ; preds = %71, %63 @@ -2008,8 +2006,8 @@ define dso_local noundef i32 @ext4_ind_remove_space(ptr noundef %0, ptr noundef br i1 %80, label %120, label %.thread122, !prof !18 120: ; preds = %.thread121, %117 - tail call void asm sideeffect "2053: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2053b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2053) #12, !srcloc !48 - tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 1259, i32 0, i64 12) #12, !srcloc !49 + tail call void asm sideeffect "2053: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2053b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2053) #11, !srcloc !48 + tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 1259, i32 0, i64 12) #11, !srcloc !49 unreachable .thread122: ; preds = %.thread121 @@ -2758,8 +2756,8 @@ define internal fastcc i32 @ext4_ind_truncate_ensure_credits(ptr noundef %0, ptr br i1 %57, label %58, label %.thread, !prof !18 58: ; preds = %51 - tail call void asm sideeffect "2052: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2052b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2052) #12, !srcloc !55 - tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 716, i32 0, i64 12) #12, !srcloc !56 + tail call void asm sideeffect "2052: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2052b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2052) #11, !srcloc !55 + tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 716, i32 0, i64 12) #11, !srcloc !56 unreachable .thread: ; preds = %51 @@ -2887,9 +2885,6 @@ declare i32 @llvm.umax.i32(i32, i32) #10 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #10 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umin.i64(i64, i64) #11 - attributes #0 = { fn_ret_thunk_extern nounwind null_pointer_is_valid "min-legal-vector-width"="0" "no-jump-tables"="true" "no-trapping-math"="true" "patchable-function-entry"="0" "patchable-function-prefix"="16" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+retpoline-external-thunk,+retpoline-indirect-branches,+retpoline-indirect-calls,-3dnow,-3dnowa,-aes,-avx,-avx10.1-256,-avx10.1-512,-avx2,-avx512bf16,-avx512bitalg,-avx512bw,-avx512cd,-avx512dq,-avx512er,-avx512f,-avx512fp16,-avx512ifma,-avx512pf,-avx512vbmi,-avx512vbmi2,-avx512vl,-avx512vnni,-avx512vp2intersect,-avx512vpopcntdq,-avxifma,-avxneconvert,-avxvnni,-avxvnniint16,-avxvnniint8,-f16c,-fma,-fma4,-gfni,-kl,-mmx,-pclmul,-sha,-sha512,-sm3,-sm4,-sse,-sse2,-sse3,-sse4.1,-sse4.2,-sse4a,-ssse3,-vaes,-vpclmulqdq,-widekl,-x87,-xop" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } @@ -2901,9 +2896,8 @@ attributes #7 = { mustprogress nocallback nofree nosync nounwind willreturn memo attributes #8 = { nocallback nounwind } attributes #9 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #10 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #12 = { nounwind } -attributes #13 = { cold nounwind } +attributes #11 = { nounwind } +attributes #12 = { cold nounwind } !llvm.named.register.rsp = !{!0} !llvm.module.flags = !{!1, !2, !3, !4, !5} diff --git a/bench/llvm/optimized/SemaConcept.ll b/bench/llvm/optimized/SemaConcept.ll index 2f437e30981..80d5c01c06f 100644 --- a/bench/llvm/optimized/SemaConcept.ll +++ b/bench/llvm/optimized/SemaConcept.ll @@ -9363,14 +9363,8 @@ _ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38: %133 = getelementptr inbounds nuw i8, ptr %15, i64 24 br i1 %124, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us.preheader, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split -_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us.preheader: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38 - %134 = add i64 %21, -1 - %135 = add i64 %3, -1 - %umin67 = call i64 @llvm.umin.i64(i64 %134, i64 %135) - br label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us - -_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us.preheader, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us - %.02260.us = phi i64 [ %143, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us ], [ 0, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us.preheader ] +_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us.preheader: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us + %134 = phi i64 [ %141, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us ], [ 0, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38 ] call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %15) #25 store ptr %0, ptr %15, align 8, !tbaa !775 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %131, i8 0, i64 20, i1 false) @@ -9388,21 +9382,17 @@ _ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38. call void @_ZN4llvm17deallocate_bufferEPvmm(ptr noundef %.val30.us, i64 noundef %142, i64 noundef 8) #25 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #25 %143 = add i64 %.02260.us, 1 - %exitcond68 = icmp eq i64 %.02260.us, %umin67 - br i1 %exitcond68, label %.critedge, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us, !llvm.loop !1084 + %exitcond68 = icmp eq i64 %141, %3 + %.not28.us = icmp eq i64 %141, %21 + %or.cond.us = or i1 %.not27.us, %.not28.us + br i1 %or.cond.us, label %.critedge, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us, !llvm.loop !1084 _ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38 %144 = icmp ugt i32 %105, %123 br i1 %144, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us.preheader, label %.critedge -_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us.preheader: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split - %145 = add i64 %21, -1 - %146 = add i64 %3, -1 - %umin = call i64 @llvm.umin.i64(i64 %145, i64 %146) - br label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us - -_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us.preheader, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us - %.02260.us61 = phi i64 [ %154, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us ], [ 0, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us.preheader ] +_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us.preheader: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us + %145 = phi i64 [ %150, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us ], [ 0, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split ] call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %16) #25 store ptr %0, ptr %16, align 8, !tbaa !775 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %126, i8 0, i64 20, i1 false) @@ -9420,8 +9410,10 @@ _ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38. call void @_ZN4llvm17deallocate_bufferEPvmm(ptr noundef %.val32.us, i64 noundef %153, i64 noundef 8) #25 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %16) #25 %154 = add i64 %.02260.us61, 1 - %exitcond = icmp eq i64 %.02260.us61, %umin - br i1 %exitcond, label %.critedge, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us, !llvm.loop !1084 + %exitcond = icmp eq i64 %150, %3 + %.not28.us63 = icmp eq i64 %150, %21 + %or.cond.us64 = or i1 %.not27.us62, %.not28.us63 + br i1 %or.cond.us64, label %.critedge, label %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us, !llvm.loop !1084 .critedge: ; preds = %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.split.us, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split.us, %_ZL36CalculateTemplateDepthForConstraintsRN5clang4SemaEPKNS_9NamedDeclEb.exit38.split call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #25 @@ -84201,9 +84193,6 @@ declare i32 @llvm.umax.i32(i32, i32) #22 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) declare void @llvm.experimental.noalias.scope.decl(metadata) #23 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umin.i64(i64, i64) #22 - ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #22 diff --git a/bench/llvm/optimized/SemaTemplate.ll b/bench/llvm/optimized/SemaTemplate.ll index 6f87da52c41..e8aa581cd40 100644 --- a/bench/llvm/optimized/SemaTemplate.ll +++ b/bench/llvm/optimized/SemaTemplate.ll @@ -78327,12 +78327,9 @@ define dso_local void @_ZN5clang4Sema31getTemplateArgumentBindingsTextB5cxx11EPK %29 = getelementptr inbounds nuw i8, ptr %1, i64 240 %30 = getelementptr inbounds nuw i8, ptr %9, i64 8 %31 = getelementptr inbounds nuw i8, ptr %10, i64 8 - %32 = add i32 %4, -1 - %33 = add nsw i32 %22, -1 - %umin = call i32 @llvm.umin.i32(i32 %32, i32 %33) - %34 = add nuw nsw i32 %umin, 1 - %wide.trip.count = zext nneg i32 %34 to i64 - br label %38 + %32 = zext i32 %4 to i64 + %33 = zext nneg i32 %22 to i64 + br label %37 35: ; preds = %19, %5 %36 = getelementptr inbounds nuw i8, ptr %0, i64 16 @@ -78347,13 +78344,13 @@ define dso_local void @_ZN5clang4Sema31getTemplateArgumentBindingsTextB5cxx11EPK %39 = icmp eq i64 %indvars.iv, 0 %40 = load ptr, ptr %25, align 8, !tbaa !2180 %41 = load ptr, ptr %26, align 8, !tbaa !2181 + %41 = ptrtoint ptr %39 to i64 %42 = ptrtoint ptr %40 to i64 - %43 = ptrtoint ptr %41 to i64 - %44 = sub i64 %42, %43 - br i1 %39, label %.split, label %.split21 + %43 = sub i64 %41, %42 + br i1 %38, label %.split, label %.split21 .split: ; preds = %38 - %45 = icmp ult i64 %44, 6 + %45 = icmp ult i64 %43, 6 br i1 %45, label %46, label %48 46: ; preds = %.split @@ -78368,7 +78365,7 @@ define dso_local void @_ZN5clang4Sema31getTemplateArgumentBindingsTextB5cxx11EPK br label %_ZN4llvm11raw_ostreamlsEPKc.exit .split21: ; preds = %38 - %51 = icmp ult i64 %44, 2 + %51 = icmp ult i64 %43, 2 br i1 %51, label %52, label %54 52: ; preds = %.split21 @@ -78407,11 +78404,11 @@ _ZN4llvm11raw_ostreamlsEPKc.exit: ; preds = %48, %46, %_ZN4llvm1 %69 = and i64 %68, 4294967295 %70 = load ptr, ptr %25, align 8, !tbaa !2180 %71 = load ptr, ptr %26, align 8, !tbaa !2181 + %71 = ptrtoint ptr %69 to i64 %72 = ptrtoint ptr %70 to i64 - %73 = ptrtoint ptr %71 to i64 - %74 = sub i64 %72, %73 - %75 = icmp ugt i64 %69, %74 - br i1 %75, label %76, label %78 + %73 = sub i64 %71, %72 + %74 = icmp ugt i64 %68, %73 + br i1 %74, label %75, label %77 76: ; preds = %63 %77 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull %67, i64 noundef %69) #30 @@ -78452,11 +78449,11 @@ _ZN4llvm11raw_ostreamlsEc.exit: ; preds = %85, %87 _ZN4llvm11raw_ostreamlsENS_9StringRefE.exit: ; preds = %79, %78, %76, %_ZN4llvm11raw_ostreamlsEc.exit %90 = load ptr, ptr %25, align 8, !tbaa !2180 %91 = load ptr, ptr %26, align 8, !tbaa !2181 + %91 = ptrtoint ptr %89 to i64 %92 = ptrtoint ptr %90 to i64 - %93 = ptrtoint ptr %91 to i64 - %94 = sub i64 %92, %93 - %95 = icmp ult i64 %94, 3 - br i1 %95, label %96, label %98 + %93 = sub i64 %91, %92 + %94 = icmp ult i64 %93, 3 + br i1 %94, label %95, label %97 96: ; preds = %_ZN4llvm11raw_ostreamlsENS_9StringRefE.exit %97 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull @.str.7, i64 noundef 3) #30 @@ -78493,26 +78490,28 @@ _ZN4llvm11raw_ostreamlsEPKc.exit37: ; preds = %96, %98 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #30 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #30 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond.not, label %114, label %38, !llvm.loop !2182 - -114: ; preds = %_ZN4llvm11raw_ostreamlsEPKc.exit37 - %115 = load ptr, ptr %26, align 8, !tbaa !2181 - %116 = load ptr, ptr %25, align 8, !tbaa !2180 - %.not.i38 = icmp ult ptr %115, %116 - br i1 %.not.i38, label %119, label %117 - -117: ; preds = %114 - %118 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEh(ptr noundef nonnull align 8 dereferenceable(48) %8, i8 noundef zeroext 93) #30 + %exitcond.not = icmp ne i64 %indvars.iv.next, %33 + %.not26 = icmp samesign ult i64 %indvars.iv.next, %32 + %or.cond28 = and i1 %.not25, %.not26 + br i1 %or.cond28, label %37, label %113, !llvm.loop !2182 + +113:; preds = %_ZN4llvm11raw_ostreamlsEPKc.exit38 + %.not.i38 = load ptr, ptr %26, align 8, !tbaa !2181 + %115 = load ptr, ptr %25, align 8, !tbaa !2180 + %.not.i38 = icmp ult ptr %114, %115 + br i1 %.not.i38, label %118, label %116 + +116: ; preds = %113 + %117 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEh(ptr noundef nonnull align 8 dereferenceable(48) %8, i8 noundef zeroext 93) #30 br label %_ZN4llvm11raw_ostreamlsEc.exit40 -119: ; preds = %114 - %120 = getelementptr inbounds nuw i8, ptr %115, i64 1 +119: ; preds = %113 + %120 = getelementptr inbounds nuw i8, ptr %114, i64 1 store ptr %120, ptr %26, align 8, !tbaa !2181 - store i8 93, ptr %115, align 1, !tbaa !794 + store i8 93, ptr %114, align 1, !tbaa !794 br label %_ZN4llvm11raw_ostreamlsEc.exit40 -_ZN4llvm11raw_ostreamlsEc.exit40: ; preds = %117, %119 +_ZN4llvm11raw_ostreamlsEc.exit40: ; preds = %116, %119 %121 = load ptr, ptr %18, align 8, !tbaa !1961 %122 = load ptr, ptr %121, align 8, !tbaa !1758 %123 = getelementptr inbounds nuw i8, ptr %121, i64 8 diff --git a/bench/node/optimized/libnode.Protocol.ll b/bench/node/optimized/libnode.Protocol.ll index 3eca643dbef..4e2805fc8f5 100644 --- a/bench/node/optimized/libnode.Protocol.ll +++ b/bench/node/optimized/libnode.Protocol.ll @@ -19437,18 +19437,13 @@ while.cond.outer: ; preds = %while.cond.outer.pr %ii.2.ph = phi i64 [ %inc, %if.end77 ], [ %ii.0190, %while.cond.outer.preheader ] %codepoint.1.ph = phi i32 [ %or, %if.end77 ], [ %and54, %while.cond.outer.preheader ] %num_bytes_left.1.ph = phi i32 [ %dec, %if.end77 ], [ %num_bytes_left.0, %while.cond.outer.preheader ] - %37 = trunc i64 %ii.2.ph to i32 - %38 = add i32 %num_bytes_left.1.ph, %37 - %smin = tail call i32 @llvm.smin.i32(i32 %num_bytes_left.1.ph, i32 0) - %39 = sub i32 %38, %smin br label %while.cond while.cond: ; preds = %while.cond.outer, %while.body %ii.2 = phi i64 [ %inc, %while.body ], [ %ii.2.ph, %while.cond.outer ] %num_bytes_left.1 = phi i32 [ %dec, %while.body ], [ %num_bytes_left.1.ph, %while.cond.outer ] - %lftr.wideiv = trunc i64 %ii.2 to i32 - %exitcond.not = icmp eq i32 %39, %lftr.wideiv - br i1 %exitcond.not, label %while.end, label %while.body + %lftr.wideiv = icmp sgt i32 %num_bytes_left.1, 0 + br i1 %lftr.wideiv, label %while.body, label %while.end while.body: ; preds = %while.cond %inc = add i64 %ii.2, 1 @@ -22449,18 +22444,13 @@ while.cond.outer: ; preds = %while.cond.outer.pr %ii.2.ph = phi i64 [ %inc, %if.end77 ], [ %ii.0154, %while.cond.outer.preheader ] %codepoint.1.ph = phi i32 [ %or, %if.end77 ], [ %and54, %while.cond.outer.preheader ] %num_bytes_left.1.ph = phi i32 [ %dec, %if.end77 ], [ %num_bytes_left.0, %while.cond.outer.preheader ] - %15 = trunc i64 %ii.2.ph to i32 - %16 = add i32 %num_bytes_left.1.ph, %15 - %smin = tail call i32 @llvm.smin.i32(i32 %num_bytes_left.1.ph, i32 0) - %17 = sub i32 %16, %smin br label %while.cond while.cond: ; preds = %while.cond.outer, %while.body %ii.2 = phi i64 [ %inc, %while.body ], [ %ii.2.ph, %while.cond.outer ] %num_bytes_left.1 = phi i32 [ %dec, %while.body ], [ %num_bytes_left.1.ph, %while.cond.outer ] - %lftr.wideiv = trunc i64 %ii.2 to i32 - %exitcond.not = icmp eq i32 %17, %lftr.wideiv - br i1 %exitcond.not, label %while.end, label %while.body + %lftr.wideiv = icmp sgt i32 %num_bytes_left.1, 0 + br i1 %lftr.wideiv, label %while.body, label %while.end while.body: ; preds = %while.cond %inc = add i64 %ii.2, 1 @@ -26588,9 +26578,6 @@ declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #25 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #26 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.smin.i32(i32, i32) #23 - attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nounwind uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } diff --git a/bench/opencv/optimized/convexhull.ll b/bench/opencv/optimized/convexhull.ll index ac1fd85c02d..0c818e2f679 100644 --- a/bench/opencv/optimized/convexhull.ll +++ b/bench/opencv/optimized/convexhull.ll @@ -188,44 +188,36 @@ define hidden noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_ad %74 = mul nuw i64 %73, 4164903690 %75 = lshr i64 %72, 32 %76 = add nuw i64 %74, %75 - %.fr85 = freeze i64 %76 - store i64 %.fr85, ptr %47, align 8 - %77 = trunc i64 %.fr85 to i32 + store i64 %76, ptr %47, align 8 + %77 = trunc i64 %76 to i32 + %77 = urem i32 %77, 100 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false) - %78 = trunc nuw i64 %75 to i32 - %79 = add i32 %78, 1 - %80 = urem i32 %77, 100 - %.neg = sub i32 %80, %77 - %81 = add i32 %.neg, %79 - %82 = trunc i64 %72 to i32 - %.neg86 = mul i32 %82, -130063606 - %83 = add i32 %.neg86, %81 - br label %84 - -84: ; preds = %71, %_ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit - %.03681 = phi i32 [ 0, %71 ], [ %143, %_ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit ] - %85 = load i32, ptr %48, align 4 - %86 = sdiv i32 %85, 4 - %87 = mul nsw i32 %85, 3 - %88 = sdiv i32 %87, 4 - %89 = icmp eq i32 %86, %88 - br i1 %89, label %_ZN2cv3RNG7uniformEii.exit, label %90 - -90: ; preds = %84 - %91 = load i64, ptr %47, align 8 - %92 = and i64 %91, 4294967295 - %93 = mul nuw i64 %92, 4164903690 - %94 = lshr i64 %91, 32 - %95 = add nuw i64 %93, %94 - store i64 %95, ptr %47, align 8 - %96 = trunc i64 %95 to i32 - %97 = sub nsw i32 %88, %86 - %98 = urem i32 %96, %97 - %99 = add i32 %98, %86 + br label %79 + +79:; preds = %71, %_ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit + %.neg = phi i32 [ 0, %71 ], [ %138, %_ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit ] + %81 = load i32, ptr %48, align 4 + %82 = sdiv i32 %80, 4 + %.neg86 = mul nsw i32 %80, 3 + %83 = sdiv i32 %.neg86, 4 + %84 = icmp eq i32 %81, %83 + br i1 %84, label %_ZN2cv3RNG7uniformEii.exit, label %85 + +85:; preds = %79 + %85 = load i64, ptr %47, align 8 + %86 = and i64 %85, 4294967295 + %87 = mul nuw i64 %87, 4164903690 + %88 = lshr i64 %86, 32 + %89 = add nuw i64 %86, %88 + store i64 %89, ptr %47, align 8 + %91 = trunc i64 %90 to i32 + %92 = sub nsw i32 %83, %81 + %91 = urem i32 %91, %92 + %92 = add i32 %91, %82 br label %_ZN2cv3RNG7uniformEii.exit -_ZN2cv3RNG7uniformEii.exit: ; preds = %84, %90 - %100 = phi i32 [ %99, %90 ], [ %86, %84 ] +_ZN2cv3RNG7uniformEii.exit: ; preds = %79, %85 + %100 = phi i32 [ %94, %85 ], [ %81, %79 ] %101 = load i32, ptr %49, align 8 %102 = sdiv i32 %101, 4 %103 = mul nsw i32 %101, 3 @@ -333,8 +325,8 @@ _ZNSt6vectorIN2cv6Point_IiEESaIS2_EE17_M_realloc_insertIJRKS2_EEEvN9__gnu_cxx17_ _ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit: ; preds = %_ZNSt6vectorIN2cv6Point_IiEESaIS2_EE17_M_realloc_insertIJRKS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_.exit.i, %119 %143 = add nuw i32 %.03681, 1 - %exitcond.not = icmp eq i32 %143, %83 - br i1 %exitcond.not, label %146, label %84, !llvm.loop !12 + %exitcond.not = icmp samesign ult i32 %.03681, %78 + br i1 %exitcond.not, label %79, label %141, !llvm.loop !12 144: ; preds = %46 %145 = landingpad { ptr, i32 } @@ -369,7 +361,7 @@ _ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit: ; preds = %_ZNSt6vect to label %.preheader.preheader unwind label %152 .preheader.preheader: ; preds = %147 - %wide.trip.count = zext i32 %83 to i64 + %wide.trip.count = zext nneg i32 %78 to i64 br label %.preheader .preheader: ; preds = %.preheader.preheader, %151 @@ -388,8 +380,8 @@ _ZNSt6vectorIN2cv6Point_IiEESaIS2_EE9push_backERKS2_.exit: ; preds = %_ZNSt6vect 151: ; preds = %.preheader %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond84.not = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond84.not, label %158, label %.preheader, !llvm.loop !13 + %exitcond84.not = icmp samesign ult i64 %indvars.iv, %wide.trip.count + br i1 %exitcond84.not, label %.preheader, label %154, !llvm.loop !13 152: ; preds = %161, %147 %153 = landingpad { ptr, i32 } diff --git a/bench/opencv/optimized/qrcode_encoder.ll b/bench/opencv/optimized/qrcode_encoder.ll index 95f111d7cb4..a977f5907e1 100644 --- a/bench/opencv/optimized/qrcode_encoder.ll +++ b/bench/opencv/optimized/qrcode_encoder.ll @@ -1925,10 +1925,7 @@ _ZNSt6vectorIhSaIhEEC2ERKS1_.exit: ; preds = %3, %17 .lr.ph21.split.us.preheader: ; preds = %_ZNSt6vectorIhSaIhEEC2ERKS1_.exit %22 = and i64 %.fr, 2147483647 - %23 = add i64 %4, 1 - %24 = add i64 %.fr, %5 - %25 = sub i64 %23, %24 - %wide.trip.count28 = and i64 %25, 4294967295 + %23 = zext nneg i32 %20 to i64 %wide.trip.count = and i64 %.fr, 2147483647 %26 = getelementptr i8, ptr %10, i64 %22 br label %.lr.ph21.split.us @@ -1956,20 +1953,20 @@ _ZN2cvL5gfMulEhh.exit.us: ; preds = %32 %36 = zext i8 %35 to i64 %37 = getelementptr inbounds nuw [256 x i8], ptr @_ZN2cvL6gf_logE, i64 0, i64 %36 %38 = load i8, ptr %37, align 1 + %37 = zext i8 %36 to i16 + %38 = load i8, ptr %50, align 1 %39 = zext i8 %38 to i16 - %40 = load i8, ptr %52, align 1 - %41 = zext i8 %40 to i16 - %.lhs.trunc.i.us = add nuw nsw i16 %41, %39 - %42 = urem i16 %.lhs.trunc.i.us, 255 - %43 = zext nneg i16 %42 to i64 - %44 = getelementptr inbounds nuw [256 x i8], ptr @_ZN2cvL6gf_expE, i64 0, i64 %43 - %45 = load i8, ptr %44, align 1 - %46 = sub nsw i64 %29, %indvars.iv - %47 = getelementptr inbounds i8, ptr %19, i64 %46 - %48 = load i8, ptr %47, align 1 - %49 = xor i8 %48, %45 - store i8 %49, ptr %47, align 1 - br label %50 + %40 = add nuw nsw i16 %39, %37 + %41 = urem i16 %40, 255 + %.lhs.trunc.i.us = zext nneg i16 %41 to i64 + %42 = getelementptr inbounds nuw [256 x i8], ptr @_ZN2cvL6gf_expE, i64 0, i64 %.lhs.trunc.i.us + %43 = load i8, ptr %42, align 1 + %44 = sub nsw i64 %27, %indvars.iv + %45 = getelementptr inbounds i8, ptr %19, i64 %44 + %46 = load i8, ptr %45, align 1 + %47 = xor i8 %46, %43 + store i8 %47, ptr %45, align 1 + br label %48 50: ; preds = %_ZN2cvL5gfMulEhh.exit.us, %32 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 @@ -1978,8 +1975,8 @@ _ZN2cvL5gfMulEhh.exit.us: ; preds = %32 ..loopexit_crit_edge.us: ; preds = %50, %.lr.ph21.split.us %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 - %exitcond29.not = icmp eq i64 %indvars.iv.next26, %wide.trip.count28 - br i1 %exitcond29.not, label %._crit_edge, label %.lr.ph21.split.us, !llvm.loop !13 + %exitcond29.not = icmp samesign ult i64 %indvars.iv25, %23 + br i1 %exitcond29.not, label %.lr.ph21.split.us, label %._crit_edge, !llvm.loop !13 .preheader.us: ; preds = %.lr.ph21.split.us %51 = zext i8 %31 to i64 diff --git a/bench/openjdk/optimized/mlib_c_ImageCopy.ll b/bench/openjdk/optimized/mlib_c_ImageCopy.ll index 0484f6f911f..b6b3dd736cb 100644 --- a/bench/openjdk/optimized/mlib_c_ImageCopy.ll +++ b/bench/openjdk/optimized/mlib_c_ImageCopy.ll @@ -388,23 +388,16 @@ define hidden void @mlib_ImageCopy_bit_al(ptr noundef %0, ptr noundef %1, i32 no %.not98120 = icmp sgt i32 %.092.lcssa, %43 br i1 %.not98120, label %.loopexit, label %.lr.ph123.preheader -.lr.ph123.preheader: ; preds = %.preheader - %44 = sub i32 %43, %.092.lcssa - %45 = lshr i32 %44, 3 - %46 = add nuw nsw i32 %45, 1 - %wide.trip.count149 = zext nneg i32 %46 to i64 - br label %.lr.ph123 - -.lr.ph123: ; preds = %.lr.ph123.preheader, %.lr.ph123 - %indvars.iv146 = phi i64 [ 0, %.lr.ph123.preheader ], [ %indvars.iv.next147, %.lr.ph123 ] - %.193121 = phi i32 [ %.092.lcssa, %.lr.ph123.preheader ], [ %50, %.lr.ph123 ] - %47 = getelementptr inbounds nuw double, ptr %.0.lcssa, i64 %indvars.iv146 - %48 = load double, ptr %47, align 8 - %49 = getelementptr inbounds nuw double, ptr %.087.lcssa, i64 %indvars.iv146 - store double %48, ptr %49, align 8 - %50 = add nuw nsw i32 %.193121, 8 +.lr.ph123.preheader: ; preds = %.preheader, %.lr.ph123 + %44 = phi i64 [ %indvars.iv.next147, %.lr.ph123 ], [ 0, %.preheader ] + %45 = phi i32 [ %47, %.lr.ph123 ], [ %.092.lcssa, %.preheader ] + %46 = getelementptr inbounds nuw double, ptr %.0.lcssa, i64 %44 + %wide.trip.count149 = load double, ptr %46, align 8 + %46 = getelementptr inbounds nuw double, ptr %.087.lcssa, i64 %indvars.iv146 + store double %45, ptr %46, align 8 + %47 = add nuw nsw i32 %.193121, 8 %indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1 - %exitcond150 = icmp eq i64 %indvars.iv.next147, %wide.trip.count149 + %exitcond150 = icmp sgt i32 %47, %43 br i1 %exitcond150, label %.loopexit, label %.lr.ph123, !llvm.loop !16 51: ; preds = %._crit_edge @@ -423,16 +416,12 @@ define hidden void @mlib_ImageCopy_bit_al(ptr noundef %0, ptr noundef %1, i32 no %60 = sub nuw nsw i32 64, %59 %61 = zext nneg i32 %59 to i64 %62 = zext nneg i32 %60 to i64 - %63 = sub i32 %55, %.092.lcssa - %64 = lshr i32 %63, 3 - %65 = add nuw nsw i32 %64, 1 - %wide.trip.count = zext nneg i32 %65 to i64 - br label %66 - -66: ; preds = %.lr.ph117, %66 - %indvars.iv = phi i64 [ 0, %.lr.ph117 ], [ %indvars.iv.next, %66 ] - %.086115 = phi i64 [ %56, %.lr.ph117 ], [ %68, %66 ] - %.3113 = phi i32 [ %.092.lcssa, %.lr.ph117 ], [ %73, %66 ] + br label %60 + +60:; preds = %.lr.ph117, %60 + %wide.trip.count = phi i64 [ 0, %.lr.ph117 ], [ %indvars.iv.next, %60 ] + %.086115 = phi i64 [ %53, %.lr.ph117 ], [ %62, %60 ] + %.3113 = phi i32 [ %.092.lcssa, %.lr.ph117 ], [ %67, %60 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %67 = getelementptr inbounds nuw i64, ptr %54, i64 %indvars.iv.next %68 = load i64, ptr %67, align 8 @@ -442,12 +431,20 @@ define hidden void @mlib_ImageCopy_bit_al(ptr noundef %0, ptr noundef %1, i32 no %72 = getelementptr inbounds nuw i64, ptr %.087.lcssa, i64 %indvars.iv store i64 %71, ptr %72, align 8 %73 = add nuw nsw i32 %.3113, 8 - %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond, label %.loopexit, label %66, !llvm.loop !17 + %exitcond = icmp sgt i32 %67, %52 + br i1 %exitcond, label %.loopexit.loopexit134, label %60, !llvm.loop !17 + +.loopexit: ; preds = %.lr.ph123.preheader + %.294 = trunc nuw nsw i64 %indvars.iv.next147 to i32 + br label %.loopexit + +.loopexit.loopexit134: ; preds = %60 + %69 = trunc nuw nsw i64 %indvars.iv.next to i32 + br label %.loopexit -.loopexit: ; preds = %66, %.lr.ph123, %51, %.preheader - %.294 = phi i32 [ %.092.lcssa, %.preheader ], [ %.092.lcssa, %51 ], [ %50, %.lr.ph123 ], [ %73, %66 ] - %.pn.in.in = phi i32 [ 0, %.preheader ], [ 0, %51 ], [ %46, %.lr.ph123 ], [ %65, %66 ] +.loopexit: ; preds = %.loopexit.loopexit134, %.loopexit.loopexit, %48, %.preheader + %.294 = phi i32 [ %.092.lcssa, %.preheader ], [ %.092.lcssa, %48 ], [ %47, %.loopexit.loopexit ], [ %67, %.loopexit.loopexit134 ] + %.pn.in.in = phi i32 [ 0, %.preheader ], [ 0, %48 ], [ %68, %.loopexit.loopexit ], [ %69, %.loopexit.loopexit134 ] %.pn.in = shl i32 %.pn.in.in, 3 %.pn = sext i32 %.pn.in to i64 %.1 = getelementptr inbounds i8, ptr %.0.lcssa, i64 %.pn diff --git a/bench/openjdk/optimized/sharedRuntimeTrig.ll b/bench/openjdk/optimized/sharedRuntimeTrig.ll index 2517d1a4e7e..22f15784f5a 100644 --- a/bench/openjdk/optimized/sharedRuntimeTrig.ll +++ b/bench/openjdk/optimized/sharedRuntimeTrig.ll @@ -611,8 +611,6 @@ define internal fastcc noundef i32 @_ZL18__ieee754_rem_pio2dPd(double noundef %0 %162 = zext nneg i32 %.0231.i to i64 %163 = getelementptr inbounds nuw [20 x double], ptr %6, i64 0, i64 %162 %164 = load double, ptr %163, align 8 - %165 = tail call i32 @llvm.smax.i32(i32 %.0231.i, i32 1) - %wide.trip.count114.i = zext nneg i32 %165 to i64 br label %.lr.ph39.i .lr.ph39.i: ; preds = %.lr.ph39.i, %.lr.ph39.preheader.i @@ -632,8 +630,8 @@ define internal fastcc noundef i32 @_ZL18__ieee754_rem_pio2dPd(double noundef %0 %174 = load double, ptr %173, align 8 %175 = fadd double %174, %168 %indvars.iv.next110.i = add nuw nsw i64 %indvars.iv109.i, 1 - %exitcond115.not.i = icmp eq i64 %indvars.iv.next110.i, %wide.trip.count114.i - br i1 %exitcond115.not.i, label %._crit_edge.i, label %.lr.ph39.i, !llvm.loop !13 + %exitcond115.not.i = icmp samesign ugt i64 %indvars.iv107.i, 1 + br i1 %exitcond115.not.i, label %.lr.ph39.i, label %._crit_edge.i, !llvm.loop !13 ._crit_edge.i: ; preds = %.lr.ph39.i %176 = bitcast double %175 to i64 diff --git a/bench/openssl/optimized/libssl-lib-s3_enc.ll b/bench/openssl/optimized/libssl-lib-s3_enc.ll index 59c370d766e..32cda81f83f 100644 --- a/bench/openssl/optimized/libssl-lib-s3_enc.ll +++ b/bench/openssl/optimized/libssl-lib-s3_enc.ll @@ -162,11 +162,11 @@ if.end2: ; preds = %if.end if.end18: ; preds = %if.end2 %8 = load ptr, ptr %c, align 8 %call19 = call i32 @EVP_CIPHER_get_key_length(ptr noundef %8) #8 - %add = add i32 %call19, %call15 + %add = add nsw i32 %call19, %call15 %9 = load ptr, ptr %c, align 8 %call20 = call i32 @EVP_CIPHER_get_iv_length(ptr noundef %9) #8 - %add21 = add i32 %add, %call20 - %mul = shl i32 %add21, 1 + %add21 = add nsw i32 %add, %call20 + %mul = shl nsw i32 %add21, 1 %key_block.i = getelementptr inbounds nuw i8, ptr %s, i64 752 %10 = load ptr, ptr %key_block.i, align 8 %11 = load i64, ptr %key_block_length, align 8 @@ -214,10 +214,7 @@ for.cond.preheader.i: ; preds = %if.end26 for.body.lr.ph.i: ; preds = %for.cond.preheader.i %server_random.i = getelementptr inbounds nuw i8, ptr %s, i64 288 %client_random.i = getelementptr inbounds nuw i8, ptr %s, i64 320 - %17 = zext i32 %mul to i64 - %umax = call i64 @llvm.umax.i64(i64 %17, i64 16) - %18 = add nsw i64 %umax, -1 - %19 = lshr i64 %18, 4 + %17 = zext nneg i32 %mul to i64 br label %for.body.i if.then.i: ; preds = %if.end26 @@ -338,8 +335,8 @@ if.then72.i: ; preds = %if.else.i if.end74.i: ; preds = %if.else.i, %if.end67.i %add.ptr.i = getelementptr inbounds nuw i8, ptr %km.addr.049.i, i64 16 - %exitcond.not = icmp eq i64 %indvars.iv.i, %19 - br i1 %exitcond.not, label %for.end.i, label %for.body.i, !llvm.loop !4 + %exitcond.not = icmp samesign ult i64 %indvars.iv.next51.i, %17 + br i1 %exitcond.not, label %for.body.i, label %for.end.i, !llvm.loop !4 for.end.i: ; preds = %if.end74.i, %for.cond.preheader.i call void @OPENSSL_cleanse(ptr noundef nonnull %smd.i, i64 noundef 20) #8 @@ -897,9 +894,6 @@ declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #6 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #6 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umax.i64(i64, i64) #7 - attributes #0 = { nounwind uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } @@ -907,9 +901,8 @@ attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) " attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #8 = { nounwind } -attributes #9 = { nounwind willreturn memory(read) } +attributes #7 = { nounwind } +attributes #8 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} diff --git a/bench/openusd/optimized/openexr-c.ll b/bench/openusd/optimized/openexr-c.ll index c37ae8e38d0..7f42fd9cb4a 100644 --- a/bench/openusd/optimized/openexr-c.ll +++ b/bench/openusd/optimized/openexr-c.ll @@ -23991,7 +23991,6 @@ reorder_and_predict.exit: ; preds = %.lr.ph39.i, %7, %._ %.061.i = phi ptr [ %36, %reorder_and_predict.exit ], [ %.162.i, %.loopexit.i ] %.pn.i = phi ptr [ %36, %reorder_and_predict.exit ], [ %.259.i, %.loopexit.i ] %.055.i = phi i64 [ 0, %reorder_and_predict.exit ], [ %.2.i, %.loopexit.i ] - %.061100.i = ptrtoint ptr %.061.i to i64 %39 = icmp ult ptr %.061.i, %37 br i1 %39, label %.preheader71.i, label %internal_rle_compress.exit @@ -24101,27 +24100,21 @@ reorder_and_predict.exit: ; preds = %.lr.ph39.i, %7, %._ %70 = icmp ult ptr %.061.i, %.360.lcssa.i br i1 %70, label %.lr.ph95.preheader.i, label %.loopexit.i -.lr.ph95.preheader.i: ; preds = %.critedge2.i - %.360.lcssa99.i = ptrtoint ptr %.360.lcssa.i to i64 - %71 = sub i64 %.392.i, %.061100.i - %72 = add i64 %71, %.360.lcssa99.i - br label %.lr.ph95.i - -.lr.ph95.i: ; preds = %.lr.ph95.i, %.lr.ph95.preheader.i - %.394.i = phi i64 [ %.3.i, %.lr.ph95.i ], [ %.392.i, %.lr.ph95.preheader.i ] - %.26393.i = phi ptr [ %73, %.lr.ph95.i ], [ %.061.i, %.lr.ph95.preheader.i ] - %73 = getelementptr inbounds nuw i8, ptr %.26393.i, i64 1 - %74 = load i8, ptr %.26393.i, align 1 - %75 = getelementptr inbounds i8, ptr %33, i64 %.394.i - store i8 %74, ptr %75, align 1 +.lr.ph95.preheader.i: ; preds = %.critedge2.i, %.lr.ph95.i + %.360.lcssa99.i = phi i64 [ %.3.i, %.lr.ph95.i ], [ %.392.i, %.critedge2.i ] + %71 = phi ptr [ %71, %.lr.ph95.i ], [ %.061.i, %.critedge2.i ] + %72 = getelementptr inbounds nuw i8, ptr %71, i64 1 + %72 = load i8, ptr %.26393.i, align 1 + %73 = getelementptr inbounds i8, ptr %33, i64 %.394.i + store i8 %72, ptr %73, align 1 %.3.i = add i64 %.394.i, 1 - %exitcond.not.i = icmp eq i64 %.3.i, %72 - br i1 %exitcond.not.i, label %.loopexit.i, label %.lr.ph95.i, !llvm.loop !122 + %exitcond.not.i = icmp ult ptr %71, %.360.lcssa.i + br i1 %exitcond.not.i, label %.lr.ph95.i, label %.loopexit.i, !llvm.loop !122 .loopexit.i: ; preds = %.lr.ph95.i, %.critedge2.i, %52 - %.162.i = phi ptr [ %.158.lcssa.i, %52 ], [ %.061.i, %.critedge2.i ], [ %73, %.lr.ph95.i ] + %.162.i = phi ptr [ %.158.lcssa.i, %52 ], [ %.061.i, %.critedge2.i ], [ %71, %.lr.ph95.i ] %.259.i = phi ptr [ %.158.lcssa.i, %52 ], [ %.360.lcssa.i, %.critedge2.i ], [ %.360.lcssa.i, %.lr.ph95.i ] - %.2.i = phi i64 [ %55, %52 ], [ %.392.i, %.critedge2.i ], [ %72, %.lr.ph95.i ] + %.2.i = phi i64 [ %55, %52 ], [ %.392.i, %.critedge2.i ], [ %.3.i, %.lr.ph95.i ] %.not70.i = icmp ult i64 %.2.i, %35 br i1 %.not70.i, label %38, label %internal_rle_compress.exit, !llvm.loop !123 @@ -25391,7 +25384,6 @@ define internal fastcc i64 @internal_rle_compress(ptr noundef writeonly captures %.061 = phi ptr [ %2, %4 ], [ %.162, %.loopexit ] %.pn = phi ptr [ %2, %4 ], [ %.259, %.loopexit ] %.055 = phi i64 [ 0, %4 ], [ %.2, %.loopexit ] - %.061100 = ptrtoint ptr %.061 to i64 %7 = icmp ult ptr %.061, %5 br i1 %7, label %.preheader71, label %43 @@ -25489,27 +25481,21 @@ define internal fastcc i64 @internal_rle_compress(ptr noundef writeonly captures %37 = icmp ult ptr %.061, %.360.lcssa br i1 %37, label %.lr.ph95.preheader, label %.loopexit -.lr.ph95.preheader: ; preds = %.critedge2 - %.360.lcssa99 = ptrtoint ptr %.360.lcssa to i64 - %38 = add i64 %.392, %.360.lcssa99 - %39 = sub i64 %38, %.061100 - br label %.lr.ph95 - -.lr.ph95: ; preds = %.lr.ph95.preheader, %.lr.ph95 - %.394 = phi i64 [ %.3, %.lr.ph95 ], [ %.392, %.lr.ph95.preheader ] - %.26393 = phi ptr [ %40, %.lr.ph95 ], [ %.061, %.lr.ph95.preheader ] - %40 = getelementptr inbounds nuw i8, ptr %.26393, i64 1 - %41 = load i8, ptr %.26393, align 1 - %42 = getelementptr inbounds i8, ptr %0, i64 %.394 - store i8 %41, ptr %42, align 1 +.lr.ph95.preheader: ; preds = %.critedge2, %.lr.ph95 + %.360.lcssa99 = phi i64 [ %.3, %.lr.ph95 ], [ %.392, %.critedge2 ] + %38 = phi ptr [ %39, %.lr.ph95 ], [ %.061, %.critedge2 ] + %39 = getelementptr inbounds nuw i8, ptr %38, i64 1 + %39 = load i8, ptr %.26393, align 1 + %40 = getelementptr inbounds i8, ptr %0, i64 %.394 + store i8 %39, ptr %40, align 1 %.3 = add i64 %.394, 1 - %exitcond.not = icmp eq i64 %.3, %39 - br i1 %exitcond.not, label %.loopexit, label %.lr.ph95, !llvm.loop !122 + %exitcond.not = icmp ult ptr %38, %.360.lcssa + br i1 %exitcond.not, label %.lr.ph95, label %.loopexit, !llvm.loop !122 .loopexit: ; preds = %.lr.ph95, %.critedge2, %19 - %.162 = phi ptr [ %.158.lcssa, %19 ], [ %.061, %.critedge2 ], [ %40, %.lr.ph95 ] + %.162 = phi ptr [ %.158.lcssa, %19 ], [ %.061, %.critedge2 ], [ %38, %.lr.ph95 ] %.259 = phi ptr [ %.158.lcssa, %19 ], [ %.360.lcssa, %.critedge2 ], [ %.360.lcssa, %.lr.ph95 ] - %.2 = phi i64 [ %22, %19 ], [ %.392, %.critedge2 ], [ %39, %.lr.ph95 ] + %.2 = phi i64 [ %22, %19 ], [ %.392, %.critedge2 ], [ %.3, %.lr.ph95 ] %.not70 = icmp ult i64 %.2, %1 br i1 %.not70, label %6, label %43, !llvm.loop !123 diff --git a/bench/protobuf/optimized/padding_optimizer.ll b/bench/protobuf/optimized/padding_optimizer.ll index c8c2cd55abc..82144d7023a 100644 --- a/bench/protobuf/optimized/padding_optimizer.ll +++ b/bench/protobuf/optimized/padding_optimizer.ll @@ -701,22 +701,18 @@ for.body97.lr.ph: ; preds = %for.cond91.preheade for.body97: ; preds = %for.body97.lr.ph, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154 %arrayidx94.val64 = phi ptr [ %arrayidx94.val62550, %for.body97.lr.ph ], [ %arrayidx94.val62, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154 ] %arrayidx94.val63 = phi ptr [ %arrayidx94.val549, %for.body97.lr.ph ], [ %arrayidx94.val, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154 ] - %indvars.iv630 = phi i64 [ 1, %for.body97.lr.ph ], [ %indvars.iv.next631, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154 ] - %indvars.iv628 = phi i64 [ -1, %for.body97.lr.ph ], [ %indvars.iv.next629, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154 ] %indvars.iv623 = phi i64 [ 0, %for.body97.lr.ph ], [ %indvars.iv.next624, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154 ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %2, i8 0, i64 24, i1 false) %sub.ptr.lhs.cast.i141 = ptrtoint ptr %arrayidx94.val64 to i64 %sub.ptr.rhs.cast.i142 = ptrtoint ptr %arrayidx94.val63 to i64 %sub.ptr.sub.i143 = sub i64 %sub.ptr.lhs.cast.i141, %sub.ptr.rhs.cast.i142 %sub.ptr.div.i144 = ashr exact i64 %sub.ptr.sub.i143, 5 - %indvars.iv.next624 = add nuw nsw i64 %indvars.iv623, 4 + %indvars.iv.next624 = add i64 %indvars.iv623, 4 %cmp105533 = icmp ugt i64 %sub.ptr.div.i144, %indvars.iv623 br i1 %cmp105533, label %for.body107.lr.ph, label %for.end116 for.body107.lr.ph: ; preds = %for.body97 - %30 = add i64 %sub.ptr.div.i144, %indvars.iv628 - %umin = tail call i64 @llvm.umin.i64(i64 %30, i64 3) - %31 = add i64 %umin, %indvars.iv630 + %30 = tail call i64 @llvm.umin.i64(i64 %sub.ptr.div.i144, i64 %indvars.iv.next624) br label %for.body107 for.body107: ; preds = %for.body107.lr.ph, %for.inc114 @@ -816,8 +812,8 @@ for.inc114: ; preds = %_ZSt22__uninitializ %40 = phi ptr [ %33, %for.body107 ], [ %add.ptr.i.i.i.i.i.i.i.i59.i, %_ZNSt12_Vector_baseIPKN6google8protobuf15FieldDescriptorESaIS4_EE13_M_deallocateEPS4_m.exit.i ], [ %add.ptr50.i, %_ZSt22__uninitialized_copy_aIN9__gnu_cxx17__normal_iteratorIPKPKN6google8protobuf15FieldDescriptorESt6vectorIS6_SaIS6_EEEEPS6_S6_ET0_T_SF_SE_RSaIT1_E.exit.i ] %div.i529 = phi double [ %div.i530534, %for.body107 ], [ %div.i, %_ZNSt12_Vector_baseIPKN6google8protobuf15FieldDescriptorESaIS4_EE13_M_deallocateEPS4_m.exit.i ], [ %div.i, %_ZSt22__uninitialized_copy_aIN9__gnu_cxx17__normal_iteratorIPKPKN6google8protobuf15FieldDescriptorESt6vectorIS6_SaIS6_EEEEPS6_S6_ET0_T_SF_SE_RSaIT1_E.exit.i ] %indvars.iv.next626 = add nuw i64 %indvars.iv625, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next626, %31 - br i1 %exitcond.not, label %for.cond100.for.end116_crit_edge, label %for.body107, !llvm.loop !6 + %exitcond.not = icmp ult i64 %indvars.iv.next626, %30 + br i1 %exitcond.not, label %for.body107, label %for.cond100.for.end116_crit_edge, !llvm.loop !6 lpad112.loopexit: ; preds = %cond.true.i.i %lpad.loopexit497 = landingpad { ptr, i32 } @@ -873,8 +869,6 @@ _ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154: ; preds %sub.ptr.sub.i139 = sub i64 %sub.ptr.lhs.cast.i137, %sub.ptr.rhs.cast.i138 %sub.ptr.div.i140 = ashr exact i64 %sub.ptr.sub.i139, 5 %cmp96 = icmp ugt i64 %sub.ptr.div.i140, %indvars.iv.next624 - %indvars.iv.next629 = add i64 %indvars.iv628, -4 - %indvars.iv.next631 = add nuw i64 %indvars.iv630, 4 br i1 %cmp96, label %for.body97, label %for.end122, !llvm.loop !7 for.end122: ; preds = %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit154, %for.cond91.preheader @@ -895,27 +889,22 @@ for.body141.lr.ph: ; preds = %for.end122 for.body141: ; preds = %for.body141.lr.ph, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 %arrayidx124.val68 = phi ptr [ %arrayidx124.val, %for.body141.lr.ph ], [ %arrayidx124.val66, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 ] %arrayidx124.val67 = phi ptr [ %arrayidx124.val72, %for.body141.lr.ph ], [ %arrayidx124.val65, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 ] - %indvars.iv641 = phi i64 [ 1, %for.body141.lr.ph ], [ %indvars.iv.next642, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 ] - %indvars.iv638 = phi i64 [ -1, %for.body141.lr.ph ], [ %indvars.iv.next639, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 ] - %indvars.iv633 = phi i64 [ 0, %for.body141.lr.ph ], [ %indvars.iv.next634, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 ] + %indvars.iv641 = phi i64 [ 0, %for.body141.lr.ph ], [ %indvars.iv.next634, %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196 ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %3, i8 0, i64 24, i1 false) %sub.ptr.lhs.cast.i159 = ptrtoint ptr %arrayidx124.val68 to i64 %sub.ptr.rhs.cast.i160 = ptrtoint ptr %arrayidx124.val67 to i64 %sub.ptr.sub.i161 = sub i64 %sub.ptr.lhs.cast.i159, %sub.ptr.rhs.cast.i160 %sub.ptr.div.i162 = ashr exact i64 %sub.ptr.sub.i161, 5 - %indvars.iv.next634 = add nuw nsw i64 %indvars.iv633, 2 - %cmp150562 = icmp ugt i64 %sub.ptr.div.i162, %indvars.iv633 + %indvars.iv.next634 = add i64 %indvars.iv629, 2 + %cmp150562 = icmp ugt i64 %sub.ptr.div.i162, %indvars.iv629 br i1 %cmp150562, label %for.body155.lr.ph, label %for.end164 for.body155.lr.ph: ; preds = %for.body141 - %42 = sub i64 0, %indvars.iv638 - %43 = icmp ne i64 %sub.ptr.div.i162, %42 - %umin640 = zext i1 %43 to i64 - %44 = add i64 %indvars.iv641, %umin640 + %42 = tail call i64 @llvm.umin.i64(i64 %sub.ptr.div.i162, i64 %indvars.iv.next630) br label %for.body155 for.body155: ; preds = %for.body155.lr.ph, %for.inc162 - %indvars.iv635 = phi i64 [ %indvars.iv633, %for.body155.lr.ph ], [ %indvars.iv.next636, %for.inc162 ] + %indvars.iv635 = phi i64 [ %indvars.iv629, %for.body155.lr.ph ], [ %indvars.iv.next636, %for.inc162 ] %45 = phi ptr [ null, %for.body155.lr.ph ], [ %52, %for.inc162 ] %cond.i47.i383574 = phi ptr [ null, %for.body155.lr.ph ], [ %cond.i47.i383573, %for.inc162 ] %46 = phi ptr [ null, %for.body155.lr.ph ], [ %53, %for.inc162 ] @@ -1011,8 +1000,8 @@ for.inc162: ; preds = %_ZSt22__uninitializ %53 = phi ptr [ %46, %for.body155 ], [ %add.ptr.i.i.i.i.i.i.i.i59.i389, %_ZNSt12_Vector_baseIPKN6google8protobuf15FieldDescriptorESaIS4_EE13_M_deallocateEPS4_m.exit.i397 ], [ %add.ptr50.i347, %_ZSt22__uninitialized_copy_aIN9__gnu_cxx17__normal_iteratorIPKPKN6google8protobuf15FieldDescriptorESt6vectorIS6_SaIS6_EEEEPS6_S6_ET0_T_SF_SE_RSaIT1_E.exit.i345 ] %div.i183558 = phi double [ %div.i183559563, %for.body155 ], [ %div.i183, %_ZNSt12_Vector_baseIPKN6google8protobuf15FieldDescriptorESaIS4_EE13_M_deallocateEPS4_m.exit.i397 ], [ %div.i183, %_ZSt22__uninitialized_copy_aIN9__gnu_cxx17__normal_iteratorIPKPKN6google8protobuf15FieldDescriptorESt6vectorIS6_SaIS6_EEEEPS6_S6_ET0_T_SF_SE_RSaIT1_E.exit.i345 ] %indvars.iv.next636 = add nuw i64 %indvars.iv635, 1 - %exitcond643.not = icmp eq i64 %indvars.iv.next636, %44 - br i1 %exitcond643.not, label %for.cond145.for.end164_crit_edge, label %for.body155, !llvm.loop !8 + %exitcond643.not = icmp ult i64 %indvars.iv.next636, %42 + br i1 %exitcond643.not, label %for.body155, label %for.cond145.for.end164_crit_edge, !llvm.loop !8 lpad160.loopexit: ; preds = %cond.true.i.i380 %lpad.loopexit494 = landingpad { ptr, i32 } @@ -1049,7 +1038,7 @@ for.end164: ; preds = %for.cond145.for.end %field_group142.val78 = phi ptr [ %cond.i47.i383573, %for.cond145.for.end164_crit_edge ], [ null, %for.body141 ] %div.i183559.lcssa = phi double [ %div.i183558, %for.cond145.for.end164_crit_edge ], [ 0.000000e+00, %for.body141 ] %sub = add nsw i64 %sub.ptr.div.i162, -1 - %cmp169 = icmp eq i64 %sub, %indvars.iv633 + %cmp169 = icmp eq i64 %sub, %indvars.iv629 %storemerge = select i1 %cmp169, double %., double %div.i183559.lcssa store double %storemerge, ptr %field_group142, align 8 invoke fastcc void @_ZNSt6vectorIN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupESaIS5_EE9push_backERKS5_(ptr noundef nonnull align 8 dereferenceable(24) %arrayidx179, ptr noundef nonnull align 8 dereferenceable(32) %field_group142) @@ -1071,8 +1060,6 @@ _ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196: ; preds %sub.ptr.sub.i157 = sub i64 %sub.ptr.lhs.cast.i155, %sub.ptr.rhs.cast.i156 %sub.ptr.div.i158 = ashr exact i64 %sub.ptr.sub.i157, 5 %cmp140 = icmp ugt i64 %sub.ptr.div.i158, %indvars.iv.next634 - %indvars.iv.next639 = add i64 %indvars.iv638, -2 - %indvars.iv.next642 = add nuw i64 %indvars.iv641, 2 br i1 %cmp140, label %for.body141, label %for.end183, !llvm.loop !9 for.end183: ; preds = %_ZN6google8protobuf8compiler3cpp12_GLOBAL__N_110FieldGroupD2Ev.exit196, %for.end122 diff --git a/bench/qemu/optimized/block_qed-table.ll b/bench/qemu/optimized/block_qed-table.ll index 4673b094099..4d472090bf5 100644 --- a/bench/qemu/optimized/block_qed-table.ll +++ b/bench/qemu/optimized/block_qed-table.ll @@ -231,27 +231,24 @@ trace_qed_write_table.exit.for.end_crit_edge: ; preds = %trace_qed_write_tab for.body.preheader: ; preds = %trace_qed_write_table.exit %7 = and i32 %index, -64 - %8 = and i32 %index, -64 - %9 = zext i32 %8 to i64 - %10 = zext i32 %and to i64 - %11 = add i32 %and3, %7 - %12 = sub i32 %11, %and + %8 = zext i32 %7 to i64 + %9 = zext i32 %and to i64 + %10 = zext i32 %and3 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body - %indvars.iv = phi i64 [ %9, %for.body.preheader ], [ %indvars.iv.next, %for.body ] + %indvars.iv = phi i64 [ %8, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr [0 x i64], ptr %table, i64 0, i64 %indvars.iv %13 = load i64, ptr %arrayidx, align 8 - %14 = sub nuw nsw i64 %indvars.iv, %10 + %14 = sub nuw nsw i64 %indvars.iv, %9 %arrayidx9 = getelementptr [0 x i64], ptr %call, i64 0, i64 %14 store i64 %13, ptr %arrayidx9, align 8 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %lftr.wideiv = trunc i64 %indvars.iv.next to i32 - %exitcond.not = icmp eq i32 %12, %lftr.wideiv - br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !5 + %lftr.wideiv = icmp samesign ult i64 %indvars.iv.next, %10 + br i1 %lftr.wideiv, label %for.body, label %for.end, !llvm.loop !5 for.end: ; preds = %for.body, %trace_qed_write_table.exit.for.end_crit_edge - %conv10.pre-phi = phi i64 [ %.pre, %trace_qed_write_table.exit.for.end_crit_edge ], [ %10, %for.body ] + %conv10.pre-phi = phi i64 [ %.pre, %trace_qed_write_table.exit.for.end_crit_edge ], [ %9, %for.body ] %mul11 = shl nuw nsw i64 %conv10.pre-phi, 3 %add12 = add i64 %mul11, %offset %table_lock = getelementptr inbounds nuw i8, ptr %s, i64 72 diff --git a/bench/qemu/optimized/hw_riscv_numa.ll b/bench/qemu/optimized/hw_riscv_numa.ll index c75fff30056..8ae50613b2b 100644 --- a/bench/qemu/optimized/hw_riscv_numa.ll +++ b/bench/qemu/optimized/hw_riscv_numa.ll @@ -364,11 +364,7 @@ for.cond.preheader: ; preds = %numa_enabled.exit if.end3.lr.ph: ; preds = %for.cond.preheader %nodes = getelementptr inbounds nuw i8, ptr %ms.val, i64 8 %2 = zext i32 %socket_id to i64 - %3 = add nsw i32 %1, -1 - %4 = add i32 %socket_id, -1 - %umin = tail call i32 @llvm.umin.i32(i32 %3, i32 %4) - %5 = add nuw nsw i32 %umin, 1 - %wide.trip.count = zext nneg i32 %5 to i64 + %3 = zext nneg i32 %1 to i64 br label %if.end3 if.end3: ; preds = %if.end3.lr.ph, %if.end3 @@ -378,16 +374,17 @@ if.end3: ; preds = %if.end3.lr.ph, %if. %6 = load i64, ptr %arrayidx, align 8 %add = add i64 %6, %mem_offset.013 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond = icmp eq i64 %indvars.iv.next, %wide.trip.count - br i1 %exitcond, label %for.end.loopexit, label %if.end3, !llvm.loop !9 + %exitcond = icmp samesign uge i64 %indvars.iv.next, %3 + %cmp1 = icmp eq i64 %indvars.iv.next, %2 + %or.cond = or i1 %cmp1, %cmp + br i1 %or.cond, label %for.end.loopexit, label %if.end3, !llvm.loop !9 for.end.loopexit: ; preds = %if.end3 - %cmp1 = icmp eq i64 %indvars.iv.next, %2 - %7 = select i1 %cmp1, i64 %add, i64 0 + %cmp1 = select i1 %cmp1, i64 %add, i64 0 br label %return return: ; preds = %for.cond.preheader, %for.end.loopexit, %entry, %numa_enabled.exit - %retval.0 = phi i64 [ 0, %numa_enabled.exit ], [ 0, %entry ], [ 0, %for.cond.preheader ], [ %7, %for.end.loopexit ] + %retval.0 = phi i64 [ 0, %numa_enabled.exit ], [ 0, %entry ], [ 0, %for.cond.preheader ], [ %5, %for.end.loopexit ] ret i64 %retval.0 } @@ -737,9 +734,6 @@ declare i32 @llvm.smin.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.umin.i32(i32, i32) #9 - attributes #0 = { mustprogress nofree norecurse nosync nounwind sspstrong willreturn memory(read, inaccessiblemem: none) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree norecurse nosync nounwind sspstrong memory(read, inaccessiblemem: none) uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nounwind sspstrong uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } diff --git a/bench/qemu/optimized/qemu-io-cmds.ll b/bench/qemu/optimized/qemu-io-cmds.ll index c86cf85070c..44443a3eef7 100644 --- a/bench/qemu/optimized/qemu-io-cmds.ll +++ b/bench/qemu/optimized/qemu-io-cmds.ll @@ -1589,15 +1589,9 @@ entry: %cmp25.not = icmp eq i64 %len, 0 br i1 %cmp25.not, label %for.end33, label %for.body.preheader -for.body.preheader: ; preds = %entry - %0 = add i64 %len, -1 - br label %for.body - -for.body: ; preds = %for.body.preheader, %for.end29 - %indvars.iv32 = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next33, %for.end29 ] - %p.027 = phi ptr [ %buffer, %for.body.preheader ], [ %incdec.ptr, %for.end29 ] - %i.026 = phi i64 [ 0, %for.body.preheader ], [ %add32, %for.end29 ] - %umin = tail call i64 @llvm.umin.i64(i64 %indvars.iv32, i64 15) +for.body.preheader: ; preds = %entry, %for.end29 + %0 = phi ptr [ %incdec.ptr, %for.end29 ], [ %buffer, %entry ] + %i.026 = phi i64 [ %add32, %for.end29 ], [ 0, %entry ] %add = add i64 %i.026, %offset %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.34, i64 noundef %add) br label %for.body6 @@ -1636,14 +1630,16 @@ for.body19: ; preds = %for.body19.lr.ph, % %putchar18 = tail call i32 @putchar(i32 %conv21.sink) %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %incdec.ptr28 = getelementptr i8, ptr %s.024, i64 1 - %exitcond.not = icmp eq i64 %indvars.iv29, %umin - br i1 %exitcond.not, label %for.end29, label %for.body19, !llvm.loop !12 + %exitcond.not = icmp samesign ult i64 %indvars.iv29, 15 + %add15 = or disjoint i64 %i.026, %indvars.iv.next30 + %cmp16 = icmp ult i64 %add15, %len + %or.cond19 = select i1 %cmp11, i1 %cmp16, i1 false + br i1 %or.cond19, label %for.body19, label %for.end29, !llvm.loop !12 for.end29: ; preds = %for.body19 %putchar16 = tail call i32 @putchar(i32 10) %add32 = add i64 %i.026, 16 %cmp = icmp ult i64 %add32, %len - %indvars.iv.next33 = add i64 %indvars.iv32, -16 br i1 %cmp, label %for.body, label %for.end33, !llvm.loop !13 for.end33: ; preds = %for.end29, %entry @@ -5212,9 +5208,6 @@ declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #23 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr captures(none)) #23 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umin.i64(i64, i64) #22 - attributes #0 = { nounwind sspstrong uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { noreturn nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx16,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } diff --git a/bench/qemu/optimized/sdhci-cmd.ll b/bench/qemu/optimized/sdhci-cmd.ll index 5542f91b175..1c97d43b2e4 100644 --- a/bench/qemu/optimized/sdhci-cmd.ll +++ b/bench/qemu/optimized/sdhci-cmd.ll @@ -48,7 +48,7 @@ while.cond.loopexit.i: ; preds = %if.end13.i, %while. while.body.i: ; preds = %entry, %while.cond.loopexit.i %index.019.i = phi i64 [ %index.1.lcssa.i, %while.cond.loopexit.i ], [ 0, %entry ] - %sub.i = sub i64 %count, %index.019.i + %sub.i = sub nuw i64 %count, %index.019.i %conv.i = trunc i64 %sub.i to i32 %call.i = tail call i32 @qtest_readl(ptr noundef %qts, i64 noundef %add) #3 %cmp414.i = icmp sgt i32 %conv.i, 0 @@ -56,11 +56,10 @@ while.body.i: ; preds = %entry, %while.cond. while.body6.preheader.i: ; preds = %while.body.i %0 = tail call i32 @llvm.umin.i32(i32 %conv.i, i32 4) - %1 = trunc i64 %index.019.i to i32 - %2 = add i32 %0, %1 br label %while.body6.i while.body6.i: ; preds = %if.end13.i, %while.body6.preheader.i + %size.017.i = phi i32 [ %dec.i, %if.end13.i ], [ %0, %while.body6.preheader.i ] %msg_frag.016.i = phi i32 [ %shr.i, %if.end13.i ], [ %call.i, %while.body6.preheader.i ] %index.115.i = phi i64 [ %inc.i, %if.end13.i ], [ %index.019.i, %while.body6.preheader.i ] %conv7.i = trunc i32 %msg_frag.016.i to i8 @@ -73,9 +72,9 @@ while.body6.i: ; preds = %if.end13.i, %while. if.end13.i: ; preds = %while.body6.i %shr.i = lshr i32 %msg_frag.016.i, 8 - %lftr.wideiv = trunc i64 %inc.i to i32 - %exitcond = icmp eq i32 %2, %lftr.wideiv - br i1 %exitcond, label %while.cond.loopexit.i, label %while.body6.i, !llvm.loop !7 + %lftr.wideiv = add nsw i32 %size.017.i, -1 + %exitcond = icmp sgt i32 %size.017.i, 1 + br i1 %exitcond, label %while.body6.i, label %while.cond.loopexit.i, !llvm.loop !7 read_fifo.exit: ; preds = %while.cond.loopexit.i, %while.body6.i, %entry %retval.0.i = phi i64 [ 0, %entry ], [ %inc.i, %while.body6.i ], [ %index.1.lcssa.i, %while.cond.loopexit.i ] diff --git a/bench/quantlib/optimized/date.ll b/bench/quantlib/optimized/date.ll index fa0b9b867f8..7f98c3f7bc1 100644 --- a/bench/quantlib/optimized/date.ll +++ b/bench/quantlib/optimized/date.ll @@ -10682,11 +10682,7 @@ if.then: ; preds = %entry br i1 %cmp.i.not28.i.i.i, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.thread.i.i, label %for.body13.preheader.i.i.i for.body13.preheader.i.i.i: ; preds = %if.then, %for.inc29.critedge.i.i.i - %indvars.iv.in = phi i64 [ %indvars.iv, %for.inc29.critedge.i.i.i ], [ %5, %if.then ] - %OuterIt.sroa.0.029.i.i.i = phi ptr [ %incdec.ptr.i11.i.i.i, %for.inc29.critedge.i.i.i ], [ %.pre155.pre156.pre159.pre162, %if.then ] - %indvars.iv = add i64 %indvars.iv.in, -1 - %.not = icmp eq i64 %indvars.iv, 0 - %6 = select i1 %.not, i64 1, i64 2 + %indvars.iv.in = phi ptr [ %incdec.ptr.i11.i.i.i, %for.inc29.critedge.i.i.i ], [ %.pre143.pre144.pre147.pre150, %if.then ] br label %for.body13.i.i.i for.body13.i.i.i: ; preds = %for.inc.i.i.i, %for.body13.preheader.i.i.i @@ -10701,12 +10697,14 @@ for.body13.i.i.i: ; preds = %for.inc.i.i.i, %for for.inc.i.i.i: ; preds = %for.body13.i.i.i %incdec.ptr.i.i.i.i = getelementptr inbounds nuw i8, ptr %InnerIt.sroa.0.023.i.i.i, i64 1 %SubstrIt.024.i.i.i.add = add nuw nsw i64 %SubstrIt.024.i.i.i.idx, 1 - %exitcond = icmp eq i64 %SubstrIt.024.i.i.i.add, %6 - br i1 %exitcond, label %for.end.i.i.i, label %for.body13.i.i.i, !llvm.loop !100 + %exitcond = icmp eq ptr %incdec.ptr.i.i.i.i, %add.ptr.i.i.i.i.i + %cmp.not.i.i.i = icmp eq i64 %SubstrIt.024.i.i.i.add, 2 + %or.cond.i.i.i = select i1 %cmp.i7.i.i.i, i1 true, i1 %cmp.not.i.i.i + br i1 %or.cond.i.i.i, label %for.end.i.i.i, label %for.body13.i.i.i, !llvm.loop !100 for.end.i.i.i: ; preds = %for.inc.i.i.i, %for.body13.i.i.i %InnerIt.sroa.0.0.lcssa.ph.i.i.i = phi ptr [ %InnerIt.sroa.0.023.i.i.i, %for.body13.i.i.i ], [ %incdec.ptr.i.i.i.i, %for.inc.i.i.i ] - %SubstrIt.0.lcssa.ph.i.i.i.idx = phi i64 [ %SubstrIt.024.i.i.i.idx, %for.body13.i.i.i ], [ %6, %for.inc.i.i.i ] + %SubstrIt.0.lcssa.ph.i.i.i.idx = phi i64 [ %SubstrIt.024.i.i.i.idx, %for.body13.i.i.i ], [ %SubstrIt.024.i.i.i.add, %for.inc.i.i.i ] %cmp21.not.i.i.i = icmp eq i64 %SubstrIt.0.lcssa.ph.i.i.i.idx, 2 br i1 %cmp21.not.i.i.i, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.i.i, label %for.inc29.critedge.i.i.i @@ -10767,11 +10765,7 @@ if.then5: ; preds = %if.end br i1 %cmp.i.not28.i.i.i19, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.thread.i.i35, label %for.body13.preheader.i.i.i22 for.body13.preheader.i.i.i22: ; preds = %if.then5, %for.inc29.critedge.i.i.i32 - %indvars.iv143.in = phi i64 [ %indvars.iv143, %for.inc29.critedge.i.i.i32 ], [ %14, %if.then5 ] - %OuterIt.sroa.0.029.i.i.i23 = phi ptr [ %incdec.ptr.i11.i.i.i33, %for.inc29.critedge.i.i.i32 ], [ %.pre155.pre156.pre159, %if.then5 ] - %indvars.iv143 = add i64 %indvars.iv143.in, -1 - %.not166 = icmp eq i64 %indvars.iv143, 0 - %15 = select i1 %.not166, i64 1, i64 2 + %indvars.iv143.in = phi ptr [ %incdec.ptr.i11.i.i.i33, %for.inc29.critedge.i.i.i32 ], [ %.pre143.pre144.pre147, %if.then5 ] br label %for.body13.i.i.i24 for.body13.i.i.i24: ; preds = %for.inc.i.i.i40, %for.body13.preheader.i.i.i22 @@ -10786,12 +10780,14 @@ for.body13.i.i.i24: ; preds = %for.inc.i.i.i40, %f for.inc.i.i.i40: ; preds = %for.body13.i.i.i24 %incdec.ptr.i.i.i.i41 = getelementptr inbounds nuw i8, ptr %InnerIt.sroa.0.023.i.i.i26, i64 1 %SubstrIt.024.i.i.i25.add = add nuw nsw i64 %SubstrIt.024.i.i.i25.idx, 1 - %exitcond146 = icmp eq i64 %SubstrIt.024.i.i.i25.add, %15 - br i1 %exitcond146, label %for.end.i.i.i28, label %for.body13.i.i.i24, !llvm.loop !100 + %exitcond146 = icmp eq ptr %incdec.ptr.i.i.i.i41, %add.ptr.i.i.i.i.i18 + %cmp.not.i.i.i44 = icmp eq i64 %SubstrIt.024.i.i.i25.add, 2 + %or.cond.i.i.i45 = select i1 %cmp.i7.i.i.i43, i1 true, i1 %cmp.not.i.i.i44 + br i1 %or.cond.i.i.i45, label %for.end.i.i.i28, label %for.body13.i.i.i24, !llvm.loop !100 for.end.i.i.i28: ; preds = %for.inc.i.i.i40, %for.body13.i.i.i24 %InnerIt.sroa.0.0.lcssa.ph.i.i.i29 = phi ptr [ %InnerIt.sroa.0.023.i.i.i26, %for.body13.i.i.i24 ], [ %incdec.ptr.i.i.i.i41, %for.inc.i.i.i40 ] - %SubstrIt.0.lcssa.ph.i.i.i30.idx = phi i64 [ %SubstrIt.024.i.i.i25.idx, %for.body13.i.i.i24 ], [ %15, %for.inc.i.i.i40 ] + %SubstrIt.0.lcssa.ph.i.i.i30.idx = phi i64 [ %SubstrIt.024.i.i.i25.idx, %for.body13.i.i.i24 ], [ %SubstrIt.024.i.i.i25.add, %for.inc.i.i.i40 ] %cmp21.not.i.i.i31 = icmp eq i64 %SubstrIt.0.lcssa.ph.i.i.i30.idx, 2 br i1 %cmp21.not.i.i.i31, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.i.i36, label %for.inc29.critedge.i.i.i32 @@ -10852,11 +10848,7 @@ if.then12: ; preds = %if.end10 br i1 %cmp.i.not28.i.i.i59, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.thread.i.i75, label %for.body13.preheader.i.i.i62 for.body13.preheader.i.i.i62: ; preds = %if.then12, %for.inc29.critedge.i.i.i72 - %indvars.iv147.in = phi i64 [ %indvars.iv147, %for.inc29.critedge.i.i.i72 ], [ %23, %if.then12 ] - %OuterIt.sroa.0.029.i.i.i63 = phi ptr [ %incdec.ptr.i11.i.i.i73, %for.inc29.critedge.i.i.i72 ], [ %.pre155.pre156, %if.then12 ] - %indvars.iv147 = add i64 %indvars.iv147.in, -1 - %.not167 = icmp eq i64 %indvars.iv147, 0 - %24 = select i1 %.not167, i64 1, i64 2 + %indvars.iv147.in = phi ptr [ %incdec.ptr.i11.i.i.i73, %for.inc29.critedge.i.i.i72 ], [ %.pre143.pre144, %if.then12 ] br label %for.body13.i.i.i64 for.body13.i.i.i64: ; preds = %for.inc.i.i.i80, %for.body13.preheader.i.i.i62 @@ -10871,12 +10863,14 @@ for.body13.i.i.i64: ; preds = %for.inc.i.i.i80, %f for.inc.i.i.i80: ; preds = %for.body13.i.i.i64 %incdec.ptr.i.i.i.i81 = getelementptr inbounds nuw i8, ptr %InnerIt.sroa.0.023.i.i.i66, i64 1 %SubstrIt.024.i.i.i65.add = add nuw nsw i64 %SubstrIt.024.i.i.i65.idx, 1 - %exitcond150 = icmp eq i64 %SubstrIt.024.i.i.i65.add, %24 - br i1 %exitcond150, label %for.end.i.i.i68, label %for.body13.i.i.i64, !llvm.loop !100 + %exitcond150 = icmp eq ptr %incdec.ptr.i.i.i.i81, %add.ptr.i.i.i.i.i58 + %cmp.not.i.i.i84 = icmp eq i64 %SubstrIt.024.i.i.i65.add, 2 + %or.cond.i.i.i85 = select i1 %cmp.i7.i.i.i83, i1 true, i1 %cmp.not.i.i.i84 + br i1 %or.cond.i.i.i85, label %for.end.i.i.i68, label %for.body13.i.i.i64, !llvm.loop !100 for.end.i.i.i68: ; preds = %for.inc.i.i.i80, %for.body13.i.i.i64 %InnerIt.sroa.0.0.lcssa.ph.i.i.i69 = phi ptr [ %InnerIt.sroa.0.023.i.i.i66, %for.body13.i.i.i64 ], [ %incdec.ptr.i.i.i.i81, %for.inc.i.i.i80 ] - %SubstrIt.0.lcssa.ph.i.i.i70.idx = phi i64 [ %SubstrIt.024.i.i.i65.idx, %for.body13.i.i.i64 ], [ %24, %for.inc.i.i.i80 ] + %SubstrIt.0.lcssa.ph.i.i.i70.idx = phi i64 [ %SubstrIt.024.i.i.i65.idx, %for.body13.i.i.i64 ], [ %SubstrIt.024.i.i.i65.add, %for.inc.i.i.i80 ] %cmp21.not.i.i.i71 = icmp eq i64 %SubstrIt.0.lcssa.ph.i.i.i70.idx, 2 br i1 %cmp21.not.i.i.i71, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.i.i76, label %for.inc29.critedge.i.i.i72 @@ -10937,11 +10931,7 @@ if.then18: ; preds = %if.end16 br i1 %cmp.i.not28.i.i.i99, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.thread.i.i115, label %for.body13.preheader.i.i.i102 for.body13.preheader.i.i.i102: ; preds = %if.then18, %for.inc29.critedge.i.i.i112 - %indvars.iv151.in = phi i64 [ %indvars.iv151, %for.inc29.critedge.i.i.i112 ], [ %32, %if.then18 ] - %OuterIt.sroa.0.029.i.i.i103 = phi ptr [ %incdec.ptr.i11.i.i.i113, %for.inc29.critedge.i.i.i112 ], [ %.pre155, %if.then18 ] - %indvars.iv151 = add i64 %indvars.iv151.in, -1 - %.not168 = icmp eq i64 %indvars.iv151, 0 - %33 = select i1 %.not168, i64 1, i64 2 + %indvars.iv151.in = phi ptr [ %incdec.ptr.i11.i.i.i113, %for.inc29.critedge.i.i.i112 ], [ %.pre143, %if.then18 ] br label %for.body13.i.i.i104 for.body13.i.i.i104: ; preds = %for.inc.i.i.i120, %for.body13.preheader.i.i.i102 @@ -10956,12 +10946,14 @@ for.body13.i.i.i104: ; preds = %for.inc.i.i.i120, % for.inc.i.i.i120: ; preds = %for.body13.i.i.i104 %incdec.ptr.i.i.i.i121 = getelementptr inbounds nuw i8, ptr %InnerIt.sroa.0.023.i.i.i106, i64 1 %SubstrIt.024.i.i.i105.add = add nuw nsw i64 %SubstrIt.024.i.i.i105.idx, 1 - %exitcond154 = icmp eq i64 %SubstrIt.024.i.i.i105.add, %33 - br i1 %exitcond154, label %for.end.i.i.i108, label %for.body13.i.i.i104, !llvm.loop !100 + %exitcond154 = icmp eq ptr %incdec.ptr.i.i.i.i121, %add.ptr.i.i.i.i.i98 + %cmp.not.i.i.i124 = icmp eq i64 %SubstrIt.024.i.i.i105.add, 2 + %or.cond.i.i.i125 = select i1 %cmp.i7.i.i.i123, i1 true, i1 %cmp.not.i.i.i124 + br i1 %or.cond.i.i.i125, label %for.end.i.i.i108, label %for.body13.i.i.i104, !llvm.loop !100 for.end.i.i.i108: ; preds = %for.inc.i.i.i120, %for.body13.i.i.i104 %InnerIt.sroa.0.0.lcssa.ph.i.i.i109 = phi ptr [ %InnerIt.sroa.0.023.i.i.i106, %for.body13.i.i.i104 ], [ %incdec.ptr.i.i.i.i121, %for.inc.i.i.i120 ] - %SubstrIt.0.lcssa.ph.i.i.i110.idx = phi i64 [ %SubstrIt.024.i.i.i105.idx, %for.body13.i.i.i104 ], [ %33, %for.inc.i.i.i120 ] + %SubstrIt.0.lcssa.ph.i.i.i110.idx = phi i64 [ %SubstrIt.024.i.i.i105.idx, %for.body13.i.i.i104 ], [ %SubstrIt.024.i.i.i105.add, %for.inc.i.i.i120 ] %cmp21.not.i.i.i111 = icmp eq i64 %SubstrIt.0.lcssa.ph.i.i.i110.idx, 2 br i1 %cmp21.not.i.i.i111, label %_ZNK5boost9algorithm6detail13first_finderFIPKcNS0_8is_equalEEclIN9__gnu_cxx17__normal_iteratorIPcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEENS_14iterator_rangeIT_EESJ_SJ_.exit.i.i116, label %for.inc29.critedge.i.i.i112 diff --git a/bench/raylib/optimized/rcore.ll b/bench/raylib/optimized/rcore.ll index ce3702dab48..6e09650e10d 100644 --- a/bench/raylib/optimized/rcore.ll +++ b/bench/raylib/optimized/rcore.ll @@ -21034,10 +21034,7 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre %smax = tail call i32 @llvm.smax.i32(i32 %9, i32 1) %smax110 = tail call i32 @llvm.smax.i32(i32 %12, i32 1) %smax116 = tail call i32 @llvm.smax.i32(i32 %15, i32 1) - %smax122 = tail call i32 @llvm.smax.i32(i32 %17, i32 6) - %21 = add nsw i32 %smax122, -1 - %22 = udiv i32 %21, 6 - %wide.trip.count127 = zext nneg i32 %1 to i64 + %smax122 = zext nneg i32 %1 to i64 %wide.trip.count = zext nneg i32 %smax to i64 %wide.trip.count111 = zext nneg i32 %smax110 to i64 %wide.trip.count117 = zext nneg i32 %smax116 to i64 @@ -21049,16 +21046,16 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre store i32 %2, ptr %24, align 8 %25 = tail call noalias ptr @malloc(i64 noundef %11) #56 %26 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv124, i32 1 + store ptr %23, ptr %24, align 8 + %25 = tail call noalias ptr @malloc(i64 noundef %14) #56 + %26 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv122, i32 2 store ptr %25, ptr %26, align 8 - %27 = tail call noalias ptr @malloc(i64 noundef %14) #56 - %28 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv124, i32 2 + %27 = tail call noalias ptr @malloc(i64 noundef %16) #56 + %28 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv124, i32 3 store ptr %27, ptr %28, align 8 - %29 = tail call noalias ptr @malloc(i64 noundef %16) #56 - %30 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv124, i32 3 + %29 = tail call noalias ptr @malloc(i64 noundef %19) #56 + %30 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv124, i32 4 store ptr %29, ptr %30, align 8 - %31 = tail call noalias ptr @malloc(i64 noundef %19) #56 - %32 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv124, i32 4 - store ptr %31, ptr %32, align 8 br i1 %20, label %.lr.ph, label %._crit_edge .lr.ph: ; preds = %23, %.lr.ph @@ -21072,7 +21069,7 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre .lr.ph91: ; preds = %.lr.ph, %.lr.ph91 %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.lr.ph91 ], [ 0, %.lr.ph ] - %35 = load ptr, ptr %28, align 8 + %35 = load ptr, ptr %26, align 8 %36 = getelementptr inbounds nuw float, ptr %35, i64 %indvars.iv107 store float 0.000000e+00, ptr %36, align 4 %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 @@ -21081,7 +21078,7 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre .lr.ph93: ; preds = %.lr.ph91, %.lr.ph93 %indvars.iv113 = phi i64 [ %indvars.iv.next114, %.lr.ph93 ], [ 0, %.lr.ph91 ] - %37 = load ptr, ptr %30, align 8 + %37 = load ptr, ptr %28, align 8 %38 = getelementptr inbounds nuw i8, ptr %37, i64 %indvars.iv113 store i8 0, ptr %38, align 1 %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 @@ -21092,41 +21089,41 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre %indvars.iv119 = phi i64 [ %indvars.iv.next120, %.lr.ph96 ], [ 0, %.lr.ph93 ] %.08194 = phi i32 [ %60, %.lr.ph96 ], [ 0, %.lr.ph93 ] %39 = shl nsw i32 %.08194, 2 - %40 = load ptr, ptr %32, align 8 + %40 = load ptr, ptr %30, align 8 %41 = getelementptr inbounds nuw i32, ptr %40, i64 %indvars.iv119 store i32 %39, ptr %41, align 4 %42 = or disjoint i32 %39, 1 - %43 = load ptr, ptr %32, align 8 + %43 = load ptr, ptr %30, align 8 %44 = or disjoint i64 %indvars.iv119, 1 %45 = getelementptr inbounds nuw i32, ptr %43, i64 %44 store i32 %42, ptr %45, align 4 %46 = or disjoint i32 %39, 2 - %47 = load ptr, ptr %32, align 8 + %47 = load ptr, ptr %30, align 8 %48 = getelementptr inbounds nuw i32, ptr %47, i64 %indvars.iv119 %49 = getelementptr inbounds nuw i8, ptr %48, i64 8 store i32 %46, ptr %49, align 4 - %50 = load ptr, ptr %32, align 8 + %50 = load ptr, ptr %30, align 8 %51 = getelementptr inbounds nuw i32, ptr %50, i64 %indvars.iv119 %52 = getelementptr inbounds nuw i8, ptr %51, i64 12 store i32 %39, ptr %52, align 4 - %53 = load ptr, ptr %32, align 8 + %53 = load ptr, ptr %30, align 8 %54 = getelementptr inbounds nuw i32, ptr %53, i64 %indvars.iv119 %55 = getelementptr inbounds nuw i8, ptr %54, i64 16 store i32 %46, ptr %55, align 4 %56 = or disjoint i32 %39, 3 - %57 = load ptr, ptr %32, align 8 + %57 = load ptr, ptr %30, align 8 %58 = getelementptr inbounds nuw i32, ptr %57, i64 %indvars.iv119 %59 = getelementptr inbounds nuw i8, ptr %58, i64 20 store i32 %56, ptr %59, align 4 %60 = add nuw nsw i32 %.08194, 1 %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 6 - %exitcond123.not = icmp eq i32 %.08194, %22 - br i1 %exitcond123.not, label %._crit_edge, label %.lr.ph96 + %exitcond123.not = icmp slt i64 %indvars.iv.next120, %18 + br i1 %exitcond123.not, label %.lr.ph96, label %._crit_edge ._crit_edge: ; preds = %.lr.ph96, %23 store i32 0, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 40), align 8 %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1 - %exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count127 + %exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count125 br i1 %exitcond128.not, label %._crit_edge100, label %23 ._crit_edge100: ; preds = %._crit_edge @@ -21145,95 +21142,95 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre %wide.trip.count132 = zext nneg i32 %1 to i64 br label %72 -72: ; preds = %._crit_edge100, %80 - %indvars.iv129 = phi i64 [ 0, %._crit_edge100 ], [ %indvars.iv.next130, %80 ] +72: ; preds = %._crit_edge100, %79 + %indvars.iv129 = phi i64 [ 0, %._crit_edge100 ], [ %indvars.iv.next128, %79 ] %73 = load i8, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2696), align 8 %74 = trunc i8 %73 to i1 - br i1 %74, label %75, label %80 + br i1 %74, label %74, label %79 + +74: ; preds = %71 + %75 = load ptr, ptr @glad_glGenVertexArrays, align 8 + %76 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 5 + tail call void %75(i32 noundef 1, ptr noundef nonnull %76) #54 + %77 = load ptr, ptr @glad_glBindVertexArray, align 8 + %78 = load i32, ptr %76, align 8 + tail call void %77(i32 noundef %78) #54 + br label %79 -75: ; preds = %72 - %76 = load ptr, ptr @glad_glGenVertexArrays, align 8 - %77 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 5 - tail call void %76(i32 noundef 1, ptr noundef nonnull %77) #54 - %78 = load ptr, ptr @glad_glBindVertexArray, align 8 - %79 = load i32, ptr %77, align 8 - tail call void %78(i32 noundef %79) #54 - br label %80 +75: ; preds = %74, %72 + %76 = load ptr, ptr @glad_glGenBuffers, align 8 + %77 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 6 + tail call void %80(i32 noundef 1, ptr noundef nonnull %77) #54 + %78 = load ptr, ptr @glad_glBindBuffer, align 8 + %79 = load i32, ptr %77, align 4 + tail call void %82(i32 noundef 34962, i32 noundef %79) #54 + %84 = load ptr, ptr @glad_glBufferData, align 8 + %85 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 1 + %86 = load ptr, ptr %85, align 8 + tail call void %84(i32 noundef 34962, i64 noundef %62, ptr noundef %86, i32 noundef 35048) #54 + %87 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8 + %88 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 + %89 = load i32, ptr %88, align 4 + tail call void %87(i32 noundef %89) #54 + %90 = load ptr, ptr @glad_glVertexAttribPointer, align 8 + %91 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 + %92 = load i32, ptr %91, align 4 + tail call void %90(i32 noundef %92, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 0, ptr noundef null) #54 + %93 = load ptr, ptr @glad_glGenBuffers, align 8 + %94 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 6, i64 1 + tail call void %93(i32 noundef 1, ptr noundef nonnull %94) #54 + %95 = load ptr, ptr @glad_glBindBuffer, align 8 + %96 = load i32, ptr %94, align 4 + tail call void %95(i32 noundef 34962, i32 noundef %96) #54 + %97 = load ptr, ptr @glad_glBufferData, align 8 + %98 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 2 + %99 = load ptr, ptr %98, align 8 + tail call void %97(i32 noundef 34962, i64 noundef %65, ptr noundef %99, i32 noundef 35048) #54 + %100 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8 + %101 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 + %102 = getelementptr inbounds nuw i8, ptr %101, i64 4 + %103 = load i32, ptr %102, align 4 + tail call void %100(i32 noundef %103) #54 + %104 = load ptr, ptr @glad_glVertexAttribPointer, align 8 + %105 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 + %106 = getelementptr inbounds nuw i8, ptr %105, i64 4 + %107 = load i32, ptr %106, align 4 + tail call void %104(i32 noundef %107, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 0, ptr noundef null) #54 + %108 = load ptr, ptr @glad_glGenBuffers, align 8 + %109 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 6, i64 2 + tail call void %108(i32 noundef 1, ptr noundef nonnull %109) #54 + %110 = load ptr, ptr @glad_glBindBuffer, align 8 + %111 = load i32, ptr %109, align 4 + tail call void %110(i32 noundef 34962, i32 noundef %111) #54 + %112 = load ptr, ptr @glad_glBufferData, align 8 + %113 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 3 + %114 = load ptr, ptr %113, align 8 + tail call void %112(i32 noundef 34962, i64 noundef %67, ptr noundef %114, i32 noundef 35048) #54 + %115 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8 + %116 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 + %117 = getelementptr inbounds nuw i8, ptr %116, i64 20 + %118 = load i32, ptr %117, align 4 + tail call void %115(i32 noundef %118) #54 + %119 = load ptr, ptr @glad_glVertexAttribPointer, align 8 + %120 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 + %121 = getelementptr inbounds nuw i8, ptr %120, i64 20 + %122 = load i32, ptr %121, align 4 + tail call void %119(i32 noundef %122, i32 noundef 4, i32 noundef 5121, i8 noundef zeroext 1, i32 noundef 0, ptr noundef null) #54 + %123 = load ptr, ptr @glad_glGenBuffers, align 8 + %124 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 6, i64 3 + tail call void %123(i32 noundef 1, ptr noundef nonnull %124) #54 + %125 = load ptr, ptr @glad_glBindBuffer, align 8 + %126 = load i32, ptr %124, align 4 + tail call void %125(i32 noundef 34963, i32 noundef %126) #54 + %127 = load ptr, ptr @glad_glBufferData, align 8 + %128 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv127, i32 4 + %129 = load ptr, ptr %128, align 8 + tail call void %127(i32 noundef 34963, i64 noundef %70, ptr noundef %129, i32 noundef 35044) #54 + %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1 + %exitcond131.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count130 + br i1 %exitcond131.not, label %._crit_edge104, label %71 -80: ; preds = %75, %72 - %81 = load ptr, ptr @glad_glGenBuffers, align 8 - %82 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 6 - tail call void %81(i32 noundef 1, ptr noundef nonnull %82) #54 - %83 = load ptr, ptr @glad_glBindBuffer, align 8 - %84 = load i32, ptr %82, align 4 - tail call void %83(i32 noundef 34962, i32 noundef %84) #54 - %85 = load ptr, ptr @glad_glBufferData, align 8 - %86 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 1 - %87 = load ptr, ptr %86, align 8 - tail call void %85(i32 noundef 34962, i64 noundef %63, ptr noundef %87, i32 noundef 35048) #54 - %88 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8 - %89 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 - %90 = load i32, ptr %89, align 4 - tail call void %88(i32 noundef %90) #54 - %91 = load ptr, ptr @glad_glVertexAttribPointer, align 8 - %92 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 - %93 = load i32, ptr %92, align 4 - tail call void %91(i32 noundef %93, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 0, ptr noundef null) #54 - %94 = load ptr, ptr @glad_glGenBuffers, align 8 - %95 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 6, i64 1 - tail call void %94(i32 noundef 1, ptr noundef nonnull %95) #54 - %96 = load ptr, ptr @glad_glBindBuffer, align 8 - %97 = load i32, ptr %95, align 4 - tail call void %96(i32 noundef 34962, i32 noundef %97) #54 - %98 = load ptr, ptr @glad_glBufferData, align 8 - %99 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 2 - %100 = load ptr, ptr %99, align 8 - tail call void %98(i32 noundef 34962, i64 noundef %66, ptr noundef %100, i32 noundef 35048) #54 - %101 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8 - %102 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 - %103 = getelementptr inbounds nuw i8, ptr %102, i64 4 - %104 = load i32, ptr %103, align 4 - tail call void %101(i32 noundef %104) #54 - %105 = load ptr, ptr @glad_glVertexAttribPointer, align 8 - %106 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 - %107 = getelementptr inbounds nuw i8, ptr %106, i64 4 - %108 = load i32, ptr %107, align 4 - tail call void %105(i32 noundef %108, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 0, ptr noundef null) #54 - %109 = load ptr, ptr @glad_glGenBuffers, align 8 - %110 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 6, i64 2 - tail call void %109(i32 noundef 1, ptr noundef nonnull %110) #54 - %111 = load ptr, ptr @glad_glBindBuffer, align 8 - %112 = load i32, ptr %110, align 4 - tail call void %111(i32 noundef 34962, i32 noundef %112) #54 - %113 = load ptr, ptr @glad_glBufferData, align 8 - %114 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 3 - %115 = load ptr, ptr %114, align 8 - tail call void %113(i32 noundef 34962, i64 noundef %68, ptr noundef %115, i32 noundef 35048) #54 - %116 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8 - %117 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 - %118 = getelementptr inbounds nuw i8, ptr %117, i64 20 - %119 = load i32, ptr %118, align 4 - tail call void %116(i32 noundef %119) #54 - %120 = load ptr, ptr @glad_glVertexAttribPointer, align 8 - %121 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2376), align 8 - %122 = getelementptr inbounds nuw i8, ptr %121, i64 20 - %123 = load i32, ptr %122, align 4 - tail call void %120(i32 noundef %123, i32 noundef 4, i32 noundef 5121, i8 noundef zeroext 1, i32 noundef 0, ptr noundef null) #54 - %124 = load ptr, ptr @glad_glGenBuffers, align 8 - %125 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 6, i64 3 - tail call void %124(i32 noundef 1, ptr noundef nonnull %125) #54 - %126 = load ptr, ptr @glad_glBindBuffer, align 8 - %127 = load i32, ptr %125, align 4 - tail call void %126(i32 noundef 34963, i32 noundef %127) #54 - %128 = load ptr, ptr @glad_glBufferData, align 8 - %129 = getelementptr inbounds nuw %struct.rlVertexBuffer, ptr %6, i64 %indvars.iv129, i32 4 - %130 = load ptr, ptr %129, align 8 - tail call void %128(i32 noundef 34963, i64 noundef %71, ptr noundef %130, i32 noundef 35044) #54 - %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 - %exitcond133.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count132 - br i1 %exitcond133.not, label %._crit_edge104, label %72 - -._crit_edge104: ; preds = %80, %._crit_edge100.thread +80: ; preds = %75, %._crit_edge100.thread tail call void (i32, ptr, ...) @TraceLog(i32 noundef 3, ptr noundef nonnull @.str.39) #54 %131 = load i8, ptr getelementptr inbounds nuw (i8, ptr @RLGL, i64 2696), align 8 %132 = trunc i8 %131 to i1 @@ -21241,7 +21238,7 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre 133: ; preds = %._crit_edge104 %134 = load ptr, ptr @glad_glBindVertexArray, align 8 - tail call void %134(i32 noundef 0) #54 + tail call void %133(i32 noundef 0) #54 br label %135 135: ; preds = %133, %._crit_edge104 @@ -21252,20 +21249,20 @@ define void @rlLoadRenderBatch(ptr dead_on_unwind noalias writable writeonly sre br label %139 139: ; preds = %135, %139 - %indvars.iv134 = phi i64 [ 0, %135 ], [ %indvars.iv.next135, %139 ] + %indvars.iv134 = phi i64 [ 0, %135 ], [ %indvars.iv.next133, %139 ] %140 = getelementptr inbounds nuw %struct.rlDrawCall, ptr %136, i64 %indvars.iv134 store i32 7, ptr %140, align 4 %141 = getelementptr inbounds nuw %struct.rlDrawCall, ptr %136, i64 %indvars.iv134, i32 1 + store i32 0, ptr %140, align 4 + %141 = getelementptr inbounds nuw %struct.rlDrawCall, ptr %135, i64 %indvars.iv132, i32 2 store i32 0, ptr %141, align 4 - %142 = getelementptr inbounds nuw %struct.rlDrawCall, ptr %136, i64 %indvars.iv134, i32 2 - store i32 0, ptr %142, align 4 - %143 = getelementptr inbounds nuw %struct.rlDrawCall, ptr %136, i64 %indvars.iv134, i32 3 - store i32 %138, ptr %143, align 4 - %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1 - %exitcond137.not = icmp eq i64 %indvars.iv.next135, 256 - br i1 %exitcond137.not, label %144, label %139 - -144: ; preds = %139 + %142 = getelementptr inbounds nuw %struct.rlDrawCall, ptr %136, i64 %indvars.iv134, i32 3 + store i32 %137, ptr %142, align 4 + %143 = add nuw nsw i64 %indvars.iv134, 1 + %exitcond135.not = icmp eq i64 %143, 256 + br i1 %exitcond135.not, label %143, label %138 + +143:; preds = %139 store i32 %1, ptr %0, align 8 %145 = getelementptr inbounds nuw i8, ptr %0, i64 24 store i32 1, ptr %145, align 8 diff --git a/bench/raylib/optimized/rtext.ll b/bench/raylib/optimized/rtext.ll index 85d958f2dcc..5750d2b674b 100644 --- a/bench/raylib/optimized/rtext.ll +++ b/bench/raylib/optimized/rtext.ll @@ -1242,14 +1242,10 @@ GetLine.exit134.i: ; preds = %99, %.split.loop.ex br i1 %129, label %.lr.ph.i, label %._crit_edge.i .lr.ph.i: ; preds = %121 - %130 = shl nuw i32 %126, 1 + %130 = shl nuw nsw i32 %126, 1 %131 = load ptr, ptr %114, align 8, !noalias !7 - %smax.i = call i32 @llvm.smax.i32(i32 %130, i32 2) - %132 = add nsw i32 %smax.i, -1 - %133 = lshr i32 %132, 1 - %134 = add nuw nsw i32 %133, 1 - %wide.trip.count.i = zext nneg i32 %134 to i64 - br label %135 + %smax.i = zext nneg i32 %130 to i64 + br label %133 135: ; preds = %135, %.lr.ph.i %indvars.iv188.i = phi i64 [ 0, %.lr.ph.i ], [ %indvars.iv.next189.i, %135 ] @@ -1263,8 +1259,8 @@ GetLine.exit134.i: ; preds = %99, %.split.loop.ex store i8 %138, ptr %140, align 1, !noalias !7 %indvars.iv.next187.i = add nuw nsw i64 %indvars.iv186.i, 2 %indvars.iv.next189.i = add nuw nsw i64 %indvars.iv188.i, 1 - %exitcond.not.i = icmp eq i64 %indvars.iv.next189.i, %wide.trip.count.i - br i1 %exitcond.not.i, label %._crit_edge.i, label %135 + %exitcond.not.i = icmp samesign ult i64 %indvars.iv.next187.i, %smax.i + br i1 %exitcond.not.i, label %133, label %._crit_edge.i ._crit_edge.i: ; preds = %135, %121 call void @UnloadImage(ptr noundef nonnull byval(%struct.Image) align 8 %14) #41, !noalias !7 diff --git a/bench/recastnavigation/optimized/RecastMeshDetail.ll b/bench/recastnavigation/optimized/RecastMeshDetail.ll index d1b9d1f75e5..e2b5df7c9eb 100644 --- a/bench/recastnavigation/optimized/RecastMeshDetail.ll +++ b/bench/recastnavigation/optimized/RecastMeshDetail.ll @@ -2384,10 +2384,8 @@ _ZL13polyMinExtentPKfi.exit.i: ; preds = %._crit_edge.us.i.i, .lr.ph414.i: ; preds = %1017 %1040 = uitofp nneg i32 %spec.select.i to float - %smin.i = call i32 @llvm.smin.i32(i32 %1037, i32 126) - %reass.sub = sub i32 %smin.i, %.0798 - %1041 = add i32 %reass.sub, 1 - %wide.trip.count505.i = zext i32 %1041 to i64 + %smin.i = add nuw i32 %spec.select.i, 1 + %reass.sub = zext i32 %smin.i to i64 br label %1042 1042: ; preds = %_ZL9getHeightffffffiRK13rcHeightPatch.exit.i, %.lr.ph414.i @@ -2526,7 +2524,7 @@ _ZL9getHeightffffffiRK13rcHeightPatch.exit.i: ; preds = %1112, %1096, %1042 %1116 = fmul float %994, %1115 store float %1116, ptr %1049, align 4 %indvars.iv.next503.i = add nuw nsw i64 %indvars.iv502.i, 1 - %exitcond506.not.i = icmp eq i64 %indvars.iv.next503.i, %wide.trip.count505.i + %exitcond506.not.i = icmp eq i64 %indvars.iv.next503.i, %reass.sub br i1 %exitcond506.not.i, label %._crit_edge415.i, label %1042, !llvm.loop !26 ._crit_edge415.i: ; preds = %_ZL9getHeightffffffiRK13rcHeightPatch.exit.i, %1017 diff --git a/bench/ruby/optimized/transcode.ll b/bench/ruby/optimized/transcode.ll index ee0ac9af048..5c4c296862a 100644 --- a/bench/ruby/optimized/transcode.ll +++ b/bench/ruby/optimized/transcode.ll @@ -8126,8 +8126,6 @@ define internal fastcc range(i32 0, 7) i32 @transcode_restartable0(ptr noundef c %.01091.pn = phi ptr [ %.01091, %26 ], [ %.51134, %189 ] %.21095 = phi ptr [ %.11094, %26 ], [ %.51098, %189 ] %.1 = phi ptr [ %.01091, %26 ], [ %.4, %189 ] - %.01091.pn1322 = ptrtoint ptr %.01091.pn to i64 - %.11323 = ptrtoint ptr %.1 to i64 %.21131 = getelementptr i8, ptr %.01091.pn, i64 1 %32 = zext i8 %31 to i64 %33 = getelementptr inbounds nuw i8, ptr %7, i64 24 @@ -8172,11 +8170,12 @@ define internal fastcc range(i32 0, 7) i32 @transcode_restartable0(ptr noundef c %65 = getelementptr inbounds nuw i8, ptr %4, i64 24 store i64 %.sink, ptr %65, align 8 %66 = getelementptr inbounds nuw i8, ptr %4, i64 24 - %67 = getelementptr inbounds nuw i8, ptr %4, i64 40 - %68 = getelementptr inbounds nuw i8, ptr %4, i64 56 + %67 = ptrtoint ptr %.1 to i64 + %68 = getelementptr inbounds nuw i8, ptr %4, i64 40 + %69 = getelementptr inbounds nuw i8, ptr %4, i64 56 %.not.i.i = icmp eq ptr %.21131, %.1 %69 = ptrtoint ptr %.21131 to i64 - %70 = sub i64 %69, %.11323 + %70 = sub i64 %69, %67 %71 = getelementptr inbounds nuw i8, ptr %7, i64 104 %72 = getelementptr inbounds nuw i8, ptr %4, i64 88 %73 = getelementptr inbounds nuw i8, ptr %7, i64 96 @@ -8219,41 +8218,38 @@ define internal fastcc range(i32 0, 7) i32 @transcode_restartable0(ptr noundef c .lr.ph: ; preds = %77 %80 = getelementptr inbounds nuw i8, ptr %4, i64 80 - %81 = add i64 %.01091.pn1322, 1 - %82 = sub i64 %81, %.11323 - %scevgep = getelementptr i8, ptr %.1, i64 %82 - br label %83 - -83: ; preds = %.lr.ph, %92 - %.010921321 = phi ptr [ %.1, %.lr.ph ], [ %84, %92 ] - %84 = getelementptr i8, ptr %.010921321, i64 1 - %85 = load i8, ptr %.010921321, align 1 - %86 = load ptr, ptr %4, align 8 - %87 = getelementptr inbounds nuw i8, ptr %86, i64 64 - %88 = load i32, ptr %87, align 8 - %89 = icmp slt i32 %88, 9 - br i1 %89, label %92, label %90 - -90: ; preds = %83 - %91 = load ptr, ptr %80, align 8 - br label %92 - -92: ; preds = %83, %90 - %93 = phi ptr [ %91, %90 ], [ %80, %83 ] - %94 = load i64, ptr %78, align 8 - %95 = add i64 %94, 1 - store i64 %95, ptr %78, align 8 - %96 = getelementptr i8, ptr %93, i64 %94 - store i8 %85, ptr %96, align 1 - %exitcond.not = icmp eq ptr %84, %scevgep - br i1 %exitcond.not, label %._crit_edge.loopexit, label %83, !llvm.loop !142 - -._crit_edge.loopexit: ; preds = %92 - %.pre1348 = load i64, ptr %78, align 8 + br label %82 + +82:; preds = %.lr.ph, %91 + %.010921321 = phi ptr [ %.1, %.lr.ph ], [ %83, %91 ] + %83 = getelementptr i8, ptr %.010921321, i64 1 + %84 = load i8, ptr %.010921321, align 1 + %.010921321 = load ptr, ptr %4, align 8 + %84 = getelementptr inbounds nuw i8, ptr %.010921321, i64 64 + %85 = load i32, ptr %86, align 8 + %86 = icmp slt i32 %87, 9 + br i1 %86, label %91, label %89 + +89:; preds = %82 + %90 = load ptr, ptr %81, align 8 + br label %91 + +91:; preds = %82, %89 + %92 = phi ptr [ %90, %89 ], [ %81, %82 ] + %93 = load i64, ptr %79, align 8 + %94 = add i64 %93, 1 + store i64 %94, ptr %79, align 8 + %94 = getelementptr i8, ptr %92, i64 %93 + store i8 %84, ptr %94, align 1 + %96 = icmp ult ptr %83, %.21131 + br i1 %96, label %82, label %._crit_edge.loopexit, !llvm.loop !142 + +._crit_edge.loopexit:; preds = %91 + %.pre1346 = load i64, ptr %79, align 8 br label %._crit_edge ._crit_edge: ; preds = %._crit_edge.loopexit, %77 - %97 = phi i64 [ %.pre1348, %._crit_edge.loopexit ], [ 0, %77 ] + %97 = phi i64 [ %.pre1346, %._crit_edge.loopexit ], [ 0, %77 ] %98 = getelementptr inbounds nuw i8, ptr %4, i64 72 store i64 %97, ptr %98, align 8 store i64 0, ptr %78, align 8 @@ -8365,12 +8361,12 @@ rbimpl_size_mul_or_raise.exit: ; preds = %113, %119 br i1 %155, label %rbimpl_size_mul_or_raise.exit1236, label %156 156: ; preds = %151 - %157 = load ptr, ptr %68, align 8 + %157 = load ptr, ptr %69, align 8 br label %rbimpl_size_mul_or_raise.exit1236 rbimpl_size_mul_or_raise.exit1236: ; preds = %151, %156 - %158 = phi ptr [ %157, %156 ], [ %68, %151 ] - %159 = load i64, ptr %67, align 8 + %158 = phi ptr [ %157, %156 ], [ %69, %151 ] + %159 = load i64, ptr %68, align 8 %160 = getelementptr i8, ptr %158, i64 %159 tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %160, ptr align 1 %.1, i64 %70, i1 false) br label %161 @@ -8378,9 +8374,9 @@ rbimpl_size_mul_or_raise.exit1236: ; preds = %151, %156 161: ; preds = %rbimpl_size_mul_or_raise.exit1236, %149 store ptr %.21131, ptr %0, align 8 store ptr %.21095, ptr %1, align 8 - %162 = load i64, ptr %67, align 8 + %162 = load i64, ptr %68, align 8 %163 = add i64 %162, %70 - store i64 %163, ptr %67, align 8 + store i64 %163, ptr %68, align 8 br label %1428 164: ; preds = %145, %147, %6, %188 @@ -9403,8 +9399,8 @@ rbimpl_size_mul_or_raise.exit1252: ; preds = %672, %678 716: ; preds = %74 %717 = load ptr, ptr %0, align 8 %718 = ptrtoint ptr %717 to i64 - %719 = sub i64 %.11323, %718 - %720 = load i64, ptr %67, align 8 + %719 = sub i64 %67, %718 + %720 = load i64, ptr %68, align 8 %721 = icmp slt i64 %719, %720 br i1 %721, label %722, label %737 @@ -9416,11 +9412,11 @@ rbimpl_size_mul_or_raise.exit1252: ; preds = %672, %678 br i1 %726, label %rbimpl_size_mul_or_raise.exit.i, label %727 727: ; preds = %722 - %728 = load ptr, ptr %68, align 8 + %728 = load ptr, ptr %69, align 8 br label %rbimpl_size_mul_or_raise.exit.i rbimpl_size_mul_or_raise.exit.i: ; preds = %727, %722 - %729 = phi ptr [ %728, %727 ], [ %68, %722 ] + %729 = phi ptr [ %728, %727 ], [ %69, %722 ] br i1 %.not.i.i, label %ruby_nonempty_memcpy.exit.i, label %730 730: ; preds = %rbimpl_size_mul_or_raise.exit.i @@ -9438,7 +9434,7 @@ ruby_nonempty_memcpy.exit.i: ; preds = %730, %rbimpl_size_m br i1 %734, label %transcode_char_start.exit, label %735 735: ; preds = %ruby_nonempty_memcpy.exit.i - %736 = load ptr, ptr %68, align 8 + %736 = load ptr, ptr %69, align 8 br label %transcode_char_start.exit 737: ; preds = %716 @@ -9449,8 +9445,8 @@ ruby_nonempty_memcpy.exit.i: ; preds = %730, %rbimpl_size_m transcode_char_start.exit: ; preds = %ruby_nonempty_memcpy.exit.i, %735, %737 %740 = phi ptr [ %.pre1345, %737 ], [ %732, %735 ], [ %732, %ruby_nonempty_memcpy.exit.i ] - %.0.i = phi ptr [ %739, %737 ], [ %736, %735 ], [ %68, %ruby_nonempty_memcpy.exit.i ] - %741 = load i64, ptr %67, align 8 + %.0.i = phi ptr [ %739, %737 ], [ %736, %735 ], [ %69, %ruby_nonempty_memcpy.exit.i ] + %741 = load i64, ptr %68, align 8 %742 = add i64 %70, %741 %743 = load ptr, ptr %71, align 8 %744 = getelementptr inbounds nuw i8, ptr %740, i64 72 @@ -10287,7 +10283,7 @@ rbimpl_size_mul_or_raise.exit1290: ; preds = %1179, %1185 br label %1165, !llvm.loop !169 1212: ; preds = %74 - %1213 = load i64, ptr %67, align 8 + %1213 = load i64, ptr %68, align 8 %1214 = add i64 %1213, %70 %.fr1217 = freeze i64 %1214 %1215 = sext i32 %9 to i64 @@ -10319,11 +10315,11 @@ rbimpl_size_mul_or_raise.exit1290: ; preds = %1179, %1185 br i1 %1227, label %rbimpl_size_mul_or_raise.exit1291, label %1228 1228: ; preds = %1223 - %1229 = load ptr, ptr %68, align 8 + %1229 = load ptr, ptr %69, align 8 br label %rbimpl_size_mul_or_raise.exit1291 rbimpl_size_mul_or_raise.exit1291: ; preds = %1223, %1228 - %1230 = phi ptr [ %1229, %1228 ], [ %68, %1223 ] + %1230 = phi ptr [ %1229, %1228 ], [ %69, %1223 ] %1231 = getelementptr i8, ptr %1230, i64 %1213 tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %1231, ptr align 1 %.1, i64 %70, i1 false) br label %1232 @@ -10331,9 +10327,9 @@ rbimpl_size_mul_or_raise.exit1291: ; preds = %1223, %1228 1232: ; preds = %rbimpl_size_mul_or_raise.exit1291, %1221 store ptr %.21131, ptr %0, align 8 store ptr %.21095, ptr %1, align 8 - %1233 = load i64, ptr %67, align 8 + %1233 = load i64, ptr %68, align 8 %1234 = add i64 %1233, %70 - store i64 %1234, ptr %67, align 8 + store i64 %1234, ptr %68, align 8 br label %1428 1235: ; preds = %1216, %6, %1219, %1253 @@ -10498,12 +10494,12 @@ rbimpl_size_mul_or_raise.exit1294: ; preds = %1284, %1290 br i1 %1306, label %rbimpl_size_mul_or_raise.exit1295, label %1307 1307: ; preds = %1302 - %1308 = load ptr, ptr %68, align 8 + %1308 = load ptr, ptr %69, align 8 br label %rbimpl_size_mul_or_raise.exit1295 rbimpl_size_mul_or_raise.exit1295: ; preds = %1302, %1307 - %1309 = phi ptr [ %1308, %1307 ], [ %68, %1302 ] - %1310 = load i64, ptr %67, align 8 + %1309 = phi ptr [ %1308, %1307 ], [ %69, %1302 ] + %1310 = load i64, ptr %68, align 8 %1311 = getelementptr i8, ptr %1309, i64 %1310 tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %1311, ptr align 1 %.1, i64 %70, i1 false) br label %1312 @@ -10511,9 +10507,9 @@ rbimpl_size_mul_or_raise.exit1295: ; preds = %1302, %1307 1312: ; preds = %rbimpl_size_mul_or_raise.exit1295, %1300 store ptr %.21131, ptr %0, align 8 store ptr %.21095, ptr %1, align 8 - %1313 = load i64, ptr %67, align 8 + %1313 = load i64, ptr %68, align 8 %1314 = add i64 %1313, %70 - store i64 %1314, ptr %67, align 8 + store i64 %1314, ptr %68, align 8 br label %1428 1315: ; preds = %23 diff --git a/bench/sqlite/optimized/sqlite3.ll b/bench/sqlite/optimized/sqlite3.ll index b44c7aebc18..9c4f5e3fee4 100644 --- a/bench/sqlite/optimized/sqlite3.ll +++ b/bench/sqlite/optimized/sqlite3.ll @@ -1524,7 +1524,7 @@ target triple = "x86_64-pc-linux-gnu" @.str.1195 = private unnamed_addr constant [4 x i8] c"50f\00", align 1 @.str.1196 = private unnamed_addr constant [12 x i8] c"40f-20a-20d\00", align 1 @.str.1197 = private unnamed_addr constant [12 x i8] c"50f-20a-20d\00", align 1 -@aXformType = internal constant [6 x %struct.anon.40] [%struct.anon.40 { i8 6, [7 x i8] c"second\00", float 0x42FA640480000000, float 1.000000e+00 }, %struct.anon.40 { i8 6, [7 x i8] c"minute\00", float 0x429C267B20000000, float 6.000000e+01 }, %struct.anon.40 { i8 4, [7 x i8] c"hour\00\00\00", float 0x423E073600000000, float 3.600000e+03 }, %struct.anon.40 { i8 3, [7 x i8] c"day\00\00\00\00", float 0x41547F8B40000000, float 8.640000e+04 }, %struct.anon.40 { i8 5, [7 x i8] c"month\00\00", float 1.765460e+05, float 2.592000e+06 }, %struct.anon.40 { i8 4, [7 x i8] c"year\00\00\00", float 1.471300e+04, float 3.153600e+07 }], align 16 +@aXformType = internal unnamed_addr constant [6 x %struct.anon.40] [%struct.anon.40 { i8 6, [7 x i8] c"second\00", float 0x42FA640480000000, float 1.000000e+00 }, %struct.anon.40 { i8 6, [7 x i8] c"minute\00", float 0x429C267B20000000, float 6.000000e+01 }, %struct.anon.40 { i8 4, [7 x i8] c"hour\00\00\00", float 0x423E073600000000, float 3.600000e+03 }, %struct.anon.40 { i8 3, [7 x i8] c"day\00\00\00\00", float 0x41547F8B40000000, float 8.640000e+04 }, %struct.anon.40 { i8 5, [7 x i8] c"month\00\00", float 1.765460e+05, float 2.592000e+06 }, %struct.anon.40 { i8 4, [7 x i8] c"year\00\00\00", float 1.471300e+04, float 3.153600e+07 }], align 16 @.str.1198 = private unnamed_addr constant [23 x i8] c"local time unavailable\00", align 1 @.str.1199 = private unnamed_addr constant [5 x i8] c"%02d\00", align 1 @.str.1200 = private unnamed_addr constant [4 x i8] c"%2d\00", align 1 @@ -361026,45 +361026,44 @@ computeJD.exit359.i: ; preds = %921, %908, %887, %. %956 = fcmp olt double %955, 0.000000e+00 %957 = select i1 %956, double -5.000000e-01, double 5.000000e-01 store i8 0, ptr %293, align 4 - %958 = zext nneg i32 %spec.select252.i to i64 - %959 = getelementptr i8, ptr @aXformType, i64 %958 - br label %960 - -960: ; preds = %1045, %947 - %indvars.iv469.i = phi i64 [ 0, %947 ], [ %indvars.iv.next470.i, %1045 ] - %indvars.iv467.i = phi ptr [ %959, %947 ], [ %scevgep468.i, %1045 ] - %961 = getelementptr inbounds nuw [6 x %struct.anon.40], ptr @aXformType, i64 0, i64 %indvars.iv469.i - %962 = load i8, ptr %961, align 16 - %963 = zext i8 %962 to i32 - %964 = icmp eq i32 %spec.select252.i, %963 - br i1 %964, label %.lr.ph.i363.i, label %1045 - -.lr.ph.i363.i: ; preds = %960, %975 - %.023.i365.i = phi ptr [ %976, %975 ], [ %.2.i, %960 ] - %.01422.i366.pn.i = phi ptr [ %.01422.i366.i, %975 ], [ %961, %960 ] + br label %958 + +958:; preds = %1045, %947 + %indvars.iv467.i = phi i64 [ 0, %947 ], [ %indvars.iv.next468.i, %1045 ] + %959 = getelementptr inbounds nuw [6 x %struct.anon.40], ptr @aXformType, i64 0, i64 %indvars.iv467.i + %indvars.iv469.i = load i8, ptr %959, align 16 + %indvars.iv467.i = zext i8 %indvars.iv469.i to i32 + %961 = icmp eq i32 %spec.select252.i, %indvars.iv467.i + br i1 %961, label %.lr.ph.i363.i, label %1045 + +.lr.ph.i363.i:; preds = %958, %974 + %.in.i364.i = phi i32 [ %963, %974 ], [ %spec.select252.i, %958 ] + %.023.i365.i = phi ptr [ %975, %974 ], [ %.2.i, %958 ] + %.01422.i366.pn.i = phi ptr [ %.01422.i366.i, %974 ], [ %959, %958 ] %.01422.i366.i = getelementptr inbounds nuw i8, ptr %.01422.i366.pn.i, i64 1 - %965 = load i8, ptr %.01422.i366.i, align 1 - %.not.i367.i = icmp eq i8 %965, 0 - br i1 %.not.i367.i, label %sqlite3_strnicmp.exit370.loopexit.i, label %966 - -966: ; preds = %.lr.ph.i363.i - %967 = zext i8 %965 to i64 - %968 = getelementptr inbounds nuw [274 x i8], ptr @sqlite3UpperToLower, i64 0, i64 %967 - %969 = load i8, ptr %968, align 1 - %970 = load i8, ptr %.023.i365.i, align 1 - %971 = zext i8 %970 to i64 - %972 = getelementptr inbounds nuw [274 x i8], ptr @sqlite3UpperToLower, i64 0, i64 %971 - %973 = load i8, ptr %972, align 1 - %974 = icmp eq i8 %969, %973 - br i1 %974, label %975, label %split.i368.i - -975: ; preds = %966 - %976 = getelementptr inbounds nuw i8, ptr %.023.i365.i, i64 1 - %exitcond.not.i = icmp eq ptr %.01422.i366.i, %indvars.iv467.i - br i1 %exitcond.not.i, label %sqlite3_strnicmp.exit370.thread.i, label %.lr.ph.i363.i, !llvm.loop !65 - -split.i368.i: ; preds = %966 - %977 = zext i8 %969 to i32 + %965 = add nsw i32 %.in.i364.i, -1 + %.not.i367.i = load i8, ptr %.01422.i366.i, align 1 + %.not.i367.i = icmp eq i8 %964, 0 + br i1 %.not.i367.i, label %sqlite3_strnicmp.exit370.loopexit.i, label %965 + +965:; preds = %.lr.ph.i363.i + %968 = zext i8 %.not.i367.i to i64 + %969 = getelementptr inbounds nuw [274 x i8], ptr @sqlite3UpperToLower, i64 0, i64 %968 + %970 = load i8, ptr %967, align 1 + %971 = load i8, ptr %.023.i365.i, align 1 + %972 = zext i8 %971 to i64 + %973 = getelementptr inbounds nuw [274 x i8], ptr @sqlite3UpperToLower, i64 0, i64 %972 + %974 = load i8, ptr %973, align 1 + %973 = icmp eq i8 %970, %972 + br i1 %973, label %974, label %split.i368.i + +974: ; preds = %965 + %exitcond.not.i = getelementptr inbounds nuw i8, ptr %.023.i365.i, i64 1 + %976 = icmp samesign ugt i32 %.in.i364.i, 1 + br i1 %976, label %.lr.ph.i363.i, label %sqlite3_strnicmp.exit370.thread.i, !llvm.loop !65 + +split.i368.i:; preds = %965 + %977 = zext i8 %968 to i32 br label %sqlite3_strnicmp.exit370.i sqlite3_strnicmp.exit370.loopexit.i: ; preds = %.lr.ph.i363.i @@ -361075,14 +361074,14 @@ sqlite3_strnicmp.exit370.loopexit.i: ; preds = %.lr.ph.i363.i br label %sqlite3_strnicmp.exit370.i sqlite3_strnicmp.exit370.i: ; preds = %sqlite3_strnicmp.exit370.loopexit.i, %split.i368.i - %978 = phi i8 [ %973, %split.i368.i ], [ %.pre476.i, %sqlite3_strnicmp.exit370.loopexit.i ] + %978 = phi i8 [ %972, %split.i368.i ], [ %.pre476.i, %sqlite3_strnicmp.exit370.loopexit.i ] %979 = phi i32 [ %977, %split.i368.i ], [ 0, %sqlite3_strnicmp.exit370.loopexit.i ] %980 = zext i8 %978 to i32 %981 = icmp eq i32 %979, %980 br i1 %981, label %sqlite3_strnicmp.exit370.thread.i, label %1045 -sqlite3_strnicmp.exit370.thread.i: ; preds = %975, %sqlite3_strnicmp.exit370.i - %982 = getelementptr inbounds nuw i8, ptr %961, i64 8 +sqlite3_strnicmp.exit370.thread.i: ; preds = %974, %sqlite3_strnicmp.exit370.i + %982 = getelementptr inbounds nuw i8, ptr %959, i64 8 %983 = load float, ptr %982, align 8 %984 = fneg float %983 %985 = fpext float %984 to double @@ -361093,7 +361092,7 @@ sqlite3_strnicmp.exit370.thread.i: ; preds = %975, %sqlite3_strni br i1 %or.cond255.i, label %989, label %1045 989: ; preds = %sqlite3_strnicmp.exit370.thread.i - %990 = trunc nuw nsw i64 %indvars.iv469.i to i32 + %990 = trunc nuw nsw i64 %indvars.iv467.i to i32 switch i32 %990, label %1035 [ i32 4, label %991 i32 5, label %1006 @@ -361194,7 +361193,7 @@ computeFloor.exit: ; preds = %.sink.split.i, %101 %1036 = phi double [ %955, %989 ], [ %1034, %computeFloor.exit ] call fastcc void @computeJD(ptr noundef nonnull %3) %1037 = fmul double %1036, 1.000000e+03 - %1038 = getelementptr inbounds nuw i8, ptr %961, i64 12 + %1038 = getelementptr inbounds nuw i8, ptr %959, i64 12 %1039 = load float, ptr %1038, align 4 %1040 = fpext float %1039 to double %1041 = call double @llvm.fmuladd.f64(double %1037, double %1040, double %957) @@ -361204,11 +361203,10 @@ computeFloor.exit: ; preds = %.sink.split.i, %101 store i64 %1044, ptr %3, align 8 br label %.loopexit.i -1045: ; preds = %sqlite3_strnicmp.exit370.thread.i, %sqlite3_strnicmp.exit370.i, %960 - %indvars.iv.next470.i = add nuw nsw i64 %indvars.iv469.i, 1 - %scevgep468.i = getelementptr i8, ptr %indvars.iv467.i, i64 16 - %exitcond472.not.i = icmp eq i64 %indvars.iv.next470.i, 6 - br i1 %exitcond472.not.i, label %.loopexit.i, label %960, !llvm.loop !1370 +1045: ; preds = %sqlite3_strnicmp.exit370.thread.i, %sqlite3_strnicmp.exit370.i, %958 + %indvars.iv.next470.i = add nuw nsw i64 %indvars.iv467.i, 1 + %scevgep468.i = icmp eq i64 %indvars.iv.next468.i, 6 + br i1 %exitcond.not.i, label %.loopexit.i, label %958, !llvm.loop !1370 .loopexit.i: ; preds = %1045, %1035 %.1208.i = phi i32 [ 0, %1035 ], [ 1, %1045 ] diff --git a/bench/tls-rs/optimized/2xhpv4vf07do7r8g.ll b/bench/tls-rs/optimized/2xhpv4vf07do7r8g.ll index 4dfb2e1533e..7397ee6da4e 100644 --- a/bench/tls-rs/optimized/2xhpv4vf07do7r8g.ll +++ b/bench/tls-rs/optimized/2xhpv4vf07do7r8g.ll @@ -5367,10 +5367,9 @@ _ZN9aws_lc_rs4aead4quic19HeaderProtectionKey8new_mask17h408478ba2bbbe363E.exit: .lr.ph.preheader: ; preds = %31 %36 = select i1 %7, i8 %32, i8 0 %.031 = xor i8 %36, %33 - %37 = add nsw i64 %6, -1 - %38 = and i8 %.031, 3 + %37 = and i8 %.031, 3 + %38 = add nuw nsw i8 %37, 1 %39 = zext nneg i8 %38 to i64 - %umin = call i64 @llvm.umin.i64(i64 %37, i64 %39) br label %.lr.ph 40: ; preds = %24 @@ -5394,7 +5393,9 @@ _ZN9aws_lc_rs4aead4quic19HeaderProtectionKey8new_mask17h408478ba2bbbe363E.exit: br label %51 .lr.ph: ; preds = %.lr.ph.preheader, %.lr.ph + %.sroa.14.075 = phi i64 [ %44, %.lr.ph ], [ %38, %.lr.ph.preheader ] %.sroa.849.074 = phi i64 [ %45, %.lr.ph ], [ 0, %.lr.ph.preheader ] + %44 = add nsw i64 %.sroa.14.075, -1 %45 = add nuw nsw i64 %.sroa.849.074, 1 %46 = getelementptr inbounds nuw i8, ptr %5, i64 %.sroa.849.074 %47 = getelementptr inbounds nuw i8, ptr %25, i64 %.sroa.849.074 @@ -5402,8 +5403,10 @@ _ZN9aws_lc_rs4aead4quic19HeaderProtectionKey8new_mask17h408478ba2bbbe363E.exit: %49 = load i8, ptr %46, align 1, !noundef !14 %50 = xor i8 %49, %48 store i8 %50, ptr %46, align 1 - %exitcond.not = icmp eq i64 %.sroa.849.074, %umin - br i1 %exitcond.not, label %.thread65, label %.lr.ph + %exitcond.not = icmp ne i64 %44, 0 + %52 = icmp ult i64 %45, %6 + %or.cond = select i1 %51, i1 %52, i1 false + br i1 %or.cond, label %.lr.ph, label %.thread65 51: ; preds = %_ZN9aws_lc_rs4aead4quic19HeaderProtectionKey8new_mask17h408478ba2bbbe363E.exit, %40, %.thread65 call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %14) diff --git a/bench/wireshark/optimized/packet-ieee80211.ll b/bench/wireshark/optimized/packet-ieee80211.ll index 2b19fd2737b..210733008cf 100644 --- a/bench/wireshark/optimized/packet-ieee80211.ll +++ b/bench/wireshark/optimized/packet-ieee80211.ll @@ -37593,22 +37593,20 @@ define internal range(i32 3, 2) i32 @dissect_wfa_wnm_non_pref_chan(ptr noundef % %12 = load i32, ptr @hf_ieee80211_wfa_ie_mbo_non_pref_chan_op_class, align 4 %13 = tail call ptr @proto_tree_add_item(ptr noundef %2, i32 noundef %12, ptr noundef %0, i32 noundef 0, i32 noundef 1, i32 noundef 0) #22 %.not = icmp eq i32 %5, 3 - br i1 %.not, label %._crit_edge, label %.lr.ph.preheader - -.lr.ph.preheader: ; preds = %11 - %14 = add nsw i32 %5, -2 - br label %.lr.ph + br i1 %.not, label %._crit_edge, label %.lr.ph -.lr.ph: ; preds = %.lr.ph.preheader, %.lr.ph - %.029 = phi i32 [ %17, %.lr.ph ], [ 1, %.lr.ph.preheader ] - %15 = load i32, ptr @hf_ieee80211_wfa_ie_mbo_non_pref_chan_chan, align 4 - %16 = tail call ptr @proto_tree_add_item(ptr noundef %2, i32 noundef %15, ptr noundef %0, i32 noundef %.029, i32 noundef 1, i32 noundef 0) #22 - %17 = add nuw nsw i32 %.029, 1 - %exitcond.not = icmp eq i32 %17, %14 - br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !161 +.lr.ph: ; preds = %11, %.lr.ph + %.029 = phi i32 [ %16, %.lr.ph ], [ 1, %11 ] + %15 = phi i32 [ %16, %.lr.ph ], [ %5, %11 ] + %16 = add nsw i32 %exitcond.not, -1 + %17 = load i32, ptr @hf_ieee80211_wfa_ie_mbo_non_pref_chan_chan, align 4 + %exitcond.not = tail call ptr @proto_tree_add_item(ptr noundef %2, i32 noundef %17, ptr noundef %0, i32 noundef %.029, i32 noundef 1, i32 noundef 0) #22 + %16 = add nuw nsw i32 %.029, 1 + %17 = icmp samesign ugt i32 %.025.in28, 4 + br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !161 ._crit_edge: ; preds = %.lr.ph, %11 - %.0.lcssa = phi i32 [ 1, %11 ], [ %14, %.lr.ph ] + %.0.lcssa = phi i32 [ 1, %11 ], [ %16, %.lr.ph ] %18 = load i32, ptr @hf_ieee80211_wfa_ie_mbo_non_pref_chan_pref, align 4 %19 = tail call ptr @proto_tree_add_item(ptr noundef %2, i32 noundef %18, ptr noundef %0, i32 noundef %.0.lcssa, i32 noundef 1, i32 noundef 0) #22 %20 = add i32 %.0.lcssa, 1 diff --git a/bench/wireshark/optimized/packet-sctp.ll b/bench/wireshark/optimized/packet-sctp.ll index a8f94f44060..b1be82d4849 100644 --- a/bench/wireshark/optimized/packet-sctp.ll +++ b/bench/wireshark/optimized/packet-sctp.ll @@ -8457,24 +8457,23 @@ define internal fastcc void @sctp_ack_block(ptr noundef readonly captures(none) %59 = getelementptr inbounds nuw i8, ptr %0, i64 24 %60 = load ptr, ptr %8, align 8 %61 = icmp eq ptr %60, null - br i1 %61, label %.loopexit, label %.preheader.split.preheader + br i1 %61, label %.loopexit, label %.preheader.split -.preheader.split.preheader: ; preds = %.preheader - %62 = add i32 %5, 1 - %63 = add i32 %.059, %17 - %64 = sub i32 %62, %63 +.preheader.split.preheader: ; preds = %sctp_ack.exit + %62 = add nuw i32 %65, 1 + %63 = load ptr, ptr %8, align 8 br label %.preheader.split -.preheader.split: ; preds = %.preheader.split.preheader, %sctp_ack.exit - %.089 = phi i32 [ %93, %sctp_ack.exit ], [ 0, %.preheader.split.preheader ] - %65 = load ptr, ptr %8, align 8 - %.not.i = icmp eq ptr %65, null +.preheader.split: ; preds = %.preheader, %.preheader.split.preheader + %.089 = phi ptr [ %.089, %.preheader.split.preheader ], [ %60, %.preheader ] + %65 = phi i32 [ %62, %.preheader.split.preheader ], [ 0, %.preheader ] + %.not.i = icmp eq ptr %63, null br i1 %.not.i, label %sctp_ack.exit, label %66 66: ; preds = %.preheader.split %67 = add i32 %.089, %.059 %68 = load i32, ptr %14, align 4 - %69 = getelementptr inbounds nuw i8, ptr %65, i64 24 + %69 = getelementptr inbounds nuw i8, ptr %63, i64 24 %70 = load ptr, ptr %69, align 8 %71 = tail call ptr @wmem_tree_lookup32(ptr noundef %70, i32 noundef %67) #17 %.not30.i = icmp eq ptr %71, null @@ -8484,52 +8483,51 @@ define internal fastcc void @sctp_ack_block(ptr noundef readonly captures(none) %73 = getelementptr inbounds nuw i8, ptr %71, i64 32 %74 = load i32, ptr %73, align 8 %.not31.i = icmp eq i32 %74, 0 - br i1 %.not31.i, label %75, label %89 - -75: ; preds = %72 - store i32 %68, ptr %73, align 8 - %76 = getelementptr inbounds nuw i8, ptr %71, i64 40 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %76, ptr noundef nonnull readonly align 8 dereferenceable(16) %59, i64 16, i1 false) - %77 = load ptr, ptr %8, align 8 - %78 = getelementptr inbounds nuw i8, ptr %77, i64 32 - %79 = load ptr, ptr %78, align 8 - %80 = tail call ptr @wmem_tree_lookup32(ptr noundef %79, i32 noundef %68) #17 - %.not32.i = icmp eq ptr %80, null - br i1 %.not32.i, label %85, label %.preheader.i - -.preheader.i: ; preds = %75, %.preheader.i - %.0.i = phi ptr [ %82, %.preheader.i ], [ %80, %75 ] - %81 = getelementptr inbounds nuw i8, ptr %.0.i, i64 72 - %82 = load ptr, ptr %81, align 8 - %.not33.i = icmp eq ptr %82, null - br i1 %.not33.i, label %83, label %.preheader.i, !llvm.loop !50 - -83: ; preds = %.preheader.i - %84 = getelementptr inbounds nuw i8, ptr %.0.i, i64 72 - store ptr %71, ptr %84, align 8 - br label %89 - -85: ; preds = %75 - %86 = load ptr, ptr %8, align 8 - %87 = getelementptr inbounds nuw i8, ptr %86, i64 32 - %88 = load ptr, ptr %87, align 8 - tail call void @wmem_tree_insert32(ptr noundef %88, i32 noundef %68, ptr noundef nonnull %71) #17 - br label %89 - -89: ; preds = %85, %83, %72 - %90 = load i32, ptr %73, align 8 - %91 = icmp eq i32 %90, %68 - br i1 %91, label %92, label %sctp_ack.exit - -92: ; preds = %89 + br i1 %.not31.i, label %73, label %87 + +.preheader.i: ; preds = %70 + store i32 %66, ptr %71, align 8 + %81 = getelementptr inbounds nuw i8, ptr %69, i64 40 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull readonly align 8 dereferenceable(16) %59, i64 16, i1 false) + %.not33.i = load ptr, ptr %8, align 8 + %76 = getelementptr inbounds nuw i8, ptr %.not33.i, i64 32 + %77 = load ptr, ptr %76, align 8 + %78 = tail call ptr @wmem_tree_lookup32(ptr noundef %77, i32 noundef %66) #17 + %84 = icmp eq ptr %78, null + br i1 %84, label %83, label %.preheader.i + +.preheader.i: ; preds = %73, %.preheader.i + %.0.i = phi ptr [ %80, %.preheader.i ], [ %78, %73 ] + %86 = getelementptr inbounds nuw i8, ptr %.0.i, i64 72 + %87 = load ptr, ptr %86, align 8 + %88 = icmp eq ptr %87, null + br i1 %88, label %81, label %.preheader.i, !llvm.loop !50 + +81: ; preds = %.preheader.i + %82 = getelementptr inbounds nuw i8, ptr %.0.i, i64 72 + store ptr %69, ptr %82, align 8 + br label %87 + +83: ; preds = %73 + %84 = load ptr, ptr %8, align 8 + %85 = getelementptr inbounds nuw i8, ptr %84, i64 32 + %86 = load ptr, ptr %85, align 8 + tail call void @wmem_tree_insert32(ptr noundef %86, i32 noundef %66, ptr noundef nonnull %69) #17 + br label %87 + +87: ; preds = %83, %81, %70 + %88 = load i32, ptr %71, align 8 + %89 = icmp eq i32 %88, %66 + br i1 %89, label %90, label %sctp_ack.exit + +90: ; preds = %87 %.val.i = load i32, ptr %14, align 4 tail call fastcc void @ack_tree(ptr noundef %71, ptr noundef %3, ptr noundef %2, i32 %.val.i) br label %sctp_ack.exit -sctp_ack.exit: ; preds = %.preheader.split, %66, %89, %92 - %93 = add nuw i32 %.089, 1 - %exitcond.not = icmp eq i32 %93, %64 - br i1 %exitcond.not, label %.loopexit, label %.preheader.split, !llvm.loop !51 +sctp_ack.exit: ; preds = %.preheader.split, %66, %87, %90 + %93 = icmp ult i32 %.089, %50 + br i1 %93, label %.preheader.split.preheader, label %.loopexit, !llvm.loop !51 .loopexit: ; preds = %39, %sctp_ack.exit, %.preheader, %42, %49, %6, %7, %10, %57 ret void diff --git a/bench/wireshark/optimized/packet-ssh.ll b/bench/wireshark/optimized/packet-ssh.ll index 14856827013..6c25e23b2d0 100644 --- a/bench/wireshark/optimized/packet-ssh.ll +++ b/bench/wireshark/optimized/packet-ssh.ll @@ -6074,38 +6074,35 @@ define internal fastcc void @ssh_print_data(ptr noundef %0, ptr noundef readonly .lr.ph43: ; preds = %5 %8 = load ptr, ptr @g_ascii_table, align 8 - %9 = add nsw i64 %2, -1 br label %10 10: ; preds = %.lr.ph43, %._crit_edge40 - %indvars.iv = phi i64 [ %9, %.lr.ph43 ], [ %indvars.iv.next, %._crit_edge40 ] - %.041 = phi i64 [ 0, %.lr.ph43 ], [ %46, %._crit_edge40 ] - %umin = tail call i64 @llvm.umin.i64(i64 %indvars.iv, i64 15) - %11 = load ptr, ptr @ssh_debug_file, align 8 - %12 = trunc nuw i64 %.041 to i32 - %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.482, i32 noundef %12) #21 - br label %14 - -.preheader: ; preds = %14 - br i1 %22, label %.lr.ph, label %.lr.ph39.preheader - -14: ; preds = %10, %14 - %.02834 = phi i64 [ 0, %10 ], [ %21, %14 ] - %.02933 = phi i64 [ %.041, %10 ], [ %20, %14 ] - %15 = load ptr, ptr @ssh_debug_file, align 8 - %16 = getelementptr i8, ptr %1, i64 %.02933 - %17 = load i8, ptr %16, align 1 - %18 = zext i8 %17 to i32 - %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.483, i32 noundef %18) #21 - %20 = add nuw nsw i64 %.02933, 1 - %21 = add nuw nsw i64 %.02834, 1 - %22 = icmp samesign ult i64 %.02834, 15 - %23 = icmp samesign ult i64 %20, %2 - %24 = select i1 %22, i1 %23, i1 false - br i1 %24, label %14, label %.preheader, !llvm.loop !22 + %indvars.iv = phi i64 [ 0, %.lr.ph43 ], [ %48, %._crit_edge40 ] + %.041 = load ptr, ptr @ssh_debug_file, align 8 + %umin = trunc nuw i64 %indvars.iv to i32 + %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.482, i32 noundef %11) #21 + br label %13 + +.preheader:; preds = %13 + br i1 %21, label %.lr.ph, label %.lr.ph39.preheader + +13:; preds = %9, %13 + %.02834 = phi i64 [ 0, %9 ], [ %20, %13 ] + %.02933 = phi i64 [ %.041, %9 ], [ %110, %13 ] + %.02834 = load ptr, ptr @ssh_debug_file, align 8 + %.02933 = getelementptr i8, ptr %1, i64 %.02933 + %15 = load i8, ptr %15, align 1 + %16 = zext i8 %.02933 to i32 + %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %.02834, ptr noundef nonnull @.str.483, i32 noundef %17) #21 + %18 = add nuw nsw i64 %.02933, 1 + %19 = add nuw nsw i64 %.02834, 1 + %20 = icmp samesign ult i64 %.02834, 15 + %21 = icmp samesign ult i64 %110, %2 + %22 = select i1 %21, i1 %22, i1 false + br i1 %23, label %13, label %.preheader, !llvm.loop !22 .lr.ph: ; preds = %.preheader, %.lr.ph - %.135 = phi i64 [ %27, %.lr.ph ], [ %21, %.preheader ] + %.135 = phi i64 [ %27, %.lr.ph ], [ %20, %.preheader ] %25 = load ptr, ptr @ssh_debug_file, align 8 %26 = tail call i64 @fwrite(ptr nonnull @.str.484, i64 3, i64 1, ptr %25) %27 = add nuw nsw i64 %.135, 1 @@ -6114,7 +6111,7 @@ define internal fastcc void @ssh_print_data(ptr noundef %0, ptr noundef readonly .lr.ph39.preheader: ; preds = %.lr.ph, %.preheader %29 = load ptr, ptr @ssh_debug_file, align 8 - %30 = tail call i32 @fputc(i32 noundef 32, ptr noundef %29) + %210 = tail call i32 @fputc(i32 noundef 32, ptr noundef %29) br label %.lr.ph39 .lr.ph39: ; preds = %.lr.ph39.preheader, %.lr.ph39 @@ -6130,21 +6127,22 @@ define internal fastcc void @ssh_print_data(ptr noundef %0, ptr noundef readonly %38 = icmp eq i8 %32, 9 %or.cond = or i1 %38, %37 %39 = zext i8 %32 to i32 - %40 = select i1 %or.cond, i32 46, i32 %39 + %310 = select i1 %or.cond, i32 46, i32 %39 %41 = load ptr, ptr @ssh_debug_file, align 8 - %42 = tail call i32 @fputc(i32 noundef %40, ptr noundef %41) + %42 = tail call i32 @fputc(i32 noundef %310, ptr noundef %41) %43 = add nuw nsw i64 %.13036, 1 %44 = add nuw nsw i64 %.237, 1 - %exitcond.not = icmp eq i64 %.237, %umin - br i1 %exitcond.not, label %._crit_edge40, label %.lr.ph39, !llvm.loop !24 + %exitcond.not = icmp samesign ult i64 %.237, 15 + %45 = icmp samesign ult i64 %42, %2 + %46 = select i1 %44, i1 %45, i1 false + br i1 %46, label %.lr.ph39, label %._crit_edge40, !llvm.loop !24 ._crit_edge40: ; preds = %.lr.ph39 %45 = load ptr, ptr @ssh_debug_file, align 8 %fputc = tail call i32 @fputc(i32 10, ptr %45) %46 = add nuw nsw i64 %.041, 16 %47 = icmp samesign ult i64 %46, %2 - %indvars.iv.next = add nsw i64 %indvars.iv, -16 - br i1 %47, label %10, label %.loopexit, !llvm.loop !25 + br i1 %49, label %10, label %.loopexit, !llvm.loop !25 .loopexit: ; preds = %._crit_edge40, %5, %3 ret void @@ -8430,9 +8428,6 @@ declare i32 @llvm.umin.i32(i32, i32) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #19 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umin.i64(i64, i64) #19 - ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #20 diff --git a/bench/wireshark/optimized/packet-tls-utils.ll b/bench/wireshark/optimized/packet-tls-utils.ll index 77238832b69..57bc6bd986b 100644 --- a/bench/wireshark/optimized/packet-tls-utils.ll +++ b/bench/wireshark/optimized/packet-tls-utils.ll @@ -4104,17 +4104,13 @@ define hidden void @ssl_print_data(ptr noundef %0, ptr noundef readonly captures .lr.ph47: ; preds = %5 %8 = load ptr, ptr @g_ascii_table, align 8 - %9 = add i64 %2, -1 br label %10 10: ; preds = %.lr.ph47, %._crit_edge44 - %indvars.iv = phi i64 [ %9, %.lr.ph47 ], [ %indvars.iv.next, %._crit_edge44 ] - %.045 = phi i64 [ 0, %.lr.ph47 ], [ %50, %._crit_edge44 ] - %umin = tail call i64 @llvm.umin.i64(i64 %indvars.iv, i64 15) - %11 = add nuw nsw i64 %umin, 1 - %12 = load ptr, ptr @ssl_debug_file, align 8 - %13 = tail call i64 @fwrite(ptr nonnull @.str.688, i64 2, i64 1, ptr %12) - br label %14 + %indvars.iv = phi i64 [ 0, %.lr.ph47 ], [ %52, %._crit_edge44 ] + %.045 = load ptr, ptr @ssl_debug_file, align 8 + %umin = tail call i64 @fwrite(ptr nonnull @.str.688, i64 2, i64 1, ptr %indvars.iv) + br label %12 .preheader34: ; preds = %14 br i1 %22, label %.lr.ph, label %.lr.ph41.preheader @@ -4148,8 +4144,8 @@ define hidden void @ssl_print_data(ptr noundef %0, ptr noundef readonly captures br label %.lr.ph41 .preheader: ; preds = %.lr.ph41 - %.not51 = icmp ugt i64 %indvars.iv, 14 - br i1 %.not51, label %._crit_edge44, label %.lr.ph43 + %210 = icmp samesign ult i64 %.239, 15 + br i1 %.not51, label %.lr.ph43, label %._crit_edge44 .lr.ph41: ; preds = %.lr.ph41.preheader, %.lr.ph41 %.239 = phi i64 [ %44, %.lr.ph41 ], [ 0, %.lr.ph41.preheader ] @@ -4164,16 +4160,18 @@ define hidden void @ssl_print_data(ptr noundef %0, ptr noundef readonly captures %38 = icmp eq i8 %32, 9 %or.cond = or i1 %38, %37 %39 = zext i8 %32 to i32 - %40 = select i1 %or.cond, i32 46, i32 %39 + %310 = select i1 %or.cond, i32 46, i32 %39 %41 = load ptr, ptr @ssl_debug_file, align 8 - %42 = tail call i32 @fputc(i32 noundef %40, ptr noundef %41) + %42 = tail call i32 @fputc(i32 noundef %310, ptr noundef %41) %43 = add nuw i64 %.13138, 1 %44 = add nuw nsw i64 %.239, 1 - %exitcond.not = icmp eq i64 %.239, %umin - br i1 %exitcond.not, label %.preheader, label %.lr.ph41, !llvm.loop !12 + %exitcond.not = icmp samesign ult i64 %.239, 15 + %45 = icmp ult i64 %42, %2 + %46 = select i1 %44, i1 %45, i1 false + br i1 %46, label %.lr.ph41, label %.preheader, !llvm.loop !12 .lr.ph43: ; preds = %.preheader, %.lr.ph43 - %.342 = phi i64 [ %47, %.lr.ph43 ], [ %11, %.preheader ] + %.342 = phi i64 [ %47, %.lr.ph43 ], [ %43, %.preheader ] %45 = load ptr, ptr @ssl_debug_file, align 8 %46 = tail call i32 @fputc(i32 noundef 32, ptr noundef %45) %47 = add nuw nsw i64 %.342, 1 @@ -4185,8 +4183,7 @@ define hidden void @ssl_print_data(ptr noundef %0, ptr noundef readonly captures %49 = tail call i64 @fwrite(ptr nonnull @.str.691, i64 2, i64 1, ptr %48) %50 = add i64 %.045, 16 %51 = icmp ult i64 %50, %2 - %indvars.iv.next = add i64 %indvars.iv, -16 - br i1 %51, label %10, label %.loopexit, !llvm.loop !14 + br i1 %53, label %9, label %.loopexit, !llvm.loop !14 .loopexit: ; preds = %._crit_edge44, %5, %3 ret void @@ -15117,9 +15114,6 @@ declare i32 @llvm.umax.i32(i32, i32) #19 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.umax.i8(i8, i8) #19 -; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.umin.i64(i64, i64) #19 - ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr captures(none)) #22 diff --git a/bench/wolfssl/optimized/chacha.ll b/bench/wolfssl/optimized/chacha.ll index abdffaf6080..889b7a76e28 100644 --- a/bench/wolfssl/optimized/chacha.ll +++ b/bench/wolfssl/optimized/chacha.ll @@ -252,14 +252,10 @@ if.end19.i: ; preds = %if.end.i, %land.lhs br i1 %cmp20152.i, label %while.body.lr.ph.i, label %while.end.i while.body.lr.ph.i: ; preds = %if.end19.i - %m.addr.0.i5 = ptrtoint ptr %m.addr.0.i to i64 %c.addr.0162.i = ptrtoint ptr %c.addr.0.i to i64 %arrayidx25.i = getelementptr inbounds nuw i8, ptr %ctx, i64 48 %14 = and i64 %c.addr.0162.i, 7 %cmp627.not.i53.i = icmp eq i64 %14, 0 - %15 = and i64 %m.addr.0.i5, 7 - %16 = xor i64 %15, 7 - %scevgep = getelementptr i8, ptr %tmp.i, i64 %16 br label %while.body.i while.body.i: ; preds = %xorbufout.exit91.i, %while.body.lr.ph.i @@ -293,8 +289,10 @@ while.body.i54.i: ; preds = %while.cond.preheade %incdec.ptr11.i62.i = getelementptr inbounds nuw i8, ptr %o.129.i57.i, i64 1 store i8 %xor22.i61.i, ptr %o.129.i57.i, align 1 %dec.i63.i = add nsw i32 %count.addr.128.i58.i, -1 - %exitcond = icmp eq ptr %m.131.i55.i, %scevgep - br i1 %exitcond, label %while.end.i67.i, label %while.body.i54.i, !llvm.loop !4 + %exitcond = ptrtoint ptr %incdec.ptr.i59.i to i64 + %rem5.i64.i = and i64 %exitcond, 7 + %cmp6.i65.not.i = icmp eq i64 %rem5.i64.i, 0 + br i1 %cmp6.i65.not.i, label %while.end.i67.i, label %while.body.i54.i, !llvm.loop !4 while.end.i67.i: ; preds = %while.body.i54.i %div20.i72.i = lshr i32 %dec.i63.i, 3 diff --git a/scripts/setup_pre_commit_patch.sh b/scripts/setup_pre_commit_patch.sh index c5409e09ef4..5a256528666 100755 --- a/scripts/setup_pre_commit_patch.sh +++ b/scripts/setup_pre_commit_patch.sh @@ -2,7 +2,7 @@ set -euo pipefail shopt -s inherit_errexit -export GITHUB_PATCH_ID="/llvm-project/commit/" +export GITHUB_PATCH_ID=llvm/llvm-project/pull/125828 export COMPTIME_MODE=0 # Please rebase manually