diff --git a/bench/abc/optimized/bmcMaj3.ll b/bench/abc/optimized/bmcMaj3.ll index 7818a15a5aa..170f243c466 100644 --- a/bench/abc/optimized/bmcMaj3.ll +++ b/bench/abc/optimized/bmcMaj3.ll @@ -6988,13 +6988,14 @@ Abc_TtNot.exit66.i: ; preds = %.lr.ph.i62.i, %Abc_ br label %190 190: ; preds = %.loopexit.i, %.lr.ph91.i - %.04889.i = phi i32 [ %184, %.lr.ph91.i ], [ %231, %.loopexit.i ] + %.04889.i = phi i32 [ %184, %.lr.ph91.i ], [ %invariant.op.i, %.loopexit.i ] %191 = add nsw i32 %.04889.i, 65 %fputc50.i = call i32 @fputc(i32 %191, ptr nonnull %180) %192 = load ptr, ptr %0, align 8, !tbaa !84 %193 = getelementptr inbounds nuw i8, ptr %192, i64 16 %194 = load i32, ptr %193, align 8, !tbaa !85 %.not51.i = icmp eq i32 %194, 0 + %invariant.op.i = add nsw i32 %.04889.i, 1 br i1 %.not51.i, label %197, label %195 195: ; preds = %190 @@ -7011,7 +7012,7 @@ Abc_TtNot.exit66.i: ; preds = %.lr.ph.i62.i, %Abc_ br i1 %200, label %.lr.ph88.i, label %.loopexit.i .lr.ph.i: ; preds = %197, %.lr.ph.i - %.086.i = phi i32 [ %214, %.lr.ph.i ], [ %198, %197 ] + %.086.i = phi i32 [ %213, %.lr.ph.i ], [ %198, %197 ] %201 = load ptr, ptr %188, align 8, !tbaa !79 %.val.i = load ptr, ptr %0, align 8, !tbaa !84 %.val56.i = load i32, ptr %187, align 8, !tbaa !93 @@ -7022,30 +7023,29 @@ Abc_TtNot.exit66.i: ; preds = %.lr.ph.i62.i, %Abc_ %205 = add nsw i32 %204, %.086.i %206 = call i32 @bmcg_sat_solver_read_cex_varvalue(ptr noundef %201, i32 noundef %205) #27 %207 = load i32, ptr %15, align 8, !tbaa !88 - %208 = add nsw i32 %207, -1 - %209 = icmp eq i32 %.04889.i, %208 - %210 = and i1 %78, %209 - %211 = zext i1 %210 to i32 - %212 = xor i32 %206, %211 - %213 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %180, ptr noundef nonnull @.str.64, i32 noundef %212) #27 - %214 = add nsw i32 %.086.i, -1 - %.not118.i = icmp eq i32 %.086.i, 0 - br i1 %.not118.i, label %.preheader.i, label %.lr.ph.i, !llvm.loop !193 - -.lr.ph88.i: ; preds = %.preheader.i, %229 - %.187.i = phi i32 [ %230, %229 ], [ 0, %.preheader.i ] - %215 = load ptr, ptr %188, align 8, !tbaa !79 - %216 = load i32, ptr %189, align 4, !tbaa !95 - %217 = load i32, ptr %15, align 8, !tbaa !88 - %218 = load ptr, ptr %0, align 8, !tbaa !84 - %219 = load i32, ptr %218, align 8, !tbaa !92 - %220 = sub nsw i32 %.04889.i, %219 - %221 = mul nsw i32 %220, %217 - %222 = add i32 %216, %.187.i - %223 = add i32 %222, %221 - %224 = call i32 @bmcg_sat_solver_read_cex_varvalue(ptr noundef %215, i32 noundef %223) #27 - %.not52.i = icmp eq i32 %224, 0 - br i1 %.not52.i, label %229, label %.sink.split.i + %208 = icmp eq i32 %207, %invariant.op.i + %209 = and i1 %78, %208 + %210 = zext i1 %209 to i32 + %211 = xor i32 %206, %210 + %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %180, ptr noundef nonnull @.str.64, i32 noundef %211) #27 + %213 = add nsw i32 %.086.i, -1 + %.not119.i = icmp eq i32 %.086.i, 0 + br i1 %.not119.i, label %.preheader.i, label %.lr.ph.i, !llvm.loop !193 + +.lr.ph88.i: ; preds = %.preheader.i, %228 + %.187.i = phi i32 [ %229, %228 ], [ 0, %.preheader.i ] + %214 = load ptr, ptr %188, align 8, !tbaa !79 + %215 = load i32, ptr %189, align 4, !tbaa !95 + %216 = load i32, ptr %15, align 8, !tbaa !88 + %217 = load ptr, ptr %0, align 8, !tbaa !84 + %218 = load i32, ptr %217, align 8, !tbaa !92 + %219 = sub nsw i32 %.04889.i, %218 + %220 = mul nsw i32 %219, %216 + %221 = add i32 %215, %.187.i + %222 = add i32 %221, %220 + %223 = call i32 @bmcg_sat_solver_read_cex_varvalue(ptr noundef %214, i32 noundef %222) #27 + %.not52.i = icmp eq i32 %223, 0 + br i1 %.not52.i, label %228, label %.sink.split.i .sink.split.i: ; preds = %.lr.ph88.i %225 = load ptr, ptr %0, align 8, !tbaa !84 @@ -7063,10 +7063,9 @@ Abc_TtNot.exit66.i: ; preds = %.lr.ph.i62.i, %Abc_ .loopexit.i: ; preds = %229, %.preheader.i, %195 %fputc55.i = call i32 @fputc(i32 10, ptr nonnull %180) - %231 = add nsw i32 %.04889.i, 1 - %232 = load i32, ptr %15, align 8, !tbaa !88 - %233 = icmp slt i32 %231, %232 - br i1 %233, label %190, label %._crit_edge.i, !llvm.loop !195 + %230 = load i32, ptr %15, align 8, !tbaa !88 + %231 = icmp slt i32 %invariant.op.i, %230 + br i1 %231, label %190, label %._crit_edge.i, !llvm.loop !195 ._crit_edge.i: ; preds = %.loopexit.i, %182 %fputc.i = call i32 @fputc(i32 10, ptr nonnull %180) diff --git a/bench/abc/optimized/cbaBlast.ll b/bench/abc/optimized/cbaBlast.ll index b15ea1f5855..e1c55db94d9 100644 --- a/bench/abc/optimized/cbaBlast.ll +++ b/bench/abc/optimized/cbaBlast.ll @@ -2214,17 +2214,20 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 br label %._crit_edge .preheader.us.preheader: ; preds = %Vec_IntFill.exit64 + %invariant.op67 = add nsw i32 %4, -1 %.not54 = icmp ne i32 %7, 0 - %53 = zext nneg i32 %3 to i64 - %54 = zext nneg i32 %4 to i64 + %invariant.op = add nsw i32 %3, -1 + %54 = zext nneg i32 %invariant.op to i64 + %54 = zext nneg i32 %invariant.op67 to i64 + %wide.trip.count77 = zext nneg i32 %4 to i64 + %wide.trip.count = zext nneg i32 %3 to i64 br label %.preheader.us .preheader.us: ; preds = %.preheader.us.preheader, %._crit_edge.us - %indvars.iv73 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next74, %._crit_edge.us ] + %indvars.iv73 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next75, %._crit_edge.us ] %55 = getelementptr inbounds nuw i32, ptr %2, i64 %indvars.iv73 %56 = getelementptr inbounds nuw i32, ptr %24, i64 %indvars.iv73 - %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1 - %57 = icmp eq i64 %indvars.iv.next74, %54 + %57 = icmp eq i64 %indvars.iv73, %54 br label %58 58: ; preds = %.preheader.us, %58 @@ -2239,10 +2242,9 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 %.not.us = icmp eq i64 %indvars.iv, 0 %66 = getelementptr i8, ptr %62, i64 -4 %67 = select i1 %.not.us, ptr %56, ptr %66 - %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %68 = icmp eq i64 %indvars.iv.next, %53 + %68 = icmp eq i64 %indvars.iv, %53 %69 = xor i1 %57, %68 - %narrow = select i1 %.not54, i1 %69, i1 false + %narrow = and i1 %.not54, %69 %70 = zext i1 %narrow to i32 %71 = tail call i32 @Gia_ManHashAnd(ptr noundef %0, i32 noundef %60, i32 noundef %61) #24 %72 = xor i32 %71, %70 @@ -2260,12 +2262,14 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 store i32 %83, ptr %67, align 4, !tbaa !11 %84 = tail call i32 @Gia_ManHashOr(ptr noundef %0, i32 noundef %73, i32 noundef %79) #24 store i32 %84, ptr %64, align 4, !tbaa !11 - %exitcond.not = icmp eq i64 %indvars.iv.next, %53 + %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 %._crit_edge.us, label %58, !llvm.loop !60 ._crit_edge.us: ; preds = %58 - %exitcond77.not = icmp eq i64 %indvars.iv.next74, %54 - br i1 %exitcond77.not, label %._crit_edge68, label %.preheader.us, !llvm.loop !61 + %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 + %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77 + br i1 %exitcond78.not, label %._crit_edge69, label %.preheader.us, !llvm.loop !61 ._crit_edge68: ; preds = %._crit_edge.us, %Vec_IntFill.exit64 %85 = getelementptr i32, ptr %46, i64 %45 @@ -2277,8 +2281,8 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 br label %.lr.ph .lr.ph: ; preds = %._crit_edge68, %.lr.ph - %indvars.iv78 = phi i64 [ 0, %._crit_edge68 ], [ %indvars.iv.next79, %.lr.ph ] - %.06569 = phi i32 [ %7, %._crit_edge68 ], [ %104, %.lr.ph ] + %indvars.iv78 = phi i64 [ 0, %._crit_edge69 ], [ %indvars.iv.next79, %.lr.ph ] + %.06569 = phi i32 [ %7, %._crit_edge69 ], [ %104, %.lr.ph ] %88 = getelementptr inbounds nuw i32, ptr %42, i64 %indvars.iv78 %89 = load i32, ptr %88, align 4, !tbaa !11 %90 = getelementptr inbounds nuw i32, ptr %46, i64 %indvars.iv78 diff --git a/bench/abc/optimized/sclLibScl.ll b/bench/abc/optimized/sclLibScl.ll index 981ea7cf4ad..d24a2d0b168 100644 --- a/bench/abc/optimized/sclLibScl.ll +++ b/bench/abc/optimized/sclLibScl.ll @@ -8264,12 +8264,13 @@ define internal fastcc void @Abc_SclWriteSurfaceText(ptr noundef nonnull capture br label %39 39: ; preds = %.lr.ph75, %67 - %.val87 = phi i32 [ %.val5173, %.lr.ph75 ], [ %.val51, %67 ] - %indvars.iv83 = phi i64 [ 0, %.lr.ph75 ], [ %indvars.iv.next84, %67 ] + %.val87 = phi i32 [ %.val5173, %.lr.ph75 ], [ %.val51, %66 ] + %indvars.iv83 = phi i64 [ 0, %.lr.ph75 ], [ %indvars.iv.next84, %66 ] %.val58 = load ptr, ptr %38, align 8, !tbaa !19 %40 = getelementptr inbounds nuw ptr, ptr %.val58, i64 %indvars.iv83 %41 = load ptr, ptr %40, align 8, !tbaa !22 %42 = getelementptr i8, ptr %41, i64 4 + %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %.val5369 = load i32, ptr %42, align 4, !tbaa !74 %43 = icmp sgt i32 %.val5369, 0 br i1 %43, label %.lr.ph72, label %.critedge6 @@ -8286,15 +8287,14 @@ define internal fastcc void @Abc_SclWriteSurfaceText(ptr noundef nonnull capture %47 = load float, ptr %46, align 4, !tbaa !77 %48 = fpext float %47 to double %.val50 = load i32, ptr %36, align 4, !tbaa !21 - %49 = add nsw i32 %.val50, -1 - %50 = zext i32 %49 to i64 - %51 = icmp eq i64 %indvars.iv83, %50 - %52 = add nsw i32 %.val5371, -1 - %53 = zext i32 %52 to i64 - %54 = icmp eq i64 %indvars.iv80, %53 - %55 = select i1 %51, i1 %54, i1 false - %56 = select i1 %55, ptr @.str.70, ptr @.str.66 - %57 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %0, ptr noundef nonnull @.str.64, double noundef %48, ptr noundef nonnull %56) #21 + %49 = zext i32 %.val50 to i64 + %50 = icmp eq i64 %indvars.iv.next84, %49 + %51 = add nsw i32 %.val5371, -1 + %52 = zext i32 %51 to i64 + %53 = icmp eq i64 %indvars.iv80, %52 + %54 = select i1 %50, i1 %53, i1 false + %55 = select i1 %54, ptr @.str.70, ptr @.str.66 + %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %0, ptr noundef nonnull @.str.64, double noundef %48, ptr noundef nonnull %55) #21 %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1 %.val53 = load i32, ptr %42, align 4, !tbaa !74 %58 = sext i32 %.val53 to i64 @@ -8322,7 +8322,6 @@ define internal fastcc void @Abc_SclWriteSurfaceText(ptr noundef nonnull capture br label %67 67: ; preds = %63, %64 - %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %.val51 = load i32, ptr %36, align 4, !tbaa !21 %68 = sext i32 %.val51 to i64 %69 = icmp slt i64 %indvars.iv.next84, %68 diff --git a/bench/abc/optimized/wlcBlast.ll b/bench/abc/optimized/wlcBlast.ll index 222210b734b..e08485c4903 100644 --- a/bench/abc/optimized/wlcBlast.ll +++ b/bench/abc/optimized/wlcBlast.ll @@ -2965,17 +2965,20 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 br label %._crit_edge .preheader.us.preheader: ; preds = %Vec_IntFill.exit64 + %invariant.op66 = add nsw i32 %4, -1 %.not54 = icmp ne i32 %7, 0 - %54 = zext nneg i32 %3 to i64 - %55 = zext nneg i32 %4 to i64 + %invariant.op = add nsw i32 %3, -1 + %55 = zext nneg i32 %invariant.op to i64 + %55 = zext nneg i32 %invariant.op66 to i64 + %wide.trip.count75 = zext nneg i32 %4 to i64 + %wide.trip.count = zext nneg i32 %3 to i64 br label %.preheader.us .preheader.us: ; preds = %.preheader.us.preheader, %._crit_edge.us - %indvars.iv71 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next72, %._crit_edge.us ] + %indvars.iv71 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next73, %._crit_edge.us ] %56 = getelementptr inbounds nuw i32, ptr %2, i64 %indvars.iv71 %57 = getelementptr inbounds nuw i32, ptr %25, i64 %indvars.iv71 - %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 - %58 = icmp eq i64 %indvars.iv.next72, %55 + %58 = icmp eq i64 %indvars.iv71, %55 br label %59 59: ; preds = %.preheader.us, %Wlc_BlastFullAdder.exit.us @@ -2990,10 +2993,9 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 %.not.us = icmp eq i64 %indvars.iv, 0 %67 = getelementptr i8, ptr %63, i64 -4 %68 = select i1 %.not.us, ptr %57, ptr %67 - %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %69 = icmp eq i64 %indvars.iv.next, %54 + %69 = icmp eq i64 %indvars.iv, %54 %70 = xor i1 %58, %69 - %narrow = select i1 %.not54, i1 %70, i1 false + %narrow = and i1 %.not54, %70 %71 = zext i1 %narrow to i32 %72 = tail call i32 @Gia_ManHashAnd(ptr noundef %0, i32 noundef %61, i32 noundef %62) #26 %73 = xor i32 %72, %71 @@ -3035,12 +3037,14 @@ Vec_IntFill.exit64.thread: ; preds = %Vec_IntGrow.exit.i5 br label %Wlc_BlastFullAdder.exit.us Wlc_BlastFullAdder.exit.us: ; preds = %93, %59 - %exitcond.not = icmp eq i64 %indvars.iv.next, %54 + %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 %._crit_edge.us, label %59, !llvm.loop !82 ._crit_edge.us: ; preds = %Wlc_BlastFullAdder.exit.us - %exitcond75.not = icmp eq i64 %indvars.iv.next72, %55 - br i1 %exitcond75.not, label %._crit_edge67, label %.preheader.us, !llvm.loop !83 + %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 + %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75 + br i1 %exitcond76.not, label %._crit_edge68, label %.preheader.us, !llvm.loop !83 ._crit_edge67: ; preds = %._crit_edge.us, %Vec_IntFill.exit64 %98 = getelementptr i32, ptr %47, i64 %46 @@ -3052,7 +3056,7 @@ Wlc_BlastFullAdder.exit.us: ; preds = %93, %59 br label %.lr.ph .lr.ph: ; preds = %._crit_edge67, %.lr.ph - %indvars.iv76 = phi i64 [ 0, %._crit_edge67 ], [ %indvars.iv.next77, %.lr.ph ] + %indvars.iv76 = phi i64 [ 0, %._crit_edge68 ], [ %indvars.iv.next77, %.lr.ph ] %101 = getelementptr inbounds nuw i32, ptr %43, i64 %indvars.iv76 %102 = load i32, ptr %101, align 4, !tbaa !3 %103 = getelementptr inbounds nuw i32, ptr %47, i64 %indvars.iv76 @@ -3183,16 +3187,19 @@ Vec_IntFill.exit73.thread: ; preds = %Vec_IntGrow.exit.i6 br label %.preheader .preheader74.us.preheader: ; preds = %Vec_IntFill.exit73 - %56 = zext nneg i32 %3 to i64 - %57 = zext nneg i32 %4 to i64 + %invariant.op76 = add nsw i32 %4, -1 + %invariant.op = add nsw i32 %3, -1 + %56 = zext nneg i32 %invariant.op to i64 + %57 = zext nneg i32 %invariant.op76 to i64 + %wide.trip.count87 = zext nneg i32 %4 to i64 + %wide.trip.count = zext nneg i32 %3 to i64 br label %.preheader74.us .preheader74.us: ; preds = %.preheader74.us.preheader, %._crit_edge.us - %indvars.iv83 = phi i64 [ 0, %.preheader74.us.preheader ], [ %indvars.iv.next84, %._crit_edge.us ] + %indvars.iv83 = phi i64 [ 0, %.preheader74.us.preheader ], [ %indvars.iv.next85, %._crit_edge.us ] %58 = getelementptr inbounds nuw i32, ptr %2, i64 %indvars.iv83 %59 = getelementptr inbounds nuw i32, ptr %26, i64 %indvars.iv83 - %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 - %60 = icmp ne i64 %indvars.iv.next84, %57 + %60 = icmp ne i64 %indvars.iv83, %57 br label %61 61: ; preds = %.preheader74.us, %Wlc_BlastFullAdder.exit.us @@ -3207,10 +3214,9 @@ Vec_IntFill.exit73.thread: ; preds = %Vec_IntGrow.exit.i6 %.not63.us = icmp eq i64 %indvars.iv, 0 %69 = getelementptr i8, ptr %65, i64 -4 %70 = select i1 %.not63.us, ptr %59, ptr %69 - %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %71 = icmp eq i64 %indvars.iv.next, %56 + %71 = icmp eq i64 %indvars.iv, %56 %72 = xor i1 %60, %71 - %narrow = select i1 %.not, i1 true, i1 %72 + %narrow = or i1 %.not, %72 %73 = zext i1 %narrow to i32 %74 = tail call i32 @Gia_ManHashAnd(ptr noundef %0, i32 noundef %63, i32 noundef %64) #26 %75 = xor i32 %74, %73 @@ -3252,11 +3258,14 @@ Vec_IntFill.exit73.thread: ; preds = %Vec_IntGrow.exit.i6 br label %Wlc_BlastFullAdder.exit.us Wlc_BlastFullAdder.exit.us: ; preds = %95, %61 - %exitcond.not = icmp eq i64 %indvars.iv.next, %56 + %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 %._crit_edge.us, label %61, !llvm.loop !86 ._crit_edge.us: ; preds = %Wlc_BlastFullAdder.exit.us - br i1 %60, label %.preheader74.us, label %._crit_edge77, !llvm.loop !87 + %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 + %exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87 + br i1 %exitcond88.not, label %._crit_edge78, label %.preheader74.us, !llvm.loop !87 ._crit_edge77: ; preds = %._crit_edge.us, %Vec_IntFill.exit73 %100 = getelementptr i32, ptr %49, i64 %48 @@ -3275,7 +3284,7 @@ Wlc_BlastFullAdder.exit.us: ; preds = %95, %61 br label %.lr.ph80 .lr.ph: ; preds = %._crit_edge77, %.lr.ph - %indvars.iv88 = phi i64 [ 0, %._crit_edge77 ], [ %indvars.iv.next89, %.lr.ph ] + %indvars.iv88 = phi i64 [ 0, %._crit_edge78 ], [ %indvars.iv.next89, %.lr.ph ] %103 = getelementptr inbounds nuw i32, ptr %44, i64 %indvars.iv88 %104 = load i32, ptr %103, align 4, !tbaa !3 %105 = getelementptr inbounds nuw i32, ptr %49, i64 %indvars.iv88 @@ -3289,7 +3298,7 @@ Wlc_BlastFullAdder.exit.us: ; preds = %95, %61 br i1 %exitcond92.not, label %.preheader, label %.lr.ph, !llvm.loop !88 .lr.ph80: ; preds = %.lr.ph80.preheader, %.lr.ph80 - %indvars.iv93 = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvars.iv.next94, %.lr.ph80 ] + %indvars.iv93 = phi i64 [ 0, %.lr.ph81.preheader ], [ %indvars.iv.next94, %.lr.ph81 ] %109 = getelementptr inbounds nuw i32, ptr %26, i64 %indvars.iv93 %110 = load i32, ptr %109, align 4, !tbaa !3 %111 = xor i32 %110, 1 diff --git a/bench/assimp/optimized/BlenderCustomData.ll b/bench/assimp/optimized/BlenderCustomData.ll index 04850ed205f..1f64c5c51d2 100644 --- a/bench/assimp/optimized/BlenderCustomData.ll +++ b/bench/assimp/optimized/BlenderCustomData.ll @@ -492,8 +492,12 @@ define hidden noalias noundef nonnull ptr @_ZN6Assimp7Blender11createMVertEm(i64 %11 = icmp eq i64 %0, 0 br i1 %11, label %.loopexit, label %.preheader -.preheader: ; preds = %1, %.preheader - %.idx = phi i64 [ %.add, %.preheader ], [ 8, %1 ] +.preheader: ; preds = %1 + %invariant.op = add i64 %4, -48 + br label %13 + +13: ; preds = %12, %13 + %.idx = phi i64 [ 8, %12 ], [ %.add, %13 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %10, i64 %.idx %12 = getelementptr inbounds nuw i8, ptr %.ptr.ptr, i64 8 store ptr null, ptr %12, align 8 @@ -505,11 +509,10 @@ define hidden noalias noundef nonnull ptr @_ZN6Assimp7Blender11createMVertEm(i64 %15 = getelementptr inbounds nuw i8, ptr %.ptr.ptr, i64 48 store i32 0, ptr %15, align 8 %.add = add nuw nsw i64 %.idx, 56 - %16 = add nuw nsw i64 %.idx, 48 - %17 = icmp eq i64 %16, %4 - br i1 %17, label %.loopexit, label %.preheader + %18 = icmp eq i64 %.idx, %invariant.op + br i1 %18, label %.loopexit, label %13 -.loopexit: ; preds = %.preheader, %1 +.loopexit: ; preds = %13, %1 %.ptr5 = getelementptr inbounds nuw i8, ptr %10, i64 8 ret ptr %.ptr5 } diff --git a/bench/assimp/optimized/MMDPmxParser.ll b/bench/assimp/optimized/MMDPmxParser.ll index c7786223009..6ec5aa57869 100644 --- a/bench/assimp/optimized/MMDPmxParser.ll +++ b/bench/assimp/optimized/MMDPmxParser.ll @@ -4901,7 +4901,7 @@ define hidden void @_ZN3pmx8PmxModel4ReadEPSi(ptr noundef nonnull align 8 derefe 39: ; preds = %38 invoke void @__cxa_throw(ptr nonnull %36, ptr nonnull @_ZTI17DeadlyImportError, ptr nonnull @_ZNSt13runtime_errorD2Ev) #20 - to label %661 unwind label %41 + to label %662 unwind label %41 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit.thread: ; preds = %35 %40 = landingpad { ptr, i32 } @@ -6222,8 +6222,12 @@ _ZNSt10unique_ptrIA_N3pmx12PmxRigidBodyESt14default_deleteIS2_EED2Ev.exit: ; pre %618 = icmp eq i32 %610, 0 br i1 %618, label %_ZN3mmd11make_uniqueIA_N3pmx8PmxJointEEENS_10_Unique_ifIT_E14_Unknown_boundEm.exit, label %.preheader -.preheader: ; preds = %._crit_edge261, %.preheader - %.idx.i = phi i64 [ %.add.i, %.preheader ], [ 8, %._crit_edge261 ] +.preheader: ; preds = %._crit_edge261 + %invariant.op.i = add nsw i64 %614, -168 + br label %620 + +620: ; preds = %620, %619 + %.idx.i = phi i64 [ 8, %619 ], [ %.add.i, %620 ] %.ptr.ptr.i = getelementptr inbounds nuw i8, ptr %617, i64 %.idx.i %619 = getelementptr inbounds nuw i8, ptr %.ptr.ptr.i, i64 16 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(160) %619, i8 0, i64 160, i1 false), !noalias !82 @@ -6236,11 +6240,10 @@ _ZNSt10unique_ptrIA_N3pmx12PmxRigidBodyESt14default_deleteIS2_EED2Ev.exit: ; pre %623 = getelementptr inbounds nuw i8, ptr %.ptr.ptr.i, i64 68 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(104) %623, i8 0, i64 104, i1 false), !noalias !82 %.add.i = add nuw nsw i64 %.idx.i, 176 - %624 = add nuw nsw i64 %.idx.i, 168 - %625 = icmp eq i64 %624, %614 - br i1 %625, label %_ZN3mmd11make_uniqueIA_N3pmx8PmxJointEEENS_10_Unique_ifIT_E14_Unknown_boundEm.exit, label %.preheader + %626 = icmp eq i64 %.idx.i, %invariant.op.i + br i1 %626, label %_ZN3mmd11make_uniqueIA_N3pmx8PmxJointEEENS_10_Unique_ifIT_E14_Unknown_boundEm.exit, label %620 -_ZN3mmd11make_uniqueIA_N3pmx8PmxJointEEENS_10_Unique_ifIT_E14_Unknown_boundEm.exit: ; preds = %.preheader, %._crit_edge261 +_ZN3mmd11make_uniqueIA_N3pmx8PmxJointEEENS_10_Unique_ifIT_E14_Unknown_boundEm.exit: ; preds = %620, %._crit_edge261 %.ptr5.i = getelementptr inbounds nuw i8, ptr %617, i64 8 %626 = getelementptr inbounds nuw i8, ptr %0, i64 280 %627 = load ptr, ptr %626, align 8 diff --git a/bench/boost/optimized/debug.ll b/bench/boost/optimized/debug.ll index 2a60a4ed100..af4a2be4507 100644 --- a/bench/boost/optimized/debug.ll +++ b/bench/boost/optimized/debug.ll @@ -323,9 +323,7 @@ _ZN5boost9unit_test9ut_detail20bcs_char_traits_implIKcE7compareEPS3_S5_m.exit.i: br i1 %.not.i, label %_ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.thread, label %.lr.ph.i.preheader.i, !llvm.loop !20 _ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit: ; preds = %18 - %23 = ptrtoint ptr %.0712.i to i64 - %24 = sub i64 %23, ptrtoint (ptr @.str to i64) - %.not7 = icmp eq i64 %24, -1 + %.not7 = icmp eq ptr %.0712.i, inttoptr (i64 add (i64 ptrtoint (ptr @.str to i64), i64 -1) to ptr) br i1 %.not7, label %_ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.thread, label %.critedge _ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.thread: ; preds = %_ZN5boost9unit_test9ut_detail20bcs_char_traits_implIKcE7compareEPS3_S5_m.exit.i, %7, %5, %_ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit @@ -765,9 +763,7 @@ _ZN5boost9unit_test9ut_detail20bcs_char_traits_implIKcE7compareEPS3_S5_m.exit.i. br i1 %.not.i.i, label %_ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.thread.i, label %.lr.ph.i.preheader.i.i, !llvm.loop !20 _ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.i: ; preds = %25 - %30 = ptrtoint ptr %.0712.i.i to i64 - %31 = sub i64 %30, ptrtoint (ptr @.str to i64) - %.not7.i = icmp eq i64 %31, -1 + %.not7.i = icmp eq ptr %.0712.i.i, inttoptr (i64 add (i64 ptrtoint (ptr @.str to i64), i64 -1) to ptr) br i1 %.not7.i, label %_ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.thread.i, label %_ZN5boost5debug14under_debuggerEv.exit _ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.thread.i: ; preds = %_ZN5boost9unit_test9ut_detail20bcs_char_traits_implIKcE7compareEPS3_S5_m.exit.i.i, %_ZNK5boost9unit_test13basic_cstringIKcE4findES3_.exit.i, %14, %12 @@ -793,7 +789,7 @@ _ZN5boost5debug14under_debuggerEv.exit: ; preds = %_ZNK5boost9unit_tes 37: ; preds = %.loopexit %38 = call i32 @fork() #32 - switch i32 %38, label %41 [ + switch i32 %38, label %39 [ i32 -1, label %.thread41 i32 0, label %.preheader ] @@ -813,7 +809,7 @@ _ZN5boost5debug14under_debuggerEv.exit: ; preds = %_ZNK5boost9unit_tes %47 = getelementptr inbounds nuw i8, ptr %4, i64 56 call void @llvm.lifetime.start.p0(ptr nonnull %5) invoke fastcc void @_ZN5boost5debug12_GLOBAL__N_112process_infoC2Ei(ptr noundef nonnull align 8 dereferenceable(1042) %5, i32 noundef %38) - to label %48 unwind label %53 + to label %46 unwind label %53 48: ; preds = %41 %49 = getelementptr inbounds nuw i8, ptr %5, i64 24 @@ -841,27 +837,27 @@ _ZN5boost5debug14under_debuggerEv.exit: ; preds = %_ZNK5boost9unit_tes store ptr %.val24, ptr %43, align 8, !tbaa !17 %58 = call ptr @getenv(ptr noundef nonnull @.str.1) #32 %.not.i.i27 = icmp eq ptr %58, null - br i1 %.not.i.i27, label %60, label %59 - -59: ; preds = %55 - %strlen.i.i.i = call noundef i64 @strlen(ptr nonnull dereferenceable(1) %58) - br label %60 - -60: ; preds = %55, %59 - %.sroa.0.0.i = phi ptr [ %58, %59 ], [ @_ZN5boost9unit_test13basic_cstringIKcE4nullE, %55 ] - %61 = phi i64 [ %strlen.i.i.i, %59 ], [ 0, %55 ] - %62 = getelementptr inbounds nuw i8, ptr %.sroa.0.0.i, i64 %61 - store ptr %.sroa.0.0.i, ptr %44, align 8, !tbaa !15 - store ptr %62, ptr %45, align 8, !tbaa !17 + br i1 %.not.i.i27, label %58, label %57 + +60: ; preds = %55 + %strlen.i.i.i = call noundef i64 @strlen(ptr nonnull dereferenceable(1) %56) + br label %58 + +58:; preds = %53, %57 + %.sroa.0.0.i = phi ptr [ %56, %57 ], [ @_ZN5boost9unit_test13basic_cstringIKcE4nullE, %53 ] + %59 = phi i64 [ %strlen.i.i.i, %57 ], [ 0, %53 ] + %60 = getelementptr inbounds nuw i8, ptr %.sroa.0.0.i, i64 %59 + store ptr %.sroa.0.0.i, ptr %42, align 8, !tbaa !15 + store ptr %60, ptr %43, align 8, !tbaa !17 %strlen.i.i.i29 = call noundef i64 @strlen(ptr nonnull dereferenceable(1) %3) %63 = getelementptr inbounds nuw i8, ptr %3, i64 %strlen.i.i.i29 store ptr %3, ptr %46, align 8, !tbaa !15 store ptr %63, ptr %47, align 8, !tbaa !17 call void @llvm.lifetime.start.p0(ptr nonnull %6) %64 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN5boost8functionIFvRKNS6_5debug16dbg_startup_infoEEEESt4lessIS5_ESaISt4pairIKS5_SD_EEEixERSH_(ptr noundef nonnull align 8 dereferenceable(48) getelementptr inbounds nuw (i8, ptr @_ZN5boost5debug12_GLOBAL__N_16s_infoE, i64 32), ptr noundef nonnull align 8 dereferenceable(32) @_ZN5boost5debug12_GLOBAL__N_16s_infoE) - to label %65 unwind label %77 + to label %63 unwind label %77 -65: ; preds = %60 +65: ; preds = %58 store ptr null, ptr %6, align 8, !tbaa !30 %66 = load ptr, ptr %64, align 8, !tbaa !30 %.not.i.i.i.i = icmp eq ptr %66, null @@ -882,7 +878,7 @@ _ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit.thread53: ; p 72: ; preds = %67 %73 = load ptr, ptr %66, align 8, !tbaa !32 %74 = getelementptr inbounds nuw i8, ptr %6, i64 8 - invoke void %73(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 8 dereferenceable(24) %74, i32 noundef 0) + invoke void %71(ptr noundef nonnull align 8 dereferenceable(24) %70, ptr noundef nonnull align 8 dereferenceable(24) %74, i32 noundef 0) to label %_ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit unwind label %77 _ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit: ; preds = %72 @@ -894,7 +890,7 @@ _ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit: ; preds = %7 invoke void @_ZNK5boost10function_nIvJRKNS_5debug16dbg_startup_infoEEEclES4_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull align 8 dereferenceable(64) %4) to label %_ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit.thread unwind label %79 -77: ; preds = %72, %60 +77: ; preds = %72, %58 %78 = landingpad { ptr, i32 } cleanup br label %81 @@ -911,12 +907,12 @@ _ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit.thread: ; pre unreachable 81: ; preds = %79, %77 - %.pn = phi { ptr, i32 } [ %80, %79 ], [ %78, %77 ] + %.pn = phi { ptr, i32 } [ %80, %77 ], [ %78, %75 ] call void @llvm.lifetime.end.p0(ptr nonnull %6) br label %82 82: ; preds = %81, %53 - %.pn.pn = phi { ptr, i32 } [ %.pn, %81 ], [ %54, %53 ] + %.pn.pn = phi { ptr, i32 } [ %.pn, %79 ], [ %54, %51 ] call void @llvm.lifetime.end.p0(ptr nonnull %5) call void @llvm.lifetime.end.p0(ptr nonnull %4) br label %92 @@ -925,7 +921,7 @@ _ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit.thread: ; pre call void @llvm.lifetime.start.p0(ptr nonnull %7) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) @__const._ZN5boost5debug15attach_debuggerEb.to, i64 16, i1 false) %83 = invoke i32 @select(i32 noundef 0, ptr noundef null, ptr noundef null, ptr noundef null, ptr noundef nonnull %7) - to label %84 unwind label %87 + to label %82 unwind label %87 84: ; preds = %.lr.ph call void @llvm.lifetime.end.p0(ptr nonnull %7) @@ -948,13 +944,13 @@ _ZN5boost8functionIFvRKNS_5debug16dbg_startup_infoEEEC2ERKS6_.exit.thread: ; pre br label %.thread41 92: ; preds = %87, %82 - %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %82 ], [ %88, %87 ] + %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %80 ], [ %88, %85 ] call fastcc void @_ZN5boost5debug12_GLOBAL__N_19fd_holderD2Ev(i32 %34) #32 call void @llvm.lifetime.end.p0(ptr nonnull %3) resume { ptr, i32 } %.pn.pn.pn.pn .thread41: ; preds = %._crit_edge, %89, %37 - %.143 = phi i1 [ false, %37 ], [ true, %89 ], [ true, %._crit_edge ] + %.143 = phi i1 [ false, %35 ], [ true, %87 ], [ true, %._crit_edge ] %93 = invoke i32 @close(i32 noundef %34) to label %_ZN5boost5debug12_GLOBAL__N_19fd_holderD2Ev.exit unwind label %94 diff --git a/bench/ceres/optimized/schur_eliminator_2_d_d.ll b/bench/ceres/optimized/schur_eliminator_2_d_d.ll index 59c90d1b38f..adf2f7fd057 100644 --- a/bench/ceres/optimized/schur_eliminator_2_d_d.ll +++ b/bench/ceres/optimized/schur_eliminator_2_d_d.ll @@ -27119,7 +27119,7 @@ _ZNK5Eigen10MatrixBaseINS_5BlockIKNS1_IKNS_9TransposeIKNS1_IKNS_6MatrixIdLin1ELi .lr.ph.i.i.i.i.i.i.us.i.i.i: ; preds = %.lr.ph.i.i.i.i.i.i.us.i.i.i, %.lr.ph.i.i.i.i.i.i.preheader.us.i.i.i %.05.i.i.i.i.i.i.us.i.i.i = phi i64 [ %95, %.lr.ph.i.i.i.i.i.i.us.i.i.i ], [ 0, %.lr.ph.i.i.i.i.i.i.preheader.us.i.i.i ] %89 = getelementptr inbounds nuw double, ptr %59, i64 %.05.i.i.i.i.i.i.us.i.i.i - %90 = icmp eq i64 %.017.us.i.i.i, %.05.i.i.i.i.i.i.us.i.i.i + %90 = icmp eq i64 %.05.i.i.i.i.i.i.us.i.i.i, %.017.us.i.i.i %91 = select i1 %90, double 1.000000e+00, double 0.000000e+00 %92 = fmul double %88, %91 %93 = load double, ptr %89, align 8, !tbaa !138 @@ -27288,7 +27288,7 @@ _ZN5Eigen8internal31generic_dense_assignment_kernelINS0_9evaluatorINS_6MatrixIdL %38 = load double, ptr %37, align 8, !tbaa !138 %39 = icmp eq i64 %.01724.i.i.i.i.i.i.us, %.03261 %40 = select i1 %39, double 1.000000e+00, double 0.000000e+00 - %41 = fmul double %38, %40 + %41 = fmul double %40, %38 %42 = fadd double %.02223.i.i.i.i.i.i.us, %41 %43 = add nuw nsw i64 %.01724.i.i.i.i.i.i.us, 1 %exitcond.not.i.i.i.i.i.i.us = icmp eq i64 %43, %24 @@ -27410,7 +27410,7 @@ _ZN5Eigen8internal31generic_dense_assignment_kernelINS0_9evaluatorINS_6MatrixIdL %105 = load double, ptr %104, align 8, !tbaa !138 %106 = icmp eq i64 %.01724.i.i.i.i.i.i38, %.03261 %107 = select i1 %106, double 1.000000e+00, double 0.000000e+00 - %108 = fmul double %105, %107 + %108 = fmul double %107, %105 %109 = fadd double %.02223.i.i.i.i.i.i39, %108 %110 = add nuw nsw i64 %.01724.i.i.i.i.i.i38, 1 %exitcond.not.i.i.i.i.i.i40 = icmp eq i64 %110, %53 @@ -27469,16 +27469,19 @@ thread-pre-split.i.i.i.i.i.i: ; preds = %_ZN5Eigen15PlainObj %20 = icmp sgt i64 %18, 0 br i1 %20, label %.lr.ph.i.i.i.i.i.i.i, label %.loopexit -.lr.ph.i.i.i.i.i.i.i: ; preds = %17, %.lr.ph.i.i.i.i.i.i.i - %.05.i.i.i.i.i.i.i = phi i64 [ %25, %.lr.ph.i.i.i.i.i.i.i ], [ 0, %17 ] - %21 = getelementptr inbounds nuw double, ptr %19, i64 %.05.i.i.i.i.i.i.i - %22 = add nsw i64 %.05.i.i.i.i.i.i.i, %11 - %23 = icmp eq i64 %22, %13 +.lr.ph.i.i.i.i.i.i.i: ; preds = %17 + %invariant.op.i.i.i.i.i.i.i = sub i64 %13, %11 + br label %21 + +21:; preds = %21, %.lr.ph.i.i.i.i.i.i.i + %.05.i.i.i.i.i.i.i = phi i64 [ 0, %.lr.ph.i.i.i.i.i.i.i ], [ %25, %21 ] + %22 = getelementptr inbounds nuw double, ptr %19, i64 %.05.i.i.i.i.i.i.i + %23 = icmp eq i64 %.05.i.i.i.i.i.i.i, %invariant.op.i.i.i.i.i.i.i %24 = select i1 %23, double 1.000000e+00, double 0.000000e+00 - store double %24, ptr %21, align 8, !tbaa !138 + store double %24, ptr %22, align 8, !tbaa !138 %25 = add nuw nsw i64 %.05.i.i.i.i.i.i.i, 1 %exitcond.not.i.i.i.i.i.i.i = icmp eq i64 %25, %18 - br i1 %exitcond.not.i.i.i.i.i.i.i, label %.loopexit, label %.lr.ph.i.i.i.i.i.i.i, !llvm.loop !1193 + br i1 %exitcond.not.i.i.i.i.i.i.i, label %.loopexit, label %21, !llvm.loop !1193 common.resume: ; preds = %37, %26 %common.resume.op = phi { ptr, i32 } [ %27, %26 ], [ %38, %37 ] @@ -27491,7 +27494,7 @@ common.resume: ; preds = %37, %26 call void @free(ptr noundef %28) #36 br label %common.resume -.loopexit: ; preds = %.lr.ph.i.i.i.i.i.i.i, %17 +.loopexit: ; preds = %21, %17 %29 = load double, ptr %3, align 8, !tbaa !138 call void @llvm.lifetime.start.p0(ptr nonnull %6) %30 = getelementptr inbounds nuw i8, ptr %.sroa.7.0.copyload, i64 16 diff --git a/bench/coreutils-rs/optimized/3x959pa9na58uqov.ll b/bench/coreutils-rs/optimized/3x959pa9na58uqov.ll index 645d745415e..35581b3900e 100644 --- a/bench/coreutils-rs/optimized/3x959pa9na58uqov.ll +++ b/bench/coreutils-rs/optimized/3x959pa9na58uqov.ll @@ -989,16 +989,20 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h .split: %3 = alloca [8 x i8], align 8 %.not49 = icmp eq i64 %1, 0 - br i1 %.not49, label %._crit_edge, label %.lr.ph + br i1 %.not49, label %._crit_edge, label %.lr.ph.preheader -._crit_edge: ; preds = %14, %.split - %.033.lcssa = phi i64 [ 0, %.split ], [ %.2, %14 ] - %.0.lcssa = phi i64 [ 0, %.split ], [ %.1, %14 ] - %4 = icmp ult i64 %.0.lcssa, %1 - br i1 %4, label %6, label %5 +._crit_edge: ; preds = %.split + %4 = add i64 %1, -2 + br label %.lr.ph -5: ; preds = %._crit_edge, %6 - %.134 = phi i64 [ %9, %6 ], [ %.033.lcssa, %._crit_edge ] +5: ; preds = %15, %.split + %.134 = phi i64 [ 0, %.split ], [ %.2, %15 ] + %.0.lcssa = phi i64 [ 0, %.split ], [ %.1, %15 ] + %5 = icmp ult i64 %.0.lcssa, %1 + br i1 %5, label %7, label %6 + +6: ; preds = %._crit_edge, %7 + %.134 = phi i64 [ %10, %7 ], [ %.033.lcssa, %._crit_edge ] call void @llvm.lifetime.start.p0(ptr nonnull %3), !noalias !210 store i64 %.134, ptr %3, align 8, !noalias !210 call fastcc void @"_ZN71_$LT$std..hash..random..DefaultHasher$u20$as$u20$core..hash..Hasher$GT$5write17h65f66e5fad0e1a99E"(ptr noalias noundef nonnull align 8 dereferenceable(72) %2, ptr noalias noundef nonnull readonly align 1 %3, i64 noundef 8) @@ -1010,12 +1014,12 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h %8 = getelementptr inbounds i8, ptr %0, i64 %.0.lcssa tail call fastcc void @"_ZN71_$LT$std..hash..random..DefaultHasher$u20$as$u20$core..hash..Hasher$GT$5write17h65f66e5fad0e1a99E"(ptr noalias noundef align 8 dereferenceable(72) %2, ptr noalias noundef nonnull readonly align 1 %8, i64 noundef %7) %9 = add i64 %7, %.033.lcssa - br label %5 + br label %6 -.lr.ph: ; preds = %.split, %14 - %.047 = phi i64 [ %.1, %14 ], [ 0, %.split ] - %.03346 = phi i64 [ %.2, %14 ], [ 0, %.split ] - %.sroa.09.045 = phi i64 [ %10, %14 ], [ 0, %.split ] +.lr.ph: ; preds = %5, %14 + %.047 = phi i64 [ %.1, %15 ], [ 0, %.lr.ph.preheader ] + %.03346 = phi i64 [ %.2, %15 ], [ 0, %.lr.ph.preheader ] + %.sroa.09.045 = phi i64 [ %10, %15 ], [ 0, %.lr.ph.preheader ] %10 = add nuw i64 %.sroa.09.045, 1 %11 = getelementptr inbounds i8, ptr %0, i64 %.sroa.09.045 %12 = load i8, ptr %11, align 1, !noundef !54 @@ -1040,10 +1044,9 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h br label %20 20: ; preds = %15, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hff67fe1f7f0405d9E.exit" - %.3 = phi i64 [ %19, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hff67fe1f7f0405d9E.exit" ], [ %.03346, %15 ] - %21 = sub nuw i64 %1, %10 - %22 = getelementptr inbounds i8, ptr %0, i64 %10 - %23 = icmp eq i64 %21, 1 + %.3 = phi i64 [ %19, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hff67fe1f7f0405d9E.exit" ], [ %.03346, %16 ] + %22 = getelementptr inbounds i8, ptr %0, i64 %11 + %23 = icmp eq i64 %.sroa.09.045, %4 br i1 %23, label %24, label %27 24: ; preds = %20 diff --git a/bench/csmith/optimized/ArrayVariable.ll b/bench/csmith/optimized/ArrayVariable.ll index 8f1d0903ff0..de503983b14 100644 --- a/bench/csmith/optimized/ArrayVariable.ll +++ b/bench/csmith/optimized/ArrayVariable.ll @@ -3510,6 +3510,7 @@ define dso_local void @_ZNK13ArrayVariable20build_init_recursiveEmRKSt6vectorINS %7 = getelementptr inbounds nuw i8, ptr %0, i64 17 store i8 0, ptr %7, align 1, !tbaa !91 %8 = getelementptr inbounds nuw i8, ptr %1, i64 216 + %invariant.op = add i64 %2, 1 %9 = load ptr, ptr %8, align 8, !tbaa !53 %10 = getelementptr inbounds nuw i32, ptr %9, i64 %2 %11 = load i32, ptr %10, align 4, !tbaa !4 @@ -3518,11 +3519,10 @@ define dso_local void @_ZNK13ArrayVariable20build_init_recursiveEmRKSt6vectorINS .lr.ph: ; preds = %._crit_edge.i.i %12 = getelementptr inbounds nuw i8, ptr %1, i64 224 - %13 = add i64 %2, 1 - %14 = getelementptr inbounds nuw i8, ptr %4, i64 8 - %15 = getelementptr inbounds nuw i8, ptr %4, i64 16 - %16 = getelementptr inbounds nuw i8, ptr %3, i64 8 - br label %20 + %13 = getelementptr inbounds nuw i8, ptr %4, i64 8 + %14 = getelementptr inbounds nuw i8, ptr %4, i64 16 + %15 = getelementptr inbounds nuw i8, ptr %3, i64 8 + br label %19 ._crit_edge: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41 %.pre59 = load i64, ptr %6, align 8, !tbaa !117 @@ -3548,44 +3548,43 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i: ; preds %24 = ptrtoint ptr %21 to i64 %25 = sub i64 %23, %24 %26 = ashr exact i64 %25, 2 - %27 = add nsw i64 %26, -1 - %28 = icmp eq i64 %2, %27 - br i1 %28, label %29, label %56 - -29: ; preds = %20 - %30 = load i32, ptr @_ZZNK13ArrayVariable20build_init_recursiveEmRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EEE4seed, align 4, !tbaa !4 - %31 = mul i32 %30, %30 - %32 = zext i32 %31 to i64 - %33 = add nuw nsw i64 %.056, 7 - %34 = add nuw nsw i64 %.056, 13 - %35 = mul i64 %33, %34 - %36 = add i64 %35, %32 - %37 = mul i64 %36, 52369 - %38 = load ptr, ptr %16, align 8, !tbaa !138 - %39 = load ptr, ptr %3, align 8, !tbaa !141 + %26 = icmp eq i64 %26, %invariant.op + br i1 %26, label %27, label %54 + +27: ; preds = %19 + %28 = load i32, ptr @_ZZNK13ArrayVariable20build_init_recursiveEmRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EEE4seed, align 4, !tbaa !4 + %29 = mul i32 %28, %28 + %30 = zext i32 %29 to i64 + %31 = add nuw nsw i64 %.056, 7 + %33 = add nuw nsw i64 %.056, 13 + %33 = mul i64 %31, %32 + %34 = add i64 %33, %30 + %35 = mul i64 %34, 52369 + %36 = load ptr, ptr %15, align 8, !tbaa !138 + %38 = load ptr, ptr %3, align 8, !tbaa !141 + %38 = ptrtoint ptr %36 to i64 %40 = ptrtoint ptr %38 to i64 - %41 = ptrtoint ptr %39 to i64 - %42 = sub i64 %40, %41 - %43 = ashr exact i64 %42, 5 - %44 = urem i64 %37, %43 - %45 = getelementptr inbounds nuw %"class.std::__cxx11::basic_string", ptr %39, i64 %44 - %46 = getelementptr inbounds nuw i8, ptr %45, i64 8 - %47 = load i64, ptr %46, align 8, !tbaa !117 - %48 = load i64, ptr %6, align 8, !tbaa !117 - %49 = sub i64 4611686018427387903, %48 - %50 = icmp ult i64 %49, %47 - br i1 %50, label %51, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i - -51: ; preds = %29 + %40 = sub i64 %38, %39 + %41 = ashr exact i64 %40, 5 + %42 = urem i64 %35, %41 + %43 = getelementptr inbounds nuw %"class.std::__cxx11::basic_string", ptr %37, i64 %42 + %45 = getelementptr inbounds nuw i8, ptr %43, i64 8 + %45 = load i64, ptr %45, align 8, !tbaa !117 + %47 = load i64, ptr %6, align 8, !tbaa !117 + %47 = sub i64 4611686018427387903, %46 + %48 = icmp ult i64 %47, %45 + br i1 %48, label %49, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i + +49: ; preds = %27 invoke void @_ZSt20__throw_length_errorPKc(ptr noundef nonnull @.str.45) #20 to label %.noexc29 unwind label %.loopexit.split-lp46 -.noexc29: ; preds = %51 +.noexc29: ; preds = %49 unreachable -_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i: ; preds = %29 - %52 = load ptr, ptr %45, align 8, !tbaa !90 - %53 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %52, i64 noundef %47) +_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i: ; preds = %27 + %52 = load ptr, ptr %43, align 8, !tbaa !90 + %53 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9_M_appendEPKcm(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %52, i64 noundef %45) to label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_.exit unwind label %.loopexit45 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_.exit: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i @@ -3599,18 +3598,18 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_.exit: ; preds = %_ cleanup br label %94 -.loopexit.split-lp46: ; preds = %51 +.loopexit.split-lp46: ; preds = %49 %lpad.loopexit.split-lp48 = landingpad { ptr, i32 } cleanup br label %94 56: ; preds = %20 call void @llvm.lifetime.start.p0(ptr nonnull %4) - invoke void @_ZNK13ArrayVariable20build_init_recursiveEmRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(288) %1, i64 noundef %13, ptr noundef nonnull align 8 dereferenceable(24) %3) - to label %57 unwind label %69 + invoke void @_ZNK13ArrayVariable20build_init_recursiveEmRKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef nonnull align 8 dereferenceable(288) %1, i64 noundef %invariant.op, ptr noundef nonnull align 8 dereferenceable(24) %3) + to label %55 unwind label %69 57: ; preds = %56 - %58 = load i64, ptr %14, align 8, !tbaa !117 + %58 = load i64, ptr %13, align 8, !tbaa !117 %59 = load i64, ptr %6, align 8, !tbaa !117 %60 = sub i64 4611686018427387903, %59 %61 = icmp ult i64 %60, %58 @@ -3630,11 +3629,11 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i31: ; p _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_.exit34: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendERKS4_.exit.i31 %65 = load ptr, ptr %4, align 8, !tbaa !90 - %66 = icmp eq ptr %65, %15 + %66 = icmp eq ptr %65, %14 br i1 %66, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_.exit34 - %67 = load i64, ptr %15, align 8, !tbaa !91 + %67 = load i64, ptr %14, align 8, !tbaa !91 %68 = add i64 %67, 1 call void @_ZdlPvm(ptr noundef %65, i64 noundef %68) #22 br label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit @@ -3661,17 +3660,17 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit: ; preds = %_ZNSt 71: ; preds = %.loopexit.split-lp, %.loopexit %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ] %72 = load ptr, ptr %4, align 8, !tbaa !90 - %73 = icmp eq ptr %72, %15 + %73 = icmp eq ptr %72, %14 br i1 %73, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i35 _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i35: ; preds = %71 - %74 = load i64, ptr %15, align 8, !tbaa !91 + %74 = load i64, ptr %14, align 8, !tbaa !91 %75 = add i64 %74, 1 call void @_ZdlPvm(ptr noundef %72, i64 noundef %75) #22 br label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37: ; preds = %71, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i35, %69 - %.pn = phi { ptr, i32 } [ %70, %69 ], [ %lpad.phi, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i35 ], [ %lpad.phi, %71 ] + %.pn = phi { ptr, i32 } [ %70, %67 ], [ %lpad.phi, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i35 ], [ %lpad.phi, %69 ] call void @llvm.lifetime.end.p0(ptr nonnull %4) br label %94 @@ -3717,8 +3716,8 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i38._ZNSt7 br label %94 _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i38._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41_crit_edge, %76 - %87 = phi i32 [ %.pre58, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i38._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41_crit_edge ], [ %79, %76 ] - %88 = phi ptr [ %.pre, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i38._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41_crit_edge ], [ %77, %76 ] + %87 = phi i32 [ %.pre58, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i38._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41_crit_edge ], [ %79, %74 ] + %88 = phi ptr [ %.pre, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc.exit.i38._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit41_crit_edge ], [ %77, %74 ] %89 = add nuw nsw i64 %.056, 1 %90 = zext i32 %87 to i64 %91 = icmp samesign ult i64 %89, %90 @@ -3733,7 +3732,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc.exit: ; preds = %_ZN ret void 94: ; preds = %.loopexit50, %.loopexit.split-lp51, %.loopexit45, %.loopexit.split-lp46, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37, %92 - %.pn23.pn = phi { ptr, i32 } [ %93, %92 ], [ %lpad.loopexit.split-lp48, %.loopexit.split-lp46 ], [ %.pn, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37 ], [ %lpad.loopexit47, %.loopexit45 ], [ %lpad.loopexit52, %.loopexit50 ], [ %lpad.loopexit.split-lp53, %.loopexit.split-lp51 ] + %.pn23.pn = phi { ptr, i32 } [ %93, %90 ], [ %lpad.loopexit.split-lp48, %.loopexit.split-lp46 ], [ %.pn, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit37 ], [ %lpad.loopexit47, %.loopexit45 ], [ %lpad.loopexit52, %.loopexit50 ], [ %lpad.loopexit.split-lp53, %.loopexit.split-lp51 ] %95 = load ptr, ptr %0, align 8, !tbaa !90 %96 = icmp eq ptr %95, %5 br i1 %96, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit44, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i42 diff --git a/bench/darktable/optimized/collect.ll b/bench/darktable/optimized/collect.ll index b7c8c1307ad..c41016ae459 100644 --- a/bench/darktable/optimized/collect.ll +++ b/bench/darktable/optimized/collect.ll @@ -4237,6 +4237,7 @@ define internal void @collection_updated(ptr readnone captures(none) %0, i32 nou br i1 %or.cond, label %.preheader, label %.critedge .preheader: ; preds = %6 + %invariant.op = add i32 %2, 1 %.not24 = icmp slt i32 %11, 0 br i1 %.not24, label %.critedge23, label %.lr.ph @@ -4255,8 +4256,7 @@ define internal void @collection_updated(ptr readnone captures(none) %0, i32 nou %23 = tail call ptr @dt_bauhaus_combobox_get_data(ptr noundef %22) #16 %24 = ptrtoint ptr %23 to i64 %25 = trunc i64 %24 to i32 - %26 = add i32 %25, -1 - %.not20 = icmp eq i32 %26, %2 + %.not20 = icmp eq i32 %invariant.op, %25 br i1 %.not20, label %.critedge, label %17 .critedge: ; preds = %.lr.ph, %6 diff --git a/bench/delta-rs/optimized/11f8x98axanecwnw.ll b/bench/delta-rs/optimized/11f8x98axanecwnw.ll index ca207e43fe8..ca190714ccc 100644 --- a/bench/delta-rs/optimized/11f8x98axanecwnw.ll +++ b/bench/delta-rs/optimized/11f8x98axanecwnw.ll @@ -41954,6 +41954,9 @@ define hidden void @_ZN4core3str7pattern15ReverseSearcher16next_reject_back17he8 %6 = load i64, ptr %5, align 8, !alias.scope !10058, !noalias !10061, !noundef !4 %7 = getelementptr inbounds i8, ptr %4, i64 %6 %8 = ptrtoint ptr %7 to i64 + %invariant.op = add i64 %6, 1 + %invariant.op6 = add i64 %6, 2 + %invariant.op7 = add i64 %6, 3 %.promoted = load i64, ptr %3, align 8, !alias.scope !10058, !noalias !10061 %9 = getelementptr inbounds nuw i8, ptr %1, i64 44 %10 = load i32, ptr %9, align 4, !range !10063 @@ -41973,57 +41976,54 @@ define hidden void @_ZN4core3str7pattern15ReverseSearcher16next_reject_back17he8 br i1 %18, label %.thread18.i, label %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" "_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i": ; preds = %15 - %19 = add nsw i64 %12, -1 - %20 = icmp ne i64 %6, %19 - tail call void @llvm.assume(i1 %20) - %21 = getelementptr inbounds i8, ptr %13, i64 -2 - %22 = load i8, ptr %21, align 1, !noalias !10064, !noundef !4 - %23 = and i8 %22, 31 - %24 = zext nneg i8 %23 to i32 - %25 = icmp slt i8 %22, -64 - br i1 %25, label %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i", label %49 + %19 = icmp ne i64 %12, %invariant.op + tail call void @llvm.assume(i1 %19) + %20 = getelementptr inbounds i8, ptr %13, i64 -2 + %21 = load i8, ptr %20, align 1, !noalias !10064, !noundef !4 + %22 = and i8 %21, 31 + %23 = zext nneg i8 %22 to i32 + %24 = icmp slt i8 %21, -64 + br i1 %24, label %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i", label %46 .thread18.i: ; preds = %15 %26 = zext nneg i8 %17 to i32 br label %"_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h47afb88dabb9161fE.llvm.8226331118977765550.exit" "_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i": ; preds = %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" - %27 = add nsw i64 %12, -2 - %28 = icmp ne i64 %6, %27 - tail call void @llvm.assume(i1 %28) - %29 = getelementptr inbounds i8, ptr %13, i64 -3 - %30 = load i8, ptr %29, align 1, !noalias !10064, !noundef !4 - %31 = and i8 %30, 15 - %32 = zext nneg i8 %31 to i32 - %33 = icmp slt i8 %30, -64 - br i1 %33, label %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i", label %44 + %26 = icmp ne i64 %12, %invariant.op6 + tail call void @llvm.assume(i1 %26) + %27 = getelementptr inbounds i8, ptr %13, i64 -3 + %28 = load i8, ptr %27, align 1, !noalias !10064, !noundef !4 + %29 = and i8 %28, 15 + %30 = zext nneg i8 %29 to i32 + %31 = icmp slt i8 %28, -64 + br i1 %31, label %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i", label %41 "_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i": ; preds = %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i" - %34 = add nsw i64 %12, -3 - %35 = icmp ne i64 %6, %34 - tail call void @llvm.assume(i1 %35) - %36 = getelementptr inbounds i8, ptr %13, i64 -4 - %37 = load i8, ptr %36, align 1, !noalias !10064, !noundef !4 - %38 = and i8 %37, 7 + %32 = icmp ne i64 %12, %invariant.op7 + tail call void @llvm.assume(i1 %32) + %33 = getelementptr inbounds i8, ptr %13, i64 -4 + %34 = load i8, ptr %33, align 1, !noalias !10064, !noundef !4 + %35 = and i8 %34, 7 + %36 = zext nneg i8 %35 to i32 + %37 = shl nuw nsw i32 %36, 6 + %38 = and i8 %28, 63 %39 = zext nneg i8 %38 to i32 - %40 = shl nuw nsw i32 %39, 6 - %41 = and i8 %30, 63 - %42 = zext nneg i8 %41 to i32 - %43 = or disjoint i32 %40, %42 + %40 = or disjoint i32 %37, %39 br label %44 44: ; preds = %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i", %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i" - %.sroa.6.1.i = phi ptr [ %36, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i" ], [ %29, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i" ] - %.1.i.i = phi i32 [ %43, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i" ], [ %32, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i" ] + %.sroa.6.1.i = phi ptr [ %33, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i" ], [ %27, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i" ] + %.1.i.i = phi i32 [ %40, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit23.i.i" ], [ %30, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit21.i.i" ] %45 = shl nuw nsw i32 %.1.i.i, 6 - %46 = and i8 %22, 63 + %46 = and i8 %21, 63 %47 = zext nneg i8 %46 to i32 %48 = or disjoint i32 %45, %47 br label %49 49: ; preds = %44, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" - %.sroa.6.0.i = phi ptr [ %.sroa.6.1.i, %44 ], [ %21, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" ] - %.013.i.i = phi i32 [ %48, %44 ], [ %24, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" ] + %.sroa.6.0.i = phi ptr [ %.sroa.6.1.i, %41 ], [ %20, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" ] + %.013.i.i = phi i32 [ %48, %41 ], [ %23, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h14913723a7083b26E.exit19.i.i" ] %50 = shl nuw nsw i32 %.013.i.i, 6 %51 = and i8 %17, 63 %52 = zext nneg i8 %51 to i32 @@ -42032,8 +42032,8 @@ define hidden void @_ZN4core3str7pattern15ReverseSearcher16next_reject_back17he8 br i1 %.not.i, label %"_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h47afb88dabb9161fE.llvm.8226331118977765550.exit.thread", label %"_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h47afb88dabb9161fE.llvm.8226331118977765550.exit" "_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h47afb88dabb9161fE.llvm.8226331118977765550.exit": ; preds = %.thread18.i, %49 - %.sroa.4.1.i.ph23.i = phi i32 [ %26, %.thread18.i ], [ %53, %49 ] - %.sroa.6.2.ph22.i = phi ptr [ %16, %.thread18.i ], [ %.sroa.6.0.i, %49 ] + %.sroa.4.1.i.ph23.i = phi i32 [ %26, %.thread18.i ], [ %53, %46 ] + %.sroa.6.2.ph22.i = phi ptr [ %16, %.thread18.i ], [ %.sroa.6.0.i, %46 ] %54 = ptrtoint ptr %.sroa.6.2.ph22.i to i64 %55 = sub nuw i64 %54, %8 %56 = add i64 %55, %6 @@ -42049,7 +42049,7 @@ define hidden void @_ZN4core3str7pattern15ReverseSearcher16next_reject_back17he8 br label %"_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h47afb88dabb9161fE.llvm.8226331118977765550.exit.thread" "_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h47afb88dabb9161fE.llvm.8226331118977765550.exit.thread": ; preds = %11, %49, %57 - %storemerge = phi i64 [ 1, %57 ], [ 0, %49 ], [ 0, %11 ] + %storemerge = phi i64 [ 1, %54 ], [ 0, %46 ], [ 0, %11 ] store i64 %storemerge, ptr %0, align 8 ret void } diff --git a/bench/delta-rs/optimized/2ounwovke18sd889.ll b/bench/delta-rs/optimized/2ounwovke18sd889.ll index 66ffbe39bae..1ca24c5d34d 100644 --- a/bench/delta-rs/optimized/2ounwovke18sd889.ll +++ b/bench/delta-rs/optimized/2ounwovke18sd889.ll @@ -5259,21 +5259,24 @@ define hidden noundef zeroext i1 @"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..Slic %8 = load i8, ptr %1, align 1, !range !960, !alias.scope !973, !noalias !976, !noundef !5 %9 = add nsw i8 %8, -16 %10 = icmp eq i8 %9, %narrow3.i.i.i - br i1 %10, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17h6bc89ac644945227E.llvm.11953678010571242332.exit", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i" + br i1 %10, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17h6bc89ac644945227E.llvm.11953678010571242332.exit", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader.i" + +"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader.i": ; preds = %.lr.ph.split.us.i + %invariant.op.i = or disjoint i8 %narrow3.i.i.i, 16 + br label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i" 11: ; preds = %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i" - %12 = load i8, ptr %15, align 1, !range !960, !alias.scope !978, !noalias !981, !noundef !5 - %13 = add nsw i8 %12, -16 - %14 = icmp eq i8 %13, %narrow3.i.i.i - br i1 %14, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17h6bc89ac644945227E.llvm.11953678010571242332.exit", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i" - -"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i": ; preds = %.lr.ph.split.us.i, %11 - %.pn = phi ptr [ %15, %11 ], [ %1, %.lr.ph.split.us.i ] - %15 = getelementptr inbounds nuw i8, ptr %.pn, i64 1 + %12 = load i8, ptr %14, align 1, !range !960, !alias.scope !978, !noalias !981, !noundef !5 + %13 = icmp eq i8 %12, %invariant.op.i + br i1 %13, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17h6bc89ac644945227E.llvm.11953678010571242332.exit", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i" + +"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.i": ; preds = %11, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader.i" + %.pn = phi ptr [ %14, %11 ], [ %1, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader.i" ] + %14 = getelementptr inbounds nuw i8, ptr %.pn, i64 1 tail call void @llvm.experimental.noalias.scope.decl(metadata !983) tail call void @llvm.experimental.noalias.scope.decl(metadata !984) tail call void @llvm.experimental.noalias.scope.decl(metadata !985) - %.not23.i.not.not = icmp ne ptr %15, %4 + %.not23.i.not.not = icmp ne ptr %14, %4 br i1 %.not23.i.not.not, label %11, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17h6bc89ac644945227E.llvm.11953678010571242332.exit" .lr.ph.split.i: ; preds = %.lr.ph.i, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.i" @@ -10437,17 +10440,20 @@ define hidden noundef zeroext i1 @"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u2 %10 = load i8, ptr %.promoted, align 1, !range !960, !alias.scope !1912, !noalias !1915, !noundef !5 %11 = add nsw i8 %10, -16 %12 = icmp eq i8 %11, %narrow3.i.i - br i1 %12, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit.sink.split", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us" + br i1 %12, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit.sink.split", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader" + +"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader": ; preds = %.lr.ph.split.us + %invariant.op = or disjoint i8 %narrow3.i.i, 16 + br label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us" 13: ; preds = %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us" %14 = getelementptr inbounds nuw i8, ptr %18, i64 1 %15 = load i8, ptr %18, align 1, !range !960, !alias.scope !1917, !noalias !1920, !noundef !5 - %16 = add nsw i8 %15, -16 - %17 = icmp eq i8 %16, %narrow3.i.i - br i1 %17, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit.sink.split", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us" + %16 = icmp eq i8 %15, %invariant.op + br i1 %16, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit.sink.split", label %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us" -"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us": ; preds = %.lr.ph.split.us, %13 - %18 = phi ptr [ %14, %13 ], [ %9, %.lr.ph.split.us ] +"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us": ; preds = %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader", %13 + %17 = phi ptr [ %14, %13 ], [ %9, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit.backedge.us.preheader" ] tail call void @llvm.experimental.noalias.scope.decl(metadata !1922) tail call void @llvm.experimental.noalias.scope.decl(metadata !1923) tail call void @llvm.experimental.noalias.scope.decl(metadata !1904) @@ -10482,8 +10488,8 @@ define hidden noundef zeroext i1 @"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u2 br label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit.sink.split" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit.sink.split": ; preds = %24, %13, %.lr.ph.split.us, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit_crit_edge" - %.us-phi12.sink = phi ptr [ %.us-phi12, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit_crit_edge" ], [ %14, %13 ], [ %9, %.lr.ph.split.us ], [ %20, %24 ] - %.lcssa.ph = phi i1 [ false, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit_crit_edge" ], [ true, %13 ], [ true, %.lr.ph.split.us ], [ true, %24 ] + %.us-phi12.sink = phi ptr [ %.us-phi12, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit_crit_edge" ], [ %14, %13 ], [ %9, %.lr.ph.split.us ], [ %20, %23 ] + %.lcssa.ph = phi i1 [ false, %"_ZN53_$LT$T$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains28_$u7b$$u7b$closure$u7d$$u7d$17hf0219b63a9d8d06bE.llvm.11953678010571242332.exit._ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit_crit_edge" ], [ true, %13 ], [ true, %.lr.ph.split.us ], [ true, %23 ] store ptr %.us-phi12.sink, ptr %0, align 8, !alias.scope !1901 br label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h99d5c854c2573e17E.llvm.11953678010571242332.exit" diff --git a/bench/draco/optimized/mesh_edgebreaker_decoder_impl.ll b/bench/draco/optimized/mesh_edgebreaker_decoder_impl.ll index ec70e953542..ef50a3e9932 100644 --- a/bench/draco/optimized/mesh_edgebreaker_decoder_impl.ll +++ b/bench/draco/optimized/mesh_edgebreaker_decoder_impl.ll @@ -24220,6 +24220,7 @@ define linkonce_odr noundef zeroext i1 @_ZN5draco31MeshEdgebreakerTraversalDecod %9 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #22 store i64 %6, ptr %9, align 16 %.ptr13 = getelementptr inbounds nuw i8, ptr %9, i64 8 + %invariant.op = add nsw i64 %7, -16 br label %10 10: ; preds = %11, %5 @@ -24230,41 +24231,40 @@ define linkonce_odr noundef zeroext i1 @_ZN5draco31MeshEdgebreakerTraversalDecod 11: ; preds = %10 %.add = add nuw nsw i64 %.idx, 24 - %12 = add nuw nsw i64 %.idx, 16 - %13 = icmp eq i64 %12, %7 - br i1 %13, label %14, label %10 - -14: ; preds = %11 - %15 = getelementptr inbounds nuw i8, ptr %0, i64 192 - %16 = load ptr, ptr %15, align 8, !tbaa !311 - store ptr %.ptr13, ptr %15, align 8, !tbaa !311 - %.not.i.i.i.i = icmp eq ptr %16, null - br i1 %.not.i.i.i.i, label %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit, label %17 - -17: ; preds = %14 - %18 = getelementptr inbounds i8, ptr %16, i64 -8 - %19 = load i64, ptr %18, align 8 - %.idx.i.i.i.i.i = mul i64 %19, 24 - %20 = icmp eq i64 %19, 0 - br i1 %20, label %_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, label %.preheader.preheader.i.i.i.i.i - -.preheader.preheader.i.i.i.i.i: ; preds = %17 - %21 = getelementptr inbounds i8, ptr %16, i64 %.idx.i.i.i.i.i + %12 = icmp eq i64 %.idx, %invariant.op + br i1 %12, label %13, label %10 + +13: ; preds = %11 + %14 = getelementptr inbounds nuw i8, ptr %0, i64 192 + %15 = load ptr, ptr %14, align 8, !tbaa !311 + store ptr %.ptr13, ptr %14, align 8, !tbaa !311 + %.not.i.i.i.i = icmp eq ptr %15, null + br i1 %.not.i.i.i.i, label %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit, label %16 + +16: ; preds = %13 + %17 = getelementptr inbounds i8, ptr %15, i64 -8 + %18 = load i64, ptr %17, align 8 + %.idx.i.i.i.i.i = mul i64 %18, 24 + %19 = icmp eq i64 %18, 0 + br i1 %19, label %_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, label %.preheader.preheader.i.i.i.i.i + +.preheader.preheader.i.i.i.i.i: ; preds = %16 + %20 = getelementptr inbounds i8, ptr %15, i64 %.idx.i.i.i.i.i br label %.preheader.i.i.i.i.i .preheader.i.i.i.i.i: ; preds = %.preheader.i.i.i.i.i, %.preheader.preheader.i.i.i.i.i - %22 = phi ptr [ %23, %.preheader.i.i.i.i.i ], [ %21, %.preheader.preheader.i.i.i.i.i ] + %22 = phi ptr [ %23, %.preheader.i.i.i.i.i ], [ %20, %.preheader.preheader.i.i.i.i.i ] %23 = getelementptr inbounds i8, ptr %22, i64 -24 tail call void @_ZN5draco14RAnsBitDecoderD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %23) #20 - %24 = icmp eq ptr %23, %16 + %24 = icmp eq ptr %23, %15 br i1 %24, label %_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, label %.preheader.i.i.i.i.i -_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i: ; preds = %.preheader.i.i.i.i.i, %17 +_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i: ; preds = %.preheader.i.i.i.i.i, %16 %25 = add i64 %.idx.i.i.i.i.i, 8 - tail call void @_ZdaPvm(ptr noundef nonnull %18, i64 noundef %25) #21 + tail call void @_ZdaPvm(ptr noundef nonnull %17, i64 noundef %25) #21 br label %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit -_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit: ; preds = %_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, %14 +_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit: ; preds = %_ZNKSt14default_deleteIA_N5draco14RAnsBitDecoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, %13 %26 = load i32, ptr %2, align 8, !tbaa !88 %27 = icmp sgt i32 %26, 0 br i1 %27, label %.lr.ph, label %.thread @@ -24283,7 +24283,7 @@ _ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit: ; br i1 %34, label %.loopexit, label %.preheader .preheader: ; preds = %32, %.preheader - %.idx14 = phi i64 [ %.add15, %.preheader ], [ %.idx, %32 ] + %.idx14 = phi i64 [ %.add15, %.preheader ], [ %.idx, %31 ] %.add15 = add nsw i64 %.idx14, -24 %.ptr17 = getelementptr inbounds i8, ptr %9, i64 %.add15 tail call void @_ZN5draco14RAnsBitDecoderD1Ev(ptr noundef nonnull align 8 dereferenceable(17) %.ptr17) #20 @@ -24295,14 +24295,14 @@ _ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit: ; resume { ptr, i32 } %33 .lr.ph: ; preds = %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit, %28 - %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 0, %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit ] - %36 = load ptr, ptr %15, align 8, !tbaa !311 + %indvars.iv = phi i64 [ %indvars.iv.next, %27 ], [ 0, %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit ] + %36 = load ptr, ptr %14, align 8, !tbaa !311 %37 = getelementptr inbounds nuw %"class.draco::RAnsBitDecoder", ptr %36, i64 %indvars.iv %38 = tail call noundef zeroext i1 @_ZN5draco14RAnsBitDecoder13StartDecodingEPNS_13DecoderBufferE(ptr noundef nonnull align 8 dereferenceable(17) %37, ptr noundef nonnull %0) br i1 %38, label %28, label %.thread .thread: ; preds = %.lr.ph, %28, %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit, %1 - %.1 = phi i1 [ true, %1 ], [ true, %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit ], [ %38, %28 ], [ %38, %.lr.ph ] + %.1 = phi i1 [ true, %1 ], [ true, %_ZNSt10unique_ptrIA_N5draco14RAnsBitDecoderESt14default_deleteIS2_EED2Ev.exit ], [ %38, %27 ], [ %38, %.lr.ph ] ret i1 %.1 } diff --git a/bench/draco/optimized/mesh_edgebreaker_encoder_impl.ll b/bench/draco/optimized/mesh_edgebreaker_encoder_impl.ll index 134ccd3ebf7..73b3a2fcdc5 100644 --- a/bench/draco/optimized/mesh_edgebreaker_encoder_impl.ll +++ b/bench/draco/optimized/mesh_edgebreaker_encoder_impl.ll @@ -5251,6 +5251,7 @@ define linkonce_odr void @_ZN5draco31MeshEdgebreakerTraversalEncoder5StartEv(ptr %9 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #22 store i64 %6, ptr %9, align 16 %.ptr9 = getelementptr inbounds nuw i8, ptr %9, i64 8 + %invariant.op = add nsw i64 %7, -48 br label %10 10: ; preds = %11, %5 @@ -5261,41 +5262,40 @@ define linkonce_odr void @_ZN5draco31MeshEdgebreakerTraversalEncoder5StartEv(ptr 11: ; preds = %10 %.add = add nuw nsw i64 %.idx, 56 - %12 = add nuw nsw i64 %.idx, 48 - %13 = icmp eq i64 %12, %7 - br i1 %13, label %14, label %10 - -14: ; preds = %11 - %15 = getelementptr inbounds nuw i8, ptr %0, i64 136 - %16 = load ptr, ptr %15, align 8, !tbaa !285 - store ptr %.ptr9, ptr %15, align 8, !tbaa !285 - %.not.i.i.i.i = icmp eq ptr %16, null - br i1 %.not.i.i.i.i, label %_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit, label %17 - -17: ; preds = %14 - %18 = getelementptr inbounds i8, ptr %16, i64 -8 - %19 = load i64, ptr %18, align 8 - %.idx.i.i.i.i.i = mul i64 %19, 56 - %20 = icmp eq i64 %19, 0 - br i1 %20, label %_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, label %.preheader.preheader.i.i.i.i.i - -.preheader.preheader.i.i.i.i.i: ; preds = %17 - %21 = getelementptr inbounds i8, ptr %16, i64 %.idx.i.i.i.i.i + %12 = icmp eq i64 %.idx, %invariant.op + br i1 %12, label %13, label %10 + +13: ; preds = %11 + %14 = getelementptr inbounds nuw i8, ptr %0, i64 136 + %15 = load ptr, ptr %14, align 8, !tbaa !285 + store ptr %.ptr9, ptr %14, align 8, !tbaa !285 + %.not.i.i.i.i = icmp eq ptr %15, null + br i1 %.not.i.i.i.i, label %_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit, label %16 + +16: ; preds = %13 + %17 = getelementptr inbounds i8, ptr %15, i64 -8 + %18 = load i64, ptr %17, align 8 + %.idx.i.i.i.i.i = mul i64 %18, 56 + %19 = icmp eq i64 %18, 0 + br i1 %19, label %_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, label %.preheader.preheader.i.i.i.i.i + +.preheader.preheader.i.i.i.i.i: ; preds = %16 + %20 = getelementptr inbounds i8, ptr %15, i64 %.idx.i.i.i.i.i br label %.preheader.i.i.i.i.i .preheader.i.i.i.i.i: ; preds = %.preheader.i.i.i.i.i, %.preheader.preheader.i.i.i.i.i - %22 = phi ptr [ %23, %.preheader.i.i.i.i.i ], [ %21, %.preheader.preheader.i.i.i.i.i ] + %22 = phi ptr [ %23, %.preheader.i.i.i.i.i ], [ %20, %.preheader.preheader.i.i.i.i.i ] %23 = getelementptr inbounds i8, ptr %22, i64 -56 tail call void @_ZN5draco14RAnsBitEncoderD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %23) #20 - %24 = icmp eq ptr %23, %16 + %24 = icmp eq ptr %23, %15 br i1 %24, label %_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, label %.preheader.i.i.i.i.i -_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i: ; preds = %.preheader.i.i.i.i.i, %17 +_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i: ; preds = %.preheader.i.i.i.i.i, %16 %25 = add i64 %.idx.i.i.i.i.i, 8 - tail call void @_ZdaPvm(ptr noundef nonnull %18, i64 noundef %25) #21 + tail call void @_ZdaPvm(ptr noundef nonnull %17, i64 noundef %25) #21 br label %_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit -_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit: ; preds = %_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, %14 +_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit: ; preds = %_ZNKSt14default_deleteIA_N5draco14RAnsBitEncoderEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i.i.i.i, %13 %26 = load i32, ptr %2, align 8, !tbaa !270 %27 = icmp sgt i32 %26, 0 br i1 %27, label %.lr.ph, label %.loopexit @@ -5307,7 +5307,7 @@ _ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit: ; br i1 %30, label %.loopexit16, label %.preheader .preheader: ; preds = %28, %.preheader - %.idx10 = phi i64 [ %.add11, %.preheader ], [ %.idx, %28 ] + %.idx10 = phi i64 [ %.add11, %.preheader ], [ %.idx, %27 ] %.add11 = add nsw i64 %.idx10, -56 %.ptr13 = getelementptr inbounds i8, ptr %9, i64 %.add11 tail call void @_ZN5draco14RAnsBitEncoderD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %.ptr13) #20 @@ -5320,7 +5320,7 @@ _ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit: ; .lr.ph: ; preds = %_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit, %.lr.ph %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %_ZNSt10unique_ptrIA_N5draco14RAnsBitEncoderESt14default_deleteIS2_EED2Ev.exit ] - %32 = load ptr, ptr %15, align 8, !tbaa !285 + %32 = load ptr, ptr %14, align 8, !tbaa !285 %33 = getelementptr inbounds nuw %"class.draco::RAnsBitEncoder", ptr %32, i64 %indvars.iv tail call void @_ZN5draco14RAnsBitEncoder13StartEncodingEv(ptr noundef nonnull align 8 dereferenceable(56) %33) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 diff --git a/bench/ffmpeg/optimized/dsp.ll b/bench/ffmpeg/optimized/dsp.ll index 44a9095619b..bb6eefc8e0e 100644 --- a/bench/ffmpeg/optimized/dsp.ll +++ b/bench/ffmpeg/optimized/dsp.ll @@ -5825,6 +5825,7 @@ prof_grad_filter_12.exit: ; preds = %._crit_edge.us.i br i1 %exitcond39.not.i68, label %prof_grad_filter_12.exit69, label %.preheader.us.i56, !llvm.loop !209 prof_grad_filter_12.exit69: ; preds = %._crit_edge.us.i67, %6 + %invariant.op = add i32 %5, -4 br i1 %10, label %.preheader.lr.ph, label %._crit_edge84 .preheader.lr.ph: ; preds = %prof_grad_filter_12.exit69 @@ -5835,7 +5836,7 @@ prof_grad_filter_12.exit69: ; preds = %._crit_edge.us.i67, %52 = zext nneg i32 %4 to i64 %53 = zext nneg i32 %4 to i64 %54 = zext nneg i32 %5 to i64 - %55 = zext nneg i32 %5 to i64 + %55 = zext i32 %invariant.op to i64 %56 = getelementptr inbounds nuw i8, ptr %8, i64 512 %57 = getelementptr inbounds nuw i8, ptr %7, i64 512 br label %.preheader.us @@ -5847,8 +5848,7 @@ prof_grad_filter_12.exit69: ; preds = %._crit_edge.us.i67, %59 = getelementptr inbounds nuw i16, ptr %2, i64 %58 %60 = getelementptr inbounds nuw i16, ptr %3, i64 %58 %.not45.us = icmp eq i64 %indvars.iv91, 0 - %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 4 - %61 = icmp eq i64 %indvars.iv.next92, %55 + %61 = icmp eq i64 %indvars.iv91, %55 %62 = shl i64 %indvars.iv91, 4 %63 = and i64 %62, 4294967232 br label %64 @@ -6078,6 +6078,7 @@ apply_bdof_min_block_12.exit.us: ; preds = %205 ._crit_edge.us: ; preds = %apply_bdof_min_block_12.exit.us %210 = getelementptr inbounds nuw i8, ptr %.083.us, i64 %.idx + %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 4 %211 = icmp samesign ult i64 %indvars.iv.next92, %54 br i1 %211, label %.preheader.us, label %._crit_edge84, !llvm.loop !221 @@ -18652,6 +18653,7 @@ prof_grad_filter_10.exit: ; preds = %._crit_edge.us.i br i1 %exitcond39.not.i68, label %prof_grad_filter_10.exit69, label %.preheader.us.i56, !llvm.loop !522 prof_grad_filter_10.exit69: ; preds = %._crit_edge.us.i67, %6 + %invariant.op = add i32 %5, -4 br i1 %10, label %.preheader.lr.ph, label %._crit_edge84 .preheader.lr.ph: ; preds = %prof_grad_filter_10.exit69 @@ -18662,7 +18664,7 @@ prof_grad_filter_10.exit69: ; preds = %._crit_edge.us.i67, %52 = zext nneg i32 %4 to i64 %53 = zext nneg i32 %4 to i64 %54 = zext nneg i32 %5 to i64 - %55 = zext nneg i32 %5 to i64 + %55 = zext i32 %invariant.op to i64 %56 = getelementptr inbounds nuw i8, ptr %8, i64 512 %57 = getelementptr inbounds nuw i8, ptr %7, i64 512 br label %.preheader.us @@ -18674,8 +18676,7 @@ prof_grad_filter_10.exit69: ; preds = %._crit_edge.us.i67, %59 = getelementptr inbounds nuw i16, ptr %2, i64 %58 %60 = getelementptr inbounds nuw i16, ptr %3, i64 %58 %.not45.us = icmp eq i64 %indvars.iv91, 0 - %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 4 - %61 = icmp eq i64 %indvars.iv.next92, %55 + %61 = icmp eq i64 %indvars.iv91, %55 %62 = shl i64 %indvars.iv91, 4 %63 = and i64 %62, 4294967232 br label %64 @@ -18905,6 +18906,7 @@ apply_bdof_min_block_10.exit.us: ; preds = %205 ._crit_edge.us: ; preds = %apply_bdof_min_block_10.exit.us %210 = getelementptr inbounds nuw i8, ptr %.083.us, i64 %.idx + %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 4 %211 = icmp samesign ult i64 %indvars.iv.next92, %54 br i1 %211, label %.preheader.us, label %._crit_edge84, !llvm.loop !534 @@ -31344,6 +31346,7 @@ prof_grad_filter_8.exit: ; preds = %._crit_edge.us.i br i1 %exitcond39.not.i64, label %prof_grad_filter_8.exit65, label %.preheader.us.i52, !llvm.loop !735 prof_grad_filter_8.exit65: ; preds = %._crit_edge.us.i63, %6 + %invariant.op = add i32 %5, -4 br i1 %9, label %.preheader.lr.ph, label %._crit_edge83 .preheader.lr.ph: ; preds = %prof_grad_filter_8.exit65 @@ -31354,7 +31357,7 @@ prof_grad_filter_8.exit65: ; preds = %._crit_edge.us.i63, %52 = zext nneg i32 %4 to i64 %53 = zext nneg i32 %4 to i64 %54 = zext nneg i32 %5 to i64 - %55 = zext nneg i32 %5 to i64 + %55 = zext i32 %invariant.op to i64 %56 = getelementptr inbounds nuw i8, ptr %8, i64 512 %57 = getelementptr inbounds nuw i8, ptr %7, i64 512 br label %.preheader.us @@ -31366,8 +31369,7 @@ prof_grad_filter_8.exit65: ; preds = %._crit_edge.us.i63, %59 = getelementptr inbounds nuw i16, ptr %2, i64 %58 %60 = getelementptr inbounds nuw i16, ptr %3, i64 %58 %.not45.us = icmp eq i64 %indvars.iv90, 0 - %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 4 - %61 = icmp eq i64 %indvars.iv.next91, %55 + %61 = icmp eq i64 %indvars.iv90, %55 %62 = shl i64 %indvars.iv90, 4 %63 = and i64 %62, 4294967232 br label %64 @@ -31599,6 +31601,7 @@ apply_bdof_min_block_8.exit.us: ; preds = %204 ._crit_edge.us: ; preds = %apply_bdof_min_block_8.exit.us %209 = getelementptr inbounds i8, ptr %.082.us, i64 %51 + %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 4 %210 = icmp samesign ult i64 %indvars.iv.next91, %54 br i1 %210, label %.preheader.us, label %._crit_edge83, !llvm.loop !747 diff --git a/bench/ffmpeg/optimized/magicyuvenc.ll b/bench/ffmpeg/optimized/magicyuvenc.ll index 52082355bab..ab54caa093b 100644 --- a/bench/ffmpeg/optimized/magicyuvenc.ll +++ b/bench/ffmpeg/optimized/magicyuvenc.ll @@ -208,11 +208,12 @@ define internal range(i32 -12, 1) i32 @magy_encode_init(ptr noundef captures(non .preheader: ; preds = %.preheader.lr.ph, %.critedge160 %98 = phi i32 [ %95, %.preheader.lr.ph ], [ %141, %.critedge160 ] %99 = phi i32 [ %.pre195, %.preheader.lr.ph ], [ %142, %.critedge160 ] - %.0139193 = phi i32 [ 0, %.preheader.lr.ph ], [ %143, %.critedge160 ] + %.0139193 = phi i32 [ 0, %.preheader.lr.ph ], [ %invariant.op, %.critedge160 ] + %invariant.op = add nuw nsw i32 %.0139193, 1 %.not156190 = icmp sgt i32 %99, 0 br i1 %.not156190, label %.lr.ph, label %.critedge160 -100: ; preds = %120 +100: ; preds = %119 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %101 = load i32, ptr %33, align 4, !tbaa !35 %102 = sext i32 %101 to i64 @@ -229,47 +230,46 @@ define internal range(i32 -12, 1) i32 @magy_encode_init(ptr noundef captures(non %108 = sext i32 %107 to i64 %109 = getelementptr inbounds %struct.Slice, ptr %104, i64 %108 %110 = load i32, ptr %42, align 8, !tbaa !40 - %111 = add nsw i32 %110, -1 - %112 = icmp eq i32 %.0139193, %111 - br i1 %112, label %113, label %118 - -113: ; preds = %.lr.ph - %114 = load i32, ptr %43, align 4, !tbaa !38 - %115 = load i32, ptr %58, align 4, !tbaa !39 - %116 = mul nsw i32 %115, %.0139193 - %117 = sub nsw i32 %114, %116 - br label %120 - -118: ; preds = %.lr.ph - %119 = load i32, ptr %58, align 4, !tbaa !39 - br label %120 - -120: ; preds = %118, %113 - %121 = phi i32 [ %115, %113 ], [ %119, %118 ] - %122 = phi i32 [ %117, %113 ], [ %119, %118 ] - %123 = getelementptr inbounds nuw i8, ptr %109, i64 4 - store i32 %122, ptr %123, align 4, !tbaa !46 - %124 = sub nsw i32 0, %122 - %125 = getelementptr inbounds nuw i32, ptr %45, i64 %indvars.iv - %126 = load i32, ptr %125, align 4, !tbaa !33 - %127 = ashr i32 %124, %126 - %128 = sub nsw i32 0, %127 - store i32 %128, ptr %123, align 4, !tbaa !46 - %129 = load i32, ptr %97, align 8, !tbaa !42 - %130 = sub nsw i32 0, %129 - %131 = getelementptr inbounds nuw i32, ptr %96, i64 %indvars.iv - %132 = load i32, ptr %131, align 4, !tbaa !33 - %133 = ashr i32 %130, %132 - %134 = sub nsw i32 0, %133 - store i32 %134, ptr %109, align 8, !tbaa !48 - %135 = add nsw i32 %121, 2 - %136 = mul nsw i32 %135, %129 - %137 = add nsw i32 %136, 64 - %138 = sext i32 %137 to i64 - %139 = tail call noalias ptr @av_malloc(i64 noundef %138) #9 - %140 = getelementptr inbounds nuw i8, ptr %109, i64 24 - store ptr %139, ptr %140, align 8, !tbaa !49 - %.not155.not = icmp eq ptr %139, null + %111 = icmp eq i32 %110, %invariant.op + br i1 %111, label %112, label %117 + +112: ; preds = %.lr.ph + %113 = load i32, ptr %43, align 4, !tbaa !38 + %114 = load i32, ptr %58, align 4, !tbaa !39 + %115 = mul nsw i32 %114, %.0139193 + %116 = sub nsw i32 %113, %115 + br label %119 + +117: ; preds = %.lr.ph + %118 = load i32, ptr %58, align 4, !tbaa !39 + br label %119 + +119: ; preds = %117, %112 + %120 = phi i32 [ %114, %112 ], [ %118, %117 ] + %121 = phi i32 [ %116, %112 ], [ %118, %117 ] + %122 = getelementptr inbounds nuw i8, ptr %109, i64 4 + store i32 %121, ptr %122, align 4, !tbaa !46 + %123 = sub nsw i32 0, %121 + %124 = getelementptr inbounds nuw i32, ptr %45, i64 %indvars.iv + %125 = load i32, ptr %124, align 4, !tbaa !33 + %126 = ashr i32 %123, %125 + %127 = sub nsw i32 0, %126 + store i32 %127, ptr %122, align 4, !tbaa !46 + %128 = load i32, ptr %97, align 8, !tbaa !42 + %129 = sub nsw i32 0, %128 + %130 = getelementptr inbounds nuw i32, ptr %96, i64 %indvars.iv + %131 = load i32, ptr %130, align 4, !tbaa !33 + %132 = ashr i32 %129, %131 + %133 = sub nsw i32 0, %132 + store i32 %133, ptr %109, align 8, !tbaa !48 + %134 = add nsw i32 %120, 2 + %135 = mul nsw i32 %134, %128 + %136 = add nsw i32 %135, 64 + %137 = sext i32 %136 to i64 + %138 = tail call noalias ptr @av_malloc(i64 noundef %137) #9 + %139 = getelementptr inbounds nuw i8, ptr %109, i64 24 + store ptr %138, ptr %139, align 8, !tbaa !49 + %.not155.not = icmp eq ptr %138, null br i1 %.not155.not, label %.critedge, label %100 .critedge160.loopexit: ; preds = %100 @@ -279,8 +279,7 @@ define internal range(i32 -12, 1) i32 @magy_encode_init(ptr noundef captures(non .critedge160: ; preds = %.critedge160.loopexit, %.preheader %141 = phi i32 [ %.pre196, %.critedge160.loopexit ], [ %98, %.preheader ] %142 = phi i32 [ %101, %.critedge160.loopexit ], [ %99, %.preheader ] - %143 = add nuw nsw i32 %.0139193, 1 - %.not157 = icmp slt i32 %143, %141 + %.not157 = icmp slt i32 %invariant.op, %140 br i1 %.not157, label %.preheader, label %.critedge162, !llvm.loop !50 .critedge162: ; preds = %.critedge160, %94 @@ -320,30 +319,30 @@ switch.lookup: ; preds = %.critedge162 %159 = getelementptr inbounds nuw i8, ptr %151, i64 10 store i8 12, ptr %159, align 1, !tbaa !55 %160 = getelementptr inbounds nuw i8, ptr %151, i64 11 + store i8 0, ptr %158, align 1, !tbaa !55 + %159 = getelementptr inbounds nuw i8, ptr %149, i64 12 + store i8 0, ptr %159, align 1, !tbaa !55 + %160 = getelementptr inbounds nuw i8, ptr %149, i64 13 store i8 0, ptr %160, align 1, !tbaa !55 - %161 = getelementptr inbounds nuw i8, ptr %151, i64 12 - store i8 0, ptr %161, align 1, !tbaa !55 - %162 = getelementptr inbounds nuw i8, ptr %151, i64 13 + %161 = getelementptr inbounds nuw i8, ptr %151, i64 14 + store i8 32, ptr %161, align 1, !tbaa !55 + %162 = getelementptr inbounds nuw i8, ptr %151, i64 15 store i8 0, ptr %162, align 1, !tbaa !55 - %163 = getelementptr inbounds nuw i8, ptr %151, i64 14 - store i8 32, ptr %163, align 1, !tbaa !55 - %164 = getelementptr inbounds nuw i8, ptr %151, i64 15 - store i8 0, ptr %164, align 1, !tbaa !55 - %165 = getelementptr inbounds nuw i8, ptr %151, i64 16 - %166 = getelementptr inbounds nuw i8, ptr %0, i64 112 - %167 = load i32, ptr %166, align 8, !tbaa !42 - store i32 %167, ptr %165, align 1, !tbaa !55 - %168 = getelementptr inbounds nuw i8, ptr %151, i64 20 - %169 = load i32, ptr %43, align 4, !tbaa !38 - store i32 %169, ptr %168, align 1, !tbaa !55 - %170 = getelementptr inbounds nuw i8, ptr %151, i64 24 - store i32 %167, ptr %170, align 1, !tbaa !55 - %171 = getelementptr inbounds nuw i8, ptr %151, i64 28 - store i32 %169, ptr %171, align 1, !tbaa !55 + %163 = getelementptr inbounds nuw i8, ptr %151, i64 16 + %164 = getelementptr inbounds nuw i8, ptr %0, i64 112 + %165 = load i32, ptr %164, align 8, !tbaa !42 + store i32 %165, ptr %163, align 1, !tbaa !55 + %165 = getelementptr inbounds nuw i8, ptr %151, i64 20 + %167 = load i32, ptr %43, align 4, !tbaa !38 + store i32 %167, ptr %166, align 1, !tbaa !55 + %168 = getelementptr inbounds nuw i8, ptr %151, i64 24 + store i32 %165, ptr %168, align 1, !tbaa !55 + %169 = getelementptr inbounds nuw i8, ptr %149, i64 28 + store i32 %167, ptr %169, align 1, !tbaa !55 br label %.critedge -.critedge: ; preds = %120, %70, %149, %40, %153 - %.0 = phi i32 [ 0, %153 ], [ -12, %149 ], [ -12, %40 ], [ -12, %70 ], [ -12, %120 ] +.critedge: ; preds = %119, %70, %149, %40, %153 + %.0 = phi i32 [ 0, %151 ], [ -12, %147 ], [ -12, %40 ], [ -12, %70 ], [ -12, %119 ] ret i32 %.0 } diff --git a/bench/fish-rs/optimized/8zxt2gjt68ikxu18thf3foa45.ll b/bench/fish-rs/optimized/8zxt2gjt68ikxu18thf3foa45.ll index a6831809fa9..89b21e28093 100644 --- a/bench/fish-rs/optimized/8zxt2gjt68ikxu18thf3foa45.ll +++ b/bench/fish-rs/optimized/8zxt2gjt68ikxu18thf3foa45.ll @@ -25796,6 +25796,7 @@ define void @_ZN4fish10parse_util13apply_indents17h4c4da62547c6a8afE(ptr dead_on store i64 0, ptr %.sroa.56.0..sroa_idx, align 8 %.idx = shl nuw nsw i64 %2, 2 %9 = getelementptr inbounds nuw i8, ptr %1, i64 %.idx + %invariant.op = add i64 %2, -1 %10 = icmp eq i64 %2, 0 br i1 %10, label %._crit_edge, label %.lr.ph @@ -25869,7 +25870,7 @@ define void @_ZN4fish10parse_util13apply_indents17h4c4da62547c6a8afE(ptr dead_on %29 = add i64 %22, 1 store i64 %29, ptr %.sroa.56.0..sroa_idx, align 8, !alias.scope !2404 %30 = icmp ne i32 %12, 10 - %31 = icmp eq i64 %20, %2 + %31 = icmp eq i64 %.sroa.7.033, %invariant.op %or.cond = or i1 %31, %30 br i1 %or.cond, label %.backedge, label %33 @@ -26043,13 +26044,14 @@ define internal fastcc void @_ZN4fish10parse_util13IndentVisitor31record_line_co %48 = getelementptr inbounds nuw i8, ptr %0, i64 8 %.idx = shl nuw nsw i64 %1, 2 %49 = getelementptr inbounds nuw i8, ptr %4, i64 %.idx + %invariant.op = sub nsw i64 %.idx, %.idx24 %.pre48 = load i64, ptr %47, align 8, !alias.scope !2440, !noalias !2443 br label %50 50: ; preds = %74, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" - %51 = phi i64 [ %.pre48, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" ], [ %59, %74 ] - %52 = phi i64 [ %6, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" ], [ %.pre, %74 ] - %.sroa.02.0 = phi i64 [ %46, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" ], [ %76, %74 ] + %51 = phi i64 [ %.pre48, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" ], [ %59, %73 ] + %52 = phi i64 [ %6, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" ], [ %.pre, %73 ] + %.sroa.02.0 = phi i64 [ %46, %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit" ], [ %76, %73 ] %53 = add i64 %52, %.sroa.02.0 %54 = load i64, ptr %0, align 8, !range !4, !alias.scope !2440, !noalias !2443, !noundef !3 %55 = icmp eq i64 %51, %54 @@ -26073,17 +26075,16 @@ define internal fastcc void @_ZN4fish10parse_util13IndentVisitor31record_line_co %.idx25 = shl nuw nsw i64 %60, 2 %.neg26 = xor i64 %.sroa.02.0, -1 %63 = add i64 %11, %.neg26 - %64 = add nuw nsw i64 %.idx25, %.idx24 - %65 = icmp samesign eq i64 %64, %.idx - br i1 %65, label %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit.thread", label %.lr.ph.i14.preheader + %64 = icmp samesign eq i64 %.idx25, %invariant.op + br i1 %64, label %"_ZN56_$LT$char$u20$as$u20$core..slice..cmp..SliceContains$GT$14slice_contains17h91675bec23efca9bE.exit.thread", label %.lr.ph.i14.preheader .lr.ph.i14.preheader: ; preds = %62 %66 = getelementptr inbounds nuw i8, ptr %13, i64 %.idx25 br label %.lr.ph.i14 .lr.ph.i14: ; preds = %.lr.ph.i14.preheader, %69 - %.sroa.02.011.i = phi i64 [ %71, %69 ], [ 0, %.lr.ph.i14.preheader ] - %67 = phi ptr [ %70, %69 ], [ %66, %.lr.ph.i14.preheader ] + %.sroa.02.011.i = phi i64 [ %71, %68 ], [ 0, %.lr.ph.i14.preheader ] + %67 = phi ptr [ %70, %68 ], [ %66, %.lr.ph.i14.preheader ] %.val.i = load i32, ptr %67, align 4, !range !207, !noalias !2445, !noundef !3 %68 = icmp eq i32 %.val.i, 10 br i1 %68, label %74, label %69 diff --git a/bench/folly/optimized/json.ll b/bench/folly/optimized/json.ll index 5d17d6fd004..ad4ab680277 100644 --- a/bench/folly/optimized/json.ll +++ b/bench/folly/optimized/json.ll @@ -8440,10 +8440,14 @@ define void @_ZN5folly4json13stripCommentsB5cxx11ENS_5RangeIPKcEE(ptr dead_on_un %.not = icmp eq ptr %2, %1 br i1 %.not, label %._crit_edge, label %.lr.ph -.lr.ph: ; preds = %3, %.thread79 - %.01186 = phi i64 [ %136, %.thread79 ], [ 0, %3 ] - %.01285 = phi i32 [ %.113, %.thread79 ], [ 0, %3 ] - %9 = getelementptr inbounds nuw i8, ptr %1, i64 %.01186 +.lr.ph: ; preds = %3 + %invariant.op = add i64 %6, -1 + br label %9 + +9: ; preds = %.lr.ph, %.thread79 + %.01186 = phi i64 [ 0, %.lr.ph ], [ %136, %.thread79 ] + %.01285 = phi i32 [ 0, %.lr.ph ], [ %.113, %.thread79 ] + %10 = getelementptr inbounds nuw i8, ptr %1, i64 %.01186 switch i32 %.01285, label %default.unreachable93 [ i32 0, label %10 i32 1, label %33 @@ -8461,14 +8465,14 @@ define void @_ZN5folly4json13stripCommentsB5cxx11ENS_5RangeIPKcEE(ptr dead_on_un cleanup br label %138 -10: ; preds = %.lr.ph - %11 = ptrtoint ptr %9 to i64 +10: ; preds = %9 + %11 = ptrtoint ptr %10 to i64 %12 = sub i64 %6, %11 %.not.i = icmp ult i64 %12, 2 br i1 %.not.i, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread73, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit: ; preds = %10 - %bcmp.i.i = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %9, ptr noundef nonnull dereferenceable(2) @.str.47, i64 2) + %bcmp.i.i = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %10, ptr noundef nonnull dereferenceable(2) @.str.47, i64 2) %13 = icmp eq i32 %bcmp.i.i, 0 br i1 %13, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit.thread, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21 @@ -8477,7 +8481,7 @@ _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit.thread: ; preds = %_ZNK5folly5Range br label %.thread79 _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21: ; preds = %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit - %bcmp.i.i20 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %9, ptr noundef nonnull dereferenceable(2) @.str.48, i64 2) + %bcmp.i.i20 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %10, ptr noundef nonnull dereferenceable(2) @.str.48, i64 2) %15 = icmp eq i32 %bcmp.i.i20, 0 br i1 %15, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread73 @@ -8486,7 +8490,7 @@ _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread: ; preds = %_ZNK5folly5Ran br label %.thread79 _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread73: ; preds = %10, %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21 - %17 = load i8, ptr %9, align 1, !tbaa !7 + %17 = load i8, ptr %10, align 1, !tbaa !7 %18 = icmp eq i8 %17, 34 %spec.select = zext i1 %18 to i32 %19 = load i64, ptr %5, align 8, !tbaa !16 @@ -8524,15 +8528,14 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit: ; preds store i8 0, ptr %32, align 1, !tbaa !7 br label %.thread79 -33: ; preds = %.lr.ph - %34 = load i8, ptr %9, align 1, !tbaa !7 +33: ; preds = %9 + %34 = load i8, ptr %10, align 1, !tbaa !7 %35 = icmp eq i8 %34, 92 br i1 %35, label %36, label %79 36: ; preds = %33 - %37 = ptrtoint ptr %9 to i64 - %38 = sub i64 %6, %37 - %39 = icmp eq i64 %38, 1 + %37 = ptrtoint ptr %10 to i64 + %39 = icmp eq i64 %invariant.op, %37 br i1 %39, label %40, label %45, !prof !107 40: ; preds = %36 @@ -8584,7 +8587,7 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE8capacityEv.exit.i23: ; pr %59 = load ptr, ptr %0, align 8, !tbaa !36 %60 = getelementptr inbounds nuw i8, ptr %59, i64 %47 store i8 0, ptr %60, align 1, !tbaa !7 - %61 = getelementptr inbounds nuw i8, ptr %9, i64 1 + %61 = getelementptr inbounds nuw i8, ptr %10, i64 1 %62 = load i8, ptr %61, align 1, !tbaa !7 %63 = load i64, ptr %5, align 8, !tbaa !16 %64 = add i64 %63, 1 @@ -8660,12 +8663,12 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit34: ; pred store i8 0, ptr %94, align 1, !tbaa !7 br label %.thread79 -95: ; preds = %.lr.ph - %96 = icmp eq ptr %9, %2 +95: ; preds = %9 + %96 = icmp eq ptr %10, %2 br i1 %96, label %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit.thread, label %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit _ZNK5folly5RangeIPKcE10startsWithERS1_.exit: ; preds = %95 - %97 = load i8, ptr %9, align 1, !tbaa !7 + %97 = load i8, ptr %10, align 1, !tbaa !7 %98 = icmp eq i8 %97, 10 br i1 %98, label %99, label %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit.thread @@ -8706,13 +8709,13 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit38: ; pred br label %.thread79 _ZNK5folly5RangeIPKcE10startsWithERS1_.exit.thread: ; preds = %95, %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit - %114 = ptrtoint ptr %9 to i64 + %114 = ptrtoint ptr %10 to i64 %115 = sub i64 %6, %114 %.not.i39 = icmp ult i64 %115, 2 br i1 %.not.i39, label %.thread79, label %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit41 _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit41: ; preds = %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit.thread - %bcmp.i.i40 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %9, ptr noundef nonnull dereferenceable(2) @.str.50, i64 2) + %bcmp.i.i40 = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %10, ptr noundef nonnull dereferenceable(2) @.str.50, i64 2) %bcmp.i.i40.fr = freeze i32 %bcmp.i.i40 %116 = icmp eq i32 %bcmp.i.i40.fr, 0 %spec.select83 = select i1 %116, i32 0, i32 2 @@ -8720,8 +8723,8 @@ _ZNK5folly5RangeIPKcE10startsWithERKS3_.exit41: ; preds = %_ZNK5folly5RangeIPK %spec.select84 = add nuw i64 %.01186, %117 br label %.thread79 -118: ; preds = %.lr.ph - %119 = load i8, ptr %9, align 1, !tbaa !7 +118: ; preds = %9 + %119 = load i8, ptr %10, align 1, !tbaa !7 %120 = icmp eq i8 %119, 10 br i1 %120, label %121, label %.thread79 @@ -8761,7 +8764,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit45: ; pred store i8 0, ptr %135, align 1, !tbaa !7 br label %.thread79 -default.unreachable93: ; preds = %.lr.ph +default.unreachable93: ; preds = %9 unreachable .thread79: ; preds = %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit41, %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit.thread, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit45, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit38, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit34, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit, %118, %73, %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread, %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit.thread @@ -8769,7 +8772,7 @@ default.unreachable93: ; preds = %.lr.ph %.1 = phi i64 [ %14, %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit.thread ], [ %16, %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit21.thread ], [ %78, %73 ], [ %.01186, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit ], [ %.01186, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit34 ], [ %.01186, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit38 ], [ %.01186, %118 ], [ %.01186, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc.exit45 ], [ %.01186, %_ZNK5folly5RangeIPKcE10startsWithERS1_.exit.thread ], [ %spec.select84, %_ZNK5folly5RangeIPKcE10startsWithERKS3_.exit41 ] %136 = add i64 %.1, 1 %137 = icmp ult i64 %136, %8 - br i1 %137, label %.lr.ph, label %._crit_edge, !llvm.loop !318 + br i1 %137, label %9, label %._crit_edge, !llvm.loop !318 138: ; preds = %.loopexit, %.loopexit.split-lp, %43 %.pn = phi { ptr, i32 } [ %44, %43 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ] diff --git a/bench/foundations-rs/optimized/208outlkq19x3hykb3fof84u4.ll b/bench/foundations-rs/optimized/208outlkq19x3hykb3fof84u4.ll index 9da5fe3ac2b..021c602c9e8 100644 --- a/bench/foundations-rs/optimized/208outlkq19x3hykb3fof84u4.ll +++ b/bench/foundations-rs/optimized/208outlkq19x3hykb3fof84u4.ll @@ -6560,6 +6560,9 @@ define hidden { ptr, i64 } @"_ZN4core3str21_$LT$impl$u20$str$GT$18trim_start_mat "_ZN52_$LT$char$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h41df5b964a3c6ce4E.exit": %3 = getelementptr inbounds nuw i8, ptr %0, i64 %1 %4 = ptrtoint ptr %3 to i64 + %invariant.op.i = add i64 %1, -1 + %invariant.op6.i = add i64 %1, -2 + %invariant.op7.i = add i64 %1, -3 %.neg.i.i = sub i64 %1, %4 br label %5 @@ -6573,60 +6576,57 @@ define hidden { ptr, i64 } @"_ZN4core3str21_$LT$impl$u20$str$GT$18trim_start_mat %10 = getelementptr inbounds nuw i8, ptr %7, i64 1 %11 = load i8, ptr %7, align 1, !noalias !686, !noundef !4 %12 = icmp sgt i8 %11, -1 - br i1 %12, label %24, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" + br i1 %12, label %23, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i": ; preds = %9 %13 = and i8 %11, 31 %14 = zext nneg i8 %13 to i32 - %15 = add nuw nsw i64 %6, 1 - %16 = icmp samesign ne i64 %15, %1 - tail call void @llvm.assume(i1 %16) - %17 = getelementptr inbounds nuw i8, ptr %7, i64 2 - %18 = load i8, ptr %10, align 1, !noalias !686, !noundef !4 - %19 = shl nuw nsw i32 %14, 6 - %20 = and i8 %18, 63 - %21 = zext nneg i8 %20 to i32 - %22 = or disjoint i32 %19, %21 - %23 = icmp samesign ugt i8 %11, -33 - br i1 %23, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i" - -24: ; preds = %9 - %25 = zext nneg i8 %11 to i32 + %15 = icmp samesign ne i64 %6, %invariant.op.i + tail call void @llvm.assume(i1 %15) + %16 = getelementptr inbounds nuw i8, ptr %7, i64 2 + %17 = load i8, ptr %10, align 1, !noalias !686, !noundef !4 + %18 = shl nuw nsw i32 %14, 6 + %19 = and i8 %17, 63 + %20 = zext nneg i8 %19 to i32 + %21 = or disjoint i32 %18, %20 + %22 = icmp samesign ugt i8 %11, -33 + br i1 %22, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i" + +23: ; preds = %9 + %24 = zext nneg i8 %11 to i32 br label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" - %26 = add nuw nsw i64 %6, 2 - %27 = icmp samesign ne i64 %26, %1 - tail call void @llvm.assume(i1 %27) - %28 = getelementptr inbounds nuw i8, ptr %7, i64 3 - %29 = load i8, ptr %17, align 1, !noalias !686, !noundef !4 - %30 = shl nuw nsw i32 %21, 6 - %31 = and i8 %29, 63 - %32 = zext nneg i8 %31 to i32 - %33 = or disjoint i32 %30, %32 - %34 = shl nuw nsw i32 %14, 12 - %35 = or disjoint i32 %33, %34 - %36 = icmp samesign ugt i8 %11, -17 - br i1 %36, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i" + %25 = icmp samesign ne i64 %6, %invariant.op6.i + tail call void @llvm.assume(i1 %25) + %26 = getelementptr inbounds nuw i8, ptr %7, i64 3 + %27 = load i8, ptr %16, align 1, !noalias !686, !noundef !4 + %28 = shl nuw nsw i32 %20, 6 + %29 = and i8 %27, 63 + %30 = zext nneg i8 %29 to i32 + %31 = or disjoint i32 %28, %30 + %32 = shl nuw nsw i32 %14, 12 + %33 = or disjoint i32 %31, %32 + %34 = icmp samesign ugt i8 %11, -17 + br i1 %34, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i" - %37 = add nuw nsw i64 %6, 3 - %38 = icmp samesign ne i64 %37, %1 - tail call void @llvm.assume(i1 %38) - %39 = getelementptr inbounds nuw i8, ptr %7, i64 4 - %40 = load i8, ptr %28, align 1, !noalias !686, !noundef !4 - %41 = shl nuw nsw i32 %14, 18 - %42 = and i32 %41, 1835008 - %43 = shl nuw nsw i32 %33, 6 - %44 = and i8 %40, 63 - %45 = zext nneg i8 %44 to i32 - %46 = or disjoint i32 %43, %45 - %47 = or disjoint i32 %46, %42 + %35 = icmp samesign ne i64 %6, %invariant.op7.i + tail call void @llvm.assume(i1 %35) + %36 = getelementptr inbounds nuw i8, ptr %7, i64 4 + %37 = load i8, ptr %26, align 1, !noalias !686, !noundef !4 + %38 = shl nuw nsw i32 %14, 18 + %39 = and i32 %38, 1835008 + %40 = shl nuw nsw i32 %31, 6 + %41 = and i8 %37, 63 + %42 = zext nneg i8 %41 to i32 + %43 = or disjoint i32 %40, %42 + %46 = or disjoint i32 %43, %39 br label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i" -"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i", %24, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" - %.sroa.0.0.ph.i.i = phi ptr [ %17, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" ], [ %28, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i" ], [ %39, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i" ], [ %10, %24 ] - %.sroa.4.0.i.ph.i.i = phi i32 [ %22, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" ], [ %35, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i" ], [ %47, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i" ], [ %25, %24 ] +"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17hdfcff69adeede8a3E.exit.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i", %23, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" + %.sroa.0.0.ph.i.i = phi ptr [ %16, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" ], [ %26, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i" ], [ %36, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i" ], [ %10, %23 ] + %.sroa.4.0.i.ph.i.i = phi i32 [ %21, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit12.i.i.i" ], [ %33, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit14.i.i.i" ], [ %44, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h663c8bbbdf3b550aE.exit16.i.i.i" ], [ %24, %23 ] %48 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i, 1114112 tail call void @llvm.assume(i1 %48) %49 = ptrtoint ptr %.sroa.0.0.ph.i.i to i64 diff --git a/bench/g2o/optimized/solver_cholmod.ll b/bench/g2o/optimized/solver_cholmod.ll index 6c9fc3c8889..07a46fe00df 100644 --- a/bench/g2o/optimized/solver_cholmod.ll +++ b/bench/g2o/optimized/solver_cholmod.ll @@ -21239,7 +21239,7 @@ _ZN5Eigen15PlainObjectBaseINS_6MatrixIdLin1ELin1ELi0ELin1ELin1EEEE6resizeEll.exi %.05.i.i.i.i.i.i.i.i.i.i.us.i.i.i.i.i.i.i.i = phi i64 [ %35, %.lr.ph.i.i.i.i.i.i.i.i.i.i.us.i.i.i.i.i.i.i.i ], [ 0, %.lr.ph.i.i.i.i.i.i.i.i.i.i.preheader.us.i.i.i.i.i.i.i.i ] %31 = mul nsw i64 %.05.i.i.i.i.i.i.i.i.i.i.us.i.i.i.i.i.i.i.i, %25 %32 = getelementptr inbounds double, ptr %30, i64 %31 - %33 = icmp eq i64 %.074.us.i.i.i.i.i.i.i.i, %.05.i.i.i.i.i.i.i.i.i.i.us.i.i.i.i.i.i.i.i + %33 = icmp eq i64 %.05.i.i.i.i.i.i.i.i.i.i.us.i.i.i.i.i.i.i.i, %.074.us.i.i.i.i.i.i.i.i %34 = select i1 %33, double 1.000000e+00, double 0.000000e+00 store double %34, ptr %32, align 8, !tbaa !336 %35 = add nuw nsw i64 %.05.i.i.i.i.i.i.i.i.i.i.us.i.i.i.i.i.i.i.i, 1 diff --git a/bench/git/optimized/commit.ll b/bench/git/optimized/commit.ll index c53f53d0a07..03ff8cb125d 100644 --- a/bench/git/optimized/commit.ll +++ b/bench/git/optimized/commit.ll @@ -4232,6 +4232,7 @@ define dso_local range(i32 0, 2) i32 @remove_signature(ptr noundef %0) local_unn .lr.ph: ; preds = %1 %8 = ptrtoint ptr %7 to i64 %9 = ptrtoint ptr %2 to i64 + %invariant.op = add i64 %9, 32 br label %11 .preheader: ; preds = %.loopexit, %1 @@ -4311,8 +4312,7 @@ skip_prefix.exit: ; preds = %30, %38, %35 %41 = icmp eq i8 %40, 10 %spec.select = select i1 %41, ptr %7, ptr %16 %42 = ptrtoint ptr %.04165 to i64 - %43 = sub i64 %42, %9 - %.not51 = icmp eq i64 %43, 32 + %.not51 = icmp eq i64 %invariant.op, %42 %or.cond = select i1 %.not49, i1 true, i1 %.not51 %.2.idx.sroa.sel.idx.sroa.sel.idx = select i1 %or.cond, i64 0, i64 16 %.2.idx.sroa.sel.idx.sroa.sel = getelementptr inbounds nuw i8, ptr %.04165, i64 %.2.idx.sroa.sel.idx.sroa.sel.idx @@ -4326,7 +4326,7 @@ skip_prefix.exit: ; preds = %30, %38, %35 br i1 %44, label %11, label %.preheader, !llvm.loop !155 45: ; preds = %.preheader, %55 - %indvars.iv71 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next72, %55 ] + %indvars.iv71 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next72, %54 ] %46 = getelementptr inbounds nuw %struct.sigbuf, ptr %2, i64 %indvars.iv71 %47 = load ptr, ptr %46, align 16, !tbaa !153 %.not = icmp eq ptr %47, null diff --git a/bench/graphviz/optimized/emit.ll b/bench/graphviz/optimized/emit.ll index e88beb7da80..ccf6f303b0c 100644 --- a/bench/graphviz/optimized/emit.ll +++ b/bench/graphviz/optimized/emit.ll @@ -940,6 +940,7 @@ define i32 @wedgedEllipse(ptr noundef %0, ptr noundef readonly captures(none) %1 27: ; preds = %26, %11 %28 = getelementptr inbounds nuw i8, ptr %4, i64 16 %.val = load i64, ptr %28, align 8, !tbaa !100 + %invariant.op = add i64 %.val, -1 %.not = icmp eq i64 %.val, 0 br i1 %.not, label %._crit_edge, label %.lr.ph @@ -951,9 +952,9 @@ define i32 @wedgedEllipse(ptr noundef %0, ptr noundef readonly captures(none) %1 %33 = load i64, ptr %32, align 8, !tbaa !107, !noalias !103 br label %34 -34: ; preds = %.lr.ph, %49 - %.046 = phi i64 [ 0, %.lr.ph ], [ %.pre-phi, %49 ] - %.03345 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1.ph, %49 ] +34: ; preds = %.lr.ph, %48 + %.046 = phi i64 [ 0, %.lr.ph ], [ %49, %48 ] + %.03345 = phi double [ 0.000000e+00, %.lr.ph ], [ %.1.ph, %48 ] %35 = add i64 %31, %.046 %36 = urem i64 %35, %33 %37 = getelementptr inbounds nuw %struct.colorseg_t, ptr %29, i64 %36 @@ -965,33 +966,28 @@ define i32 @wedgedEllipse(ptr noundef %0, ptr noundef readonly captures(none) %1 39: ; preds = %34 %40 = fcmp ugt double %.sroa.4.0.copyload, 0.000000e+00 - br i1 %40, label %41, label %._crit_edge50 - -._crit_edge50: ; preds = %39 - %.pre51 = add nuw i64 %.046, 1 - br label %49 + br i1 %40, label %41, label %48 41: ; preds = %39 tail call void @gvrender_set_fillcolor(ptr noundef %0, ptr noundef nonnull %.sroa.0.0.copyload) #28 - %42 = add nuw i64 %.046, 1 - %43 = icmp eq i64 %42, %.val - %44 = tail call double @llvm.fmuladd.f64(double %.sroa.4.0.copyload, double 0x401921FB54442D18, double %.03345) - %.034 = select i1 %43, double 0x401921FB54442D18, double %44 - %45 = tail call ptr @ellipticWedge(double %20, double %22, double noundef %23, double noundef %24, double noundef %.03345, double noundef %.034) #28 - %46 = load ptr, ptr %45, align 8, !tbaa !109 - %47 = getelementptr inbounds nuw i8, ptr %45, i64 8 - %48 = load i64, ptr %47, align 8, !tbaa !111 - tail call void @gvrender_beziercurve(ptr noundef %0, ptr noundef %46, i64 noundef %48, i32 noundef 1) #28 - tail call void @freePath(ptr noundef nonnull %45) #28 - br label %49 - -49: ; preds = %._crit_edge50, %41 - %.pre-phi = phi i64 [ %.pre51, %._crit_edge50 ], [ %42, %41 ] - %.1.ph = phi double [ %.03345, %._crit_edge50 ], [ %.034, %41 ] - %exitcond.not = icmp eq i64 %.pre-phi, %.val + %42 = icmp eq i64 %.046, %invariant.op + %43 = tail call double @llvm.fmuladd.f64(double %.sroa.4.0.copyload, double 0x401921FB54442D18, double %.03345) + %.034 = select i1 %42, double 0x401921FB54442D18, double %43 + %44 = tail call ptr @ellipticWedge(double %20, double %22, double noundef %23, double noundef %24, double noundef %.03345, double noundef %.034) #28 + %45 = load ptr, ptr %44, align 8, !tbaa !109 + %46 = getelementptr inbounds nuw i8, ptr %44, i64 8 + %47 = load i64, ptr %46, align 8, !tbaa !111 + tail call void @gvrender_beziercurve(ptr noundef %0, ptr noundef %45, i64 noundef %47, i32 noundef 1) #28 + tail call void @freePath(ptr noundef nonnull %44) #28 + br label %48 + +48: ; preds = %41, %39 + %.1.ph = phi double [ %.03345, %39 ], [ %.034, %41 ] + %49 = add nuw i64 %.046, 1 + %exitcond.not = icmp eq i64 %49, %.val br i1 %exitcond.not, label %._crit_edge, label %34, !llvm.loop !112 -._crit_edge: ; preds = %49, %34, %27 +._crit_edge: ; preds = %48, %34, %27 br i1 %25, label %50, label %51 50: ; preds = %._crit_edge @@ -1387,6 +1383,7 @@ define i32 @stripedBox(ptr noundef %0, ptr noundef readonly captures(none) %1, p 34: ; preds = %33, %25 %35 = getelementptr inbounds nuw i8, ptr %5, i64 16 %.val35 = load i64, ptr %35, align 8, !tbaa !100 + %invariant.op = add i64 %.val35, -1 %.not41 = icmp eq i64 %.val35, 0 br i1 %.not41, label %._crit_edge, label %.lr.ph @@ -1400,7 +1397,7 @@ define i32 @stripedBox(ptr noundef %0, ptr noundef readonly captures(none) %1, p br label %42 42: ; preds = %.lr.ph, %55 - %.038 = phi i64 [ 0, %.lr.ph ], [ %.pre-phi, %55 ] + %.038 = phi i64 [ 0, %.lr.ph ], [ %55, %54 ] %43 = add i64 %38, %.038 %44 = urem i64 %43, %40 %45 = getelementptr inbounds nuw %struct.colorseg_t, ptr %36, i64 %44 @@ -1412,19 +1409,14 @@ define i32 @stripedBox(ptr noundef %0, ptr noundef readonly captures(none) %1, p 47: ; preds = %42 %48 = fcmp ugt double %.sroa.4.0.copyload, 0.000000e+00 - br i1 %48, label %49, label %._crit_edge43 - -._crit_edge43: ; preds = %47 - %.pre44 = add nuw i64 %.038, 1 - br label %55 + br i1 %48, label %49, label %54 49: ; preds = %47 call void @gvrender_set_fillcolor(ptr noundef %0, ptr noundef nonnull %.sroa.0.0.copyload) #28 - %50 = add nuw i64 %.038, 1 - %51 = icmp eq i64 %50, %.val35 - %52 = load double, ptr %6, align 16 - %53 = call double @llvm.fmuladd.f64(double %30, double %.sroa.4.0.copyload, double %52) - %storemerge = select i1 %51, double %28, double %53 + %50 = icmp eq i64 %.038, %invariant.op + %51 = load double, ptr %6, align 16 + %52 = call double @llvm.fmuladd.f64(double %30, double %.sroa.4.0.copyload, double %51) + %storemerge = select i1 %50, double %28, double %52 store double %storemerge, ptr %31, align 16, !tbaa !127 store double %storemerge, ptr %27, align 16, !tbaa !127 call void @gvrender_polygon(ptr noundef %0, ptr noundef nonnull %6, i64 noundef 4, i32 noundef 1) #28 @@ -1433,9 +1425,9 @@ define i32 @stripedBox(ptr noundef %0, ptr noundef readonly captures(none) %1, p store double %54, ptr %6, align 16, !tbaa !127 br label %55 -55: ; preds = %._crit_edge43, %49 - %.pre-phi = phi i64 [ %.pre44, %._crit_edge43 ], [ %50, %49 ] - %exitcond.not = icmp eq i64 %.pre-phi, %.val35 +55: ; preds = %49, %47 + %55 = add nuw i64 %.038, 1 + %exitcond.not = icmp eq i64 %55, %.val35 br i1 %exitcond.not, label %._crit_edge, label %42, !llvm.loop !131 ._crit_edge: ; preds = %55, %42, %34 diff --git a/bench/gromacs/optimized/selvalue.ll b/bench/gromacs/optimized/selvalue.ll index a57b23162bf..b4af1e4b9c2 100644 --- a/bench/gromacs/optimized/selvalue.ll +++ b/bench/gromacs/optimized/selvalue.ll @@ -161,26 +161,29 @@ define void @_Z21_gmx_selvalue_reserveP18gmx_ana_selvalue_ti(ptr noundef capture %39 = icmp eq i32 %1, 0 br i1 %39, label %.loopexit.sink.split, label %.preheader61 -.preheader61: ; preds = %28, %40 - %.idx = phi i64 [ %.add, %40 ], [ 8, %28 ] +.preheader61: ; preds = %28 + %invariant.op = add nsw i64 %32, -144 + br label %41 + +41: ; preds = %42, %40 + %.idx = phi i64 [ 8, %40 ], [ %.add, %42 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %38, i64 %.idx invoke void @_ZN13gmx_ana_pos_tC1Ev(ptr noundef nonnull align 8 dereferenceable(148) %.ptr.ptr) - to label %40 unwind label %43 + to label %42 unwind label %43 -40: ; preds = %.preheader61 +40: ; preds = %41 %.add = add nuw nsw i64 %.idx, 152 - %41 = add nuw nsw i64 %.idx, 144 - %42 = icmp eq i64 %41, %32 - br i1 %42, label %.loopexit.sink.split, label %.preheader61 + %43 = icmp eq i64 %.idx, %invariant.op + br i1 %43, label %.loopexit.sink.split, label %41 -43: ; preds = %.preheader61 +43: ; preds = %41 %44 = landingpad { ptr, i32 } cleanup %45 = icmp eq i64 %.idx, 8 br i1 %45, label %.loopexit42, label %.preheader .preheader: ; preds = %43, %.preheader - %.idx37 = phi i64 [ %.add38, %.preheader ], [ %.idx, %43 ] + %.idx37 = phi i64 [ %.add38, %.preheader ], [ %.idx, %44 ] %.add38 = add nsw i64 %.idx37, -152 %.ptr40 = getelementptr inbounds i8, ptr %38, i64 %.add38 tail call void @_ZN13gmx_ana_pos_tD1Ev(ptr noundef nonnull align 8 dereferenceable(148) %.ptr40) #10 @@ -214,7 +217,7 @@ define void @_Z21_gmx_selvalue_reserveP18gmx_ana_selvalue_ti(ptr noundef capture br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !22 .loopexit.sink.split: ; preds = %40, %28, %12, %15 - %.ptr36.sink = phi ptr [ %14, %12 ], [ %17, %15 ], [ %.ptr36, %28 ], [ %.ptr36, %40 ] + %.ptr36.sink = phi ptr [ %14, %12 ], [ %17, %15 ], [ %.ptr36, %28 ], [ %.ptr36, %42 ] store ptr %.ptr36.sink, ptr %7, align 8, !tbaa !11 br label %.loopexit diff --git a/bench/grpc/optimized/compression_internal.ll b/bench/grpc/optimized/compression_internal.ll index 42723e503d5..c00ff35acb3 100644 --- a/bench/grpc/optimized/compression_internal.ll +++ b/bench/grpc/optimized/compression_internal.ll @@ -1311,10 +1311,8 @@ define internal void @_GLOBAL__sub_I_compression_internal.cc() #24 section ".tex br i1 %.not19.i.i, label %switch.lookup, label %17 17: ; preds = %16 - %18 = ptrtoint ptr %.121.i.i to i64 - %19 = sub i64 %18, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @_ZN9grpc_core12_GLOBAL__N_120kCommaSeparatedListsE, i64 128) to i64) - %20 = icmp eq i64 %19, 86 - br i1 %20, label %21, label %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit.i.i + %18 = icmp eq ptr %.121.i.i, inttoptr (i64 add (i64 ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @_ZN9grpc_core12_GLOBAL__N_120kCommaSeparatedListsE, i64 128) to i64), i64 86) to ptr) + br i1 %18, label %19, label %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit.i.i 21: ; preds = %17 tail call void @abort() #30 @@ -1323,10 +1321,8 @@ define internal void @_GLOBAL__sub_I_compression_internal.cc() #24 section ".tex _ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit.i.i: ; preds = %17 %22 = getelementptr inbounds nuw i8, ptr %.121.i.i, i64 1 store i8 44, ptr %.121.i.i, align 1, !tbaa !6 - %23 = ptrtoint ptr %22 to i64 - %24 = sub i64 %23, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @_ZN9grpc_core12_GLOBAL__N_120kCommaSeparatedListsE, i64 128) to i64) - %25 = icmp eq i64 %24, 86 - br i1 %25, label %26, label %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit26.i.i + %21 = icmp eq ptr %20, inttoptr (i64 add (i64 ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @_ZN9grpc_core12_GLOBAL__N_120kCommaSeparatedListsE, i64 128) to i64), i64 86) to ptr) + br i1 %21, label %22, label %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit26.i.i 26: ; preds = %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit.i.i tail call void @abort() #30 @@ -1350,12 +1346,10 @@ switch.lookup: ; preds = %16, %_ZZN9grpc_core %30 = phi i8 [ %37, %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit27.i.i ], [ %29, %switch.lookup ] %.020.i.i = phi ptr [ %36, %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit27.i.i ], [ %switch.load, %switch.lookup ] %.319.i.i = phi ptr [ %35, %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit27.i.i ], [ %.2.i.i, %switch.lookup ] - %31 = ptrtoint ptr %.319.i.i to i64 - %32 = sub i64 %31, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @_ZN9grpc_core12_GLOBAL__N_120kCommaSeparatedListsE, i64 128) to i64) - %33 = icmp eq i64 %32, 86 - br i1 %33, label %34, label %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit27.i.i + %27 = icmp eq ptr %.319.i.i, inttoptr (i64 add (i64 ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @_ZN9grpc_core12_GLOBAL__N_120kCommaSeparatedListsE, i64 128) to i64), i64 86) to ptr) + br i1 %27, label %28, label %_ZZN9grpc_core12_GLOBAL__N_119CommaSeparatedListsC1EvENKUlcE_clEc.exit27.i.i -34: ; preds = %.lr.ph.i.i +28: ; preds = %.lr.ph.i.i tail call void @abort() #30 unreachable diff --git a/bench/grpc/optimized/legacy_channel_idle_filter.ll b/bench/grpc/optimized/legacy_channel_idle_filter.ll index c82ca256abf..5144cd8857d 100644 --- a/bench/grpc/optimized/legacy_channel_idle_filter.ll +++ b/bench/grpc/optimized/legacy_channel_idle_filter.ll @@ -4765,23 +4765,26 @@ define linkonce_odr void @_ZN9grpc_core10NoDestructINS_6PerCpuIZNS_18LegacyMaxAg %17 = icmp eq i64 %7, 0 br i1 %17, label %_ZN9grpc_core6PerCpuIZNS_18LegacyMaxAgeFilter6Config15FromChannelArgsERKNS_11ChannelArgsEE6BitGenEC2ENS_13PerCpuOptionsE.exit, label %.preheader -.preheader: ; preds = %2, %19 - %.idx.i = phi i64 [ %.add.i, %19 ], [ 8, %2 ] +.preheader: ; preds = %2 + %invariant.op.i = add i64 %10, -288 + br label %19 + +19: ; preds = %21, %18 + %.idx.i = phi i64 [ 8, %18 ], [ %.add.i, %21 ] %.ptr.ptr.i = getelementptr inbounds nuw i8, ptr %16, i64 %.idx.i store i64 0, ptr %.ptr.ptr.i, align 8, !tbaa !272 %18 = getelementptr inbounds nuw i8, ptr %.ptr.ptr.i, i64 8 call void @llvm.lifetime.start.p0(ptr nonnull %3), !noalias !273 invoke void @_ZN4absl12lts_2024072215random_internal13randen_engineImEC2IRNS1_17RandenPoolSeedSeqEvEEOT_(ptr noundef nonnull align 8 dereferenceable(288) %18, ptr noundef nonnull align 1 dereferenceable(1) %3) - to label %19 unwind label %.loopexit.i + to label %21 unwind label %.loopexit.i -19: ; preds = %.preheader +19: ; preds = %19 call void @llvm.lifetime.end.p0(ptr nonnull %3), !noalias !273 %.add.i = add nuw nsw i64 %.idx.i, 296 - %20 = add nuw nsw i64 %.idx.i, 288 - %21 = icmp eq i64 %20, %10 - br i1 %21, label %_ZN9grpc_core6PerCpuIZNS_18LegacyMaxAgeFilter6Config15FromChannelArgsERKNS_11ChannelArgsEE6BitGenEC2ENS_13PerCpuOptionsE.exit, label %.preheader + %22 = icmp eq i64 %.idx.i, %invariant.op.i + br i1 %22, label %_ZN9grpc_core6PerCpuIZNS_18LegacyMaxAgeFilter6Config15FromChannelArgsERKNS_11ChannelArgsEE6BitGenEC2ENS_13PerCpuOptionsE.exit, label %19 -.loopexit.i: ; preds = %.preheader +.loopexit.i: ; preds = %19 %22 = landingpad { ptr, i32 } cleanup call void @_ZdaPvm(ptr noundef nonnull %16, i64 noundef %15) #39 diff --git a/bench/hermes/optimized/String.ll b/bench/hermes/optimized/String.ll index 308bac045a7..d7e957572f6 100644 --- a/bench/hermes/optimized/String.ll +++ b/bench/hermes/optimized/String.ll @@ -4488,6 +4488,7 @@ _ZN6hermes2vm13MutableHandleINS0_15StringPrimitiveEEC2ERNS0_15HandleRootOwnerEPS %retval.0.i.i.i.i.i.i108 = phi ptr [ %41, %if.then.i.i.i.i.i.i109 ], [ %call7.i.i.i.i.i.i107, %if.end.i.i.i.i.i.i106 ] %43 = load ptr, ptr %next_.i, align 8 %44 = load i32, ptr %curChunkIndex_.i, align 8 + %invariant.op = add nsw i64 %conv.i, -1 %call.i112150 = call { i32, i64 } @_ZN6hermes2vm8JSObject27getComputedWithReceiver_RJSENS0_6HandleIS1_EERNS0_7RuntimeENS2_INS0_11HermesValueEEES7_(ptr %retval.0.i.i.i.i.i.i44, ptr noundef nonnull align 8 dereferenceable(9832) %runtime, ptr %retval.0.i.i.i.i.i.i70, ptr %retval.0.i.i.i.i.i.i44) #14 %45 = extractvalue { i32, i64 } %call.i112150, 0 %cmp.i113151 = icmp eq i32 %45, 0 @@ -4511,8 +4512,7 @@ if.end112: ; preds = %if.end101 call void @_ZNK6hermes2vm15StringPrimitive17appendUTF16StringERN4llvh15SmallVectorImplIDsEE(ptr noundef nonnull align 4 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(16) %stringElements) #14 %49 = load double, ptr %retval.0.i.i.i.i.i.i70, align 8 %conv.i118 = fptosi double %49 to i64 - %add = add nsw i64 %conv.i118, 1 - %cmp119 = icmp eq i64 %add, %conv.i + %cmp119 = icmp eq i64 %invariant.op, %conv.i118 br i1 %cmp119, label %if.then120, label %if.end123 if.then120: ; preds = %if.end112 @@ -4560,12 +4560,12 @@ if.end146: ; preds = %_ZNK6hermes2vm10Nat call void @_ZNK6hermes2vm15StringPrimitive17appendUTF16StringERN4llvh15SmallVectorImplIDsEE(ptr noundef nonnull align 4 dereferenceable(8) %58, ptr noundef nonnull align 8 dereferenceable(16) %stringElements) #14 %.pre = load double, ptr %retval.0.i.i.i.i.i.i70, align 8 %.pre153 = fptosi double %.pre to i64 - %.pre154 = add nsw i64 %.pre153, 1 br label %if.end151 if.end151: ; preds = %if.end146, %if.end123 - %add155.pre-phi = phi i64 [ %.pre154, %if.end146 ], [ %add, %if.end123 ] - %conv.i133 = sitofp i64 %add155.pre-phi to double + %add155.pre-phi = phi i64 [ %.pre153, %if.end146 ], [ %conv.i118, %if.end123 ] + %add155 = add nsw i64 %add155.pre-phi, 1 + %conv.i133 = sitofp i64 %add155 to double store double %conv.i133, ptr %retval.0.i.i.i.i.i.i70, align 8 %59 = load ptr, ptr %chunks_.i, align 8 %arrayidx.i20.i.i = getelementptr inbounds nuw ptr, ptr %59, i64 %.pre155 diff --git a/bench/hwloc/optimized/hwloc-calc.ll b/bench/hwloc/optimized/hwloc-calc.ll index 11c278bb99e..5cb1a3c107b 100644 --- a/bench/hwloc/optimized/hwloc-calc.ll +++ b/bench/hwloc/optimized/hwloc-calc.ll @@ -5482,30 +5482,30 @@ define internal fastcc void @hwloc_calc_hierarch_output(ptr noundef %0, ptr noun %8 = alloca [32 x i8], align 16 %9 = getelementptr inbounds nuw i8, ptr %3, i64 184 %10 = sext i32 %5 to i64 + %invariant.op = add i32 %5, 1 %.not38 = icmp eq i32 %5, 0 %11 = select i1 %.not38, ptr @.str.266, ptr @.str.189 - %12 = add nsw i32 %5, 1 - br label %13 - -13: ; preds = %60, %6 - %.032 = phi i32 [ 1, %6 ], [ %.1, %60 ] - %.031 = phi i32 [ 0, %6 ], [ %61, %60 ] - %.0 = phi ptr [ null, %6 ], [ %.015.i, %60 ] - %14 = load ptr, ptr %9, align 8, !tbaa !73 - %15 = load ptr, ptr @hierlevels, align 8, !tbaa !49 - %16 = getelementptr inbounds %struct.hwloc_calc_level, ptr %15, i64 %10 - %17 = load i32, ptr %16, align 8, !tbaa !47 + br label %12 + +12: ; preds = %58, %6 + %.032 = phi i32 [ 1, %6 ], [ %.1, %58 ] + %.032 = phi i32 [ 0, %6 ], [ %59, %58 ] + %.031 = phi ptr [ null, %6 ], [ %.015.i, %58 ] + %13 = load ptr, ptr %9, align 8, !tbaa !73 + %14 = load ptr, ptr @hierlevels, align 8, !tbaa !49 + %15 = getelementptr inbounds %struct.hwloc_calc_level, ptr %14, i64 %10 + %16 = load i32, ptr %15, align 8, !tbaa !47 %.not.i.i = icmp eq ptr %.0, null br i1 %.not.i.i, label %18, label %20 -18: ; preds = %13 - %19 = call ptr @hwloc_get_obj_by_depth(ptr noundef readonly %0, i32 noundef %17, i32 noundef 0) #29 +18: ; preds = %12 + %19 = call ptr @hwloc_get_obj_by_depth(ptr noundef readonly %0, i32 noundef %16, i32 noundef 0) #29 br label %hwloc_get_next_obj_by_depth.exit.i -20: ; preds = %13 +20: ; preds = %12 %21 = getelementptr inbounds nuw i8, ptr %.0, i64 48 %22 = load i32, ptr %21, align 8, !tbaa !62 - %.not7.i.i = icmp eq i32 %22, %17 + %.not7.i.i = icmp eq i32 %22, %16 br i1 %.not7.i.i, label %23, label %.loopexit 23: ; preds = %20 @@ -5514,15 +5514,15 @@ define internal fastcc void @hwloc_calc_hierarch_output(ptr noundef %0, ptr noun br label %hwloc_get_next_obj_by_depth.exit.i hwloc_get_next_obj_by_depth.exit.i: ; preds = %23, %18 - %.0.i.i = phi ptr [ %19, %18 ], [ %25, %23 ] + %.0.i.i = phi ptr [ %19, %17 ], [ %25, %22 ] %.not.i = icmp eq ptr %.0.i.i, null br i1 %.not.i, label %.loopexit, label %.preheader.i .preheader.i: ; preds = %hwloc_get_next_obj_by_depth.exit.i, %29 - %.015.i = phi ptr [ %31, %29 ], [ %.0.i.i, %hwloc_get_next_obj_by_depth.exit.i ] + %.015.i = phi ptr [ %31, %28 ], [ %.0.i.i, %hwloc_get_next_obj_by_depth.exit.i ] %26 = getelementptr inbounds nuw i8, ptr %.015.i, i64 184 %27 = load ptr, ptr %26, align 8, !tbaa !73 - %28 = call i32 @hwloc_bitmap_intersects(ptr noundef readonly %14, ptr noundef %27) #29 + %28 = call i32 @hwloc_bitmap_intersects(ptr noundef readonly %13, ptr noundef %27) #29 %.not12.i = icmp eq i32 %28, 0 br i1 %.not12.i, label %29, label %hwloc_get_next_obj_covering_cpuset_by_depth.exit @@ -5545,15 +5545,15 @@ hwloc_get_next_obj_covering_cpuset_by_depth.exit: ; preds = %.preheader.i br label %36 36: ; preds = %hwloc_get_next_obj_covering_cpuset_by_depth.exit, %33 - %37 = phi i32 [ %35, %33 ], [ %.031, %hwloc_get_next_obj_covering_cpuset_by_depth.exit ] + %37 = phi i32 [ %35, %32 ], [ %.031, %hwloc_get_next_obj_covering_cpuset_by_depth.exit ] %38 = call i32 @hwloc_bitmap_intersects(ptr noundef %4, ptr noundef %27) #29 %.not36 = icmp eq i32 %38, 0 - br i1 %.not36, label %60, label %39 + br i1 %.not36, label %58, label %39 39: ; preds = %36 - %40 = call fastcc i32 @hwloc_calc_check_object_filtered(ptr noundef nonnull %.015.i, ptr noundef nonnull %16) + %40 = call fastcc i32 @hwloc_calc_check_object_filtered(ptr noundef nonnull %.015.i, ptr noundef nonnull %15) %.not37 = icmp eq i32 %40, 0 - br i1 %.not37, label %41, label %60 + br i1 %.not37, label %41, label %58 41: ; preds = %39 %42 = call i32 @hwloc_obj_type_snprintf(ptr noundef nonnull %8, i64 noundef 32, ptr noundef nonnull %.015.i, i64 noundef 2) #28 @@ -5570,36 +5570,35 @@ hwloc_get_next_obj_covering_cpuset_by_depth.exit: ; preds = %.preheader.i 48: ; preds = %46, %44 %.not40 = icmp eq i32 %.032, 0 - br i1 %.not40, label %49, label %51 + br i1 %.not40, label %49, label %50 49: ; preds = %48 %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.160, ptr noundef %2) - br label %51 + br label %50 + +50: ; preds = %48, %47 + %51 = load i32, ptr @hiernblevels, align 4, !tbaa !16 + %.not41 = icmp eq i32 %51, %invariant.op + br i1 %.not41, label %56, label %52 + +52: ; preds = %50 + %53 = call noalias ptr @hwloc_bitmap_dup(ptr noundef %4) #28 + %54 = load ptr, ptr %31, align 8, !tbaa !73 + %55 = call i32 @hwloc_bitmap_and(ptr noundef %53, ptr noundef %53, ptr noundef %54) #28 + call fastcc void @hwloc_calc_hierarch_output(ptr noundef %0, ptr noundef nonnull %7, ptr noundef %2, ptr noundef nonnull %.015.i, ptr noundef %53, i32 noundef %invariant.op) + call void @hwloc_bitmap_free(ptr noundef %53) #28 + br label %58 + +56: ; preds = %50 + %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.160, ptr noundef nonnull %7) + br label %58 -51: ; preds = %49, %48 - %52 = load i32, ptr @hiernblevels, align 4, !tbaa !16 - %53 = add nsw i32 %52, -1 - %.not41 = icmp eq i32 %5, %53 - br i1 %.not41, label %58, label %54 - -54: ; preds = %51 - %55 = call noalias ptr @hwloc_bitmap_dup(ptr noundef %4) #28 - %56 = load ptr, ptr %32, align 8, !tbaa !73 - %57 = call i32 @hwloc_bitmap_and(ptr noundef %55, ptr noundef %55, ptr noundef %56) #28 - call fastcc void @hwloc_calc_hierarch_output(ptr noundef %0, ptr noundef nonnull %7, ptr noundef %2, ptr noundef nonnull %.015.i, ptr noundef %55, i32 noundef %12) - call void @hwloc_bitmap_free(ptr noundef %55) #28 - br label %60 - -58: ; preds = %51 - %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.160, ptr noundef nonnull %7) - br label %60 - -60: ; preds = %54, %58, %39, %36 - %.1 = phi i32 [ %.032, %39 ], [ 0, %54 ], [ 0, %58 ], [ %.032, %36 ] - %61 = add i32 %.031, 1 +51: ; preds = %52, %56, %38, %35 + %.1 = phi i32 [ %.032, %38 ], [ 0, %52 ], [ 0, %56 ], [ %.032, %35 ] + %53 = add i32 %.032, 1 call void @llvm.lifetime.end.p0(ptr nonnull %8) call void @llvm.lifetime.end.p0(ptr nonnull %7) - br label %13, !llvm.loop !141 + br label %12, !llvm.loop !141 .loopexit: ; preds = %hwloc_get_next_obj_by_depth.exit.i, %20, %29 ret void diff --git a/bench/icu/optimized/caniter.ll b/bench/icu/optimized/caniter.ll index 4c7cd8e5c30..be96dbbb167 100644 --- a/bench/icu/optimized/caniter.ll +++ b/bench/icu/optimized/caniter.ll @@ -217,22 +217,25 @@ define void @_ZN6icu_7717CanonicalIterator9setSourceERKNS_13UnicodeStringER10UEr %66 = icmp eq i32 %57, 0 br i1 %66, label %.loopexit116, label %.preheader115 -.preheader115: ; preds = %65, %.preheader115 - %.idx = phi i64 [ %.add, %.preheader115 ], [ 8, %65 ] +.preheader115: ; preds = %65 + %invariant.op = add nsw i64 %60, -56 + br label %67 + +67: ; preds = %.preheader115, %67 + %.idx = phi i64 [ %.add, %67 ], [ 8, %.preheader115 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %63, i64 %.idx store ptr getelementptr inbounds nuw inrange(-16, 88) (i8, ptr @_ZTVN6icu_7713UnicodeStringE, i64 16), ptr %.ptr.ptr, align 8, !tbaa !3 %67 = getelementptr inbounds nuw i8, ptr %.ptr.ptr, i64 8 store i16 2, ptr %67, align 8, !tbaa !6 %.add = add nuw nsw i64 %.idx, 64 - %68 = add nuw nsw i64 %.idx, 56 - %69 = icmp eq i64 %68, %60 - br i1 %69, label %.loopexit116, label %.preheader115 + %69 = icmp eq i64 %.idx, %invariant.op + br i1 %69, label %.loopexit116, label %67 70: ; preds = %49 store i32 7, ptr %2, align 4, !tbaa !23 br label %.thread100 -.loopexit116: ; preds = %.preheader115, %65 +.loopexit116: ; preds = %67, %65 %71 = tail call noundef i32 @_ZNK6icu_7713UnicodeString8char32AtEi(ptr noundef nonnull align 8 dereferenceable(64) %6, i32 noundef 0) %72 = icmp ult i32 %71, 65536 %73 = select i1 %72, i32 1, i32 2 @@ -1099,6 +1102,7 @@ _ZNK6icu_779Hashtable5countEv.exit: ; preds = %153 164: ; preds = %156 store i64 %157, ptr %162, align 8 + %invariant.op = add nsw i64 %159, -56 br label %165 165: ; preds = %164, %165 @@ -1108,9 +1112,8 @@ _ZNK6icu_779Hashtable5countEv.exit: ; preds = %153 %166 = getelementptr inbounds nuw i8, ptr %.ptr.ptr, i64 8 store i16 2, ptr %166, align 8, !tbaa !6 %.add = add nuw nsw i64 %.idx, 64 - %167 = add nuw nsw i64 %.idx, 56 - %168 = icmp eq i64 %167, %159 - br i1 %168, label %169, label %165 + %167 = icmp eq i64 %.idx, %invariant.op + br i1 %167, label %168, label %165 .loopexit121: ; preds = %172, %180 %lpad.loopexit = landingpad { ptr, i32 } @@ -1131,7 +1134,7 @@ _ZNK6icu_779Hashtable5countEv.exit: ; preds = %153 to label %_ZNK6icu_779Hashtable11nextElementERi.exit111 unwind label %.loopexit.split-lp _ZNK6icu_779Hashtable11nextElementERi.exit111: ; preds = %169, %180 - %.155 = phi ptr [ %182, %180 ], [ %171, %169 ] + %.155 = phi ptr [ %182, %179 ], [ %171, %168 ] %.not74 = icmp eq ptr %.155, null br i1 %.not74, label %.loopexit, label %172 @@ -1144,7 +1147,7 @@ _ZNK6icu_779Hashtable11nextElementERi.exit111: ; preds = %169, %180 %177 = sext i32 %175 to i64 %178 = getelementptr inbounds %"class.icu_77::UnicodeString", ptr %.ptr68, i64 %177 %179 = invoke noundef nonnull align 8 dereferenceable(64) ptr @_ZN6icu_7713UnicodeStringaSERKS0_(ptr noundef nonnull align 8 dereferenceable(64) %178, ptr noundef nonnull align 8 dereferenceable(64) %174) - to label %180 unwind label %.loopexit121 + to label %179 unwind label %.loopexit121 180: ; preds = %172 %181 = load ptr, ptr %5, align 8, !tbaa !39 @@ -1172,12 +1175,12 @@ _ZNK6icu_779Hashtable11nextElementERi.exit111: ; preds = %169, %180 br label %_ZN6icu_779HashtableC2ER10UErrorCode.exit93.thread 185: ; preds = %183, %62, %60 - %.pn77.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn, %183 ], [ %61, %60 ], [ %63, %62 ] + %.pn77.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn, %182 ], [ %61, %60 ], [ %63, %62 ] call void @llvm.lifetime.end.p0(ptr nonnull %8) br label %199 _ZN6icu_779HashtableC2ER10UErrorCode.exit93.thread: ; preds = %.noexc91, %_ZN6icu_779HashtableC2ER10UErrorCode.exit93, %184 - %.0.ph = phi ptr [ null, %.noexc91 ], [ null, %_ZN6icu_779HashtableC2ER10UErrorCode.exit93 ], [ %.1, %184 ] + %.0.ph = phi ptr [ null, %.noexc91 ], [ null, %_ZN6icu_779HashtableC2ER10UErrorCode.exit93 ], [ %.1, %183 ] %.pr151 = load ptr, ptr %7, align 8, !tbaa !39 %.not.i114 = icmp eq ptr %.pr151, null br i1 %.not.i114, label %_ZN6icu_779HashtableD2Ev.exit, label %186 @@ -1194,7 +1197,7 @@ _ZN6icu_779HashtableC2ER10UErrorCode.exit93.thread: ; preds = %.noexc91, %_ZN6ic unreachable _ZN6icu_779HashtableD2Ev.exit: ; preds = %_ZN6icu_779HashtableC2ER10UErrorCode.exit90, %_ZN6icu_779HashtableC2ER10UErrorCode.exit90.thread, %_ZN6icu_779HashtableC2ER10UErrorCode.exit93.thread, %186 - %.0154.ph = phi ptr [ null, %_ZN6icu_779HashtableC2ER10UErrorCode.exit90 ], [ null, %_ZN6icu_779HashtableC2ER10UErrorCode.exit90.thread ], [ %.0.ph, %_ZN6icu_779HashtableC2ER10UErrorCode.exit93.thread ], [ %.0.ph, %186 ] + %.0154.ph = phi ptr [ null, %_ZN6icu_779HashtableC2ER10UErrorCode.exit90 ], [ null, %_ZN6icu_779HashtableC2ER10UErrorCode.exit90.thread ], [ %.0.ph, %_ZN6icu_779HashtableC2ER10UErrorCode.exit93.thread ], [ %.0.ph, %185 ] %.pr155 = load ptr, ptr %6, align 8, !tbaa !39 call void @llvm.lifetime.end.p0(ptr nonnull %7) %.not.i115 = icmp eq ptr %.pr155, null @@ -1212,7 +1215,7 @@ _ZN6icu_779HashtableD2Ev.exit: ; preds = %_ZN6icu_779Hashtabl unreachable _ZN6icu_779HashtableD2Ev.exit116: ; preds = %_ZN6icu_779HashtableD2Ev.exit.thread, %_ZN6icu_779HashtableD2Ev.exit, %190 - %.0154158 = phi ptr [ null, %_ZN6icu_779HashtableD2Ev.exit.thread ], [ %.0154.ph, %_ZN6icu_779HashtableD2Ev.exit ], [ %.0154.ph, %190 ] + %.0154158 = phi ptr [ null, %_ZN6icu_779HashtableD2Ev.exit.thread ], [ %.0154.ph, %_ZN6icu_779HashtableD2Ev.exit ], [ %.0154.ph, %189 ] call void @llvm.lifetime.end.p0(ptr nonnull %6) %194 = load ptr, ptr %5, align 8, !tbaa !39 %.not.i117 = icmp eq ptr %194, null @@ -1234,18 +1237,18 @@ _ZN6icu_779HashtableD2Ev.exit118: ; preds = %_ZN6icu_779Hashtabl ret ptr %.0154158 199: ; preds = %185, %44 - %.pn77.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn.pn, %185 ], [ %45, %44 ] + %.pn77.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn.pn, %184 ], [ %45, %44 ] call void @_ZN6icu_779HashtableD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %7) #13 br label %200 200: ; preds = %199, %42 - %.pn77.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn.pn.pn, %199 ], [ %43, %42 ] + %.pn77.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn.pn.pn, %198 ], [ %43, %42 ] call void @llvm.lifetime.end.p0(ptr nonnull %7) call void @_ZN6icu_779HashtableD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %6) #13 br label %201 201: ; preds = %200, %40 - %.pn77.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn.pn.pn.pn, %200 ], [ %41, %40 ] + %.pn77.pn.pn.pn.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn77.pn.pn.pn.pn.pn.pn.pn.pn.pn, %199 ], [ %41, %40 ] call void @llvm.lifetime.end.p0(ptr nonnull %6) call void @_ZN6icu_779HashtableD2Ev(ptr noundef nonnull align 8 dereferenceable(88) %5) #13 call void @llvm.lifetime.end.p0(ptr nonnull %5) diff --git a/bench/icu/optimized/coll.ll b/bench/icu/optimized/coll.ll index a14855c93b6..f5fda635a24 100644 --- a/bench/icu/optimized/coll.ll +++ b/bench/icu/optimized/coll.ll @@ -947,19 +947,22 @@ define internal fastcc noundef signext range(i8 0, 2) i8 @_ZN6icu_77L32isAvailab store i64 %21, ptr %27, align 8 %.ptr21.i = getelementptr inbounds nuw i8, ptr %27, i64 8 %30 = icmp eq i32 %19, 0 - br i1 %30, label %.loopexit35.i, label %.preheader + br i1 %30, label %.loopexit35.i, label %31 -.preheader: ; preds = %29, %31 - %.idx.i = phi i64 [ %.add.i, %31 ], [ 8, %29 ] +31: ; preds = %29 + %invariant.op.i = add nsw i64 %24, -216 + br label %32 + +.preheader: ; preds = %33, %31 + %.idx.i = phi i64 [ 8, %31 ], [ %.add.i, %33 ] %.ptr.ptr.i = getelementptr inbounds nuw i8, ptr %27, i64 %.idx.i invoke void @_ZN6icu_776LocaleC1Ev(ptr noundef nonnull align 8 dereferenceable(217) %.ptr.ptr.i) - to label %31 unwind label %45 + to label %33 unwind label %45 31: ; preds = %.preheader %.add.i = add nuw nsw i64 %.idx.i, 224 - %32 = add nuw nsw i64 %.idx.i, 216 - %33 = icmp eq i64 %32, %24 - br i1 %33, label %.loopexit35.i, label %.preheader + %34 = icmp eq i64 %.idx.i, %invariant.op.i + br i1 %34, label %.loopexit35.i, label %32 34: ; preds = %20 store ptr null, ptr @_ZL19availableLocaleList, align 8, !tbaa !37 @@ -971,9 +974,9 @@ define internal fastcc noundef signext range(i8 0, 2) i8 @_ZN6icu_77L32isAvailab to label %.preheader.i unwind label %.loopexit.split-lp.i .preheader.i: ; preds = %.loopexit35.i, %41 - %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %41 ], [ 0, %.loopexit35.i ] + %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %42 ], [ 0, %.loopexit35.i ] %35 = invoke signext i8 @ures_hasNext_77(ptr noundef nonnull %2) - to label %36 unwind label %.loopexit.i + to label %37 unwind label %.loopexit.i 36: ; preds = %.preheader.i %.not28.i = icmp eq i8 %35, 0 @@ -983,13 +986,13 @@ define internal fastcc noundef signext range(i8 0, 2) i8 @_ZN6icu_77L32isAvailab call void @llvm.lifetime.start.p0(ptr nonnull %3) store ptr null, ptr %3, align 8, !tbaa !31 %38 = invoke ptr @ures_getNextString_77(ptr noundef nonnull %2, ptr noundef null, ptr noundef nonnull %3, ptr noundef nonnull align 4 dereferenceable(4) %0) - to label %39 unwind label %49 + to label %40 unwind label %49 39: ; preds = %37 call void @llvm.lifetime.start.p0(ptr nonnull %4) %40 = load ptr, ptr %3, align 8, !tbaa !31 invoke void @_ZN6icu_776LocaleC1EPKcS2_S2_S2_(ptr noundef nonnull align 8 dereferenceable(217) %4, ptr noundef %40, ptr noundef null, ptr noundef null, ptr noundef null) - to label %41 unwind label %51 + to label %42 unwind label %51 41: ; preds = %39 %42 = load ptr, ptr @_ZL19availableLocaleList, align 8, !tbaa !37 @@ -1018,7 +1021,7 @@ define internal fastcc noundef signext range(i8 0, 2) i8 @_ZN6icu_77L32isAvailab br i1 %47, label %.loopexit34.i, label %.preheader33.i .preheader33.i: ; preds = %45, %.preheader33.i - %.idx22.i = phi i64 [ %.add23.i, %.preheader33.i ], [ %.idx.i, %45 ] + %.idx22.i = phi i64 [ %.add23.i, %.preheader33.i ], [ %.idx.i, %46 ] %.add23.i = add nsw i64 %.idx22.i, -224 %.ptr25.i = getelementptr inbounds i8, ptr %27, i64 %.add23.i call void @_ZN6icu_776LocaleD1Ev(ptr noundef nonnull align 8 dereferenceable(217) %.ptr25.i) #16 @@ -1041,20 +1044,20 @@ define internal fastcc noundef signext range(i8 0, 2) i8 @_ZN6icu_77L32isAvailab br label %53 53: ; preds = %51, %49 - %.pn.i = phi { ptr, i32 } [ %52, %51 ], [ %50, %49 ] + %.pn.i = phi { ptr, i32 } [ %52, %52 ], [ %50, %50 ] call void @llvm.lifetime.end.p0(ptr nonnull %3) br label %55 .loopexit32.i: ; preds = %36, %34, %15 invoke void @ures_close_77(ptr noundef %12) - to label %54 unwind label %.loopexit.split-lp.i + to label %55 unwind label %.loopexit.split-lp.i 54: ; preds = %.loopexit32.i invoke void @ucln_i18n_registerCleanup_77(i32 noundef 28, ptr noundef nonnull @_ZL16collator_cleanupv) to label %_ZN6icu_77L23initAvailableLocaleListER10UErrorCode.exit unwind label %.loopexit.split-lp.i 55: ; preds = %53, %.loopexit34.i, %.loopexit.split-lp.i, %.loopexit.i - %.pn.pn.i = phi { ptr, i32 } [ %.pn.i, %53 ], [ %46, %.loopexit34.i ], [ %lpad.loopexit.i, %.loopexit.i ], [ %lpad.loopexit.split-lp.i, %.loopexit.split-lp.i ] + %.pn.pn.i = phi { ptr, i32 } [ %.pn.i, %54 ], [ %46, %.loopexit34.i ], [ %lpad.loopexit.i, %.loopexit.i ], [ %lpad.loopexit.split-lp.i, %.loopexit.split-lp.i ] call void @_ZN6icu_7720StackUResourceBundleD1Ev(ptr noundef nonnull align 8 dereferenceable(136) %2) #16 call void @llvm.lifetime.end.p0(ptr nonnull %2) resume { ptr, i32 } %.pn.pn.i diff --git a/bench/icu/optimized/measfmt.ll b/bench/icu/optimized/measfmt.ll index ce3ca7ea84a..d913c0009f8 100644 --- a/bench/icu/optimized/measfmt.ll +++ b/bench/icu/optimized/measfmt.ll @@ -2719,6 +2719,7 @@ _ZN6icu_77L5toHMSEPKNS_7MeasureEiPNS_11FormattableER10UErrorCode.exit.thread: ; 111: ; preds = %103 store i64 %104, ptr %109, align 8 + %invariant.op = add nsw i64 %106, -56 br label %112 112: ; preds = %111, %112 @@ -2728,9 +2729,8 @@ _ZN6icu_77L5toHMSEPKNS_7MeasureEiPNS_11FormattableER10UErrorCode.exit.thread: ; %113 = getelementptr inbounds nuw i8, ptr %.ptr75.ptr, i64 8 store i16 2, ptr %113, align 8, !tbaa !72 %.add74 = add nuw nsw i64 %.idx73, 64 - %114 = add nuw nsw i64 %.idx73, 56 - %115 = icmp eq i64 %114, %106 - br i1 %115, label %.preheader100, label %112 + %114 = icmp eq i64 %.idx73, %invariant.op + br i1 %114, label %.preheader100, label %112 .preheader100: ; preds = %112 %.ptr77.ptr = getelementptr inbounds nuw i8, ptr %109, i64 8 @@ -2763,7 +2763,7 @@ _ZN6icu_77L5toHMSEPKNS_7MeasureEiPNS_11FormattableER10UErrorCode.exit.thread: ; br label %.preheader 127: ; preds = %.lr.ph, %127 - %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %127 ] + %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %126 ] %128 = load ptr, ptr %117, align 8, !tbaa !53 %129 = getelementptr inbounds nuw i8, ptr %128, i64 64 %130 = icmp eq i64 %indvars.iv, %120 @@ -2791,7 +2791,7 @@ _ZN6icu_77L5toHMSEPKNS_7MeasureEiPNS_11FormattableER10UErrorCode.exit.thread: ; br label %137 137: ; preds = %121, %.loopexit, %93, %10, %6, %101, %11 - %.054 = phi ptr [ %3, %93 ], [ %3, %6 ], [ %16, %11 ], [ %3, %101 ], [ %3, %10 ], [ %3, %.loopexit ], [ %3, %121 ] + %.054 = phi ptr [ %3, %93 ], [ %3, %6 ], [ %16, %11 ], [ %3, %101 ], [ %3, %10 ], [ %3, %.loopexit ], [ %3, %120 ] ret ptr %.054 } @@ -3332,18 +3332,21 @@ define noundef nonnull align 8 dereferenceable(64) ptr @_ZNK6icu_7713MeasureForm %30 = icmp eq i32 %2, 0 br i1 %30, label %.thread, label %.preheader -.preheader: ; preds = %29, %.preheader - %.idx = phi i64 [ %.add, %.preheader ], [ 8, %29 ] +.preheader: ; preds = %29 + %invariant.op = add nsw i64 %24, -56 + br label %31 + +31: ; preds = %.preheader, %31 + %.idx = phi i64 [ %.add, %31 ], [ 8, %.preheader ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %27, i64 %.idx store ptr getelementptr inbounds nuw inrange(-16, 88) (i8, ptr @_ZTVN6icu_7713UnicodeStringE, i64 16), ptr %.ptr.ptr, align 8, !tbaa !15 %31 = getelementptr inbounds nuw i8, ptr %.ptr.ptr, i64 8 store i16 2, ptr %31, align 8, !tbaa !72 %.add = add nuw nsw i64 %.idx, 64 - %32 = add nuw nsw i64 %.idx, 56 - %33 = icmp eq i64 %32, %24 - br i1 %33, label %.thread, label %.preheader + %33 = icmp eq i64 %.idx, %invariant.op + br i1 %33, label %.thread, label %31 -.thread: ; preds = %.preheader, %29 +.thread: ; preds = %31, %29 store ptr %.ptr64, ptr %9, align 8, !tbaa !101 br label %_ZN6icu_7710LocalArrayINS_13UnicodeStringEEC2EPS1_R10UErrorCode.exit diff --git a/bench/just-rs/optimized/bulvmt5gknxyhsd.ll b/bench/just-rs/optimized/bulvmt5gknxyhsd.ll index c8a9052dc4d..be41fadaeb5 100644 --- a/bench/just-rs/optimized/bulvmt5gknxyhsd.ll +++ b/bench/just-rs/optimized/bulvmt5gknxyhsd.ll @@ -5412,16 +5412,20 @@ define hidden noundef zeroext i1 @"_ZN52_$LT$Q$u20$as$u20$hashbrown..Equivalent$ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4hash17h3cef665ae1998f6eE"(ptr noalias noundef nonnull readonly align 1 captures(none) %0, i64 noundef %1, ptr noalias noundef align 8 captures(none) dereferenceable(72) %2) unnamed_addr #15 { %4 = alloca [8 x i8], align 8 %.not48 = icmp eq i64 %1, 0 - br i1 %.not48, label %._crit_edge, label %.lr.ph + br i1 %.not48, label %._crit_edge, label %.lr.ph.preheader -._crit_edge: ; preds = %15, %3 - %.033.lcssa = phi i64 [ 0, %3 ], [ %.2, %15 ] - %.0.lcssa = phi i64 [ 0, %3 ], [ %.1, %15 ] - %5 = icmp ult i64 %.0.lcssa, %1 - br i1 %5, label %7, label %6 +._crit_edge: ; preds = %3 + %5 = add i64 %1, -2 + br label %.lr.ph + +._crit_edge:; preds = %15, %3 + %.033.lcssa = phi i64 [ 0, %3 ], [ %.2, %16 ] + %.0.lcssa = phi i64 [ 0, %3 ], [ %.1, %16 ] + %6 = icmp ult i64 %.0.lcssa, %1 + br i1 %6, label %8, label %7 6: ; preds = %._crit_edge, %7 - %.134 = phi i64 [ %10, %7 ], [ %.033.lcssa, %._crit_edge ] + %.134 = phi i64 [ %10, %8 ], [ %.033.lcssa, %._crit_edge ] call void @llvm.lifetime.start.p0(ptr nonnull %4), !noalias !1608 store i64 %.134, ptr %4, align 8, !noalias !1608 call void @"_ZN71_$LT$core..hash..sip..Hasher$LT$S$GT$$u20$as$u20$core..hash..Hasher$GT$5write17h8d26e9746a504159E.llvm.1648887574124572298"(ptr noalias noundef nonnull align 8 dereferenceable(72) %2, ptr noalias noundef nonnull readonly align 1 %4, i64 noundef 8) @@ -5435,10 +5439,10 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h %10 = add i64 %8, %.033.lcssa br label %6 -.lr.ph: ; preds = %3, %15 - %.046 = phi i64 [ %.1, %15 ], [ 0, %3 ] - %.03345 = phi i64 [ %.2, %15 ], [ 0, %3 ] - %.sroa.09.044 = phi i64 [ %11, %15 ], [ 0, %3 ] +.lr.ph: ; preds = %._crit_edge, %15 + %.046 = phi i64 [ %.1, %16 ], [ 0, %.lr.ph.preheader ] + %.03345 = phi i64 [ %.2, %16 ], [ 0, %.lr.ph.preheader ] + %.sroa.09.044 = phi i64 [ %11, %16 ], [ 0, %.lr.ph.preheader ] %11 = add nuw i64 %.sroa.09.044, 1 %12 = getelementptr inbounds i8, ptr %0, i64 %.sroa.09.044 %13 = load i8, ptr %12, align 1, !noundef !8 @@ -5463,10 +5467,9 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h br label %21 21: ; preds = %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h8658a1b51fbcd7edE.exit", %16 - %.3 = phi i64 [ %20, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h8658a1b51fbcd7edE.exit" ], [ %.03345, %16 ] - %22 = sub nuw i64 %1, %11 + %.3 = phi i64 [ %20, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h8658a1b51fbcd7edE.exit" ], [ %.03345, %17 ] %23 = getelementptr inbounds i8, ptr %0, i64 %11 - %24 = icmp eq i64 %22, 1 + %24 = icmp eq i64 %.sroa.09.044, %5 br i1 %24, label %25, label %28 25: ; preds = %21 diff --git a/bench/libquic/optimized/quic_stream_sequencer_buffer.ll b/bench/libquic/optimized/quic_stream_sequencer_buffer.ll index 767d938dc8b..2e6a8576468 100644 --- a/bench/libquic/optimized/quic_stream_sequencer_buffer.ll +++ b/bench/libquic/optimized/quic_stream_sequencer_buffer.ll @@ -4374,6 +4374,7 @@ define noundef range(i32 0, -2147483648) i32 @_ZNK3net25QuicStreamSequencerBuffe br i1 %45, label %.lr.ph, label %._crit_edge .lr.ph: ; preds = %._crit_edge66 + %invariant.op = add i64 %32, -1 %46 = zext nneg i32 %2 to i64 br label %47 @@ -4384,15 +4385,14 @@ define noundef range(i32 0, -2147483648) i32 @_ZNK3net25QuicStreamSequencerBuffe %49 = load ptr, ptr %48, align 8, !tbaa !56 %50 = getelementptr inbounds nuw %struct.iovec, ptr %1, i64 %indvars.iv store ptr %49, ptr %50, align 8, !tbaa !139 - %51 = add nuw nsw i64 %.061, 1 - %52 = icmp eq i64 %51, %32 - %53 = load i64, ptr %0, align 8 - %54 = and i64 %53, 8191 - %55 = icmp ne i64 %54, 0 - %56 = select i1 %52, i1 %55, i1 false - %.0.i49 = select i1 %56, i64 %54, i64 8192 - %57 = getelementptr inbounds nuw i8, ptr %50, i64 8 - store i64 %.0.i49, ptr %57, align 8, !tbaa !137 + %51 = icmp eq i64 %.061, %invariant.op + %52 = load i64, ptr %0, align 8 + %53 = and i64 %52, 8191 + %54 = icmp ne i64 %53, 0 + %55 = select i1 %51, i1 %54, i1 false + %56 = select i1 %55, i64 %53, i64 8192 + %56 = getelementptr inbounds nuw i8, ptr %50, i64 8 + store i64 %.0.i49, ptr %56, align 8, !tbaa !137 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %58 = add nuw nsw i64 %15, %indvars.iv.next %59 = urem i64 %58, %32 @@ -4422,7 +4422,7 @@ define noundef range(i32 0, -2147483648) i32 @_ZNK3net25QuicStreamSequencerBuffe br label %72 72: ; preds = %._crit_edge.loopexit, %27, %64, %._crit_edge, %11 - %.043 = phi i32 [ 0, %11 ], [ 1, %27 ], [ %71, %64 ], [ 1, %._crit_edge ], [ %63, %._crit_edge.loopexit ] + %.043 = phi i32 [ 0, %11 ], [ 1, %27 ], [ %71, %63 ], [ 1, %._crit_edge ], [ %63, %._crit_edge.loopexit ] ret i32 %.043 } diff --git a/bench/lief/optimized/ssl_tls13_server.ll b/bench/lief/optimized/ssl_tls13_server.ll index 013cc54a7a9..cd5fe4f52e0 100644 --- a/bench/lief/optimized/ssl_tls13_server.ll +++ b/bench/lief/optimized/ssl_tls13_server.ll @@ -2031,6 +2031,7 @@ define internal fastcc void @ssl_tls13_select_ciphersuite(ptr noundef %0, ptr no br i1 %.not, label %.preheader, label %64 .preheader: ; preds = %6 + %invariant.op = add nsw i32 %4, -33554432 %11 = icmp ult ptr %1, %2 br i1 %11, label %.lr.ph, label %._crit_edge @@ -2116,8 +2117,7 @@ mbedtls_ssl_tls13_cipher_suite_is_offered.exit.i.us: ; preds = %31 %42 = getelementptr inbounds nuw i8, ptr %37, i64 17 %43 = load i8, ptr %42, align 1, !tbaa !102 %44 = zext i8 %43 to i32 - %45 = or disjoint i32 %44, 33554432 - %.not29.us = icmp eq i32 %45, %4 + %.not29.us = icmp eq i32 %invariant.op, %44 br i1 %.not29.us, label %.split.us, label %ssl_tls13_validate_peer_ciphersuite.exit.thread.us ssl_tls13_validate_peer_ciphersuite.exit.thread.us: ; preds = %41, %36, %mbedtls_ssl_tls13_cipher_suite_is_offered.exit.i.us @@ -2136,7 +2136,7 @@ ssl_tls13_validate_peer_ciphersuite.exit.thread.us: ; preds = %41, %36, %mbedtls br label %51 51: ; preds = %51, %.lr.ph.split - %.08.i.i = phi i64 [ 0, %.lr.ph.split ], [ %55, %51 ] + %.08.i.i = phi i64 [ 0, %.lr.ph.split ], [ %55, %50 ] %52 = getelementptr inbounds nuw i32, ptr %.val.val.i, i64 %.08.i.i %53 = load i32, ptr %52, align 4, !tbaa !106 %.not.i.i = icmp eq i32 %53, 0 @@ -2165,7 +2165,7 @@ ssl_tls13_validate_peer_ciphersuite.exit.thread: ; preds = %mbedtls_ssl_tls13_c br i1 %62, label %.lr.ph.split, label %._crit_edge, !llvm.loop !111 .split.us: ; preds = %56, %41, %21 - %.us-phi = phi ptr [ %37, %41 ], [ %22, %21 ], [ %57, %56 ] + %.us-phi = phi ptr [ %37, %41 ], [ %22, %21 ], [ %57, %55 ] store ptr %.us-phi, ptr %5, align 8, !tbaa !108 br label %64 diff --git a/bench/linux/optimized/pagelist.ll b/bench/linux/optimized/pagelist.ll index 8f7103038c3..0e3f5b256c1 100644 --- a/bench/linux/optimized/pagelist.ll +++ b/bench/linux/optimized/pagelist.ll @@ -3477,6 +3477,7 @@ define dso_local void @nfs_pageio_cond_complete(ptr noundef %0, i64 noundef %1) 6: ; preds = %2 %7 = getelementptr inbounds nuw i8, ptr %0, i64 8 %8 = getelementptr inbounds nuw i8, ptr %0, i64 80 + %invariant.op = add i64 %1, -1 %9 = load ptr, ptr %7, align 8 %10 = getelementptr inbounds nuw i8, ptr %9, i64 40 %11 = load ptr, ptr %10, align 8 @@ -3488,11 +3489,11 @@ define dso_local void @nfs_pageio_cond_complete(ptr noundef %0, i64 noundef %1) %14 = getelementptr inbounds nuw i8, ptr %13, i64 8 br label %15 -15: ; preds = %47, %.split.us - %16 = phi i32 [ 0, %.split.us ], [ %48, %47 ] +15: ; preds = %46, %.split.us + %16 = phi i32 [ 0, %.split.us ], [ %47, %46 ] %17 = load volatile ptr, ptr %13, align 8 %18 = icmp eq ptr %17, %13 - br i1 %18, label %47, label %19 + br i1 %18, label %46, label %19 19: ; preds = %15 %20 = load ptr, ptr %14, align 8 @@ -3526,95 +3527,93 @@ define dso_local void @nfs_pageio_cond_complete(ptr noundef %0, i64 noundef %1) %40 = phi i64 [ %38, %35 ], [ 1, %29 ] %41 = add i64 %40, %31 %42 = icmp eq i64 %41, %1 - br i1 %42, label %47, label %.split5.us + br i1 %42, label %46, label %.split5.us .thread.us: ; preds = %25, %19 %43 = getelementptr inbounds nuw i8, ptr %20, i64 32 %44 = load i64, ptr %43, align 8 - %45 = add i64 %44, 1 - %46 = icmp eq i64 %45, %1 - br i1 %46, label %47, label %.split5.us - -47: ; preds = %.thread.us, %39, %15 - %48 = add nuw i32 %16, 1 - %49 = icmp ult i32 %48, %4 - br i1 %49, label %15, label %.loopexit, !llvm.loop !91 - -.split: ; preds = %6, %92 - %50 = phi i32 [ %93, %92 ], [ 0, %6 ] - %51 = load ptr, ptr %7, align 8 - %52 = getelementptr inbounds nuw i8, ptr %51, i64 40 - %53 = load ptr, ptr %52, align 8 - %54 = icmp eq ptr %53, null - br i1 %54, label %57, label %55 + %45 = icmp eq i64 %44, %invariant.op + br i1 %45, label %46, label %.split5.us + +46: ; preds = %.thread.us, %39, %15 + %47 = add nuw i32 %16, 1 + %48 = icmp ult i32 %47, %4 + br i1 %48, label %15, label %.loopexit, !llvm.loop !91 + +.split: ; preds = %6, %90 + %49 = phi i32 [ %91, %90 ], [ 0, %6 ] + %50 = load ptr, ptr %7, align 8 + %51 = getelementptr inbounds nuw i8, ptr %50, i64 40 + %52 = load ptr, ptr %51, align 8 + %53 = icmp eq ptr %52, null + br i1 %53, label %56, label %54 -55: ; preds = %.split - %56 = tail call ptr %53(ptr noundef %0, i32 noundef %50) #11 - br label %59 +47: ; preds = %.split + %55 = tail call ptr %52(ptr noundef %0, i32 noundef %49) #11 + br label %58 -57: ; preds = %.split - %58 = load ptr, ptr %8, align 8 - br label %59 +.split: ; preds = %.split + %57 = load ptr, ptr %8, align 8 + br label %58 -59: ; preds = %57, %55 - %60 = phi ptr [ %56, %55 ], [ %58, %57 ] - %61 = load volatile ptr, ptr %60, align 8 - %62 = icmp eq ptr %61, %60 - br i1 %62, label %92, label %63 +55: ; preds = %.split, %54 + %59 = phi ptr [ %55, %54 ], [ %57, %56 ] + %60 = load volatile ptr, ptr %59, align 8 + %61 = icmp eq ptr %60, %59 + br i1 %61, label %90, label %62 -63: ; preds = %59 - %64 = getelementptr inbounds nuw i8, ptr %60, i64 8 - %65 = load ptr, ptr %64, align 8 - %66 = getelementptr inbounds nuw i8, ptr %65, i64 56 - %67 = load volatile i64, ptr %66, align 8 - %68 = and i64 %67, 4 - %69 = icmp eq i64 %68, 0 - br i1 %69, label %.thread, label %70 - -70: ; preds = %63 - %71 = getelementptr inbounds nuw i8, ptr %65, i64 16 - %72 = load ptr, ptr %71, align 8 - %73 = icmp eq ptr %72, null - br i1 %73, label %.thread, label %74 - -74: ; preds = %70 - %75 = getelementptr inbounds nuw i8, ptr %72, i64 32 - %76 = load i64, ptr %75, align 16 - %77 = load volatile i64, ptr %72, align 16 - %78 = and i64 %77, 64 - %79 = icmp eq i64 %78, 0 - br i1 %79, label %84, label %80 - -80: ; preds = %74 - %81 = getelementptr inbounds nuw i8, ptr %72, i64 100 - %82 = load i32, ptr %81, align 4 - %83 = zext i32 %82 to i64 - br label %84 +57: ; preds = %58 + %63 = getelementptr inbounds nuw i8, ptr %59, i64 8 + %64 = load ptr, ptr %63, align 8 + %65 = getelementptr inbounds nuw i8, ptr %64, i64 56 + %66 = load volatile i64, ptr %65, align 8 + %67 = and i64 %66, 4 + %68 = icmp eq i64 %67, 0 + br i1 %68, label %.thread, label %69 + +69: ; preds = %62 + %70 = getelementptr inbounds nuw i8, ptr %64, i64 16 + %71 = load ptr, ptr %70, align 8 + %72 = icmp eq ptr %71, null + br i1 %72, label %.thread, label %73 + +63: ; preds = %69 + %64 = getelementptr inbounds nuw i8, ptr %71, i64 32 + %65 = load i64, ptr %64, align 16 + %76 = load volatile i64, ptr %71, align 16 + %77 = and i64 %76, 64 + %78 = icmp eq i64 %77, 0 + br i1 %78, label %83, label %79 + +79: ; preds = %73 + %80 = getelementptr inbounds nuw i8, ptr %71, i64 100 + %81 = load i32, ptr %80, align 4 + %82 = zext i32 %81 to i64 + br label %83 -84: ; preds = %80, %74 - %85 = phi i64 [ %83, %80 ], [ 1, %74 ] - %86 = add i64 %85, %76 +84: ; preds = %79, %73 + %85 = phi i64 [ %82, %79 ], [ 1, %73 ] + %86 = add i64 %85, %75 %87 = icmp eq i64 %86, %1 br i1 %87, label %92, label %.split5.us -.thread: ; preds = %63, %70 - %88 = getelementptr inbounds nuw i8, ptr %65, i64 32 +.thread: ; preds = %62, %69 + %88 = getelementptr inbounds nuw i8, ptr %64, i64 32 %89 = load i64, ptr %88, align 8 - %90 = add i64 %89, 1 - %91 = icmp eq i64 %90, %1 - br i1 %91, label %92, label %.split5.us + %89 = icmp eq i64 %89, %invariant.op + br i1 %89, label %90, label %.split5.us .split5.us: ; preds = %84, %.thread, %39, %.thread.us tail call void @nfs_pageio_complete(ptr noundef %0) br label %.loopexit -92: ; preds = %.thread, %84, %59 - %93 = add nuw i32 %50, 1 +92: ; preds = %.thread, %84, %58 + %93 = add nuw i32 %49, 1 %94 = load i32, ptr %3, align 4 %95 = icmp ult i32 %93, %94 br i1 %95, label %.split, label %.loopexit, !llvm.loop !92 -.loopexit: ; preds = %92, %47, %.split5.us, %2 +.loopexit: ; preds = %92, %46, %.split5.us, %2 ret void } diff --git a/bench/llvm/optimized/CGCleanup.ll b/bench/llvm/optimized/CGCleanup.ll index a9bbbf22809..8305f4dd0b8 100644 --- a/bench/llvm/optimized/CGCleanup.ll +++ b/bench/llvm/optimized/CGCleanup.ll @@ -1006,9 +1006,9 @@ define dso_local noundef zeroext i1 @_ZNK5clang7CodeGen12EHScopeStack24containsO %5 = getelementptr inbounds nuw i8, ptr %0, i64 8 %6 = load ptr, ptr %5, align 8, !tbaa !658 %7 = ptrtoint ptr %6 to i64 + %invariant.op = sub i64 %7, %1 %8 = ptrtoint ptr %4 to i64 - %9 = sub i64 %7, %8 - %.not1316 = icmp eq i64 %9, %1 + %.not1316 = icmp eq i64 %invariant.op, %8 br i1 %.not1316, label %._crit_edge, label %.lr.ph .lr.ph: ; preds = %2, %_ZN5clang7CodeGen12EHScopeStack8iteratorppEi.exit @@ -1034,8 +1034,7 @@ _ZN5clang7CodeGen12EHScopeStack8iteratorppEi.exit: ; preds = %.lr.ph %21 = getelementptr i8, ptr %.sroa.0.017, i64 %20 %22 = getelementptr i8, ptr %21, i64 8 %23 = ptrtoint ptr %22 to i64 - %24 = sub i64 %7, %23 - %.not13 = icmp eq i64 %24, %1 + %.not13 = icmp eq i64 %invariant.op, %23 br i1 %.not13, label %._crit_edge, label %.lr.ph, !llvm.loop !661 ._crit_edge: ; preds = %_ZN5clang7CodeGen12EHScopeStack8iteratorppEi.exit, %.lr.ph, %2 diff --git a/bench/llvm/optimized/CoverageMapping.ll b/bench/llvm/optimized/CoverageMapping.ll index 00e6c3699c5..70466ce775e 100644 --- a/bench/llvm/optimized/CoverageMapping.ll +++ b/bench/llvm/optimized/CoverageMapping.ll @@ -12414,6 +12414,7 @@ _ZN12_GLOBAL__N_114SegmentBuilder14combineRegionsEN4llvm15MutableArrayRefINS1_8c %70 = add i64 %.neg.i, %2 %.idx85.i = mul nuw nsw i64 %70, 80 %71 = getelementptr inbounds nuw i8, ptr %1, i64 %.idx85.i + %invariant.op.i = add i64 %70, -1 %.not7182.i = icmp eq i64 %70, 0 br i1 %.not7182.i, label %._crit_edge.i10, label %.lr.ph.i8 @@ -12427,8 +12428,8 @@ _ZN12_GLOBAL__N_114SegmentBuilder14combineRegionsEN4llvm15MutableArrayRefINS1_8c br i1 %.not.i.i, label %_ZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplEN4llvm8ArrayRefINS1_8coverage13CountedRegionEEE.exit, label %208 74: ; preds = %206, %.lr.ph.i8 - %.sroa.7.084.i = phi i64 [ 0, %.lr.ph.i8 ], [ %161, %206 ] - %.sroa.052.083.i = phi ptr [ %1, %.lr.ph.i8 ], [ %207, %206 ] + %.sroa.7.084.i = phi i64 [ 0, %.lr.ph.i8 ], [ %208, %207 ] + %.sroa.052.083.i = phi ptr [ %1, %.lr.ph.i8 ], [ %209, %207 ] call void @llvm.lifetime.start.p0(ptr nonnull %4) %75 = getelementptr inbounds nuw i8, ptr %.sroa.052.083.i, i64 36 %76 = load i64, ptr %75, align 4 @@ -12602,7 +12603,7 @@ _ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_p br label %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i _ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i: ; preds = %89, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit46, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit48, %123, %118, %113 - %.028.i.i.i.i.i = phi ptr [ %.029.lcssa.i.i.i.i.i, %113 ], [ %.2.i.i.i.i.i, %123 ], [ %.1.i.i.i.i.i, %118 ], [ %127, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit48 ], [ %125, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit ], [ %126, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit46 ], [ %.02998.i.i.i.i.i, %89 ] + %.028.i.i.i.i.i = phi ptr [ %.029.lcssa.i.i.i.i.i, %113 ], [ %.2.i.i.i.i.i, %123 ], [ %.1.i.i.i.i.i, %118 ], [ %127, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit49 ], [ %125, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit ], [ %126, %_ZSt13__find_if_notIPPKN4llvm8coverage13CountedRegionEN9__gnu_cxx5__ops10_Iter_predIZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_EEET_SF_SF_T0_.exit.i.i.i.loopexit.split.loop.exit47 ], [ %.02998.i.i.i.i.i, %89 ] %128 = icmp eq ptr %.028.i.i.i.i.i, %80 br i1 %128, label %_ZSt16stable_partitionIPPKN4llvm8coverage13CountedRegionEZN12_GLOBAL__N_114SegmentBuilder17buildSegmentsImplENS0_8ArrayRefIS2_EEEUlS4_E_ET_SB_SB_T0_.exit.i, label %129 @@ -12669,30 +12670,29 @@ _ZSt16stable_partitionIPPKN4llvm8coverage13CountedRegionEZN12_GLOBAL__N_114Segme %158 = load i32, ptr %72, align 4 %159 = icmp eq i32 %158, %.sroa.4.0.extract.trunc.i %160 = select i1 %157, i1 %159, i1 false - %161 = add nuw nsw i64 %.sroa.7.084.i, 1 - %162 = icmp eq i64 %161, %70 - br i1 %160, label %163, label %185 - -163: ; preds = %150 - %164 = icmp eq i32 %152, 2 - %spec.select.i = select i1 %162, i1 true, i1 %164 - %165 = load i32, ptr %8, align 8, !tbaa !47 - %.not.i36.i = icmp eq i32 %165, 0 - br i1 %.not.i36.i, label %172, label %166 - -166: ; preds = %163 - %167 = load ptr, ptr %6, align 8, !tbaa !50 - %168 = zext i32 %165 to i64 - %169 = getelementptr inbounds nuw ptr, ptr %167, i64 %168 - %170 = getelementptr inbounds i8, ptr %169, i64 -8 - %171 = load ptr, ptr %170, align 8, !tbaa !419 - %.phi.trans.insert.i = getelementptr i8, ptr %171, i64 52 + br i1 %160, label %161, label %184 + +161:; preds = %150 + %162 = icmp eq i64 %.sroa.7.084.i, %invariant.op.i + %163 = icmp eq i32 %152, 2 + %spec.select.i = select i1 %162, i1 true, i1 %163 + %164 = load i32, ptr %8, align 8, !tbaa !47 + %.not.i36.i = icmp eq i32 %164, 0 + br i1 %.not.i36.i, label %172, label %165 + +165: ; preds = %161 + %166 = load ptr, ptr %6, align 8, !tbaa !50 + %167 = zext i32 %164 to i64 + %168 = getelementptr inbounds nuw ptr, ptr %166, i64 %167 + %169 = getelementptr inbounds i8, ptr %168, i64 -8 + %170 = load ptr, ptr %169, align 8, !tbaa !419 + %.phi.trans.insert.i = getelementptr i8, ptr %170, i64 52 %.val28.pre.i = load i32, ptr %.phi.trans.insert.i, align 4 br label %172 -172: ; preds = %166, %163 - %.val28.i = phi i32 [ %.val28.pre.i, %166 ], [ %152, %163 ] - %173 = phi ptr [ %171, %166 ], [ %.sroa.052.083.i, %163 ] +172: ; preds = %165, %161 + %.val28.i = phi i32 [ %.val28.pre.i, %165 ], [ %152, %161 ] + %173 = phi ptr [ %170, %165 ], [ %.sroa.052.083.i, %161 ] %.sroa.03.0.copyload.i = load i64, ptr %4, align 8 %.val.i = load ptr, ptr %5, align 8, !tbaa !748 %174 = getelementptr i8, ptr %173, i64 56 @@ -12721,21 +12721,23 @@ _ZSt16stable_partitionIPPKN4llvm8coverage13CountedRegionEZN12_GLOBAL__N_114Segme br label %206 185: ; preds = %150 - br i1 %162, label %.critedge.i11, label %186 - -186: ; preds = %185 - %187 = getelementptr inbounds nuw %"struct.llvm::coverage::CountedRegion", ptr %1, i64 %161 - %188 = getelementptr inbounds nuw i8, ptr %187, i64 36 - %189 = load i64, ptr %188, align 4 - %.sroa.038.0.extract.trunc.i = trunc i64 %189 to i32 - %.sroa.5.0.extract.shift.i = lshr i64 %189, 32 + %185 = add nuw nsw i64 %.sroa.7.084.i, 1 + %186 = icmp eq i64 %185, %70 + br i1 %186, label %.critedge.i11, label %187 + +187: ; preds = %184 + %188 = getelementptr inbounds nuw %"struct.llvm::coverage::CountedRegion", ptr %1, i64 %185 + %189 = getelementptr inbounds nuw i8, ptr %188, i64 36 + %190 = load i64, ptr %189, align 4 + %.sroa.038.0.extract.trunc.i = trunc i64 %190 to i32 + %.sroa.5.0.extract.shift.i = lshr i64 %190, 32 %.sroa.5.0.extract.trunc.i = trunc nuw i64 %.sroa.5.0.extract.shift.i to i32 %190 = icmp ne i32 %156, %.sroa.038.0.extract.trunc.i %191 = icmp ne i32 %158, %.sroa.5.0.extract.trunc.i %.not3.i.i = select i1 %190, i1 true, i1 %191 br i1 %.not3.i.i, label %.critedge.i11, label %193 -.critedge.i11: ; preds = %186, %185 +.critedge.i11: ; preds = %187, %185 %.sroa.01.0.copyload.i = load i64, ptr %4, align 8 %.val33.i = load ptr, ptr %5, align 8, !tbaa !748 %192 = getelementptr i8, ptr %.sroa.052.083.i, i64 56 @@ -12743,7 +12745,7 @@ _ZSt16stable_partitionIPPKN4llvm8coverage13CountedRegionEZN12_GLOBAL__N_114Segme call fastcc void @_ZN12_GLOBAL__N_114SegmentBuilder12startSegmentERKN4llvm8coverage13CountedRegionESt4pairIjjEbb(ptr %.val33.i, i32 %152, i64 %.val35.i, i64 %.sroa.01.0.copyload.i, i1 noundef zeroext %153, i1 noundef zeroext false) br label %193 -193: ; preds = %.critedge.i11, %186 +193: ; preds = %.critedge.i11, %187 %194 = load i32, ptr %8, align 8, !tbaa !47 %195 = load i32, ptr %9, align 4, !tbaa !49 %.not.i.i.not.i.i = icmp ult i32 %194, %195 @@ -12757,7 +12759,7 @@ _ZSt16stable_partitionIPPKN4llvm8coverage13CountedRegionEZN12_GLOBAL__N_114Segme br label %_ZN4llvm23SmallVectorTemplateBaseIPKNS_8coverage13CountedRegionELb1EE9push_backES4_.exit.i _ZN4llvm23SmallVectorTemplateBaseIPKNS_8coverage13CountedRegionELb1EE9push_backES4_.exit.i: ; preds = %196, %193 - %199 = phi i32 [ %194, %193 ], [ %.pre.i.i, %196 ] + %199 = phi i32 [ %194, %194 ], [ %.pre.i.i, %197 ] %200 = load ptr, ptr %6, align 8, !tbaa !50 %201 = zext i32 %199 to i64 %202 = getelementptr inbounds nuw ptr, ptr %200, i64 %201 @@ -12770,8 +12772,9 @@ _ZN4llvm23SmallVectorTemplateBaseIPKNS_8coverage13CountedRegionELb1EE9push_backE 206: ; preds = %_ZN4llvm23SmallVectorTemplateBaseIPKNS_8coverage13CountedRegionELb1EE9push_backES4_.exit.i, %177, %175, %172 call void @llvm.lifetime.end.p0(ptr nonnull %4) - %207 = getelementptr inbounds nuw i8, ptr %.sroa.052.083.i, i64 80 - %.not71.i = icmp eq ptr %207, %71 + %208 = add nuw nsw i64 %.sroa.7.084.i, 1 + %209 = getelementptr inbounds nuw i8, ptr %.sroa.052.083.i, i64 80 + %.not71.i = icmp eq ptr %209, %71 br i1 %.not71.i, label %._crit_edge.i10, label %74 208: ; preds = %._crit_edge.i10 diff --git a/bench/llvm/optimized/IVDescriptors.ll b/bench/llvm/optimized/IVDescriptors.ll index 91974794cf0..43223b7b3c3 100644 --- a/bench/llvm/optimized/IVDescriptors.ll +++ b/bench/llvm/optimized/IVDescriptors.ll @@ -5396,8 +5396,9 @@ _ZN4llvm19SelectPatternResult10isMinOrMaxENS_19SelectPatternFlavorE.exit.i: ; pr "_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_0clEPNS_11InstructionE.exit": ; preds = %.lr.ph.i, %99, %93, %.lr.ph.i.us, %87 %102 = phi ptr [ null, %87 ], [ null, %93 ], [ %90, %.lr.ph.i.us ], [ null, %99 ], [ %97, %.lr.ph.i ] - %.not4092 = icmp eq ptr %102, %.134 - br i1 %.not4092, label %._crit_edge, label %.lr.ph + %invariant.op = add nuw nsw i32 %.0.i.i, 29 + %.not4093 = icmp eq ptr %102, %.134 + br i1 %.not4093, label %._crit_edge, label %.lr.ph .lr.ph: ; preds = %"_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_0clEPNS_11InstructionE.exit", %"_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_0clEPNS_11InstructionE.exit69" %.093 = phi ptr [ %157, %"_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_0clEPNS_11InstructionE.exit69" ], [ %102, %"_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_0clEPNS_11InstructionE.exit" ] @@ -5460,8 +5461,7 @@ _ZN4llvm20RecurrenceDescriptor18isFMulAddIntrinsicEPNS_11InstructionE.exit.i58: "_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_1clEPNS_11InstructionE.exit62": ; preds = %106, %109, %112, %_ZN4llvm16dyn_cast_or_nullINS_8FunctionENS_5ValueEEEDaPT0_.exit.i.i.i.i.i.i.i.i.i.i.i.i55, %_ZN4llvm3isaINS_13IntrinsicInstEPNS_11InstructionEEEbRKT0_.exit.i.i56 %.old80 = zext i8 %107 to i32 - %.old81 = add nsw i32 %.old80, -29 - %.old82 = icmp eq i32 %.old81, %.0.i.i + %.old82 = icmp eq i32 %invariant.op, %.old80 br i1 %.old82, label %"_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_1clEPNS_11InstructionE.exit62.thread", label %.loopexit "_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_1clEPNS_11InstructionE.exit62.thread": ; preds = %104, %_ZN4llvm20RecurrenceDescriptor18isFMulAddIntrinsicEPNS_11InstructionE.exit.i58, %"_ZZNK4llvm20RecurrenceDescriptor19getReductionOpChainEPNS_7PHINodeEPNS_4LoopEENK3$_1clEPNS_11InstructionE.exit62" diff --git a/bench/llvm/optimized/SemaTemplateDeduction.ll b/bench/llvm/optimized/SemaTemplateDeduction.ll index 78631801454..90209c49752 100644 --- a/bench/llvm/optimized/SemaTemplateDeduction.ll +++ b/bench/llvm/optimized/SemaTemplateDeduction.ll @@ -7141,6 +7141,7 @@ _ZN4llvm15SmallVectorImplIN5clang23DeducedTemplateArgumentEE6resizeEm.exit: ; pr br i1 %.not150298, label %.thread238, label %.lr.ph302 .lr.ph302: ; preds = %_ZN4llvm15SmallVectorImplIN5clang23DeducedTemplateArgumentEE6resizeEm.exit + %invariant.op = add i32 %167, -1 %168 = getelementptr inbounds nuw i8, ptr %32, i64 44 %169 = getelementptr inbounds nuw i8, ptr %32, i64 36 %170 = getelementptr inbounds nuw i8, ptr %32, i64 38 @@ -7150,8 +7151,9 @@ _ZN4llvm15SmallVectorImplIN5clang23DeducedTemplateArgumentEE6resizeEm.exit: ; pr %174 = getelementptr inbounds nuw i8, ptr %32, i64 32 %175 = getelementptr inbounds nuw i8, ptr %32, i64 24 %176 = getelementptr inbounds nuw i8, ptr %32, i64 64 - %177 = zext i32 %167 to i64 - br label %178 + %177 = zext i32 %invariant.op to i64 + %178 = zext i32 %167 to i64 + br label %179 178: ; preds = %.lr.ph302, %.thread232 %indvars.iv321 = phi i64 [ 0, %.lr.ph302 ], [ %indvars.iv.next322, %.thread232 ] @@ -7193,7 +7195,7 @@ _ZN4llvm15SmallVectorImplIN5clang23DeducedTemplateArgumentEE6resizeEm.exit: ; pr br label %_ZN4llvm23SmallVectorTemplateBaseIN5clang8QualTypeELb1EE9push_backES2_.exit179 _ZN4llvm23SmallVectorTemplateBaseIN5clang8QualTypeELb1EE9push_backES2_.exit179: ; preds = %192, %195 - %198 = phi i32 [ %193, %192 ], [ %.pre.i178, %195 ] + %198 = phi i32 [ %193, %193 ], [ %.pre.i178, %196 ] %199 = load ptr, ptr %31, align 8, !tbaa !722 %200 = zext i32 %198 to i64 %201 = getelementptr inbounds nuw %"class.clang::QualType", ptr %199, i64 %200 @@ -7220,9 +7222,8 @@ _ZN4llvm23SmallVectorTemplateBaseIN5clang8QualTypeELb1EE9push_backES2_.exit179: br i1 %.not153, label %.thread232, label %.thread242 210: ; preds = %178 - %211 = add nuw nsw i64 %indvars.iv321, 1 - %212 = icmp eq i64 %211, %177 - %213 = getelementptr inbounds nuw i8, ptr %184, i64 32 + %212 = icmp eq i64 %indvars.iv321, %177 + %213 = getelementptr inbounds nuw i8, ptr %185, i64 32 %.sroa.0.0.copyload.i180 = load i64, ptr %213, align 16, !tbaa !12 call void @llvm.lifetime.start.p0(ptr nonnull %32) %214 = load ptr, ptr %23, align 8, !tbaa !1128 @@ -7584,10 +7585,10 @@ _ZN4llvm23SmallVectorTemplateBaseIN5clang11DeducedPackELb0EE13destroy_rangeEPS2_ ] .thread232: ; preds = %207, %205, %352, %352 - %.9237 = phi i32 [ %.14, %352 ], [ %.14, %352 ], [ %.7301, %205 ], [ %.7301, %207 ] - %.1129236 = phi i32 [ %.3131, %352 ], [ %.3131, %352 ], [ %.0128299, %205 ], [ %208, %207 ] + %.9237 = phi i32 [ %.14, %352 ], [ %.14, %352 ], [ %.7301, %206 ], [ %.7301, %208 ] + %.1129236 = phi i32 [ %.3131, %352 ], [ %.3131, %352 ], [ %.0128299, %206 ], [ %208, %208 ] %indvars.iv.next322 = add nuw nsw i64 %indvars.iv321, 1 - %.not150 = icmp eq i64 %indvars.iv.next322, %177 + %.not150 = icmp eq i64 %indvars.iv.next322, %178 br i1 %.not150, label %.thread238, label %178, !llvm.loop !1158 .thread238: ; preds = %188, %.thread232, %_ZN4llvm15SmallVectorImplIN5clang23DeducedTemplateArgumentEE6resizeEm.exit @@ -7633,7 +7634,7 @@ _ZN4llvm23SmallVectorTemplateBaseIN5clang11DeducedPackELb0EE13destroy_rangeEPS2_ br label %.thread242 .thread242: ; preds = %205, %207, %204, %352, %.thread238 - %.23 = phi i32 [ %369, %.thread238 ], [ 13, %204 ], [ %209, %207 ], [ %206, %205 ], [ %.14, %352 ] + %.23 = phi i32 [ %369, %.thread238 ], [ 13, %205 ], [ %209, %208 ], [ %206, %206 ], [ %.14, %352 ] %370 = load ptr, ptr %31, align 8, !tbaa !722 %371 = icmp eq ptr %370, %164 br i1 %371, label %_ZN4llvm11SmallVectorIN5clang8QualTypeELj8EED2Ev.exit, label %372 diff --git a/bench/lodepng/optimized/pngdetail.ll b/bench/lodepng/optimized/pngdetail.ll index 3febccf7ea8..7538e189fe7 100644 --- a/bench/lodepng/optimized/pngdetail.ll +++ b/bench/lodepng/optimized/pngdetail.ll @@ -10968,6 +10968,7 @@ declare noundef i32 @printf(ptr noundef readonly captures(none), ...) local_unna ; Function Attrs: mustprogress uwtable define void @_Z7showHexPKhmRK7Options(ptr noundef readonly captures(none) %0, i64 noundef %1, ptr noundef nonnull readonly align 4 captures(none) dereferenceable(37) %2) local_unnamed_addr #3 { + %invariant.op = add i64 %1, -1 %.not29 = icmp eq i64 %1, 0 br i1 %.not29, label %._crit_edge, label %.lr.ph @@ -10982,7 +10983,7 @@ define void @_Z7showHexPKhmRK7Options(ptr noundef readonly captures(none) %0, i6 br i1 %.not, label %62, label %42 7: ; preds = %.lr.ph, %41 - %.028 = phi i64 [ 0, %.lr.ph ], [ %.pre-phi, %41 ] + %.028 = phi i64 [ 0, %.lr.ph ], [ %41, %40 ] %8 = getelementptr inbounds nuw i8, ptr %0, i64 %.028 %9 = load i8, ptr %8, align 1, !tbaa !32 %10 = load i32, ptr %4, align 4, !tbaa !223 @@ -10992,8 +10993,7 @@ define void @_Z7showHexPKhmRK7Options(ptr noundef readonly captures(none) %0, i6 13: ; preds = %7 %putchar = tail call i32 @putchar(i32 %12) - %.pre = add nuw i64 %.028, 1 - br label %41 + br label %40 14: ; preds = %7 %15 = add i8 %9, -33 @@ -11004,8 +11004,7 @@ define void @_Z7showHexPKhmRK7Options(ptr noundef readonly captures(none) %0, i6 %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.120..str.121, i32 noundef %12) %18 = and i64 %.028, 31 %19 = icmp ne i64 %18, 31 - %20 = add nuw i64 %.028, 1 - %.not20 = icmp eq i64 %20, %1 + %.not20 = icmp eq i64 %.028, %invariant.op %or.cond22 = or i1 %19, %.not20 br i1 %or.cond22, label %41, label %21 @@ -11039,18 +11038,18 @@ _ZSt13__check_facetISt5ctypeIcEERKT_PS3_.exit.i.i: ; preds = %21 %35 = load ptr, ptr %27, align 8, !tbaa !3 %36 = getelementptr inbounds nuw i8, ptr %35, i64 48 %37 = load ptr, ptr %36, align 8 - %38 = tail call noundef signext i8 %37(ptr noundef nonnull align 8 dereferenceable(570) %27, i8 noundef signext 10) + %38 = tail call noundef signext i8 %36(ptr noundef nonnull align 8 dereferenceable(570) %27, i8 noundef signext 10) br label %_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_.exit _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_.exit: ; preds = %31, %34 - %.0.i.i.i = phi i8 [ %33, %31 ], [ %38, %34 ] + %.0.i.i.i = phi i8 [ %33, %30 ], [ %38, %33 ] %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo3putEc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %.0.i.i.i) %40 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSo5flushEv(ptr noundef nonnull align 8 dereferenceable(8) %39) br label %41 41: ; preds = %14, %_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_.exit, %13 - %.pre-phi = phi i64 [ %20, %14 ], [ %20, %_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_.exit ], [ %.pre, %13 ] - %exitcond.not = icmp eq i64 %.pre-phi, %1 + %41 = add nuw i64 %.028, 1 + %exitcond.not = icmp eq i64 %41, %1 br i1 %exitcond.not, label %._crit_edge, label %7, !llvm.loop !224 42: ; preds = %._crit_edge diff --git a/bench/luau/optimized/BytecodeBuilder.ll b/bench/luau/optimized/BytecodeBuilder.ll index 551e75146c8..917ff513d68 100644 --- a/bench/luau/optimized/BytecodeBuilder.ll +++ b/bench/luau/optimized/BytecodeBuilder.ll @@ -10545,9 +10545,9 @@ define dso_local void @_ZNK4Luau15BytecodeBuilder12dumpTypeInfoB5cxx11Ev(ptr dea br i1 %.not34, label %._crit_edge33, label %.lr.ph32 .lr.ph32: ; preds = %2, %39 - %8 = phi ptr [ %40, %39 ], [ %7, %2 ] - %9 = phi ptr [ %41, %39 ], [ %6, %2 ] - %.030 = phi i64 [ %42, %39 ], [ 0, %2 ] + %8 = phi ptr [ %40, %38 ], [ %7, %2 ] + %9 = phi ptr [ %41, %38 ], [ %6, %2 ] + %.030 = phi i64 [ %42, %38 ], [ 0, %2 ] %10 = getelementptr inbounds nuw %"struct.Luau::BytecodeBuilder::Function", ptr %8, i64 %.030 %11 = getelementptr inbounds nuw i8, ptr %10, i64 136 %12 = getelementptr inbounds nuw i8, ptr %10, i64 144 @@ -10564,6 +10564,7 @@ define dso_local void @_ZNK4Luau15BytecodeBuilder12dumpTypeInfoB5cxx11Ev(ptr dea %18 = getelementptr inbounds nuw i8, ptr %17, i64 1 %19 = load i8, ptr %18, align 1, !tbaa !128 %20 = zext i8 %19 to i32 + %invariant.op = add nsw i32 %20, -1 %.not35 = icmp eq i8 %19, 0 br i1 %.not35, label %._crit_edge, label %.lr.ph.preheader @@ -10586,8 +10587,8 @@ define dso_local void @_ZNK4Luau15BytecodeBuilder12dumpTypeInfoB5cxx11Ev(ptr dea br label %50 .lr.ph: ; preds = %.lr.ph.preheader, %37 - %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %37 ] - %23 = phi i32 [ 0, %.lr.ph.preheader ], [ %38, %37 ] + %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %36 ] + %23 = phi i32 [ 0, %.lr.ph.preheader ], [ %38, %36 ] %24 = load ptr, ptr %11, align 8, !tbaa !143 %25 = getelementptr inbounds nuw i8, ptr %24, i64 %indvars.iv %26 = getelementptr inbounds nuw i8, ptr %25, i64 2 @@ -10610,13 +10611,12 @@ _ZN4LuauL17getBaseTypeStringEh.exit: ; preds = %.lr.ph, %switch.loo to label %32 unwind label %35 32: ; preds = %_ZN4LuauL17getBaseTypeStringEh.exit - %33 = add nuw nsw i32 %23, 1 - %.not26 = icmp eq i32 %33, %20 - br i1 %.not26, label %37, label %34 + %.not26 = icmp eq i32 %23, %invariant.op + br i1 %.not26, label %36, label %33 34: ; preds = %32 invoke void (ptr, ptr, ...) @_ZN4Luau12formatAppendERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKcz(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.118) - to label %37 unwind label %35 + to label %36 unwind label %35 35: ; preds = %34, %_ZN4LuauL17getBaseTypeStringEh.exit %36 = landingpad { ptr, i32 } @@ -10646,7 +10646,7 @@ _ZN4LuauL17getBaseTypeStringEh.exit: ; preds = %.lr.ph, %switch.loo br label %50 50: ; preds = %35, %48, %21 - %.pn.pn = phi { ptr, i32 } [ %22, %21 ], [ %36, %35 ], [ %49, %48 ] + %.pn.pn = phi { ptr, i32 } [ %22, %21 ], [ %36, %34 ], [ %49, %47 ] %51 = load ptr, ptr %0, align 8, !tbaa !143 %52 = icmp eq ptr %51, %3 br i1 %52, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i diff --git a/bench/luau/optimized/ltable.ll b/bench/luau/optimized/ltable.ll index b20ad1b2fa8..89372c86d87 100644 --- a/bench/luau/optimized/ltable.ll +++ b/bench/luau/optimized/ltable.ll @@ -262,7 +262,11 @@ define internal fastcc noundef i32 @_ZL11adjustasizeP8LuaTableiPK10lua_TValue(pt %23 = getelementptr inbounds nuw i8, ptr %0, i64 8 %24 = getelementptr i8, ptr %0, i64 6 %25 = getelementptr inbounds nuw i8, ptr %0, i64 24 - br i1 %.fr, label %.split.us, label %.critedge + br i1 %.fr, label %.split.us, label %.critedge.preheader + +.critedge.preheader: ; preds = %21 + %invariant.op = add i32 %22, -1 + br label %.critedge .split.us: ; preds = %21 %26 = sext i32 %1 to i64 @@ -376,11 +380,10 @@ _Z11luaH_getnumP8LuaTablei.exit.us: ; preds = %70, %74, %80 .split.us.split.backedge: ; preds = %_Z11luaH_getnumP8LuaTablei.exit.us, %.split.us.split br label %.split.us.split, !llvm.loop !27 -.critedge: ; preds = %21, %.critedge - %.0 = phi i32 [ %22, %.critedge ], [ %1, %21 ] - %85 = add nsw i32 %.0, 1 - %86 = icmp eq i32 %85, %22 - br i1 %86, label %.critedge, label %.critedge2, !llvm.loop !27 +.critedge: ; preds = %.critedge.preheader, %.critedge + %.0 = phi i32 [ %22, %.critedge ], [ %1, %.critedge.preheader ] + %85 = icmp eq i32 %.0, %invariant.op + br i1 %85, label %.critedge, label %.critedge2, !llvm.loop !27 .critedge2: ; preds = %.critedge, %_Z11luaH_getnumP8LuaTablei.exit.us, %_Z11luaH_getnumP8LuaTablei.exit.us.us %.us-phi = phi i32 [ %42, %_Z11luaH_getnumP8LuaTablei.exit.us ], [ %31, %_Z11luaH_getnumP8LuaTablei.exit.us.us ], [ %.0, %.critedge ] diff --git a/bench/lvgl/optimized/lv_label.ll b/bench/lvgl/optimized/lv_label.ll index a9069e456d4..ed3188f5910 100644 --- a/bench/lvgl/optimized/lv_label.ll +++ b/bench/lvgl/optimized/lv_label.ll @@ -2130,8 +2130,8 @@ calculate_x_coordinate.exit: ; preds = %84, %89, %.loopexit br label %95 95: ; preds = %.lr.ph131, %122 - %.079130 = phi i32 [ 0, %.lr.ph131 ], [ %.180, %122 ] - %.0105129 = phi i32 [ %.2107, %.lr.ph131 ], [ %.1106, %122 ] + %.079130 = phi i32 [ 0, %.lr.ph131 ], [ %.180, %121 ] + %.0105129 = phi i32 [ %.2107, %.lr.ph131 ], [ %.1106, %121 ] call void @llvm.lifetime.start.p0(ptr nonnull %8) call void @llvm.lifetime.start.p0(ptr nonnull %9) call void @lv_text_encoded_letter_next_2(ptr noundef nonnull %80, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %7) #7 @@ -2148,8 +2148,7 @@ calculate_x_coordinate.exit: ; preds = %84, %89, %.loopexit ._crit_edge: ; preds = %96 %.pre = load i32, ptr %7, align 4, !tbaa !48 - %.pre136 = add i32 %.pre, %.076121 - br label %122, !llvm.loop !69 + br label %121, !llvm.loop !69 103: ; preds = %96, %95 %104 = load i32, ptr %8, align 4, !tbaa !48 @@ -2162,40 +2161,39 @@ calculate_x_coordinate.exit: ; preds = %84, %89, %.loopexit 110: ; preds = %103 %111 = load i32, ptr %7, align 4, !tbaa !48 - %112 = add i32 %111, %.076121 - %113 = icmp eq i32 %112, %.177 - br i1 %113, label %.thread112, label %114 - -114: ; preds = %110 - %115 = add i32 %.079130, %.076121 - %116 = zext i32 %115 to i64 - %117 = getelementptr inbounds nuw i8, ptr %21, i64 %116 - %118 = load i8, ptr %117, align 1, !tbaa !25 - %119 = icmp eq i8 %118, 0 - br i1 %119, label %.thread112, label %120 - -.thread112: ; preds = %103, %110, %114 + %112 = icmp eq i32 %111, %83 + br i1 %112, label %.thread112, label %113 + +113: ; preds = %110 + %114 = add i32 %.079130, %.076121 + %115 = zext i32 %114 to i64 + %116 = getelementptr inbounds nuw i8, ptr %21, i64 %115 + %117 = load i8, ptr %116, align 1, !tbaa !25 + %118 = icmp eq i8 %117, 0 + br i1 %118, label %.thread112, label %120 + +.thread112: ; preds = %103, %110, %113 store i32 %.079130, ptr %7, align 4, !tbaa !48 call void @llvm.lifetime.end.p0(ptr nonnull %9) call void @llvm.lifetime.end.p0(ptr nonnull %8) br label %.loopexit -120: ; preds = %114 +120: ; preds = %113 %121 = add nsw i32 %108, %.sroa.0.0.extract.trunc.i103 br label %122 122: ; preds = %._crit_edge, %120 - %.pre-phi = phi i32 [ %.pre136, %._crit_edge ], [ %112, %120 ] - %123 = phi i32 [ %.pre, %._crit_edge ], [ %111, %120 ] - %.1106 = phi i32 [ %.0105129, %._crit_edge ], [ %121, %120 ] - %.180 = phi i32 [ %.079130, %._crit_edge ], [ %111, %120 ] + %.pre-phi = phi i32 [ %.pre, %._crit_edge ], [ %111, %119 ] + %123 = phi i32 [ %.0105129, %._crit_edge ], [ %121, %119 ] + %.1106 = phi i32 [ %.079130, %._crit_edge ], [ %111, %119 ] call void @llvm.lifetime.end.p0(ptr nonnull %9) call void @llvm.lifetime.end.p0(ptr nonnull %8) - %124 = icmp ult i32 %.pre-phi, %.177 + %123 = add i32 %.pre-phi, %.076121 + %124 = icmp ult i32 %123, %.177 br i1 %124, label %95, label %.loopexit .loopexit: ; preds = %122, %.thread112, %calculate_x_coordinate.exit - %125 = phi i32 [ 0, %calculate_x_coordinate.exit ], [ %.079130, %.thread112 ], [ %123, %122 ] + %125 = phi i32 [ 0, %calculate_x_coordinate.exit ], [ %.079130, %.thread112 ], [ %122, %121 ] %126 = load ptr, ptr @lv_text_encoded_get_char_id, align 8, !tbaa !67 %127 = call i32 %126(ptr noundef nonnull %80, i32 noundef %125) #7 %128 = call i32 %126(ptr noundef nonnull %21, i32 noundef %.076121) #7 diff --git a/bench/minetest/optimized/mapgen.ll b/bench/minetest/optimized/mapgen.ll index 284cc3a9997..dba3ba74c63 100644 --- a/bench/minetest/optimized/mapgen.ll +++ b/bench/minetest/optimized/mapgen.ll @@ -3281,6 +3281,7 @@ for.body.lr.ph.split.split: ; preds = %for.body.lr.ph.spli %xtraiter = and i32 %12, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 %14 = icmp ult i32 %13, 3 + %invariant.op = add nsw i32 %conv32, -3 br i1 %14, label %for.body.lr.ph.split.split.split.us, label %for.body.lr.ph.split.split.split for.body.lr.ph.split.split.split.us: ; preds = %for.body.lr.ph.split.split @@ -3368,7 +3369,6 @@ for.body35.us.us: ; preds = %for.body35.us.us, % %param1.2.split.us.us = getelementptr inbounds nuw %struct.MapNode, ptr %11, i64 %idxprom.2.us.us %param1.2.us.us = getelementptr inbounds nuw i8, ptr %param1.2.split.us.us, i64 2 store i8 %light, ptr %param1.2.us.us, align 2, !tbaa !170 - %inc.2.us.us = add nsw i32 %x.083.us.us, 3 %inc37.2.us.us = add i32 %i.082.us.us, 3 %idxprom.3.us.us = zext i32 %inc37.2.us.us to i64 %param1.3.split.us.us = getelementptr inbounds nuw %struct.MapNode, ptr %11, i64 %idxprom.3.us.us @@ -3376,7 +3376,7 @@ for.body35.us.us: ; preds = %for.body35.us.us, % store i8 %light, ptr %param1.3.us.us, align 2, !tbaa !170 %inc.3.us.us = add nsw i32 %x.083.us.us, 4 %inc37.3.us.us = add i32 %i.082.us.us, 4 - %exitcond.not.3.us.us = icmp eq i32 %inc.2.us.us, %conv32 + %exitcond.not.3.us.us = icmp eq i32 %x.083.us.us, %invariant.op br i1 %exitcond.not.3.us.us, label %for.cond29.for.cond.cleanup34_crit_edge.loopexit.us.us, label %for.body35.us.us, !llvm.loop !175 for.cond29.for.cond.cleanup34_crit_edge.loopexit.us.us: ; preds = %for.body35.us.us @@ -3467,7 +3467,6 @@ for.body35: ; preds = %for.body35.prol, %f %param1.2.split = getelementptr inbounds nuw %struct.MapNode, ptr %11, i64 %idxprom.2 %param1.2 = getelementptr inbounds nuw i8, ptr %param1.2.split, i64 2 store i8 %light, ptr %param1.2, align 2, !tbaa !170 - %inc.2 = add nsw i32 %x.083, 3 %inc37.2 = add i32 %i.082, 3 %idxprom.3 = zext i32 %inc37.2 to i64 %param1.3.split = getelementptr inbounds nuw %struct.MapNode, ptr %11, i64 %idxprom.3 @@ -3475,7 +3474,7 @@ for.body35: ; preds = %for.body35.prol, %f store i8 %light, ptr %param1.3, align 2, !tbaa !170 %inc.3 = add nsw i32 %x.083, 4 %inc37.3 = add i32 %i.082, 4 - %exitcond.not.3 = icmp eq i32 %inc.2, %conv32 + %exitcond.not.3 = icmp eq i32 %x.083, %invariant.op br i1 %exitcond.not.3, label %for.cond29.for.cond.cleanup34_crit_edge.loopexit, label %for.body35, !llvm.loop !175 } diff --git a/bench/minetest/optimized/string.ll b/bench/minetest/optimized/string.ll index f1633a45637..1416174896d 100644 --- a/bench/minetest/optimized/string.ll +++ b/bench/minetest/optimized/string.ll @@ -6235,9 +6235,7 @@ if.else: ; preds = %for.body57 if.then66: ; preds = %if.else %call.i.i.i142 = call ptr @wmemchr(ptr noundef nonnull @.str.210, i32 noundef signext %45, i64 noundef 10) #33 %tobool.not.i.i = icmp eq ptr %call.i.i.i142, null - %sub.ptr.lhs.cast.i.i = ptrtoint ptr %call.i.i.i142 to i64 - %sub.ptr.sub.i.i = sub i64 %sub.ptr.lhs.cast.i.i, ptrtoint (ptr @.str.210 to i64) - %cmp70158 = icmp eq i64 %sub.ptr.sub.i.i, -4 + %cmp70158 = icmp eq ptr %call.i.i.i142, inttoptr (i64 add (i64 ptrtoint (ptr @.str.210 to i64), i64 -4) to ptr) %cmp70 = or i1 %tobool.not.i.i, %cmp70158 br i1 %cmp70, label %if.end76, label %if.then73 diff --git a/bench/minetest/optimized/voxelalgorithms.ll b/bench/minetest/optimized/voxelalgorithms.ll index 36df255675a..7bcf9390307 100644 --- a/bench/minetest/optimized/voxelalgorithms.ll +++ b/bench/minetest/optimized/voxelalgorithms.ll @@ -298,6 +298,7 @@ while.body: ; preds = %if.end.i, %while.co %inc26.i = add i16 %neighbor_block_pos.sroa.18.0.extract.trunc, 1 %inc15.i = add i16 %neighbor_block_pos.sroa.12.0.extract.trunc, 1 %inc5.i = add i16 %neighbor_block_pos.sroa.0.0.extract.trunc, 1 + %invariant.op = sub nsw i32 5, %conv5 br label %for.body for.cond.cleanup: ; preds = %for.inc @@ -312,8 +313,7 @@ for.body: ; preds = %for.inc, %while.bod %source_dir.0331 = phi i8 [ 6, %while.body ], [ %source_dir.3, %for.inc ] %brightest_neighbor_light.0330 = phi i8 [ %narrow, %while.body ], [ %brightest_neighbor_light.3, %for.inc ] %indvars333 = trunc i32 %indvars.iv to i8 - %add7 = add nuw nsw i32 %indvars.iv, %conv5 - %cmp8 = icmp eq i32 %add7, 5 + %cmp8 = icmp eq i32 %indvars.iv, %invariant.op br i1 %cmp8, label %for.inc, label %if.end if.end: ; preds = %for.body @@ -960,13 +960,13 @@ while.body: ; preds = %if.end.i, %while.co %arrayidx.i98 = getelementptr inbounds nuw %"class.std::vector", ptr %light_sources, i64 %idxprom.i97 %_M_finish.i.i99 = getelementptr inbounds nuw i8, ptr %arrayidx.i98, i64 8 %_M_end_of_storage.i.i = getelementptr inbounds nuw i8, ptr %arrayidx.i98, i64 16 + %invariant.op = sub nsw i32 5, %conv1 br label %for.body for.body: ; preds = %for.inc, %while.body %indvars.iv = phi i32 [ 0, %while.body ], [ %indvars.iv.next, %for.inc ] %indvars167 = trunc i32 %indvars.iv to i8 - %add = add nuw nsw i32 %indvars.iv, %conv1 - %cmp3 = icmp eq i32 %add, 5 + %cmp3 = icmp eq i32 %indvars.iv, %invariant.op br i1 %cmp3, label %for.inc, label %if.end if.end: ; preds = %for.body diff --git a/bench/mitsuba3/optimized/jitallocator.ll b/bench/mitsuba3/optimized/jitallocator.ll index c37c8b08470..d323a0fdbdc 100644 --- a/bench/mitsuba3/optimized/jitallocator.ll +++ b/bench/mitsuba3/optimized/jitallocator.ll @@ -321,15 +321,19 @@ define dso_local void @_ZN6asmjit9_abi_1_1012JitAllocator5resetENS0_11ResetPolic %117 = icmp ult i64 %112, %80 br i1 %117, label %.preheader, label %.loopexit16 -118: ; preds = %133 - %119 = add nuw nsw i64 %121, 64 +118: ; preds = %116 + %119 = add i64 %108, -1 + br label %121 + +118: ; preds = %134 + %119 = add nuw nsw i64 %122, 64 %120 = icmp ult i64 %119, %80 br i1 %120, label %.preheader, label %.loopexit16, !llvm.loop !54 -.preheader: ; preds = %116, %118 - %121 = phi i64 [ %119, %118 ], [ %112, %116 ] - %122 = phi i64 [ %121, %118 ], [ %105, %116 ] - %123 = phi ptr [ %124, %118 ], [ %106, %116 ] +.preheader: ; preds = %118, %118 + %121 = phi i64 [ %119, %118 ], [ %112, %.preheader ] + %122 = phi i64 [ %121, %118 ], [ %105, %.preheader ] + %123 = phi ptr [ %124, %118 ], [ %106, %.preheader ] %124 = getelementptr inbounds nuw i8, ptr %123, i64 8 %125 = load i64, ptr %124, align 8, !tbaa !51 %126 = icmp eq i64 %125, 0 @@ -346,8 +350,7 @@ define dso_local void @_ZN6asmjit9_abi_1_1012JitAllocator5resetENS0_11ResetPolic 133: ; preds = %.preheader %134 = add i64 %122, 128 %135 = call noundef i64 @llvm.umin.i64(i64 %80, i64 %134) - %136 = sub i64 %135, %108 - %137 = icmp eq i64 %136, -1 + %137 = icmp eq i64 %135, %119 br i1 %137, label %.loopexit16, label %118, !llvm.loop !54 138: ; preds = %103 @@ -360,10 +363,10 @@ define dso_local void @_ZN6asmjit9_abi_1_1012JitAllocator5resetENS0_11ResetPolic br label %.loopexit16 .loopexit16: ; preds = %133, %118, %138, %127, %116, %111 - %145 = phi i64 [ %142, %138 ], [ %130, %127 ], [ %113, %111 ], [ %113, %116 ], [ %135, %118 ], [ %135, %133 ] - %146 = phi ptr [ %106, %138 ], [ %124, %127 ], [ %106, %111 ], [ %106, %116 ], [ %124, %118 ], [ %124, %133 ] - %147 = phi i64 [ %105, %138 ], [ %121, %127 ], [ %105, %111 ], [ %112, %116 ], [ %121, %133 ], [ %119, %118 ] - %148 = phi i64 [ %144, %138 ], [ %132, %127 ], [ 0, %111 ], [ 0, %116 ], [ 0, %118 ], [ 0, %133 ] + %145 = phi i64 [ %142, %138 ], [ %130, %128 ], [ %113, %111 ], [ %113, %116 ], [ %119, %134 ], [ %135, %118 ] + %146 = phi ptr [ %106, %138 ], [ %124, %128 ], [ %106, %111 ], [ %106, %116 ], [ %124, %118 ], [ %124, %134 ] + %147 = phi i64 [ %105, %138 ], [ %121, %128 ], [ %105, %111 ], [ %112, %116 ], [ %121, %134 ], [ %119, %118 ] + %148 = phi i64 [ %144, %138 ], [ %132, %128 ], [ 0, %111 ], [ 0, %116 ], [ 0, %118 ], [ 0, %134 ] %149 = mul i64 %108, %87 %150 = getelementptr inbounds i8, ptr %74, i64 %149 %151 = sub i64 %145, %108 @@ -406,7 +409,7 @@ define dso_local void @_ZN6asmjit9_abi_1_1012JitAllocator5resetENS0_11ResetPolic br label %172 172: ; preds = %.preheader75, %172 - %173 = phi i64 [ %175, %172 ], [ %.ph, %.preheader75 ] + %173 = phi i64 [ %175, %172 ], [ %.ph, %.preheader76 ] %174 = getelementptr inbounds nuw i32, ptr %150, i64 %173 store i32 %153, ptr %174, align 4, !tbaa !55 %175 = add nuw nsw i64 %173, 1 diff --git a/bench/opencv/optimized/dwt.ll b/bench/opencv/optimized/dwt.ll index d1aab0e9390..8b32a36cf31 100644 --- a/bench/opencv/optimized/dwt.ll +++ b/bench/opencv/optimized/dwt.ll @@ -4435,10 +4435,10 @@ opj_dwt_max_resolution.exit.i: ; preds = %.lr.ph.i.i br label %75 75: ; preds = %.loopexit.i, %.lr.ph350.i - %76 = phi i32 [ %36, %.lr.ph350.i ], [ %358, %.loopexit.i ] - %.0224348.i = phi ptr [ %14, %.lr.ph350.i ], [ %77, %.loopexit.i ] - %.0225347.i = phi i32 [ %18, %.lr.ph350.i ], [ %81, %.loopexit.i ] - %.0250345.i = phi i32 [ %23, %.lr.ph350.i ], [ %86, %.loopexit.i ] + %76 = phi i32 [ %36, %.lr.ph351.i ], [ %358, %.loopexit.i ] + %.0224348.i = phi ptr [ %14, %.lr.ph351.i ], [ %77, %.loopexit.i ] + %.0225347.i = phi i32 [ %18, %.lr.ph351.i ], [ %81, %.loopexit.i ] + %.0250345.i = phi i32 [ %23, %.lr.ph351.i ], [ %86, %.loopexit.i ] store i32 %.0225347.i, ptr %54, align 4, !tbaa !189, !noalias !181 store i32 %.0250345.i, ptr %55, align 4, !tbaa !189, !noalias !181 %77 = getelementptr inbounds nuw i8, ptr %.0224348.i, i64 192 @@ -4704,12 +4704,13 @@ opj_v8dwt_interleave_h.exit.i: ; preds = %.loopexit.i.i %spec.select.i = tail call i32 @llvm.umin.i32(i32 %228, i32 %33) %229 = udiv i32 %86, %spec.select.i %230 = and i32 %229, -8 + %invariant.op.i = add nsw i32 %spec.select.i, -1 %231 = and i32 %86, -8 br label %232 232: ; preds = %238, %227 - %.2231321.i = phi i32 [ 0, %227 ], [ %249, %238 ] - %.2237320.i = phi ptr [ %53, %227 ], [ %257, %238 ] + %.2231321.i = phi i32 [ 0, %227 ], [ %258, %238 ] + %.2237320.i = phi ptr [ %53, %227 ], [ %256, %238 ] %233 = tail call ptr @opj_malloc(i64 noundef 64) #16, !noalias !181 %.not267.i = icmp eq ptr %233, null br i1 %.not267.i, label %234, label %235 @@ -4750,25 +4751,26 @@ opj_v8dwt_interleave_h.exit.i: ; preds = %.loopexit.i.i store i32 %32, ptr %247, align 4, !tbaa !220, !noalias !181 %248 = getelementptr inbounds nuw i8, ptr %233, i64 48 store ptr %.2237320.i, ptr %248, align 8, !tbaa !221, !noalias !181 - %249 = add nuw nsw i32 %.2231321.i, 1 - %250 = icmp eq i32 %249, %spec.select.i - %251 = mul i32 %.2231321.i, %230 - %252 = sub i32 %231, %251 - %253 = select i1 %250, i32 %252, i32 %230 - %254 = getelementptr inbounds nuw i8, ptr %233, i64 56 - store i32 %253, ptr %254, align 8, !tbaa !222, !noalias !181 - %255 = mul i32 %253, %32 - %256 = zext i32 %255 to i64 - %257 = getelementptr inbounds nuw float, ptr %.2237320.i, i64 %256 - %258 = tail call i32 @opj_thread_pool_submit_job(ptr noundef %12, ptr noundef nonnull @opj_dwt97_decode_h_func, ptr noundef nonnull %233) #16, !noalias !181 - br i1 %250, label %259, label %232, !llvm.loop !223 + %249 = icmp eq i32 %.2231321.i, %invariant.op.i + %250 = mul i32 %.2231321.i, %230 + %251 = sub i32 %231, %250 + %252 = select i1 %249, i32 %251, i32 %230 + %253 = getelementptr inbounds nuw i8, ptr %233, i64 56 + store i32 %252, ptr %253, align 8, !tbaa !222, !noalias !181 + %254 = mul i32 %252, %32 + %255 = zext i32 %254 to i64 + %256 = getelementptr inbounds nuw float, ptr %.2237320.i, i64 %255 + %257 = tail call i32 @opj_thread_pool_submit_job(ptr noundef %12, ptr noundef nonnull @opj_dwt97_decode_h_func, ptr noundef nonnull %233) #16, !noalias !181 + %258 = add nuw nsw i32 %.2231321.i, 1 + %exitcond.not.i = icmp eq i32 %258, %spec.select.i + br i1 %exitcond.not.i, label %259, label %232, !llvm.loop !223 259: ; preds = %238 tail call void @opj_thread_pool_wait_completion(ptr noundef %12, i32 noundef 0) #16, !noalias !181 br label %.loopexit313.i .loopexit313.i: ; preds = %._crit_edge.i, %259, %.preheader312.i - %.1236.i = phi ptr [ %257, %259 ], [ %53, %.preheader312.i ], [ %223, %._crit_edge.i ] + %.1236.i = phi ptr [ %256, %259 ], [ %53, %.preheader312.i ], [ %223, %._crit_edge.i ] %.1230.i = phi i32 [ %231, %259 ], [ 0, %.preheader312.i ], [ %224, %._crit_edge.i ] %260 = icmp ult i32 %.1230.i, %86 br i1 %260, label %261, label %.loopexit311.i @@ -4840,8 +4842,8 @@ opj_v8dwt_interleave_h.exit.i: ; preds = %.loopexit.i.i br label %278 278: ; preds = %._crit_edge337.i, %.lr.ph340.i - %.4233339.i = phi i32 [ %81, %.lr.ph340.i ], [ %294, %._crit_edge337.i ] - %.5240338.i = phi ptr [ %53, %.lr.ph340.i ], [ %293, %._crit_edge337.i ] + %.4233339.i = phi i32 [ %81, %.lr.ph341.i ], [ %294, %._crit_edge338.i ] + %.5240338.i = phi ptr [ %53, %.lr.ph341.i ], [ %293, %._crit_edge338.i ] br i1 %.not305.i, label %._crit_edge.i.i, label %.lr.ph.i281.i .lr.ph.i281.i: ; preds = %278, %.lr.ph.i281.i @@ -4877,7 +4879,7 @@ opj_v8dwt_interleave_v.exit.i: ; preds = %.lr.ph29.i.i, %._cr br i1 %.not356.i, label %._crit_edge337.i, label %.lr.ph336.i .lr.ph336.i: ; preds = %opj_v8dwt_interleave_v.exit.i, %.lr.ph336.i - %indvars.iv389.i = phi i64 [ %indvars.iv.next390.i, %.lr.ph336.i ], [ 0, %opj_v8dwt_interleave_v.exit.i ] + %indvars.iv389.i = phi i64 [ %indvars.iv.next390.i, %.lr.ph337.i ], [ 0, %opj_v8dwt_interleave_v.exit.i ] %290 = mul nuw i64 %indvars.iv389.i, %64 %291 = getelementptr inbounds nuw float, ptr %.5240338.i, i64 %290 %292 = getelementptr inbounds nuw %union.opj_v8_t, ptr %51, i64 %indvars.iv389.i @@ -4897,12 +4899,13 @@ opj_v8dwt_interleave_v.exit.i: ; preds = %.lr.ph29.i.i, %._cr %spec.select279.i = tail call i32 @llvm.umin.i32(i32 %297, i32 %74) %298 = udiv i32 %81, %spec.select279.i %299 = and i32 %298, -8 + %invariant.op333.i = add nsw i32 %spec.select279.i, -1 %300 = and i32 %81, -8 br label %301 301: ; preds = %307, %296 - %.5234334.i = phi i32 [ 0, %296 ], [ %318, %307 ] - %.7242333.i = phi ptr [ %53, %296 ], [ %325, %307 ] + %.5234334.i = phi i32 [ 0, %296 ], [ %326, %307 ] + %.7242333.i = phi ptr [ %53, %296 ], [ %324, %307 ] %302 = tail call ptr @opj_malloc(i64 noundef 64) #16, !noalias !181 %.not270.i = icmp eq ptr %302, null br i1 %.not270.i, label %303, label %304 @@ -4943,24 +4946,25 @@ opj_v8dwt_interleave_v.exit.i: ; preds = %.lr.ph29.i.i, %._cr store i32 %32, ptr %316, align 4, !tbaa !220, !noalias !181 %317 = getelementptr inbounds nuw i8, ptr %302, i64 48 store ptr %.7242333.i, ptr %317, align 8, !tbaa !221, !noalias !181 - %318 = add nuw nsw i32 %.5234334.i, 1 - %319 = icmp eq i32 %318, %spec.select279.i - %320 = mul i32 %.5234334.i, %299 - %321 = sub i32 %300, %320 - %322 = select i1 %319, i32 %321, i32 %299 - %323 = getelementptr inbounds nuw i8, ptr %302, i64 56 - store i32 %322, ptr %323, align 8, !tbaa !222, !noalias !181 - %324 = zext i32 %322 to i64 - %325 = getelementptr inbounds nuw float, ptr %.7242333.i, i64 %324 - %326 = tail call i32 @opj_thread_pool_submit_job(ptr noundef %12, ptr noundef nonnull @opj_dwt97_decode_v_func, ptr noundef nonnull %302) #16, !noalias !181 - br i1 %319, label %327, label %301, !llvm.loop !233 + %318 = icmp eq i32 %.5234334.i, %invariant.op333.i + %319 = mul i32 %.5234335.i, %299 + %320 = sub i32 %300, %319 + %321 = select i1 %318, i32 %320, i32 %299 + %322 = getelementptr inbounds nuw i8, ptr %302, i64 56 + store i32 %321, ptr %322, align 8, !tbaa !222, !noalias !181 + %323 = zext i32 %321 to i64 + %324 = getelementptr inbounds nuw float, ptr %.7242334.i, i64 %323 + %325 = tail call i32 @opj_thread_pool_submit_job(ptr noundef %12, ptr noundef nonnull @opj_dwt97_decode_v_func, ptr noundef nonnull %302) #16, !noalias !181 + %326 = add nuw nsw i32 %.5234335.i, 1 + %exitcond389.not.i = icmp eq i32 %326, %spec.select279.i + br i1 %exitcond389.not.i, label %327, label %301, !llvm.loop !233 327: ; preds = %307 tail call void @opj_thread_pool_wait_completion(ptr noundef %12, i32 noundef 0) #16, !noalias !181 br label %.loopexit310.i .loopexit310.i: ; preds = %._crit_edge337.i, %327, %.preheader309.i - %.6241.i = phi ptr [ %325, %327 ], [ %53, %.preheader309.i ], [ %293, %._crit_edge337.i ] + %.6241.i = phi ptr [ %324, %327 ], [ %53, %.preheader309.i ], [ %293, %._crit_edge338.i ] %328 = and i32 %81, 7 %.not273.i = icmp eq i32 %328, 0 br i1 %.not273.i, label %.loopexit.i, label %329 @@ -5031,7 +5035,7 @@ opj_v8dwt_interleave_v.exit293.i: ; preds = %346, %._crit_edge.i br label %354 354: ; preds = %354, %.lr.ph343.i - %indvars.iv394.i = phi i64 [ 0, %.lr.ph343.i ], [ %indvars.iv.next395.i, %354 ] + %indvars.iv394.i = phi i64 [ 0, %.lr.ph344.i ], [ %indvars.iv.next395.i, %354 ] %355 = mul nuw i64 %indvars.iv394.i, %64 %356 = getelementptr inbounds nuw float, ptr %.6241.i, i64 %355 %357 = getelementptr inbounds nuw %union.opj_v8_t, ptr %51, i64 %indvars.iv394.i diff --git a/bench/openjdk/optimized/c1_LinearScan.ll b/bench/openjdk/optimized/c1_LinearScan.ll index be6bc3c38bf..bfae13de923 100644 --- a/bench/openjdk/optimized/c1_LinearScan.ll +++ b/bench/openjdk/optimized/c1_LinearScan.ll @@ -11597,36 +11597,35 @@ define hidden noundef ptr @_ZN10LinearScan15compute_oop_mapEP14IntervalWalkerP6L %31 = load ptr, ptr %30, align 8 %32 = ptrtoint ptr %31 to i64 %33 = trunc i64 %32 to i32 - %34 = sub i32 %33, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32) - %.not.i = icmp eq i32 %34, -1 - br i1 %.not.i, label %35, label %_ZN10LinearScan19vm_reg_for_intervalEP8Interval.exit - -35: ; preds = %29 - %36 = getelementptr inbounds nuw i8, ptr %.02834, i64 72 - %.sroa.0.0.copyload.i.i.i = load i64, ptr %36, align 8 - %37 = and i64 %.sroa.0.0.copyload.i.i.i, 7 - %38 = icmp eq i64 %37, 7 - br i1 %38, label %39, label %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i - -39: ; preds = %35 - %40 = tail call i64 @_ZN10LinearScan25calc_operand_for_intervalEPK8Interval(ptr noundef nonnull %.02834) - store i64 %40, ptr %36, align 8 + %.not.i = icmp eq i32 %33, add (i32 ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32), i32 -1) + br i1 %.not.i, label %34, label %_ZN10LinearScan19vm_reg_for_intervalEP8Interval.exit + +34: ; preds = %29 + %35 = getelementptr inbounds nuw i8, ptr %.02834, i64 72 + %.sroa.0.0.copyload.i.i.i = load i64, ptr %35, align 8 + %36 = and i64 %.sroa.0.0.copyload.i.i.i, 7 + %37 = icmp eq i64 %36, 7 + br i1 %37, label %38, label %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i + +38: ; preds = %34 + %39 = tail call i64 @_ZN10LinearScan25calc_operand_for_intervalEPK8Interval(ptr noundef nonnull %.02834) + store i64 %39, ptr %35, align 8 br label %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i -_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i: ; preds = %39, %35 - %.sroa.0.0.i.i = phi i64 [ %40, %39 ], [ %.sroa.0.0.copyload.i.i.i, %35 ] +_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i: ; preds = %38, %34 + %.sroa.0.0.i.i = phi i64 [ %39, %38 ], [ %.sroa.0.0.copyload.i.i.i, %34 ] %41 = load ptr, ptr %9, align 8 %42 = tail call noundef ptr @_ZNK8FrameMap7regnameE7LIR_Opr(ptr noundef nonnull align 8 dereferenceable(40) %41, i64 %.sroa.0.0.i.i) #22 store ptr %42, ptr %30, align 8 %.pre = ptrtoint ptr %42 to i64 %.pre41 = trunc i64 %.pre to i32 - %.pre43 = sub i32 %.pre41, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32) br label %_ZN10LinearScan19vm_reg_for_intervalEP8Interval.exit _ZN10LinearScan19vm_reg_for_intervalEP8Interval.exit: ; preds = %29, %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i - %.pre-phi44 = phi i32 [ %34, %29 ], [ %.pre43, %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i ] + %.pre-phi44 = phi i32 [ %33, %29 ], [ %.pre41, %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i ] %.0.i = phi ptr [ %31, %29 ], [ %42, %_ZN10LinearScan20operand_for_intervalEP8Interval.exit.i ] - %43 = icmp ult i32 %.pre-phi44, 16384 + %42 = sub i32 %.pre-phi44, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32) + %43 = icmp ult i32 %42, 16384 br i1 %43, label %44, label %45 44: ; preds = %_ZN10LinearScan19vm_reg_for_intervalEP8Interval.exit diff --git a/bench/openjdk/optimized/instanceStackChunkKlass.ll b/bench/openjdk/optimized/instanceStackChunkKlass.ll index a21990883d5..b958008570f 100644 --- a/bench/openjdk/optimized/instanceStackChunkKlass.ll +++ b/bench/openjdk/optimized/instanceStackChunkKlass.ll @@ -4216,10 +4216,9 @@ _ZN12OopMapStream7is_doneEv.exit.thread: ; preds = %75, %_ZN12OopMapStr %83 = getelementptr inbounds nuw i8, ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1), i64 %82 %84 = ptrtoint ptr %83 to i64 %85 = trunc i64 %84 to i32 - %86 = sub i32 %85, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32) - %87 = icmp ne i32 %86, -1 + %86 = icmp ne i32 %85, add (i32 ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32), i32 -1) %.not.i.i9 = icmp samesign ult i32 %81, 616 - %88 = select i1 %87, i1 %.not.i.i9, i1 false + %88 = select i1 %86, i1 %.not.i.i9, i1 false br i1 %88, label %89, label %92 89: ; preds = %79 @@ -4236,7 +4235,7 @@ _ZN12OopMapStream7is_doneEv.exit.thread: ; preds = %75, %_ZN12OopMapStr br label %_ZNK21StackChunkFrameStreamIL11ChunkFrames1EE10reg_to_locI16SmallRegisterMapEEPvP9VMRegImplPKT_.exit _ZNK21StackChunkFrameStreamIL11ChunkFrames1EE10reg_to_locI16SmallRegisterMapEEPvP9VMRegImplPKT_.exit: ; preds = %89, %92 - %98 = phi ptr [ %91, %89 ], [ %97, %92 ] + %98 = phi ptr [ %91, %88 ], [ %97, %91 ] %99 = icmp eq i32 %78, 1 %100 = load ptr, ptr %72, align 8 %.not.i.i.i.i.i10 = icmp uge ptr %98, %100 @@ -4254,7 +4253,7 @@ _ZNK21StackChunkFrameStreamIL11ChunkFrames1EE10reg_to_locI16SmallRegisterMapEEPv %108 = load ptr, ptr %107, align 8 %109 = getelementptr inbounds nuw i8, ptr %108, i64 8 %110 = load ptr, ptr %109, align 8 - call void %110(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef %98) #9 + call void %109(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef %98) #9 br label %_ZN13Devirtualizer6do_oopI33StackChunkOopIterateFilterClosureI17OopIterateClosureE9narrowOopEEvPT_PT0_.exit 111: ; preds = %_ZNK21StackChunkFrameStreamIL11ChunkFrames1EE10reg_to_locI16SmallRegisterMapEEPvP9VMRegImplPKT_.exit @@ -4262,9 +4261,9 @@ _ZNK21StackChunkFrameStreamIL11ChunkFrames1EE10reg_to_locI16SmallRegisterMapEEPv 112: ; preds = %111 %113 = load ptr, ptr %74, align 8 + %113 = load ptr, ptr %112, align 8 %114 = load ptr, ptr %113, align 8 - %115 = load ptr, ptr %114, align 8 - call void %115(ptr noundef nonnull align 8 dereferenceable(8) %113, ptr noundef %98) #9 + call void %114(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef %97) #9 br label %_ZN13Devirtualizer6do_oopI33StackChunkOopIterateFilterClosureI17OopIterateClosureE9narrowOopEEvPT_PT0_.exit _ZN13Devirtualizer6do_oopI33StackChunkOopIterateFilterClosureI17OopIterateClosureE9narrowOopEEvPT_PT0_.exit: ; preds = %_ZN12OopMapStream7is_doneEv.exit.thread, %112, %111, %106, %105 @@ -4530,10 +4529,9 @@ _ZN12OopMapStream7is_doneEv.exit.thread: ; preds = %44, %_ZN12OopMapStr %52 = getelementptr inbounds nuw i8, ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1), i64 %51 %53 = ptrtoint ptr %52 to i64 %54 = trunc i64 %53 to i32 - %55 = sub i32 %54, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32) - %56 = icmp ne i32 %55, -1 + %55 = icmp ne i32 %54, add (i32 ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 1) to i32), i32 -1) %.not.i.i = icmp samesign ult i32 %50, 616 - %57 = select i1 %56, i1 %.not.i.i, i1 false + %57 = select i1 %55, i1 %.not.i.i, i1 false %58 = load ptr, ptr %39, align 8 %59 = sub i32 %54, ptrtoint (ptr getelementptr inbounds nuw (i8, ptr @all_VMRegs, i64 617) to i32) %60 = mul nsw i32 %40, %59 @@ -4557,7 +4555,7 @@ _ZN12OopMapStream7is_doneEv.exit.thread: ; preds = %44, %_ZN12OopMapStr %72 = load ptr, ptr %71, align 8 %73 = getelementptr inbounds nuw i8, ptr %72, i64 8 %74 = load ptr, ptr %73, align 8 - call void %74(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef %62) #9 + call void %73(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef %62) #9 br label %_ZN13Devirtualizer6do_oopI33StackChunkOopIterateFilterClosureI17OopIterateClosureE9narrowOopEEvPT_PT0_.exit 75: ; preds = %48 @@ -4565,9 +4563,9 @@ _ZN12OopMapStream7is_doneEv.exit.thread: ; preds = %44, %_ZN12OopMapStr 76: ; preds = %75 %77 = load ptr, ptr %43, align 8 + %77 = load ptr, ptr %76, align 8 %78 = load ptr, ptr %77, align 8 - %79 = load ptr, ptr %78, align 8 - call void %79(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef %62) #9 + call void %78(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef %61) #9 br label %_ZN13Devirtualizer6do_oopI33StackChunkOopIterateFilterClosureI17OopIterateClosureE9narrowOopEEvPT_PT0_.exit _ZN13Devirtualizer6do_oopI33StackChunkOopIterateFilterClosureI17OopIterateClosureE9narrowOopEEvPT_PT0_.exit: ; preds = %_ZN12OopMapStream7is_doneEv.exit.thread, %76, %75, %70, %69 diff --git a/bench/openjdk/optimized/zRelocate.ll b/bench/openjdk/optimized/zRelocate.ll index 45d0f087f4b..1d0580f5bcf 100644 --- a/bench/openjdk/optimized/zRelocate.ll +++ b/bench/openjdk/optimized/zRelocate.ll @@ -5715,36 +5715,31 @@ _ZNK5ZPage16object_alignmentEv.exit.sink.split.i.i36: ; preds = %239, %235 br label %_ZNK5ZPage16object_alignmentEv.exit.i.i33 _ZNK5ZPage16object_alignmentEv.exit.i.i33: ; preds = %_ZNK5ZPage16object_alignmentEv.exit.sink.split.i.i36, %235 - %.0.i.i.i34 = phi i64 [ 2097152, %235 ], [ %244, %_ZNK5ZPage16object_alignmentEv.exit.sink.split.i.i36 ] + %.0.i.i.i34 = phi i64 [ 2097152, %235 ], [ %244, %_ZNK5ZPage16object_alignmentEv.exit.sink.split.i.i35 ] %245 = add i64 %.0.i.i.i34, %132 %246 = sub nsw i64 0, %.0.i.i.i34 %247 = and i64 %245, %246 %248 = load volatile i64, ptr %136, align 8 - br label %249 - -249: ; preds = %251, %_ZNK5ZPage16object_alignmentEv.exit.i.i33 - %.012.i.i = phi i64 [ %248, %_ZNK5ZPage16object_alignmentEv.exit.i.i33 ], [ %252, %251 ] - %250 = sub i64 %.012.i.i, %247 - %.not.i.i35 = icmp eq i64 %250, %237 - br i1 %.not.i.i35, label %251, label %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit - -251: ; preds = %249 - %252 = tail call noundef i64 asm sideeffect "lock cmpxchgq $1,($3)", "={ax},r,{ax},r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %237, i64 %.012.i.i, ptr nonnull %136) #15, !srcloc !15 - %253 = icmp eq i64 %252, %.012.i.i - br i1 %253, label %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit, label %249, !llvm.loop !40 - -_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit: ; preds = %249, %251 - %254 = load ptr, ptr %60, align 8 - %255 = getelementptr inbounds nuw i8, ptr %254, i64 16 - %256 = load i64, ptr %255, align 8 - %257 = shl nuw i64 1, %256 - %258 = add i64 %257, %132 + %invariant.op.i.i = add i64 %247, %237 + %249 = icmp eq i64 %248, %invariant.op.i.i + br i1 %249, label %250, label %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit + +250:; preds = %_ZNK5ZPage16object_alignmentEv.exit.i.i33 + %251 = tail call noundef i64 asm sideeffect "lock cmpxchgq $1,($3)", "={ax},r,{ax},r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %237, i64 %invariant.op.i.i, ptr nonnull %136) #15, !srcloc !15 + br label %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit, !llvm.loop !40 + +251: ; preds = %250, %_ZNK5ZPage16object_alignmentEv.exit.i.i33 + %252 = load ptr, ptr %60, align 8 + %253 = getelementptr inbounds nuw i8, ptr %252, i64 16 + %254 = load i64, ptr %253, align 8 + %255 = shl nuw i64 1, %254 + %256 = add i64 %255, %132 br label %_ZNK24ZRelocateMediumAllocator12alloc_objectEP5ZPagem.exit.thread.sink.split _ZNK24ZRelocateMediumAllocator12alloc_objectEP5ZPagem.exit.thread.sink.split: ; preds = %116, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit - %.sink84 = phi i64 [ %257, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %120, %116 ] - %.sink82 = phi i64 [ %258, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %122, %116 ] - %.sink81 = phi ptr [ %254, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %117, %116 ] + %.sink84 = phi i64 [ %255, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %120, %116 ] + %.sink82 = phi i64 [ %256, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %122, %116 ] + %.sink81 = phi ptr [ %252, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %117, %116 ] %.0.ph = phi i64 [ %234, %_ZNK24ZRelocateMediumAllocator17undo_alloc_objectEP5ZPage8zaddressm.exit ], [ %114, %116 ] %259 = sub i64 0, %.sink84 %260 = and i64 %.sink82, %259 diff --git a/bench/openmpi/optimized/pmix_mca_base_var.ll b/bench/openmpi/optimized/pmix_mca_base_var.ll index 8393c9f6823..ae2dc1b42d2 100644 --- a/bench/openmpi/optimized/pmix_mca_base_var.ll +++ b/bench/openmpi/optimized/pmix_mca_base_var.ll @@ -3483,7 +3483,7 @@ source_name.exit: ; preds = %source_name.exit.si br label %var_get.exit.thread 89: ; preds = %source_name.exit - switch i32 %2, label %327 [ + switch i32 %2, label %326 [ i32 1, label %90 i32 0, label %221 i32 2, label %317 @@ -3799,7 +3799,9 @@ var_get.exit180.thread: ; preds = %pmix_pointer_array_ br i1 %or.cond306, label %.lr.ph.split.preheader, label %.loopexit257 .lr.ph.split.preheader: ; preds = %.preheader256 - %265 = and i64 %.val, 2147483647 + %invariant.op = add i64 %.val, 4294967295 + %265 = and i64 %invariant.op, 4294967295 + %wide.trip.count = and i64 %.val, 2147483647 br label %.lr.ph.split .lr.ph.split: ; preds = %.lr.ph.split.preheader, %var_get.exit185.thread @@ -3829,22 +3831,21 @@ pmix_pointer_array_get_item.exit.i184: ; preds = %270 %280 = load ptr, ptr %1, align 8, !tbaa !64 %281 = load ptr, ptr %280, align 8, !tbaa !51 store ptr %281, ptr %7, align 8, !tbaa !51 - %282 = add nuw nsw i64 %indvars.iv, 1 - %283 = icmp eq i64 %282, %265 - %284 = getelementptr inbounds nuw i8, ptr %277, i64 144 - %285 = load ptr, ptr %284, align 8, !tbaa !42 - %.str.61..str.62 = select i1 %283, ptr @.str.61, ptr @.str.62 - %286 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %280, ptr noundef nonnull %.str.61..str.62, ptr noundef %281, ptr noundef %285) #25 - %287 = load ptr, ptr %7, align 8, !tbaa !51 - call void @free(ptr noundef %287) #25 - %288 = icmp slt i32 %286, 0 + %282 = icmp eq i64 %indvars.iv, %265 + %283 = getelementptr inbounds nuw i8, ptr %277, i64 144 + %284 = load ptr, ptr %283, align 8, !tbaa !42 + %.str.61..str.62 = select i1 %282, ptr @.str.61, ptr @.str.62 + %285 = call i32 (ptr, ptr, ...) @asprintf(ptr noundef nonnull %280, ptr noundef nonnull %.str.61..str.62, ptr noundef %281, ptr noundef %284) #25 + %286 = load ptr, ptr %7, align 8, !tbaa !51 + call void @free(ptr noundef %286) #25 + %287 = icmp slt i32 %285, 0 %.pre278 = load i8, ptr @pmix_mca_base_var_initialized, align 1, !tbaa !54, !range !36 - br i1 %288, label %var_get.exit.thread, label %var_get.exit185.thread + br i1 %287, label %var_get.exit.thread, label %var_get.exit185.thread var_get.exit185.thread: ; preds = %pmix_pointer_array_get_item.exit.i184, %270, %.lr.ph.split, %279 %289 = phi i8 [ 1, %pmix_pointer_array_get_item.exit.i184 ], [ 1, %270 ], [ 0, %.lr.ph.split ], [ %.pre278, %279 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 - %exitcond.not = icmp eq i64 %indvars.iv.next, %265 + %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %.loopexit257, label %.lr.ph.split, !llvm.loop !113 290: ; preds = %257 @@ -3868,7 +3869,7 @@ var_get.exit185.thread: ; preds = %pmix_pointer_array_ br i1 %300, label %var_get.exit.thread, label %301 301: ; preds = %296, %.loopexit257 - %.7131 = phi i64 [ 2, %296 ], [ 1, %.loopexit257 ] + %.7131 = phi i64 [ 2, %295 ], [ 1, %.loopexit257 ] %302 = getelementptr inbounds nuw i8, ptr %21, i64 352 %303 = load ptr, ptr %302, align 8, !tbaa !31 %.not156 = icmp eq ptr %303, null @@ -3878,7 +3879,7 @@ var_get.exit185.thread: ; preds = %pmix_pointer_array_ call void @llvm.lifetime.start.p0(ptr nonnull %11) %305 = getelementptr inbounds nuw i8, ptr %303, i64 168 %306 = load ptr, ptr %305, align 8, !tbaa !114 - %307 = call i32 %306(ptr noundef nonnull %303, ptr noundef nonnull %11) #25 + %307 = call i32 %305(ptr noundef nonnull %303, ptr noundef nonnull %11) #25 %308 = icmp eq i32 %307, 0 br i1 %308, label %309, label %.critedge @@ -3926,7 +3927,7 @@ var_get.exit185.thread: ; preds = %pmix_pointer_array_ br label %var_get.exit.thread var_get.exit.thread: ; preds = %279, %209, %167, %.loopexit255, %130, %153, %122, %115, %183, %pmix_pointer_array_get_item.exit.i173, %36, %31, %pmix_pointer_array_get_item.exit.i, %14, %3, %322, %316, %296, %290, %258, %251, %239, %226, %112, %58, %23, %327, %320, %225, %110, %87 - %.0 = phi i32 [ -29, %296 ], [ -29, %209 ], [ %26, %23 ], [ -1, %3 ], [ -29, %322 ], [ -29, %87 ], [ -29, %110 ], [ %59, %58 ], [ 0, %327 ], [ -1, %31 ], [ -29, %225 ], [ -29, %112 ], [ -29, %226 ], [ -29, %239 ], [ -29, %290 ], [ -29, %316 ], [ -29, %251 ], [ -29, %320 ], [ -29, %258 ], [ -27, %pmix_pointer_array_get_item.exit.i ], [ -27, %14 ], [ -27, %pmix_pointer_array_get_item.exit.i173 ], [ -27, %36 ], [ -29, %183 ], [ -29, %115 ], [ -29, %122 ], [ -29, %153 ], [ -29, %130 ], [ -29, %.loopexit255 ], [ -29, %167 ], [ -29, %279 ] + %.0 = phi i32 [ -29, %295 ], [ -29, %209 ], [ %26, %23 ], [ -1, %3 ], [ -29, %321 ], [ -29, %87 ], [ -29, %110 ], [ %59, %58 ], [ 0, %326 ], [ -1, %31 ], [ -29, %225 ], [ -29, %112 ], [ -29, %226 ], [ -29, %239 ], [ -29, %289 ], [ -29, %315 ], [ -29, %251 ], [ -29, %319 ], [ -29, %258 ], [ -27, %pmix_pointer_array_get_item.exit.i ], [ -27, %14 ], [ -27, %pmix_pointer_array_get_item.exit.i173 ], [ -27, %36 ], [ -29, %183 ], [ -29, %115 ], [ -29, %122 ], [ -29, %153 ], [ -29, %130 ], [ -29, %.loopexit255 ], [ -29, %167 ], [ -29, %279 ] call void @llvm.lifetime.end.p0(ptr nonnull %8) call void @llvm.lifetime.end.p0(ptr nonnull %7) call void @llvm.lifetime.end.p0(ptr nonnull %6) diff --git a/bench/openspiel/optimized/breakthrough.ll b/bench/openspiel/optimized/breakthrough.ll index 367d86f6b6d..1ce2ec3926d 100644 --- a/bench/openspiel/optimized/breakthrough.ll +++ b/bench/openspiel/optimized/breakthrough.ll @@ -1044,7 +1044,9 @@ _ZNSt10shared_ptrIKN10open_spiel4GameEED2Ev.exit: ; preds = %26, %44, %57, %_ZNS .preheader: ; preds = %.preheader.preheader, %._crit_edge %93 = phi i32 [ %135, %._crit_edge ], [ %3, %.preheader.preheader ] %94 = phi i32 [ %136, %._crit_edge ], [ %3, %.preheader.preheader ] - %.01738 = phi i32 [ %137, %._crit_edge ], [ 0, %.preheader.preheader ] + %.01738 = phi i32 [ %invariant.op, %._crit_edge ], [ 0, %.preheader.preheader ] + %invariant.op = add nuw nsw i32 %.01739, 1 + %invariant.op36 = add nuw i32 %.01739, 2 %95 = icmp sgt i32 %94, 0 br i1 %95, label %.lr.ph, label %._crit_edge @@ -1066,40 +1068,36 @@ _ZNSt10shared_ptrIKN10open_spiel4GameEED2Ev.exit: ; preds = %26, %44, %57, %_ZNS br i1 %100, label %.split.us, label %._crit_edge, !llvm.loop !4 .lr.ph.split.split.us: ; preds = %.lr.ph, %116 - %101 = phi i32 [ %117, %116 ], [ %93, %.lr.ph ] - %102 = phi i32 [ %117, %116 ], [ %94, %.lr.ph ] - %.036.us37 = phi i32 [ %118, %116 ], [ 0, %.lr.ph ] + %101 = phi i32 [ %117, %113 ], [ %93, %.lr.ph ] + %102 = phi i32 [ %117, %113 ], [ %94, %.lr.ph ] + %.036.us37 = phi i32 [ %118, %113 ], [ 0, %.lr.ph ] %103 = load i32, ptr %65, align 8 - %104 = add nsw i32 %103, -1 - %105 = icmp eq i32 %.01738, %104 - br i1 %105, label %110, label %106 - -106: ; preds = %.lr.ph.split.split.us - %107 = icmp sgt i32 %103, 5 - %108 = add nsw i32 %103, -2 - %109 = icmp eq i32 %.01738, %108 - %or.cond26.us = select i1 %107, i1 %109, i1 false - br i1 %or.cond26.us, label %110, label %116 - -110: ; preds = %106, %.lr.ph.split.split.us - %111 = mul nsw i32 %102, %.01738 - %112 = add nsw i32 %111, %.036.us37 - %113 = sext i32 %112 to i64 - %114 = load ptr, ptr %67, align 8 - %115 = getelementptr inbounds i32, ptr %114, i64 %113 - store i32 2, ptr %115, align 4 + %104 = icmp sgt i32 %103, 5 + %105 = icmp eq i32 %103, %invariant.op + %106 = icmp eq i32 %103, %invariant.op36 + %or.cond26.us = and i1 %104, %106 + %or.cond = or i1 %105, %or.cond26.us + br i1 %or.cond, label %107, label %113 + +107:; preds = %.lr.ph.split.split.us + %108 = mul nsw i32 %102, %.01739 + %109 = add nsw i32 %108, %.037.us38 + %110 = sext i32 %109 to i64 + %111 = load ptr, ptr %67, align 8 + %112 = getelementptr inbounds i32, ptr %111, i64 %110 + store i32 2, ptr %112, align 4 %.pre = load i32, ptr %66, align 4 br label %116 -116: ; preds = %110, %106 - %117 = phi i32 [ %.pre, %110 ], [ %101, %106 ] +116: ; preds = %.lr.ph.split.split.us, %107 + %117 = phi i32 [ %101, %.lr.ph.split.split.us ], [ %.pre, %107 ] %118 = add nuw nsw i32 %.036.us37, 1 %119 = icmp slt i32 %118, %117 br i1 %119, label %.lr.ph.split.split.us, label %._crit_edge, !llvm.loop !4 .lr.ph.split.split: ; preds = %.lr.ph, %131 - %120 = phi i32 [ %133, %131 ], [ %94, %.lr.ph ] - %.036 = phi i32 [ %132, %131 ], [ 0, %.lr.ph ] + %120 = phi i32 [ %133, %128 ], [ %94, %.lr.ph ] + %.036 = phi i32 [ %132, %128 ], [ 0, %.lr.ph ] %121 = load i32, ptr %65, align 8 %122 = icmp sgt i32 %121, 5 br i1 %122, label %.sink.split, label %125 @@ -1110,11 +1108,11 @@ _ZNSt10shared_ptrIKN10open_spiel4GameEED2Ev.exit: ; preds = %26, %44, %57, %_ZNS br label %145 125: ; preds = %.lr.ph.split.split - %126 = icmp eq i32 %121, 2 + %126 = icmp eq i32 %121, %invariant.op br i1 %126, label %.sink.split, label %131 .sink.split: ; preds = %125, %.lr.ph.split.split - %.sink = phi i32 [ 1, %.lr.ph.split.split ], [ 2, %125 ] + %.sink = phi i32 [ 1, %.lr.ph.split.split ], [ 2, %122 ] %127 = add nsw i32 %120, %.036 %128 = sext i32 %127 to i64 %129 = load ptr, ptr %67, align 8 @@ -1129,16 +1127,15 @@ _ZNSt10shared_ptrIKN10open_spiel4GameEED2Ev.exit: ; preds = %26, %44, %57, %_ZNS br i1 %134, label %.lr.ph.split.split, label %._crit_edge, !llvm.loop !4 ._crit_edge: ; preds = %131, %.split.us, %116, %.preheader - %135 = phi i32 [ %117, %116 ], [ %98, %.split.us ], [ %93, %.preheader ], [ %133, %131 ] - %136 = phi i32 [ %117, %116 ], [ %98, %.split.us ], [ %94, %.preheader ], [ %133, %131 ] - %137 = add nuw nsw i32 %.01738, 1 - %138 = load i32, ptr %65, align 8 - %139 = icmp slt i32 %137, %138 - br i1 %139, label %.preheader, label %._crit_edge41, !llvm.loop !6 - -._crit_edge41: ; preds = %._crit_edge + %135 = phi i32 [ %117, %113 ], [ %98, %.split.us ], [ %93, %.preheader ], [ %133, %128 ] + %136 = phi i32 [ %117, %113 ], [ %98, %.split.us ], [ %94, %.preheader ], [ %133, %128 ] + %134 = load i32, ptr %65, align 8 + %135 = icmp slt i32 %invariant.op, %134 + br i1 %135, label %.preheader, label %._crit_edge42, !llvm.loop !6 + +._crit_edge42: ; preds = %._crit_edge store i32 -3, ptr %63, align 8 - %140 = icmp sgt i32 %138, 5 + %140 = icmp sgt i32 %134, 5 %141 = zext i1 %140 to i32 %142 = shl i32 %135, %141 %143 = getelementptr inbounds nuw i8, ptr %0, i64 72 @@ -1150,7 +1147,7 @@ _ZNSt10shared_ptrIKN10open_spiel4GameEED2Ev.exit: ; preds = %26, %44, %57, %_ZNS ret void 145: ; preds = %123, %83, %76, %74 - %.pn = phi { ptr, i32 } [ %124, %123 ], [ %84, %83 ], [ %75, %74 ], [ %77, %76 ] + %.pn = phi { ptr, i32 } [ %124, %120 ], [ %84, %83 ], [ %75, %74 ], [ %77, %76 ] %146 = load ptr, ptr %67, align 8 %.not.i.i.i32 = icmp eq ptr %146, null br i1 %.not.i.i.i32, label %_ZNSt6vectorIN10open_spiel12breakthrough9CellStateESaIS2_EED2Ev.exit33, label %147 diff --git a/bench/openspiel/optimized/catch.ll b/bench/openspiel/optimized/catch.ll index e3581396e8d..f5dce4edf91 100644 --- a/bench/openspiel/optimized/catch.ll +++ b/bench/openspiel/optimized/catch.ll @@ -1785,19 +1785,19 @@ define void @_ZNK10open_spiel6catch_10CatchState8ToStringB5cxx11Ev(ptr dead_on_u br label %.preheader .preheader: ; preds = %.preheader.lr.ph, %80 - %.01126 = phi i32 [ 0, %.preheader.lr.ph ], [ %81, %80 ] + %.01126 = phi i32 [ 0, %.preheader.lr.ph ], [ %invariant.op, %79 ] + %invariant.op = add nuw nsw i32 %.01126, 1 %21 = load i32, ptr %15, align 8 %22 = icmp sgt i32 %21, 0 br i1 %22, label %.lr.ph, label %._crit_edge .lr.ph: ; preds = %.preheader, %72 - %.01025 = phi i32 [ %73, %72 ], [ 0, %.preheader ] + %.01025 = phi i32 [ %73, %71 ], [ 0, %.preheader ] %23 = load i32, ptr %12, align 4 - %24 = add nsw i32 %23, -1 - %25 = icmp eq i32 %.01126, %24 - %26 = load i32, ptr %16, align 8 - %27 = icmp eq i32 %.01025, %26 - %or.cond.i = select i1 %25, i1 %27, i1 false + %24 = icmp eq i32 %23, %invariant.op + %25 = load i32, ptr %16, align 8 + %26 = icmp eq i32 %.01025, %25 + %or.cond.i = select i1 %24, i1 %26, i1 false br i1 %or.cond.i, label %_ZNK10open_spiel6catch_10CatchState7BoardAtEii.exit.thread, label %_ZNK10open_spiel6catch_10CatchState7BoardAtEii.exit _ZNK10open_spiel6catch_10CatchState7BoardAtEii.exit.thread: ; preds = %.lr.ph @@ -1831,7 +1831,7 @@ _ZNK10open_spiel6catch_10CatchState7BoardAtEii.exit: ; preds = %.lr.ph .noexc5.i: ; preds = %.noexc.i call void @llvm.lifetime.start.p0(ptr nonnull %3) %35 = invoke noundef ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_M_local_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %10) - to label %39 unwind label %36 + to label %38 unwind label %36 36: ; preds = %.noexc5.i %37 = landingpad { ptr, i32 } @@ -1843,7 +1843,7 @@ _ZNK10open_spiel6catch_10CatchState7BoardAtEii.exit: ; preds = %.lr.ph 39: ; preds = %.noexc5.i store ptr %10, ptr %3, align 8 %40 = invoke noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_M_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %10) - to label %41 unwind label %.body18 + to label %40 unwind label %.body18 41: ; preds = %39 call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_(ptr noundef %40, ptr noundef nonnull @.str.27, ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @.str.27, i64 1)) #25 @@ -1874,7 +1874,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_S .noexc7.i: ; preds = %.noexc6.i call void @llvm.lifetime.start.p0(ptr nonnull %4) %45 = invoke noundef ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_M_local_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %10) - to label %49 unwind label %46 + to label %48 unwind label %46 46: ; preds = %.noexc7.i %47 = landingpad { ptr, i32 } @@ -1886,7 +1886,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_S 49: ; preds = %.noexc7.i store ptr %10, ptr %4, align 8 %50 = invoke noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_M_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %10) - to label %51 unwind label %.body15 + to label %50 unwind label %.body15 51: ; preds = %49 call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_(ptr noundef %50, ptr noundef nonnull @.str.28, ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @.str.28, i64 1)) #25 @@ -1922,7 +1922,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_S .noexc12.i: ; preds = %.noexc11.i call void @llvm.lifetime.start.p0(ptr nonnull %5) %57 = invoke noundef ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_M_local_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %10) - to label %61 unwind label %58 + to label %60 unwind label %58 58: ; preds = %.noexc12.i %59 = landingpad { ptr, i32 } @@ -1934,7 +1934,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_S 61: ; preds = %.noexc12.i store ptr %10, ptr %5, align 8 %62 = invoke noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7_M_dataEv(ptr noundef nonnull align 8 dereferenceable(32) %10) - to label %63 unwind label %.body13 + to label %62 unwind label %.body13 63: ; preds = %61 call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13_S_copy_charsEPcPKcS7_(ptr noundef %62, ptr noundef nonnull @.str.29, ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @.str.29, i64 1)) #25 @@ -1959,8 +1959,8 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_S br label %.body.i .body.i: ; preds = %65, %.body13, %53, %.body15, %43, %.body18 - %.sink17.i = phi ptr [ %7, %53 ], [ %6, %43 ], [ %6, %.body18 ], [ %7, %.body15 ], [ %8, %.body13 ], [ %8, %65 ] - %.pn.i = phi { ptr, i32 } [ %54, %53 ], [ %44, %43 ], [ %42, %.body18 ], [ %52, %.body15 ], [ %64, %.body13 ], [ %66, %65 ] + %.sink17.i = phi ptr [ %7, %52 ], [ %6, %42 ], [ %6, %.body18 ], [ %7, %.body15 ], [ %8, %.body13 ], [ %8, %64 ] + %.pn.i = phi { ptr, i32 } [ %54, %52 ], [ %44, %42 ], [ %42, %.body18 ], [ %52, %.body15 ], [ %64, %.body13 ], [ %66, %64 ] call void @_ZNSaIcED1Ev(ptr noundef nonnull align 1 dereferenceable(1) %.sink17.i) #25 br label %.body @@ -1983,7 +1983,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPKcEEvT_S8_S _ZN4absl7debian28AlphaNumC2ISaIcEEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcET_EE.exit: ; preds = %67 store i64 %69, ptr %19, align 8 invoke void @_ZN4absl7debian29StrAppendEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_8AlphaNumE(ptr noundef nonnull %0, ptr noundef nonnull align 8 dereferenceable(48) %9) - to label %72 unwind label %78 + to label %71 unwind label %78 72: ; preds = %_ZN4absl7debian28AlphaNumC2ISaIcEEERKNSt7__cxx1112basic_stringIcSt11char_traitsIcET_EE.exit call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #25 @@ -2007,19 +2007,18 @@ _ZN4absl7debian28AlphaNumC2ISaIcEEERKNSt7__cxx1112basic_stringIcSt11char_traitsI store ptr @.str.22, ptr %11, align 8 store i64 1, ptr %20, align 8 invoke void @_ZN4absl7debian29StrAppendEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS0_8AlphaNumE(ptr noundef nonnull %0, ptr noundef nonnull align 8 dereferenceable(48) %11) - to label %80 unwind label %76 + to label %79 unwind label %76 80: ; preds = %._crit_edge - %81 = add nuw nsw i32 %.01126, 1 - %82 = load i32, ptr %12, align 4 - %83 = icmp slt i32 %81, %82 - br i1 %83, label %.preheader, label %._crit_edge27, !llvm.loop !16 + %80 = load i32, ptr %12, align 4 + %81 = icmp slt i32 %invariant.op, %80 + br i1 %81, label %.preheader, label %._crit_edge27, !llvm.loop !16 ._crit_edge27: ; preds = %80, %2 ret void .body: ; preds = %76, %.body.i, %78 - %.pn = phi { ptr, i32 } [ %79, %78 ], [ %77, %76 ], [ %.pn.i, %.body.i ] + %.pn = phi { ptr, i32 } [ %79, %77 ], [ %77, %75 ], [ %.pn.i, %.body.i ] call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #25 resume { ptr, i32 } %.pn } diff --git a/bench/openspiel/optimized/cliff_walking.ll b/bench/openspiel/optimized/cliff_walking.ll index c30bdebe14e..05bd6673882 100644 --- a/bench/openspiel/optimized/cliff_walking.ll +++ b/bench/openspiel/optimized/cliff_walking.ll @@ -1569,7 +1569,8 @@ define void @_ZNK10open_spiel13cliff_walking17CliffWalkingState8ToStringB5cxx11E br label %.preheader .preheader: ; preds = %.preheader.lr.ph, %36 - %.01323 = phi i32 [ 0, %.preheader.lr.ph ], [ %37, %36 ] + %.01323 = phi i32 [ 0, %.preheader.lr.ph ], [ %invariant.op, %36 ] + %invariant.op = add nuw nsw i32 %.01324, 1 %14 = load i32, ptr %5, align 8 %15 = icmp sgt i32 %14, 0 br i1 %15, label %.lr.ph, label %._crit_edge @@ -1584,8 +1585,8 @@ define void @_ZNK10open_spiel13cliff_walking17CliffWalkingState8ToStringB5cxx11E %or.cond = select i1 %18, i1 %20, i1 false br i1 %or.cond, label %.invoke, label %23 -.invoke: ; preds = %.lr.ph, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread.thread - %21 = phi i8 [ 71, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread ], [ 46, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread.thread ], [ 88, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit ], [ 80, %.lr.ph ] +.invoke: ; preds = %.lr.ph, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread, %23 + %21 = phi i8 [ %., %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread ], [ 88, %23 ], [ 80, %.lr.ph ] %22 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %21) to label %31 unwind label %.loopexit @@ -1615,19 +1616,14 @@ define void @_ZNK10open_spiel13cliff_walking17CliffWalkingState8ToStringB5cxx11E %26 = icmp slt i32 %.022, %25 %or.cond17 = select i1 %24, i1 %26, i1 false %.pre = load i32, ptr %3, align 4 - %27 = add nsw i32 %.pre, -1 - %28 = icmp eq i32 %.01323, %27 - br i1 %or.cond17, label %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit, label %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread - -_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit: ; preds = %23 - br i1 %28, label %.invoke, label %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread.thread + %28 = icmp eq i32 %.pre, %invariant.op + %or.cond27 = select i1 %or.cond17, i1 %28, i1 false + br i1 %or.cond27, label %.invoke, label %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread _ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread: ; preds = %23 %29 = icmp eq i32 %.022, %25 %30 = select i1 %28, i1 %29, i1 false - br i1 %30, label %.invoke, label %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread.thread - -_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread.thread: ; preds = %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit, %_ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread + %. = select i1 %30, i8 71, i8 46 br label %.invoke 31: ; preds = %.invoke @@ -1641,10 +1637,9 @@ _ZNK10open_spiel13cliff_walking17CliffWalkingState7IsCliffEii.exit.thread.thread to label %36 unwind label %.loopexit.split-lp.loopexit 36: ; preds = %._crit_edge - %37 = add nuw nsw i32 %.01323, 1 - %38 = load i32, ptr %3, align 4 - %39 = icmp slt i32 %37, %38 - br i1 %39, label %.preheader, label %._crit_edge24, !llvm.loop !6 + %37 = load i32, ptr %3, align 4 + %38 = icmp slt i32 %invariant.op, %37 + br i1 %38, label %.preheader, label %._crit_edge25, !llvm.loop !6 ._crit_edge24: ; preds = %36, %.preheader18 ret void diff --git a/bench/openusd/optimized/pathPattern.ll b/bench/openusd/optimized/pathPattern.ll index 272491e861e..624c40f311c 100644 --- a/bench/openusd/optimized/pathPattern.ll +++ b/bench/openusd/optimized/pathPattern.ll @@ -952,7 +952,7 @@ _ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exi %22 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull @.str.10) to label %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit.thread unwind label %.loopexit.split-lp -.loopexit: ; preds = %.invoke, %46, %61, %70 +.loopexit: ; preds = %.invoke, %46, %60, %69 %lpad.loopexit = landingpad { ptr, i32 } cleanup br label %90 @@ -987,6 +987,7 @@ _ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exi %34 = ptrtoint ptr %32 to i64 %35 = sub i64 %33, %34 %36 = sdiv exact i64 %35, 40 + %invariant.op = add nsw i64 %36, -1 %.not30 = icmp eq ptr %31, %32 br i1 %.not30, label %._crit_edge, label %.lr.ph @@ -996,7 +997,7 @@ _ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exi br label %39 39: ; preds = %.lr.ph, %89 - %.031 = phi i64 [ 0, %.lr.ph ], [ %.pre-phi, %89 ] + %.031 = phi i64 [ 0, %.lr.ph ], [ %89, %88 ] %40 = load ptr, ptr %29, align 8 %41 = getelementptr inbounds %"struct.pxrInternal_v0_24__pxrReserved__::SdfPathPattern::Component", ptr %40, i64 %.031 %42 = getelementptr inbounds nuw i8, ptr %41, i64 32 @@ -1013,112 +1014,107 @@ _ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exi %48 = and i1 %28, %47 %49 = select i1 %48, ptr @.str.11, ptr @.str.12 %50 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %49) - to label %._crit_edge32 unwind label %.loopexit - -._crit_edge32: ; preds = %46 - %.pre = add i64 %.031, 1 - br label %89 + to label %88 unwind label %.loopexit _ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread: ; preds = %39, %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29 - %51 = add i64 %.031, 1 - %52 = icmp eq i64 %51, %36 - %53 = load i8, ptr %37, align 8 - %54 = trunc i8 %53 to i1 - %or.cond = select i1 %52, i1 %54, i1 false - br i1 %or.cond, label %.invoke, label %56 - -.invoke: ; preds = %58, %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread - %55 = phi i8 [ 46, %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread ], [ 47, %58 ] - invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %55) - to label %61 unwind label %.loopexit - -56: ; preds = %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread - %57 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #18 - br i1 %57, label %61, label %58 - -58: ; preds = %56 - %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #18 - %60 = load i8, ptr %59, align 1 - %.not19 = icmp eq i8 %60, 47 - br i1 %.not19, label %61, label %.invoke - -61: ; preds = %.invoke, %56, %58 - %62 = load ptr, ptr %29, align 8 - %63 = getelementptr inbounds %"struct.pxrInternal_v0_24__pxrReserved__::SdfPathPattern::Component", ptr %62, i64 %.031 - %64 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %63) - to label %65 unwind label %.loopexit - -65: ; preds = %61 - %66 = load ptr, ptr %29, align 8 - %67 = getelementptr inbounds %"struct.pxrInternal_v0_24__pxrReserved__::SdfPathPattern::Component", ptr %66, i64 %.031 - %68 = getelementptr inbounds nuw i8, ptr %67, i64 32 - %69 = load i32, ptr %68, align 8 - %.not20 = icmp eq i32 %69, -1 - br i1 %.not20, label %89, label %70 - -70: ; preds = %65 - %71 = sext i32 %69 to i64 - %72 = load ptr, ptr %38, align 8 - %73 = getelementptr inbounds %"class.pxrInternal_v0_24__pxrReserved__::SdfPredicateExpression", ptr %72, i64 %71 - invoke void @_ZNK32pxrInternal_v0_24__pxrReserved__22SdfPredicateExpression7GetTextB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(80) %73) - to label %74 unwind label %.loopexit - -74: ; preds = %70 - %75 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6insertEmPKc(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef 0, ptr noundef nonnull @.str.13) - to label %76 unwind label %81 - -76: ; preds = %74 - call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %75) #18 - %77 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.14) - to label %78 unwind label %83 - -78: ; preds = %76 - call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %77) #18 - %79 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %4) - to label %80 unwind label %85 - -80: ; preds = %78 + %51 = icmp eq i64 %.031, %invariant.op + %52 = load i8, ptr %37, align 8 + %53 = trunc i8 %52 to i1 + %or.cond = select i1 %51, i1 %53, i1 false + br i1 %or.cond, label %.invoke, label %55 + +.invoke: ; preds = %57, %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread + %54 = phi i8 [ 46, %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread ], [ 47, %57 ] + invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE9push_backEc(ptr noundef nonnull align 8 dereferenceable(32) %0, i8 noundef signext %54) + to label %60 unwind label %.loopexit + +55: ; preds = %_ZNK32pxrInternal_v0_24__pxrReserved__14SdfPathPattern9Component9IsStretchEv.exit29.thread + %56 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #18 + br i1 %56, label %60, label %57 + +57: ; preds = %55 + %58 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4backEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #18 + %59 = load i8, ptr %58, align 1 + %.not19 = icmp eq i8 %59, 47 + br i1 %.not19, label %60, label %.invoke + +60: ; preds = %.invoke, %55, %57 + %61 = load ptr, ptr %29, align 8 + %62 = getelementptr inbounds %"struct.pxrInternal_v0_24__pxrReserved__::SdfPathPattern::Component", ptr %61, i64 %.031 + %63 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %62) + to label %64 unwind label %.loopexit + +64: ; preds = %60 + %65 = load ptr, ptr %29, align 8 + %66 = getelementptr inbounds %"struct.pxrInternal_v0_24__pxrReserved__::SdfPathPattern::Component", ptr %65, i64 %.031 + %67 = getelementptr inbounds nuw i8, ptr %66, i64 32 + %68 = load i32, ptr %67, align 8 + %.not20 = icmp eq i32 %68, -1 + br i1 %.not20, label %88, label %69 + +69: ; preds = %64 + %70 = sext i32 %68 to i64 + %71 = load ptr, ptr %38, align 8 + %72 = getelementptr inbounds %"class.pxrInternal_v0_24__pxrReserved__::SdfPredicateExpression", ptr %71, i64 %70 + invoke void @_ZNK32pxrInternal_v0_24__pxrReserved__22SdfPredicateExpression7GetTextB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %6, ptr noundef nonnull align 8 dereferenceable(80) %72) + to label %73 unwind label %.loopexit + +73: ; preds = %69 + %74 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6insertEmPKc(ptr noundef nonnull align 8 dereferenceable(32) %6, i64 noundef 0, ptr noundef nonnull @.str.13) + to label %75 unwind label %80 + +75: ; preds = %73 + call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 8 dereferenceable(32) %74) #18 + %76 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKc(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.14) + to label %77 unwind label %85 + +77: ; preds = %75 + call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1EOS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %76) #18 + %78 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEpLERKS4_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %4) + to label %79 unwind label %84 + +79: ; preds = %77 call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #18 call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #18 call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #18 - br label %89 - -81: ; preds = %74 - %82 = landingpad { ptr, i32 } - cleanup br label %88 -83: ; preds = %76 +83: ; preds = %73 %84 = landingpad { ptr, i32 } cleanup br label %87 -85: ; preds = %78 +85: ; preds = %75 %86 = landingpad { ptr, i32 } cleanup + br label %86 + +84: ; preds = %77 + %85 = landingpad { ptr, i32 } + cleanup call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #18 br label %87 -87: ; preds = %85, %83 - %.pn = phi { ptr, i32 } [ %86, %85 ], [ %84, %83 ] +87: ; preds = %84, %82 + %.pn = phi { ptr, i32 } [ %85, %84 ], [ %83, %82 ] call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #18 br label %88 -88: ; preds = %87, %81 - %.pn.pn = phi { ptr, i32 } [ %.pn, %87 ], [ %82, %81 ] +88: ; preds = %87, %80 + %.pn.pn = phi { ptr, i32 } [ %.pn, %86 ], [ %81, %80 ] call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #18 br label %90 -89: ; preds = %._crit_edge32, %65, %80 - %.pre-phi = phi i64 [ %.pre, %._crit_edge32 ], [ %51, %65 ], [ %51, %80 ] - %.not = icmp eq i64 %.pre-phi, %36 +89: ; preds = %64, %79, %46 + %89 = add i64 %.031, 1 + %.not = icmp eq i64 %89, %36 br i1 %.not, label %._crit_edge, label %39, !llvm.loop !8 ._crit_edge: ; preds = %89, %27 ret void 90: ; preds = %.loopexit, %.loopexit.split-lp, %88 - %.pn23 = phi { ptr, i32 } [ %.pn.pn, %88 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ] + %.pn23 = phi { ptr, i32 } [ %.pn.pn, %87 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ] call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(32) %0) #18 resume { ptr, i32 } %.pn23 } diff --git a/bench/openvdb/optimized/Filter.ll b/bench/openvdb/optimized/Filter.ll index 355f77c3f70..288022d8358 100644 --- a/bench/openvdb/optimized/Filter.ll +++ b/bench/openvdb/optimized/Filter.ll @@ -122296,6 +122296,7 @@ if.then3: ; preds = %if.then %call = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %6) #28 store i64 %mul, ptr %call, align 16 %.ptr = getelementptr inbounds nuw i8, ptr %call, i64 8 + %invariant.op = add i64 %4, -8 br label %arrayctor.loop arrayctor.loop: ; preds = %invoke.cont, %if.then3 @@ -122311,8 +122312,7 @@ invoke.cont: ; preds = %arrayctor.loop %mOutOfCore2.i = getelementptr inbounds nuw i8, ptr %arrayctor.cur.ptr.ptr, i64 8 store atomic i32 0, ptr %mOutOfCore2.i seq_cst, align 8 %arrayctor.cur.add = add nuw nsw i64 %arrayctor.cur.idx, 16 - %7 = add nuw nsw i64 %arrayctor.cur.idx, 8 - %arrayctor.done = icmp eq i64 %7, %4 + %arrayctor.done = icmp eq i64 %arrayctor.cur.idx, %invariant.op br i1 %arrayctor.done, label %arrayctor.cont, label %arrayctor.loop arrayctor.cont: ; preds = %invoke.cont @@ -158695,6 +158695,7 @@ if.then3: ; preds = %if.then %call = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %6) #28 store i64 %mul, ptr %call, align 16 %.ptr = getelementptr inbounds nuw i8, ptr %call, i64 8 + %invariant.op = add i64 %4, -8 br label %arrayctor.loop arrayctor.loop: ; preds = %invoke.cont, %if.then3 @@ -158710,8 +158711,7 @@ invoke.cont: ; preds = %arrayctor.loop %mOutOfCore2.i = getelementptr inbounds nuw i8, ptr %arrayctor.cur.ptr.ptr, i64 8 store atomic i32 0, ptr %mOutOfCore2.i seq_cst, align 8 %arrayctor.cur.add = add nuw nsw i64 %arrayctor.cur.idx, 16 - %7 = add nuw nsw i64 %arrayctor.cur.idx, 8 - %arrayctor.done = icmp eq i64 %7, %4 + %arrayctor.done = icmp eq i64 %arrayctor.cur.idx, %invariant.op br i1 %arrayctor.done, label %arrayctor.cont, label %arrayctor.loop arrayctor.cont: ; preds = %invoke.cont diff --git a/bench/openvdb/optimized/TopologyToLevelSet.ll b/bench/openvdb/optimized/TopologyToLevelSet.ll index ba30b9035d7..db1b31d1c88 100644 --- a/bench/openvdb/optimized/TopologyToLevelSet.ll +++ b/bench/openvdb/optimized/TopologyToLevelSet.ll @@ -101047,6 +101047,7 @@ if.then3: ; preds = %if.then %call = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %6) #28 store i64 %mul, ptr %call, align 16 %.ptr = getelementptr inbounds nuw i8, ptr %call, i64 8 + %invariant.op = add i64 %4, -8 br label %arrayctor.loop arrayctor.loop: ; preds = %invoke.cont, %if.then3 @@ -101062,8 +101063,7 @@ invoke.cont: ; preds = %arrayctor.loop %mOutOfCore2.i = getelementptr inbounds nuw i8, ptr %arrayctor.cur.ptr.ptr, i64 8 store atomic i32 0, ptr %mOutOfCore2.i seq_cst, align 8 %arrayctor.cur.add = add nuw nsw i64 %arrayctor.cur.idx, 16 - %7 = add nuw nsw i64 %arrayctor.cur.idx, 8 - %arrayctor.done = icmp eq i64 %7, %4 + %arrayctor.done = icmp eq i64 %arrayctor.cur.idx, %invariant.op br i1 %arrayctor.done, label %arrayctor.cont, label %arrayctor.loop arrayctor.cont: ; preds = %invoke.cont diff --git a/bench/pola-rs/optimized/bg2ex4k819k713rsl5rc2q2v3.ll b/bench/pola-rs/optimized/bg2ex4k819k713rsl5rc2q2v3.ll index d1efe2248cf..88ad8aa187f 100644 --- a/bench/pola-rs/optimized/bg2ex4k819k713rsl5rc2q2v3.ll +++ b/bench/pola-rs/optimized/bg2ex4k819k713rsl5rc2q2v3.ll @@ -126640,11 +126640,11 @@ _ZN5rayon5slice9mergesort7recurse17hb706ddad160cbce6E.exit.i: ; preds = %81, %"_ br i1 %.not.i60.i, label %._crit_edge.i.i, label %.lr.ph.i.preheader.i .lr.ph.i.preheader.i: ; preds = %174 + %invariant.op.i.i = add nsw i8 %.val12.i.i, -1 %178 = getelementptr i8, ptr %169, i64 20 %.val9.i90.i = load i8, ptr %178, align 4, !range !8741, !alias.scope !13472, !noalias !13446, !noundef !3 - %179 = sub nsw i8 %.val9.i90.i, %.val12.i.i - %180 = icmp eq i8 %179, -1 - br i1 %180, label %.lr.ph.preheader.i, label %._crit_edge.i.i + %179 = icmp eq i8 %.val9.i90.i, %invariant.op.i.i + br i1 %179, label %.lr.ph.preheader.i, label %._crit_edge.i.i .lr.ph.preheader.i: ; preds = %.lr.ph.i.preheader.i %181 = getelementptr inbounds nuw i8, ptr %169, i64 16 @@ -126663,9 +126663,8 @@ _ZN5rayon5slice9mergesort7recurse17hb706ddad160cbce6E.exit.i: ; preds = %81, %"_ %182 = getelementptr inbounds nuw { i32, i8, [3 x i8] }, ptr %169, i64 %187 %183 = getelementptr i8, ptr %182, i64 4 %.val9.i.i = load i8, ptr %183, align 4, !range !8741, !alias.scope !13472, !noalias !13446, !noundef !3 - %184 = sub nsw i8 %.val9.i.i, %.val12.i.i - %185 = icmp eq i8 %184, -1 - br i1 %185, label %.lr.ph.i, label %._crit_edge.i.i + %184 = icmp eq i8 %.val9.i.i, 0 + br i1 %184, label %.lr.ph.i, label %._crit_edge.i.i .lr.ph.i: ; preds = %.lr.ph.i.i, %.lr.ph.preheader.i %186 = phi ptr [ %182, %.lr.ph.i.i ], [ %181, %.lr.ph.preheader.i ] @@ -145234,11 +145233,11 @@ _ZN5rayon5slice9mergesort7recurse17hc21f51a2117f4982E.exit.i: ; preds = %82, %"_ br i1 %.not.i60.i, label %._crit_edge.i.i, label %.lr.ph.i.preheader.i .lr.ph.i.preheader.i: ; preds = %175 + %invariant.op.i.i = add nuw nsw i8 %.val8.i.i, 1 %179 = getelementptr i8, ptr %170, i64 20 %.val.i90.i = load i8, ptr %179, align 4, !range !8741, !alias.scope !16359, !noalias !16333, !noundef !3 - %180 = sub nsw i8 %.val8.i.i, %.val.i90.i - %181 = icmp eq i8 %180, -1 - br i1 %181, label %.lr.ph.preheader.i, label %._crit_edge.i.i + %180 = icmp eq i8 %.val.i90.i, %invariant.op.i.i + br i1 %180, label %.lr.ph.preheader.i, label %._crit_edge.i.i .lr.ph.preheader.i: ; preds = %.lr.ph.i.preheader.i %182 = getelementptr inbounds nuw i8, ptr %170, i64 16 @@ -145257,9 +145256,8 @@ _ZN5rayon5slice9mergesort7recurse17hc21f51a2117f4982E.exit.i: ; preds = %82, %"_ %183 = getelementptr inbounds nuw { i32, i8, [3 x i8] }, ptr %170, i64 %188 %184 = getelementptr i8, ptr %183, i64 4 %.val.i.i = load i8, ptr %184, align 4, !range !8741, !alias.scope !16359, !noalias !16333, !noundef !3 - %185 = sub nsw i8 %.val8.i.i, %.val.i.i - %186 = icmp eq i8 %185, -1 - br i1 %186, label %.lr.ph.i, label %._crit_edge.i.i + %.not119.i = icmp eq i8 %.val.i.i, 0 + br i1 %.not119.i, label %._crit_edge.i.i, label %.lr.ph.i .lr.ph.i: ; preds = %.lr.ph.i.i, %.lr.ph.preheader.i %187 = phi ptr [ %183, %.lr.ph.i.i ], [ %182, %.lr.ph.preheader.i ] @@ -163441,7 +163439,7 @@ define internal fastcc noundef range(i8 0, 3) i8 @_ZN5rayon5slice9mergesort9merg .loopexit.split-lp: ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit72, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp73, %.loopexit.split-lp.loopexit.split-lp ] invoke void @"_ZN4core3ptr72drop_in_place$LT$alloc..vec..Vec$LT$rayon..slice..mergesort..Run$GT$$GT$17h68394d7aa5c1aa5bE"(ptr noalias noundef nonnull align 8 dereferenceable(24) %4) #36 - to label %212 unwind label %210 + to label %210 unwind label %210 15: ; preds = %7 %16 = add i64 %.sroa.027.0157, -2 @@ -163841,11 +163839,11 @@ thread-pre-split: ; preds = %179 br i1 %.not.i63, label %._crit_edge.i, label %.lr.ph.i64.preheader .lr.ph.i64.preheader: ; preds = %193 + %invariant.op.i = add nsw i8 %.val12.i, -1 %197 = getelementptr i8, ptr %73, i64 20 %.val9.i119 = load i8, ptr %197, align 4, !range !8741, !alias.scope !18495, !noundef !3 - %198 = sub nsw i8 %.val9.i119, %.val12.i - %199 = icmp eq i8 %198, -1 - br i1 %199, label %.lr.ph.preheader, label %._crit_edge.i + %198 = icmp eq i8 %.val9.i119, %invariant.op.i + br i1 %198, label %.lr.ph.preheader, label %._crit_edge.i .lr.ph.preheader: ; preds = %.lr.ph.i64.preheader %200 = getelementptr inbounds nuw i8, ptr %73, i64 16 @@ -163864,9 +163862,8 @@ thread-pre-split: ; preds = %179 %201 = getelementptr inbounds nuw { i32, i8, [3 x i8] }, ptr %73, i64 %206 %202 = getelementptr i8, ptr %201, i64 4 %.val9.i = load i8, ptr %202, align 4, !range !8741, !alias.scope !18495, !noundef !3 - %203 = sub nsw i8 %.val9.i, %.val12.i - %204 = icmp eq i8 %203, -1 - br i1 %204, label %.lr.ph, label %._crit_edge.i + %202 = icmp eq i8 %.val9.i, 0 + br i1 %202, label %.lr.ph, label %._crit_edge.i .lr.ph: ; preds = %.lr.ph.preheader, %.lr.ph.i64 %205 = phi ptr [ %201, %.lr.ph.i64 ], [ %200, %.lr.ph.preheader ] @@ -185414,7 +185411,7 @@ define internal fastcc noundef range(i8 0, 3) i8 @_ZN5rayon5slice9mergesort9merg .loopexit.split-lp: ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit73, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp74, %.loopexit.split-lp.loopexit.split-lp ] invoke void @"_ZN4core3ptr72drop_in_place$LT$alloc..vec..Vec$LT$rayon..slice..mergesort..Run$GT$$GT$17h68394d7aa5c1aa5bE"(ptr noalias noundef nonnull align 8 dereferenceable(24) %4) #36 - to label %212 unwind label %210 + to label %211 unwind label %210 15: ; preds = %7 %16 = add i64 %.sroa.027.0158, -2 @@ -185651,7 +185648,7 @@ thread-pre-split: ; preds = %179 %126 = phi i64 [ %.sroa.027.0158, %.lr.ph126.split ], [ %121, %112 ], [ %.sroa.027.0158, %.lr.ph126.split.us ], [ %.sroa.027.0158, %.thread ] %127 = phi ptr [ @anon.fdb8f275ae6cbd2e17583d2141f98aa5.215, %.lr.ph126.split ], [ @anon.fdb8f275ae6cbd2e17583d2141f98aa5.212, %112 ], [ @anon.fdb8f275ae6cbd2e17583d2141f98aa5.215, %.lr.ph126.split.us ], [ @anon.fdb8f275ae6cbd2e17583d2141f98aa5.208, %.thread ] invoke void @_ZN4core5slice5index22slice_index_order_fail17h6e5a6dffd042468aE(i64 noundef %125, i64 noundef %126, ptr noalias noundef nonnull readonly align 8 dereferenceable(24) %127) #34 - to label %.cont285 unwind label %.loopexit.split-lp.loopexit.split-lp + to label %.cont286 unwind label %.loopexit.split-lp.loopexit.split-lp .cont285: ; preds = %.invoke284 unreachable @@ -185791,7 +185788,7 @@ thread-pre-split: ; preds = %179 %186 = phi i64 [ %78, %109 ], [ %177, %176 ] %187 = phi ptr [ @anon.fdb8f275ae6cbd2e17583d2141f98aa5.210, %109 ], [ @anon.fdb8f275ae6cbd2e17583d2141f98aa5.213, %176 ] invoke void @_ZN4core9panicking18panic_bounds_check17h0cc3ae16a8cc728fE(i64 noundef %185, i64 noundef %186, ptr noalias noundef readonly align 8 dereferenceable(24) %187) #34 - to label %.cont287 unwind label %.loopexit.split-lp.loopexit.split-lp + to label %.cont288 unwind label %.loopexit.split-lp.loopexit.split-lp .cont287: ; preds = %.invoke286 unreachable @@ -185814,11 +185811,11 @@ thread-pre-split: ; preds = %179 br i1 %.not.i63, label %._crit_edge.i, label %.lr.ph.i64.preheader .lr.ph.i64.preheader: ; preds = %193 + %invariant.op.i = add nuw nsw i8 %.val8.i, 1 %197 = getelementptr i8, ptr %73, i64 20 %.val.i65120 = load i8, ptr %197, align 4, !range !8741, !alias.scope !20575, !noundef !3 - %198 = sub nsw i8 %.val8.i, %.val.i65120 - %199 = icmp eq i8 %198, -1 - br i1 %199, label %.lr.ph.preheader, label %._crit_edge.i + %198 = icmp eq i8 %.val.i65120, %invariant.op.i + br i1 %198, label %.lr.ph.preheader, label %._crit_edge.i .lr.ph.preheader: ; preds = %.lr.ph.i64.preheader %200 = getelementptr inbounds nuw i8, ptr %73, i64 16 @@ -185837,9 +185834,8 @@ thread-pre-split: ; preds = %179 %201 = getelementptr inbounds nuw { i32, i8, [3 x i8] }, ptr %73, i64 %206 %202 = getelementptr i8, ptr %201, i64 4 %.val.i65 = load i8, ptr %202, align 4, !range !8741, !alias.scope !20575, !noundef !3 - %203 = sub nsw i8 %.val8.i, %.val.i65 - %204 = icmp eq i8 %203, -1 - br i1 %204, label %.lr.ph, label %._crit_edge.i + %.not238 = icmp eq i8 %.val.i65, 0 + br i1 %.not238, label %._crit_edge.i, label %.lr.ph .lr.ph: ; preds = %.lr.ph.preheader, %.lr.ph.i64 %205 = phi ptr [ %201, %.lr.ph.i64 ], [ %200, %.lr.ph.preheader ] diff --git a/bench/pola-rs/optimized/eno41myg76h8nryc673zxzdw7.ll b/bench/pola-rs/optimized/eno41myg76h8nryc673zxzdw7.ll index 0b31b33258f..521eb2f31f6 100644 --- a/bench/pola-rs/optimized/eno41myg76h8nryc673zxzdw7.ll +++ b/bench/pola-rs/optimized/eno41myg76h8nryc673zxzdw7.ll @@ -147260,13 +147260,13 @@ _ZN12polars_arrow5array5Array10null_count17h8283f4f6a28137b0E.exit.thread.i: ; p br label %84 107: ; preds = %158, %72 - %.sroa.9.0.i = phi ptr [ %.sroa.9.0.copyload.i, %72 ], [ %.sroa.9.182115.i, %158 ] - %.sroa.6.0.i = phi ptr [ %.sroa.6.0.copyload.i, %72 ], [ %.sroa.6.183113.i, %158 ] - %.sroa.071.0.i = phi ptr [ %.sroa.071.0.copyload.i, %72 ], [ %.sroa.071.184111.i, %158 ] - %.sroa.14.0.i = phi i64 [ %.sroa.14.0.copyload.i, %72 ], [ %.sroa.14.185109.i, %158 ] - %.sroa.16.0.i = phi i64 [ %.sroa.16.0.copyload.i, %72 ], [ %.sroa.16.186107.i, %158 ] - %.sroa.18.0.i = phi i64 [ %.sroa.18.0.copyload.i, %72 ], [ %.sroa.18.187105.i, %158 ] - %.sroa.020.3.i = phi i32 [ %.sroa.020.0132.i, %72 ], [ %159, %158 ] + %.sroa.9.0.i = phi ptr [ %.sroa.9.0.copyload.i, %72 ], [ %.sroa.9.182115.i, %157 ] + %.sroa.6.0.i = phi ptr [ %.sroa.6.0.copyload.i, %72 ], [ %.sroa.6.183113.i, %157 ] + %.sroa.071.0.i = phi ptr [ %.sroa.071.0.copyload.i, %72 ], [ %.sroa.071.184111.i, %157 ] + %.sroa.14.0.i = phi i64 [ %.sroa.14.0.copyload.i, %72 ], [ %.sroa.14.185109.i, %157 ] + %.sroa.16.0.i = phi i64 [ %.sroa.16.0.copyload.i, %72 ], [ %.sroa.16.186107.i, %157 ] + %.sroa.18.0.i = phi i64 [ %.sroa.18.0.copyload.i, %72 ], [ %.sroa.18.187105.i, %157 ] + %.sroa.020.3.i = phi i32 [ %.sroa.020.0132.i, %72 ], [ %159, %157 ] %.not47.i = icmp eq ptr %.sroa.071.0.i, null %108 = icmp ne ptr %.sroa.6.0.i, null tail call void @llvm.assume(i1 %108) @@ -147344,47 +147344,46 @@ _ZN12polars_arrow5array5Array10null_count17h8283f4f6a28137b0E.exit.thread.i: ; p %.not124.i = icmp uge i32 %133, %.sroa.3.0.i.i.i %134 = icmp ult i32 %133, %.sroa.3.0.i.i59.i %or.cond126.i = select i1 %.not124.i, i1 %134, i1 false - br i1 %or.cond126.i, label %139, label %158 + br i1 %or.cond126.i, label %138, label %158 135: ; preds = %128 %136 = load i64, ptr %51, align 8, !noalias !17175, !noundef !6 - %137 = add i64 %136, -1 - %138 = icmp eq i64 %1, %137 - br i1 %138, label %160, label %158 - -139: ; preds = %132 - %140 = zext i32 %133 to i64 - %141 = getelementptr inbounds nuw { ptr, i32, i32 }, ptr %6, i64 %140 - %142 = getelementptr inbounds nuw i8, ptr %141, i64 8 - %143 = load i32, ptr %142, align 8, !alias.scope !17188, !noalias !17175, !noundef !6 - %144 = getelementptr inbounds nuw i8, ptr %141, i64 12 - %145 = load i32, ptr %144, align 4, !range !17181, !alias.scope !17188, !noalias !17175, !noundef !6 - %146 = icmp eq i32 %143, %145 - br i1 %146, label %147, label %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i", !prof !30 - -147: ; preds = %139 - tail call void @"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$7reserve17h1eaed34b6044c5bbE"(ptr noalias noundef nonnull align 8 dereferenceable(16) %141, i64 noundef 1), !noalias !17175 - %.pre139.i = load i32, ptr %144, align 4, !range !17181, !alias.scope !17188, !noalias !17175 - %.pre140.i = load i32, ptr %142, align 8, !alias.scope !17188, !noalias !17175 + %137 = icmp eq i64 %136, %24 + br i1 %137, label %159, label %157 + +138: ; preds = %132 + %139 = zext i32 %133 to i64 + %140 = getelementptr inbounds nuw { ptr, i32, i32 }, ptr %6, i64 %139 + %141 = getelementptr inbounds nuw i8, ptr %140, i64 8 + %142 = load i32, ptr %141, align 8, !alias.scope !17188, !noalias !17175, !noundef !6 + %143 = getelementptr inbounds nuw i8, ptr %140, i64 12 + %144 = load i32, ptr %143, align 4, !range !17181, !alias.scope !17188, !noalias !17175, !noundef !6 + %145 = icmp eq i32 %142, %144 + br i1 %145, label %146, label %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i", !prof !30 + +146: ; preds = %138 + tail call void @"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$7reserve17h1eaed34b6044c5bbE"(ptr noalias noundef nonnull align 8 dereferenceable(16) %140, i64 noundef 1), !noalias !17175 + %.pre139.i = load i32, ptr %143, align 4, !range !17181, !alias.scope !17188, !noalias !17175 + %.pre139.i = load i32, ptr %141, align 8, !alias.scope !17188, !noalias !17175 br label %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" -"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i": ; preds = %147, %139 - %148 = phi i32 [ %143, %139 ], [ %.pre140.i, %147 ] - %149 = phi i32 [ %145, %139 ], [ %.pre139.i, %147 ] +"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i": ; preds = %146, %138 + %148 = phi i32 [ %142, %138 ], [ %.pre140.i, %146 ] + %149 = phi i32 [ %144, %138 ], [ %.pre139.i, %146 ] %150 = icmp eq i32 %149, 1 - %151 = load ptr, ptr %141, align 8, !alias.scope !17188, !noalias !17175 - %spec.select.i52.i = select i1 %150, ptr %141, ptr %151 + %151 = load ptr, ptr %140, align 8, !alias.scope !17188, !noalias !17175 + %spec.select.i52.i = select i1 %150, ptr %140, ptr %151 %152 = zext i32 %148 to i64 %153 = getelementptr inbounds nuw i32, ptr %spec.select.i52.i, i64 %152 store i32 %.sroa.020.3.i, ptr %153, align 4, !noalias !17175 - %154 = load i32, ptr %142, align 8, !alias.scope !17188, !noalias !17175, !noundef !6 + %154 = load i32, ptr %141, align 8, !alias.scope !17188, !noalias !17175, !noundef !6 %155 = add i32 %154, 1 - store i32 %155, ptr %142, align 8, !alias.scope !17188, !noalias !17175 + store i32 %155, ptr %141, align 8, !alias.scope !17188, !noalias !17175 %156 = icmp eq i32 %154, 0 br i1 %156, label %.sink.split.i, label %158 .sink.split.i: ; preds = %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i", %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" - %.sink161.i = phi i64 [ %161, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i" ], [ %140, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" ] + %.sink161.i = phi i64 [ %161, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i" ], [ %139, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" ] %.sroa.9.182115.ph.i = phi ptr [ %.sroa.9.3.i, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i" ], [ %.sroa.9.182116.i, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" ] %.sroa.6.183113.ph.i = phi ptr [ %.sroa.6.0.i, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i" ], [ %.sroa.6.183114.i, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" ] %.sroa.071.184111.ph.i = phi ptr [ %spec.select.i, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i" ], [ %.sroa.071.184112.i, %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit53.i" ] @@ -147422,8 +147421,8 @@ _ZN12polars_arrow5array5Array10null_count17h8283f4f6a28137b0E.exit.thread.i: ; p br label %"_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i" "_ZN12polars_utils7idx_vec16UnitVec$LT$T$GT$4push17h3349c17cad7674a3E.exit.i": ; preds = %168, %160 - %169 = phi i32 [ %164, %160 ], [ %.pre138.i, %168 ] - %170 = phi i32 [ %166, %160 ], [ %.pre.i, %168 ] + %169 = phi i32 [ %164, %159 ], [ %.pre138.i, %167 ] + %170 = phi i32 [ %166, %159 ], [ %.pre.i, %167 ] %171 = icmp eq i32 %170, 1 %172 = load ptr, ptr %162, align 8, !alias.scope !17191, !noalias !17175 %spec.select.i.i = select i1 %171, ptr %162, ptr %172 diff --git a/bench/quantlib/optimized/lfmprocess.ll b/bench/quantlib/optimized/lfmprocess.ll index 5d4e4541026..8cd8d84a617 100644 --- a/bench/quantlib/optimized/lfmprocess.ll +++ b/bench/quantlib/optimized/lfmprocess.ll @@ -3515,6 +3515,7 @@ _ZNK8QuantLib24LiborForwardModelProcess14nextIndexResetEd.exit: ; preds = %invok %sub.ptr.sub.i.i = sub i64 %sub.ptr.lhs.cast.i.pre-phi.i, %sub.ptr.rhs.cast.i.i.i.i.i.i %sub.ptr.div.i.i = ashr exact i64 %sub.ptr.sub.i.i, 3 %12 = load i64, ptr %size_, align 8, !tbaa !47 + %invariant.op = add i64 %sub.ptr.sub.i.i, -8 %cmp38 = icmp ult i64 %sub.ptr.div.i.i, %12 %.pre = load ptr, ptr %covariance, align 8, !tbaa !3 br i1 %cmp38, label %invoke.cont29.lr.ph, label %for.cond.cleanup @@ -3563,8 +3564,7 @@ invoke.cont29: ; preds = %invoke.cont29.lr.ph %arrayidx.i24.idx = shl nuw nsw i64 %k.039, 3 %arrayidx.i24 = getelementptr inbounds nuw i8, ptr %15, i64 %arrayidx.i24.idx store double %div, ptr %arrayidx.i24, align 8, !tbaa !78 - %21 = add nuw nsw i64 %arrayidx.i24.idx, 8 - %cmp.not5.i = icmp samesign eq i64 %sub.ptr.sub.i.i, %21 + %cmp.not5.i = icmp samesign eq i64 %arrayidx.i24.idx, %invariant.op br i1 %cmp.not5.i, label %invoke.cont33, label %for.body.i.preheader for.body.i.preheader: ; preds = %invoke.cont29 @@ -3879,9 +3879,10 @@ invoke.cont7: ; preds = %.noexc45, %invoke.c for.cond.preheader: ; preds = %invoke.cont7 %size_ = getelementptr inbounds nuw i8, ptr %this, i64 128 %16 = load i64, ptr %size_, align 8, !tbaa !47 - %cmp104 = icmp ult i64 %sub.ptr.div.i.i, %16 + %invariant.op = add i64 %sub.ptr.sub.i.i, -8 + %cmp105 = icmp ult i64 %sub.ptr.div.i.i, %16 %.pre = load ptr, ptr %covariance, align 8, !tbaa !3 - br i1 %cmp104, label %invoke.cont30.lr.ph, label %for.cond.cleanup + br i1 %cmp105, label %invoke.cont30.lr.ph, label %for.cond.cleanup invoke.cont30.lr.ph: ; preds = %for.cond.preheader %accrualPeriod_ = getelementptr inbounds nuw i8, ptr %this, i64 280 @@ -3951,8 +3952,7 @@ invoke.cont30: ; preds = %invoke.cont30.lr.ph %arrayidx.i50 = getelementptr inbounds nuw i8, ptr %19, i64 %arrayidx.i50.idx store double %div, ptr %arrayidx.i50, align 8, !tbaa !78 %gep = getelementptr double, ptr %invariant.gep, i64 %k.0105 - %31 = add nuw nsw i64 %arrayidx.i50.idx, 8 - %cmp.not5.i = icmp samesign eq i64 %sub.ptr.sub.i.i, %31 + %cmp.not5.i = icmp samesign eq i64 %arrayidx.i50.idx, %invariant.op br i1 %cmp.not5.i, label %invoke.cont34, label %for.body.i for.body.i: ; preds = %invoke.cont30, %for.body.i diff --git a/bench/quiche-rs/optimized/7uu0743ctz557px8xpqxzn9zi.ll b/bench/quiche-rs/optimized/7uu0743ctz557px8xpqxzn9zi.ll index a3e3a8de707..e83ec026a53 100644 --- a/bench/quiche-rs/optimized/7uu0743ctz557px8xpqxzn9zi.ll +++ b/bench/quiche-rs/optimized/7uu0743ctz557px8xpqxzn9zi.ll @@ -2545,6 +2545,7 @@ define hidden noundef ptr @"_ZN94_$LT$inquire..ui..backend..Backend$LT$T$GT$$u20 %20 = getelementptr inbounds nuw i8, ptr %1, i64 24 %21 = load i64, ptr %20, align 8, !noundef !4 %22 = getelementptr inbounds nuw { ptr, i64 }, ptr %19, i64 %21 + %invariant.op = add i64 %21, -1 %23 = load i64, ptr %1, align 8, !range !3 %24 = trunc nuw i64 %23 to i1 %25 = getelementptr inbounds nuw i8, ptr %1, i64 8 @@ -2624,7 +2625,7 @@ define hidden noundef ptr @"_ZN94_$LT$inquire..ui..backend..Backend$LT$T$GT$$u20 br label %"_ZN7inquire2ui7backend16Backend$LT$T$GT$19print_option_prefix17he19c7ec3b789bb48E.exit" 55: ; preds = %52 - %56 = icmp ne i64 %50, %21 + %56 = icmp ne i64 %.sroa.8.0, %invariant.op %or.cond5.i = select i1 %56, i1 true, i1 %33 br i1 %or.cond5.i, label %58, label %59 diff --git a/bench/quinn-rs/optimized/em94uyxz0wp9gccfab963606p.ll b/bench/quinn-rs/optimized/em94uyxz0wp9gccfab963606p.ll index 34fa996ada2..d0ac1aa96b3 100644 --- a/bench/quinn-rs/optimized/em94uyxz0wp9gccfab963606p.ll +++ b/bench/quinn-rs/optimized/em94uyxz0wp9gccfab963606p.ll @@ -4160,7 +4160,7 @@ define noundef zeroext i1 @_ZN11quinn_proto9range_set15array_range_set13ArrayRan br i1 %44, label %47, label %45 "_ZN7tinyvec7tinyvec16TinyVec$LT$A$GT$4push17h8a8b9b22489ca452E.exit": ; preds = %49, %.thread40, %62, %"_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h05b403b6c4741911E.exit33", %"_ZN4core3ptr109drop_in_place$LT$tinyvec..tinyvec..TinyVec$LT$$u5b$core..ops..range..Range$LT$u64$GT$$u3b$$u20$2$u5d$$GT$$GT$17h94f331ee33f8c12dE.exit.i", %"_ZN7tinyvec8arrayvec17ArrayVec$LT$A$GT$8try_push17ha8cc315bfb4bf1c4E.exit.i", %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17hf7df4a505fdd4d65E.exit.i", %3, %47 - %.sroa.0.1 = phi i1 [ true, %"_ZN7tinyvec8arrayvec17ArrayVec$LT$A$GT$8try_push17ha8cc315bfb4bf1c4E.exit.i" ], [ true, %47 ], [ true, %.thread40 ], [ false, %3 ], [ true, %"_ZN4core3ptr109drop_in_place$LT$tinyvec..tinyvec..TinyVec$LT$$u5b$core..ops..range..Range$LT$u64$GT$$u3b$$u20$2$u5d$$GT$$GT$17h94f331ee33f8c12dE.exit.i" ], [ true, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17hf7df4a505fdd4d65E.exit.i" ], [ true, %"_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h05b403b6c4741911E.exit33" ], [ true, %62 ], [ %.sroa.0.2, %49 ] + %.sroa.0.1 = phi i1 [ true, %"_ZN7tinyvec8arrayvec17ArrayVec$LT$A$GT$8try_push17ha8cc315bfb4bf1c4E.exit.i" ], [ true, %47 ], [ true, %.thread40 ], [ false, %3 ], [ true, %"_ZN4core3ptr109drop_in_place$LT$tinyvec..tinyvec..TinyVec$LT$$u5b$core..ops..range..Range$LT$u64$GT$$u3b$$u20$2$u5d$$GT$$GT$17h94f331ee33f8c12dE.exit.i" ], [ true, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17hf7df4a505fdd4d65E.exit.i" ], [ true, %"_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h05b403b6c4741911E.exit33" ], [ true, %61 ], [ %.sroa.0.2, %49 ] ret i1 %.sroa.0.1 45: ; preds = %"_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hd3aa1c250e3a7311E.exit" @@ -4204,16 +4204,14 @@ define noundef zeroext i1 @_ZN11quinn_proto9range_set15array_range_set13ArrayRan 62: ; preds = %59 %63 = load i64, ptr %7, align 8, !noundef !3 - %64 = add nsw i64 %63, -1 - %.not22 = icmp eq i64 %.sroa.03.0, %64 + %.not22 = icmp eq i64 %63, %57 br i1 %.not22, label %"_ZN7tinyvec7tinyvec16TinyVec$LT$A$GT$4push17h8a8b9b22489ca452E.exit", label %"_ZN87_$LT$tinyvec..tinyvec..TinyVec$LT$A$GT$$u20$as$u20$core..ops..index..Index$LT$I$GT$$GT$5index17hc5053c89cea360c0E.exit26" .thread40: ; preds = %59 %65 = load i16, ptr %5, align 8, !noundef !3 %66 = zext i16 %65 to i64 - %67 = add nsw i64 %66, -1 - %.not2242 = icmp eq i64 %.sroa.03.0, %67 - br i1 %.not2242, label %"_ZN7tinyvec7tinyvec16TinyVec$LT$A$GT$4push17h8a8b9b22489ca452E.exit", label %68 + %.not2242 = icmp eq i64 %57, %64 + br i1 %.not2242, label %"_ZN7tinyvec7tinyvec16TinyVec$LT$A$GT$4push17h8a8b9b22489ca452E.exit", label %65 68: ; preds = %.thread40 %69 = icmp ugt i16 %65, 2 @@ -4252,8 +4250,8 @@ define noundef zeroext i1 @_ZN11quinn_proto9range_set15array_range_set13ArrayRan unreachable "_ZN87_$LT$tinyvec..tinyvec..TinyVec$LT$A$GT$$u20$as$u20$core..ops..index..Index$LT$I$GT$$GT$5index17hc5053c89cea360c0E.exit": ; preds = %77, %74 - %.pn52 = phi ptr [ %75, %74 ], [ %6, %77 ] - %.pn50 = phi i64 [ %76, %74 ], [ %79, %77 ] + %.pn52 = phi ptr [ %75, %71 ], [ %6, %74 ] + %.pn50 = phi i64 [ %76, %71 ], [ %79, %74 ] %.pn = getelementptr inbounds nuw { i64, i64 }, ptr %.pn52, i64 %.sroa.03.0 %.val32150.in = getelementptr i8, ptr %.pn, i64 8 %.val32150 = load i64, ptr %.val32150.in, align 8, !alias.scope !510, !noundef !3 @@ -4292,8 +4290,8 @@ define noundef zeroext i1 @_ZN11quinn_proto9range_set15array_range_set13ArrayRan unreachable "_ZN90_$LT$tinyvec..tinyvec..TinyVec$LT$A$GT$$u20$as$u20$core..ops..index..IndexMut$LT$I$GT$$GT$9index_mut17h7732e039d6f7b4acE.exit": ; preds = %90, %87 - %.pn55 = phi ptr [ %88, %87 ], [ %6, %90 ] - %.pn53 = phi i64 [ %89, %87 ], [ %92, %90 ] + %.pn55 = phi ptr [ %88, %84 ], [ %6, %87 ] + %.pn53 = phi i64 [ %89, %84 ], [ %92, %87 ] %95 = icmp ult i64 %.sroa.03.0, %.pn53 br i1 %95, label %"_ZN75_$LT$usize$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$9index_mut17hd3aa1c250e3a7311E.exit35", label %96 diff --git a/bench/regex-rs/optimized/6c2onrqlphpgxx0.ll b/bench/regex-rs/optimized/6c2onrqlphpgxx0.ll index 3feecf5824b..638d3a55f98 100644 --- a/bench/regex-rs/optimized/6c2onrqlphpgxx0.ll +++ b/bench/regex-rs/optimized/6c2onrqlphpgxx0.ll @@ -4288,11 +4288,12 @@ define internal fastcc void @_ZN4core5slice4sort25insertion_sort_shift_left17h6f call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %.sroa.8.i, ptr noundef nonnull align 1 dereferenceable(7) %.sroa.713.0..sroa_idx.i, i64 7, i1 false) tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %27, i64 32, i1 false), !alias.scope !745 %28 = add i64 %.sroa.01.03, -1 + %invariant.op.i = add i8 %19, 1 %.not17.i = icmp eq i64 %28, 0 br i1 %.not17.i, label %.thread.i, label %.lr.ph.i .thread.i: ; preds = %44, %.lr.ph.i, %26 - %.sroa.5.0.lcssa.i = phi ptr [ %27, %26 ], [ %.sroa.5.018.i, %.lr.ph.i ], [ %0, %44 ] + %.sroa.5.0.lcssa.i = phi ptr [ %27, %26 ], [ %.sroa.5.018.i, %.lr.ph.i ], [ %0, %43 ] store i64 %.sroa.010.0.copyload.i, ptr %.sroa.5.0.lcssa.i, align 8, !alias.scope !745 %.sroa.5.0..sroa.5.0.sroa_idx.i = getelementptr inbounds nuw i8, ptr %.sroa.5.0.lcssa.i, i64 8 store ptr %.val.i.i.i.i, ptr %.sroa.5.0..sroa.5.0.sroa_idx.i, align 8, !alias.scope !745 @@ -4306,8 +4307,8 @@ define internal fastcc void @_ZN4core5slice4sort25insertion_sort_shift_left17h6f br label %_ZN4core5slice4sort11insert_tail17h8dcf42bd1a58aa57E.exit .lr.ph.i: ; preds = %26, %44 - %.sroa.4.019.i = phi i64 [ %29, %44 ], [ %28, %26 ] - %.sroa.5.018.i = phi ptr [ %30, %44 ], [ %27, %26 ] + %.sroa.4.019.i = phi i64 [ %29, %43 ], [ %28, %26 ] + %.sroa.5.018.i = phi ptr [ %30, %43 ], [ %27, %26 ] %29 = add i64 %.sroa.4.019.i, -1 %30 = getelementptr inbounds { { { i64, ptr }, i64 }, i8, [7 x i8] }, ptr %0, i64 %29 tail call void @llvm.experimental.noalias.scope.decl(metadata !775) @@ -4326,11 +4327,10 @@ define internal fastcc void @_ZN4core5slice4sort25insertion_sort_shift_left17h6f %37 = icmp eq i64 %spec.store.select.i.i.i.i.i.i18.i, 0 %38 = getelementptr inbounds nuw i8, ptr %30, i64 24 %39 = load i8, ptr %38, align 8, !range !304, !alias.scope !784, !noalias !785 - %40 = sub nsw i8 %19, %39 - %41 = icmp eq i8 %40, -1 - %42 = icmp slt i64 %spec.store.select.i.i.i.i.i.i18.i, 0 - %43 = select i1 %37, i1 %41, i1 %42 - br i1 %43, label %44, label %.thread.i + %40 = icmp eq i8 %39, %invariant.op.i + %41 = icmp slt i64 %spec.store.select.i.i.i.i.i.i18.i, 0 + %42 = select i1 %37, i1 %40, i1 %41 + br i1 %42, label %43, label %.thread.i 44: ; preds = %.lr.ph.i tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %.sroa.5.018.i, ptr noundef nonnull align 8 dereferenceable(32) %30, i64 32, i1 false), !alias.scope !745 diff --git a/bench/rocksdb/optimized/block_cache_tier.ll b/bench/rocksdb/optimized/block_cache_tier.ll index bb76096fd71..5dce6421564 100644 --- a/bench/rocksdb/optimized/block_cache_tier.ll +++ b/bench/rocksdb/optimized/block_cache_tier.ll @@ -8486,6 +8486,7 @@ define linkonce_odr void @_ZN7rocksdb18EvictableHashTableINS_14BlockCacheFileENS .preheader17: ; preds = %11 %13 = load i8, ptr @_ZN7rocksdb23kDefaultToAdaptiveMutexE, align 1, !tbaa !26, !range !27, !noundef !28 %14 = trunc nuw i8 %13 to i1 + %invariant.op = add nsw i64 %8, -56 br label %15 15: ; preds = %.preheader17, %17 @@ -8500,9 +8501,8 @@ define linkonce_odr void @_ZN7rocksdb18EvictableHashTableINS_14BlockCacheFileENS %18 = getelementptr inbounds nuw i8, ptr %.ptr.ptr, i64 48 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %18, i8 0, i64 16, i1 false) %.add = add nuw nsw i64 %.idx, 64 - %19 = add nuw nsw i64 %.idx, 56 - %20 = icmp eq i64 %19, %8 - br i1 %20, label %.loopexit18, label %15 + %19 = icmp eq i64 %.idx, %invariant.op + br i1 %19, label %.loopexit18, label %15 .loopexit18: ; preds = %17, %11 %.ptr10 = getelementptr inbounds nuw i8, ptr %10, i64 8 @@ -8522,7 +8522,7 @@ define linkonce_odr void @_ZN7rocksdb18EvictableHashTableINS_14BlockCacheFileENS br i1 %26, label %.loopexit, label %.preheader .preheader: ; preds = %24, %.preheader - %.idx11 = phi i64 [ %.add12, %.preheader ], [ %.idx, %24 ] + %.idx11 = phi i64 [ %.add12, %.preheader ], [ %.idx, %23 ] %.add12 = add nsw i64 %.idx11, -64 %.ptr14 = getelementptr inbounds i8, ptr %10, i64 %.add12 tail call void @_ZN7rocksdb7LRUListINS_14BlockCacheFileEED2Ev(ptr noundef nonnull align 8 dereferenceable(64) %.ptr14) #21 @@ -8534,7 +8534,7 @@ define linkonce_odr void @_ZN7rocksdb18EvictableHashTableINS_14BlockCacheFileENS br label %28 28: ; preds = %.loopexit, %22 - %.pn = phi { ptr, i32 } [ %25, %.loopexit ], [ %23, %22 ] + %.pn = phi { ptr, i32 } [ %25, %.loopexit ], [ %23, %21 ] tail call void @_ZN7rocksdb9HashTableIPNS_14BlockCacheFileENS_22BlockCacheTierMetadata18BlockCacheFileHashENS3_19BlockCacheFileEqualEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #21 resume { ptr, i32 } %.pn } @@ -8597,17 +8597,20 @@ _ZNSt10unique_ptrIA_N7rocksdb9HashTableIPNS0_9BlockInfoENS0_22BlockCacheTierMeta %36 = icmp eq i32 %30, 0 br i1 %36, label %.loopexit24, label %.preheader23 -.preheader23: ; preds = %35, %37 - %.idx = phi i64 [ %.add, %37 ], [ 8, %35 ] +.preheader23: ; preds = %35 + %invariant.op = add nsw i64 %32, -48 + br label %37 + +37: ; preds = %.preheader23, %38 + %.idx = phi i64 [ %.add, %38 ], [ 8, %.preheader23 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %34, i64 %.idx invoke void @_ZN7rocksdb4port7RWMutexC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %.ptr.ptr) - to label %37 unwind label %57 + to label %38 unwind label %57 -37: ; preds = %.preheader23 +37: ; preds = %37 %.add = add nuw nsw i64 %.idx, 56 - %38 = add nuw nsw i64 %.idx, 48 - %39 = icmp eq i64 %38, %32 - br i1 %39, label %.loopexit24, label %.preheader23 + %39 = icmp eq i64 %.idx, %invariant.op + br i1 %39, label %.loopexit24, label %37 .loopexit24: ; preds = %37, %35 %.ptr12 = getelementptr inbounds nuw i8, ptr %34, i64 8 @@ -8653,7 +8656,7 @@ _ZNSt10unique_ptrIA_N7rocksdb4port7RWMutexESt14default_deleteIS3_EE5resetIPS2_vE cleanup br label %61 -57: ; preds = %.preheader23 +57: ; preds = %37 %58 = landingpad { ptr, i32 } cleanup %59 = icmp eq i64 %.idx, 8 @@ -8736,17 +8739,20 @@ _ZNSt10unique_ptrIA_N7rocksdb9HashTableIPNS0_14BlockCacheFileENS0_22BlockCacheTi %36 = icmp eq i32 %30, 0 br i1 %36, label %.loopexit24, label %.preheader23 -.preheader23: ; preds = %35, %37 - %.idx = phi i64 [ %.add, %37 ], [ 8, %35 ] +.preheader23: ; preds = %35 + %invariant.op = add nsw i64 %32, -48 + br label %37 + +37: ; preds = %.preheader23, %38 + %.idx = phi i64 [ %.add, %38 ], [ 8, %.preheader23 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %34, i64 %.idx invoke void @_ZN7rocksdb4port7RWMutexC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %.ptr.ptr) - to label %37 unwind label %57 + to label %38 unwind label %57 -37: ; preds = %.preheader23 +37: ; preds = %37 %.add = add nuw nsw i64 %.idx, 56 - %38 = add nuw nsw i64 %.idx, 48 - %39 = icmp eq i64 %38, %32 - br i1 %39, label %.loopexit24, label %.preheader23 + %39 = icmp eq i64 %.idx, %invariant.op + br i1 %39, label %.loopexit24, label %37 .loopexit24: ; preds = %37, %35 %.ptr12 = getelementptr inbounds nuw i8, ptr %34, i64 8 @@ -8792,7 +8798,7 @@ _ZNSt10unique_ptrIA_N7rocksdb4port7RWMutexESt14default_deleteIS3_EE5resetIPS2_vE cleanup br label %61 -57: ; preds = %.preheader23 +57: ; preds = %37 %58 = landingpad { ptr, i32 } cleanup %59 = icmp eq i64 %.idx, 8 diff --git a/bench/rocksdb/optimized/histogram_windowing.ll b/bench/rocksdb/optimized/histogram_windowing.ll index 6d4279f7a78..4db11f15201 100644 --- a/bench/rocksdb/optimized/histogram_windowing.ll +++ b/bench/rocksdb/optimized/histogram_windowing.ll @@ -154,17 +154,20 @@ _ZNSt10shared_ptrIN7rocksdb11SystemClockEEaSERKS2_.exit: ; preds = %10, %_ZNSt16 %58 = icmp eq i64 %47, 0 br i1 %58, label %.loopexit16, label %.preheader -.preheader: ; preds = %57, %59 - %.idx = phi i64 [ %.add, %59 ], [ 8, %57 ] +.preheader: ; preds = %57 + %invariant.op = add i64 %50, -912 + br label %60 + +60: ; preds = %61, %59 + %.idx = phi i64 [ 8, %59 ], [ %.add, %61 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %56, i64 %.idx invoke void @_ZN7rocksdb13HistogramStatC1Ev(ptr noundef nonnull align 8 dereferenceable(920) %.ptr.ptr) - to label %59 unwind label %.loopexit + to label %61 unwind label %.loopexit -59: ; preds = %.preheader +59: ; preds = %60 %.add = add nuw nsw i64 %.idx, 920 - %60 = add nuw nsw i64 %.idx, 912 - %61 = icmp eq i64 %60, %50 - br i1 %61, label %.loopexit16, label %.preheader + %62 = icmp eq i64 %.idx, %invariant.op + br i1 %.preheader, label %.loopexit16, label %60 .loopexit16: ; preds = %59, %57 %62 = load ptr, ptr %5, align 8, !tbaa !42 @@ -184,7 +187,7 @@ _ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EE5resetIPS1_ %66 = load ptr, ptr %0, align 8, !tbaa !4 %67 = getelementptr inbounds nuw i8, ptr %66, i64 16 %68 = load ptr, ptr %67, align 8 - invoke void %68(ptr noundef nonnull align 8 dereferenceable(1032) %0) + invoke void %69(ptr noundef nonnull align 8 dereferenceable(1032) %0) to label %69 unwind label %72 69: ; preds = %_ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EE5resetIPS1_vEEvT_.exit @@ -200,14 +203,14 @@ _ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EE5resetIPS1_ cleanup br label %75 -.loopexit: ; preds = %.preheader +.loopexit: ; preds = %60 %74 = landingpad { ptr, i32 } cleanup tail call void @_ZdaPvm(ptr noundef nonnull %56, i64 noundef %55) #14 br label %75 75: ; preds = %.loopexit, %72 - %.pn = phi { ptr, i32 } [ %73, %72 ], [ %74, %.loopexit ] + %.pn = phi { ptr, i32 } [ %73, %73 ], [ %74, %.loopexit ] %76 = load ptr, ptr %5, align 8, !tbaa !42 %.not.i = icmp eq ptr %76, null br i1 %.not.i, label %_ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EED2Ev.exit, label %_ZNKSt14default_deleteIA_N7rocksdb13HistogramStatEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i @@ -427,17 +430,20 @@ _ZNSt10shared_ptrIN7rocksdb11SystemClockEEaSERKS2_.exit: ; preds = %13, %_ZNSt16 %61 = icmp eq i64 %50, 0 br i1 %61, label %.loopexit19, label %.preheader -.preheader: ; preds = %60, %62 - %.idx = phi i64 [ %.add, %62 ], [ 8, %60 ] +.preheader: ; preds = %60 + %invariant.op = add i64 %53, -912 + br label %63 + +63: ; preds = %64, %62 + %.idx = phi i64 [ 8, %62 ], [ %.add, %64 ] %.ptr.ptr = getelementptr inbounds nuw i8, ptr %59, i64 %.idx invoke void @_ZN7rocksdb13HistogramStatC1Ev(ptr noundef nonnull align 8 dereferenceable(920) %.ptr.ptr) - to label %62 unwind label %.loopexit + to label %64 unwind label %.loopexit -62: ; preds = %.preheader +62: ; preds = %63 %.add = add nuw nsw i64 %.idx, 920 - %63 = add nuw nsw i64 %.idx, 912 - %64 = icmp eq i64 %63, %53 - br i1 %64, label %.loopexit19, label %.preheader + %65 = icmp eq i64 %.idx, %invariant.op + br i1 %64, label %.loopexit19, label %63 .loopexit19: ; preds = %62, %60 %65 = load ptr, ptr %8, align 8, !tbaa !42 @@ -457,8 +463,8 @@ _ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EE5resetIPS1_ %69 = load ptr, ptr %0, align 8, !tbaa !4 %70 = getelementptr inbounds nuw i8, ptr %69, i64 16 %71 = load ptr, ptr %70, align 8 - invoke void %71(ptr noundef nonnull align 8 dereferenceable(1032) %0) - to label %72 unwind label %75 + invoke void %72(ptr noundef nonnull align 8 dereferenceable(1032) %0) + to label %73 unwind label %75 72: ; preds = %_ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EE5resetIPS1_vEEvT_.exit ret void @@ -473,14 +479,14 @@ _ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EE5resetIPS1_ cleanup br label %78 -.loopexit: ; preds = %.preheader +.loopexit: ; preds = %63 %77 = landingpad { ptr, i32 } cleanup tail call void @_ZdaPvm(ptr noundef nonnull %59, i64 noundef %58) #14 br label %78 78: ; preds = %.loopexit, %75 - %.pn = phi { ptr, i32 } [ %76, %75 ], [ %77, %.loopexit ] + %.pn = phi { ptr, i32 } [ %76, %76 ], [ %77, %.loopexit ] %79 = load ptr, ptr %8, align 8, !tbaa !42 %.not.i = icmp eq ptr %79, null br i1 %.not.i, label %_ZNSt10unique_ptrIA_N7rocksdb13HistogramStatESt14default_deleteIS2_EED2Ev.exit, label %_ZNKSt14default_deleteIA_N7rocksdb13HistogramStatEEclIS1_EENSt9enable_ifIXsr14is_convertibleIPA_T_PS2_EE5valueEvE4typeEPS6_.exit.i diff --git a/bench/rocksdb/optimized/statistics.ll b/bench/rocksdb/optimized/statistics.ll index 4d86286b190..0ba7ace67b7 100644 --- a/bench/rocksdb/optimized/statistics.ll +++ b/bench/rocksdb/optimized/statistics.ll @@ -7815,6 +7815,7 @@ _ZN7rocksdb14StatisticsImpl14StatisticsDatanaEm.exit: ; preds = %7 %17 = getelementptr inbounds nuw i8, ptr %16, i64 56 store i64 %10, ptr %17, align 8 %.idx1314 = shl i64 62720, %9 + %invariant.op = add i64 %.idx1314, -62656 br label %18 18: ; preds = %_ZN7rocksdb14StatisticsImpl14StatisticsDataC2Ev.exit, %_ZN7rocksdb14StatisticsImpl14StatisticsDatanaEm.exit @@ -7847,9 +7848,8 @@ _ZN7rocksdb14StatisticsImpl14StatisticsDatanaEm.exit: ; preds = %7 _ZN7rocksdb14StatisticsImpl14StatisticsDataC2Ev.exit: ; preds = %.noexc15 %.add = add nuw nsw i64 %.idx, 62720 - %25 = add nuw nsw i64 %.idx, 62656 - %26 = icmp eq i64 %25, %.idx1314 - br i1 %26, label %27, label %18 + %25 = icmp eq i64 %.idx, %invariant.op + br i1 %25, label %26, label %18 27: ; preds = %_ZN7rocksdb14StatisticsImpl14StatisticsDataC2Ev.exit %.ptr7 = getelementptr inbounds nuw i8, ptr %16, i64 64 @@ -7892,7 +7892,7 @@ _ZNSt10unique_ptrIA_N7rocksdb14StatisticsImpl14StatisticsDataESt14default_delete unreachable _ZN7rocksdb14StatisticsImpl14StatisticsDatadaEPv.exit: ; preds = %.loopexit, %33 - %.pn = phi { ptr, i32 } [ %34, %33 ], [ %35, %.loopexit ] + %.pn = phi { ptr, i32 } [ %34, %32 ], [ %35, %.loopexit ] tail call void @_ZNSt10unique_ptrIA_N7rocksdb14StatisticsImpl14StatisticsDataESt14default_deleteIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #32 resume { ptr, i32 } %.pn } diff --git a/bench/ruff-rs/optimized/3962cj1utxtdqcwyobmnzow9t.ll b/bench/ruff-rs/optimized/3962cj1utxtdqcwyobmnzow9t.ll index 64ba6dbed8a..3723c3ba31a 100644 --- a/bench/ruff-rs/optimized/3962cj1utxtdqcwyobmnzow9t.ll +++ b/bench/ruff-rs/optimized/3962cj1utxtdqcwyobmnzow9t.ll @@ -8228,6 +8228,9 @@ _ZN21ruff_python_formatter8comments6format20strip_comment_prefix17h2e2c2de330183 call void @llvm.lifetime.start.p0(ptr nonnull %19) %94 = getelementptr inbounds nuw i8, ptr %36, i64 %35 %95 = ptrtoint ptr %94 to i64 + %invariant.op.i.i = add i64 %35, -1 + %invariant.op6.i.i = add i64 %35, -2 + %invariant.op7.i.i = add i64 %35, -3 %.neg.i.i.i = sub i64 %35, %95 br label %96 @@ -8246,51 +8249,48 @@ _ZN21ruff_python_formatter8comments6format20strip_comment_prefix17h2e2c2de330183 %103 = getelementptr inbounds nuw i8, ptr %98, i64 1 %104 = and i8 %101, 31 %105 = zext nneg i8 %104 to i32 - %106 = add nuw nsw i64 %97, 1 - %107 = icmp samesign ne i64 %106, %35 - call void @llvm.assume(i1 %107) - %108 = getelementptr inbounds nuw i8, ptr %98, i64 2 - %109 = load i8, ptr %103, align 1, !alias.scope !1054, !noalias !1057, !noundef !3 - %110 = shl nuw nsw i32 %105, 6 - %111 = and i8 %109, 63 - %112 = zext nneg i8 %111 to i32 - %113 = or disjoint i32 %110, %112 - %114 = icmp samesign ugt i8 %101, -33 - br i1 %114, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h9270fe57bce9436eE.exit.i.i" + %106 = icmp samesign ne i64 %97, %invariant.op.i.i + call void @llvm.assume(i1 %106) + %107 = getelementptr inbounds nuw i8, ptr %98, i64 2 + %108 = load i8, ptr %103, align 1, !alias.scope !1054, !noalias !1057, !noundef !3 + %109 = shl nuw nsw i32 %105, 6 + %110 = and i8 %108, 63 + %111 = zext nneg i8 %110 to i32 + %112 = or disjoint i32 %109, %111 + %113 = icmp samesign ugt i8 %101, -33 + br i1 %113, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h9270fe57bce9436eE.exit.i.i" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit12.i.i.i.i55" - %115 = add nuw nsw i64 %97, 2 - %116 = icmp samesign ne i64 %115, %35 - call void @llvm.assume(i1 %116) - %117 = getelementptr inbounds nuw i8, ptr %98, i64 3 - %118 = load i8, ptr %108, align 1, !alias.scope !1054, !noalias !1057, !noundef !3 - %119 = shl nuw nsw i32 %112, 6 - %120 = and i8 %118, 63 - %121 = zext nneg i8 %120 to i32 - %122 = or disjoint i32 %119, %121 - %123 = shl nuw nsw i32 %105, 12 - %124 = or disjoint i32 %122, %123 - %125 = icmp samesign ugt i8 %101, -17 - br i1 %125, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h9270fe57bce9436eE.exit.i.i" + %114 = icmp samesign ne i64 %97, %invariant.op6.i.i + call void @llvm.assume(i1 %114) + %115 = getelementptr inbounds nuw i8, ptr %98, i64 3 + %116 = load i8, ptr %107, align 1, !alias.scope !1054, !noalias !1057, !noundef !3 + %117 = shl nuw nsw i32 %111, 6 + %118 = and i8 %116, 63 + %119 = zext nneg i8 %118 to i32 + %120 = or disjoint i32 %117, %119 + %121 = shl nuw nsw i32 %105, 12 + %122 = or disjoint i32 %120, %121 + %123 = icmp samesign ugt i8 %101, -17 + br i1 %123, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58", label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h9270fe57bce9436eE.exit.i.i" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57" - %126 = add nuw nsw i64 %97, 3 - %127 = icmp samesign ne i64 %126, %35 - call void @llvm.assume(i1 %127) - %128 = getelementptr inbounds nuw i8, ptr %98, i64 4 - %129 = load i8, ptr %117, align 1, !alias.scope !1054, !noalias !1057, !noundef !3 - %130 = shl nuw nsw i32 %105, 18 - %131 = and i32 %130, 1835008 - %132 = shl nuw nsw i32 %122, 6 - %133 = and i8 %129, 63 - %134 = zext nneg i8 %133 to i32 - %135 = or disjoint i32 %132, %134 - %136 = or disjoint i32 %135, %131 + %124 = icmp samesign ne i64 %97, %invariant.op7.i.i + call void @llvm.assume(i1 %124) + %125 = getelementptr inbounds nuw i8, ptr %98, i64 4 + %126 = load i8, ptr %115, align 1, !alias.scope !1054, !noalias !1057, !noundef !3 + %127 = shl nuw nsw i32 %105, 18 + %128 = and i32 %127, 1835008 + %129 = shl nuw nsw i32 %120, 6 + %130 = and i8 %126, 63 + %131 = zext nneg i8 %130 to i32 + %132 = or disjoint i32 %129, %131 + %135 = or disjoint i32 %132, %128 br label %"_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h9270fe57bce9436eE.exit.i.i" "_ZN81_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h9270fe57bce9436eE.exit.i.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit12.i.i.i.i55" - %.sroa.0.0.ph.i.i.i = phi ptr [ %108, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit12.i.i.i.i55" ], [ %117, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57" ], [ %128, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58" ] - %.sroa.4.0.i.ph.i.i.i56 = phi i32 [ %113, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit12.i.i.i.i55" ], [ %124, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57" ], [ %136, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58" ] + %.sroa.0.0.ph.i.i.i = phi ptr [ %107, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit12.i.i.i.i55" ], [ %115, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57" ], [ %125, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58" ] + %.sroa.4.0.i.ph.i.i.i56 = phi i32 [ %112, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit12.i.i.i.i55" ], [ %122, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit14.i.i.i.i57" ], [ %133, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h223e5af2d791cb36E.exit16.i.i.i.i58" ] %137 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.i56, 1114112 call void @llvm.assume(i1 %137) %138 = ptrtoint ptr %.sroa.0.0.ph.i.i.i to i64 @@ -8377,11 +8377,10 @@ _ZN21ruff_python_formatter8comments6format20strip_comment_prefix17h2e2c2de330183 br label %166 160: ; preds = %154, %152 - %161 = add i64 %35, -2 - %162 = getelementptr inbounds nuw i8, ptr %36, i64 2 - store ptr %162, ptr %15, align 8 - %163 = getelementptr inbounds nuw i8, ptr %15, i64 8 - store i64 %161, ptr %163, align 8 + %158 = getelementptr inbounds nuw i8, ptr %36, i64 2 + store ptr %158, ptr %15, align 8 + %159 = getelementptr inbounds nuw i8, ptr %15, i64 8 + store i64 %invariant.op6.i.i, ptr %159, align 8 store ptr %15, ptr %16, align 8 %.sroa.445.0..sroa_idx = getelementptr inbounds nuw i8, ptr %16, i64 8 store ptr @"_ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hf0995410dacd337cE", ptr %.sroa.445.0..sroa_idx, align 8 diff --git a/bench/ruff-rs/optimized/bat91tmhz9zqtv9nbte3nknzg.ll b/bench/ruff-rs/optimized/bat91tmhz9zqtv9nbte3nknzg.ll index f4d13290ecb..27092173e9b 100644 --- a/bench/ruff-rs/optimized/bat91tmhz9zqtv9nbte3nknzg.ll +++ b/bench/ruff-rs/optimized/bat91tmhz9zqtv9nbte3nknzg.ll @@ -299,7 +299,7 @@ define internal fastcc void @"_ZN5alloc3str21_$LT$impl$u20$str$GT$7replace17h92a .loopexit: ; preds = %.loopexit.split-lp, %.loopexit.split.us, %.loopexit.split.split.us, %16 %.pn = phi { ptr, i32 } [ %17, %16 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit.us157, %.loopexit.split.split.us ], [ %lpad.loopexit.us, %.loopexit.split.us ] invoke void @"_ZN4core3ptr42drop_in_place$LT$alloc..string..String$GT$17h77dc74e7efeab628E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %6) #16 - to label %192 unwind label %190 + to label %189 unwind label %190 16: ; preds = %"_ZN5alloc7raw_vec20RawVecInner$LT$A$GT$16with_capacity_in17hf52a03f3087b4829E.exit", %.critedge20 %17 = landingpad { ptr, i32 } @@ -329,6 +329,9 @@ define internal fastcc void @"_ZN5alloc3str21_$LT$impl$u20$str$GT$7replace17h92a call void @llvm.lifetime.end.p0(ptr nonnull %5) %18 = trunc nuw i64 %.sroa.041.0.copyload to i1 %19 = icmp ne ptr %.sroa.1250.0.copyload, null + %invariant.op.i = add i64 %.sroa.1351.0.copyload, -1 + %invariant.op26.i = add i64 %.sroa.1351.0.copyload, -2 + %invariant.op27.i = add i64 %.sroa.1351.0.copyload, -3 %20 = icmp ne ptr %.sroa.14.0.copyload, null %21 = add i64 %.sroa.15.0.copyload, -1 br i1 %18, label %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.us", label %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split" @@ -542,9 +545,9 @@ define internal fastcc void @"_ZN5alloc3str21_$LT$impl$u20$str$GT$7replace17h92a br label %.preheader.i.us .preheader.i.us: ; preds = %181, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" - %.sroa.48.0.us146 = phi i64 [ %.sroa.442.0.copyload, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" ], [ %.sroa.48.1.us204, %181 ] - %.sroa.810.sroa.0.0.us147 = phi i1 [ %117, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" ], [ false, %181 ] - %.sroa.07.0.us148 = phi i64 [ 0, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" ], [ %.sroa.48.1.us204, %181 ] + %.sroa.48.0.us146 = phi i64 [ %.sroa.442.0.copyload, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" ], [ %.sroa.48.1.us204, %178 ] + %.sroa.810.sroa.0.0.us147 = phi i1 [ %117, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" ], [ false, %178 ] + %.sroa.07.0.us148 = phi i64 [ 0, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split.split.us" ], [ %.sroa.48.1.us204, %178 ] br label %118 118: ; preds = %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us", %.preheader.i.us @@ -575,90 +578,87 @@ define internal fastcc void @"_ZN5alloc3str21_$LT$impl$u20$str$GT$7replace17h92a 131: ; preds = %128 %132 = load i8, ptr %129, align 1, !noalias !45, !noundef !12 %133 = icmp sgt i8 %132, -1 - br i1 %133, label %167, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" + br i1 %133, label %164, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us": ; preds = %131 %134 = getelementptr inbounds nuw i8, ptr %129, i64 1 %135 = and i8 %132, 31 %136 = zext nneg i8 %135 to i32 - %137 = add nuw nsw i64 %.sroa.48.1.us, 1 - %138 = icmp samesign ne i64 %137, %.sroa.1351.0.copyload - call void @llvm.assume(i1 %138) - %139 = load i8, ptr %134, align 1, !noalias !45, !noundef !12 - %140 = shl nuw nsw i32 %136, 6 - %141 = and i8 %139, 63 - %142 = zext nneg i8 %141 to i32 - %143 = or disjoint i32 %140, %142 - %144 = icmp samesign ugt i8 %132, -33 - br i1 %144, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us", label %169 + %137 = icmp samesign ne i64 %.sroa.48.1.us, %invariant.op.i + call void @llvm.assume(i1 %137) + %138 = load i8, ptr %134, align 1, !noalias !45, !noundef !12 + %139 = shl nuw nsw i32 %136, 6 + %140 = and i8 %138, 63 + %141 = zext nneg i8 %140 to i32 + %142 = or disjoint i32 %139, %141 + %143 = icmp samesign ugt i8 %132, -33 + br i1 %143, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us", label %166 "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" %145 = getelementptr inbounds nuw i8, ptr %129, i64 2 - %146 = add nuw nsw i64 %.sroa.48.1.us, 2 - %147 = icmp samesign ne i64 %146, %.sroa.1351.0.copyload - call void @llvm.assume(i1 %147) - %148 = load i8, ptr %145, align 1, !noalias !45, !noundef !12 - %149 = shl nuw nsw i32 %142, 6 - %150 = and i8 %148, 63 - %151 = zext nneg i8 %150 to i32 - %152 = or disjoint i32 %149, %151 - %153 = shl nuw nsw i32 %136, 12 - %154 = or disjoint i32 %152, %153 - %155 = icmp samesign ugt i8 %132, -17 - br i1 %155, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us", label %169 + %145 = icmp samesign ne i64 %.sroa.48.1.us, %invariant.op26.i + call void @llvm.assume(i1 %145) + %146 = load i8, ptr %144, align 1, !noalias !45, !noundef !12 + %147 = shl nuw nsw i32 %141, 6 + %148 = and i8 %146, 63 + %149 = zext nneg i8 %148 to i32 + %150 = or disjoint i32 %147, %149 + %151 = shl nuw nsw i32 %136, 12 + %152 = or disjoint i32 %150, %151 + %153 = icmp samesign ugt i8 %132, -17 + br i1 %153, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us", label %166 "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us" %156 = getelementptr inbounds nuw i8, ptr %129, i64 3 - %157 = add nuw nsw i64 %.sroa.48.1.us, 3 - %158 = icmp samesign ne i64 %157, %.sroa.1351.0.copyload - call void @llvm.assume(i1 %158) - %159 = load i8, ptr %156, align 1, !noalias !45, !noundef !12 - %160 = shl nuw nsw i32 %136, 18 - %161 = and i32 %160, 1835008 - %162 = shl nuw nsw i32 %152, 6 - %163 = and i8 %159, 63 - %164 = zext nneg i8 %163 to i32 - %165 = or disjoint i32 %162, %164 - %166 = or disjoint i32 %165, %161 - br label %169 - -167: ; preds = %131 - %168 = zext nneg i8 %132 to i32 - br label %169 - -169: ; preds = %167, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" - %.sroa.4.0.i.ph.i.i.us = phi i32 [ %154, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us" ], [ %166, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us" ], [ %143, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" ], [ %168, %167 ] - %170 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 1114112 - call void @llvm.assume(i1 %170) - br i1 %119, label %.loopexit.i.us149, label %171 - -171: ; preds = %169 - %172 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 128 - br i1 %172, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us", label %173 - -173: ; preds = %171 - %174 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 2048 - br i1 %174, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us", label %175 - -175: ; preds = %173 - %176 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 65536 - %..i.i.us = select i1 %176, i64 3, i64 4 + %155 = icmp samesign ne i64 %.sroa.48.1.us, %invariant.op27.i + call void @llvm.assume(i1 %155) + %156 = load i8, ptr %154, align 1, !noalias !45, !noundef !12 + %157 = shl nuw nsw i32 %136, 18 + %158 = and i32 %157, 1835008 + %159 = shl nuw nsw i32 %150, 6 + %160 = and i8 %156, 63 + %161 = zext nneg i8 %160 to i32 + %162 = or disjoint i32 %159, %161 + %165 = or disjoint i32 %162, %158 + br label %166 + +164: ; preds = %131 + %165 = zext nneg i8 %132 to i32 + br label %166 + +166: ; preds = %164, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" + %.sroa.4.0.i.ph.i.i.us = phi i32 [ %152, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit14.i.i.i.us" ], [ %163, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit16.i.i.i.us" ], [ %142, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h3094bbf31f161de0E.exit12.i.i.i.us" ], [ %165, %164 ] + %167 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 1114112 + call void @llvm.assume(i1 %167) + br i1 %119, label %.loopexit.i.us149, label %168 + +168: ; preds = %166 + %169 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 128 + br i1 %169, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us", label %170 + +170: ; preds = %168 + %171 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 2048 + br i1 %171, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us", label %172 + +172: ; preds = %170 + %173 = icmp samesign ult i32 %.sroa.4.0.i.ph.i.i.us, 65536 + %..i.i.us = select i1 %173, i64 3, i64 4 br label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us" -"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us": ; preds = %175, %173, %171 - %.sroa.01.0.i.i.us = phi i64 [ 2, %173 ], [ %..i.i.us, %175 ], [ 1, %171 ] +"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$4next17h934bd5cedbd0d186E.exit.i.us": ; preds = %172, %170, %168 + %.sroa.01.0.i.i.us = phi i64 [ 2, %170 ], [ %..i.i.us, %172 ], [ 1, %168 ] %177 = add i64 %.sroa.01.0.i.i.us, %.sroa.48.1.us br label %118 178: ; preds = %128 br i1 %119, label %.loopexit.i.us149, label %.critedge20 -.loopexit.i.us149: ; preds = %169, %178 - %.sroa.48.1.us204 = phi i64 [ %.sroa.1351.0.copyload, %178 ], [ %.sroa.48.1.us, %169 ] +.loopexit.i.us149: ; preds = %166, %178 + %.sroa.48.1.us204 = phi i64 [ %.sroa.1351.0.copyload, %175 ], [ %.sroa.48.1.us, %166 ] %179 = getelementptr inbounds nuw i8, ptr %1, i64 %.sroa.07.0.us148 %180 = getelementptr inbounds nuw i8, ptr %1, i64 %.sroa.48.1.us204 invoke void @"_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17he435a9e90b5ea3ffE"(ptr noalias noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull %179, ptr noundef nonnull %180, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.0ca76464b2e8e510ae63dcf0a8444076.25) - to label %181 unwind label %.loopexit.split.split.us + to label %178 unwind label %.loopexit.split.split.us 181: ; preds = %.loopexit.i.us149 invoke void @"_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17he435a9e90b5ea3ffE"(ptr noalias noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull @anon.0ca76464b2e8e510ae63dcf0a8444076.150, ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @anon.0ca76464b2e8e510ae63dcf0a8444076.150, i64 5), ptr noalias noundef readonly align 8 dereferenceable(24) @anon.0ca76464b2e8e510ae63dcf0a8444076.25) @@ -702,11 +702,11 @@ define internal fastcc void @"_ZN5alloc3str21_$LT$impl$u20$str$GT$7replace17h92a br label %.loopexit .critedge20: ; preds = %178, %72, %28, %.sink.split.i.us, %112, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split" - %.sroa.07.0112 = phi i64 [ %.sroa.07.0.us, %72 ], [ 0, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split" ], [ %.sroa.07.0.us, %.sink.split.i.us ], [ %.sroa.07.0.us, %112 ], [ %.sroa.07.0.us, %28 ], [ %.sroa.07.0.us148, %178 ] + %.sroa.07.0112 = phi i64 [ %.sroa.07.0.us, %72 ], [ 0, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$13into_searcher17h2654c6b5f23cd4cfE.exit.split" ], [ %.sroa.07.0.us, %.sink.split.i.us ], [ %.sroa.07.0.us, %112 ], [ %.sroa.07.0.us, %28 ], [ %.sroa.07.0.us148, %175 ] %187 = getelementptr inbounds nuw i8, ptr %1, i64 %.sroa.07.0112 %188 = getelementptr inbounds nuw i8, ptr %1, i64 %2 invoke void @"_ZN132_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$$RF$T$C$core..slice..iter..Iter$LT$T$GT$$GT$$GT$11spec_extend17he435a9e90b5ea3ffE"(ptr noalias noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull %187, ptr noundef nonnull %188, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.0ca76464b2e8e510ae63dcf0a8444076.25) - to label %189 unwind label %16 + to label %186 unwind label %16 189: ; preds = %.critedge20 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %6, i64 24, i1 false) @@ -11296,6 +11296,7 @@ define internal fastcc void @_ZN19ruff_python_codegen9generator9Generator18unpar %9 = tail call { ptr, ptr } @"_ZN94_$LT$$RF$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..collect..IntoIterator$GT$9into_iter17hf654a21a4d84b4c4E"(ptr noalias noundef nonnull readonly align 8 dereferenceable(24) %8), !noalias !1823 %10 = extractvalue { ptr, ptr } %9, 0 %11 = extractvalue { ptr, ptr } %9, 1 + %invariant.op = add i64 %6, -1 %12 = getelementptr inbounds nuw i8, ptr %0, i64 40 %13 = getelementptr inbounds nuw i8, ptr %0, i64 49 %14 = icmp ult i64 %6, 144115188075855872 @@ -11448,7 +11449,7 @@ _ZN19ruff_python_codegen9generator9Generator1p17h945a79d7e53ba346E.exit42: ; pre _ZN19ruff_python_codegen9generator9Generator30unparse_parameter_with_default17h712e5d3d04f8c4c6E.exit: ; preds = %_ZN19ruff_python_codegen9generator9Generator17unparse_parameter17h18a0bd997947b856E.exit115, %_ZN19ruff_python_codegen9generator9Generator1p17h945a79d7e53ba346E.exit42 tail call void @llvm.assume(i1 %14) - %64 = icmp eq i64 %21, %6 + %64 = icmp eq i64 %.sroa.12.0, %invariant.op br i1 %64, label %65, label %_ZN19ruff_python_codegen9generator9Generator4p_if17hb616e9f1a73751a4E.exit.backedge _ZN19ruff_python_codegen9generator9Generator4p_if17hb616e9f1a73751a4E.exit.backedge: ; preds = %_ZN19ruff_python_codegen9generator9Generator30unparse_parameter_with_default17h712e5d3d04f8c4c6E.exit, %_ZN19ruff_python_codegen9generator9Generator1p17h945a79d7e53ba346E.exit.i diff --git a/bench/rust-analyzer-rs/optimized/5a391sezfv8ojps9.ll b/bench/rust-analyzer-rs/optimized/5a391sezfv8ojps9.ll index e52a34aa6b9..5314cedb37b 100644 --- a/bench/rust-analyzer-rs/optimized/5a391sezfv8ojps9.ll +++ b/bench/rust-analyzer-rs/optimized/5a391sezfv8ojps9.ll @@ -47,8 +47,8 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R br i1 %7, label %54, label %56 "_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit.thread": ; preds = %4, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit", %54, %56 - %.sroa.6.0 = phi i64 [ 14, %54 ], [ %57, %56 ], [ undef, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ undef, %4 ] - %.sroa.016.0 = phi ptr [ %55, %54 ], [ %58, %56 ], [ null, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ null, %4 ] + %.sroa.6.0 = phi i64 [ 14, %53 ], [ %57, %55 ], [ undef, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ undef, %4 ] + %.sroa.016.0 = phi ptr [ %55, %53 ], [ %58, %55 ], [ null, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ null, %4 ] %8 = getelementptr inbounds nuw i8, ptr %1, i64 32 %9 = load ptr, ptr %8, align 8, !nonnull !4, !noundef !4 %10 = getelementptr inbounds nuw i8, ptr %1, i64 40 @@ -61,6 +61,7 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R "_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.lr.ph.i": ; preds = %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit.thread" %.val2.i.i.fr.i = freeze ptr %.sroa.016.0 %.not.i2.i.i.i.i.i = icmp eq ptr %.val2.i.i.fr.i, null + %invariant.op.i = add i64 %.sroa.6.0, 2 br i1 %.not.i2.i.i.i.i.i, label %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.us.i", label %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.i" "_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.us.i": ; preds = %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.lr.ph.i", %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17hea0d24b938f00e9dE.exit.thread.i.i.i.i.us.i" @@ -113,7 +114,7 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R br i1 %31, label %.loopexit, label %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.us.i" "_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.i": ; preds = %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.lr.ph.i", %52 - %32 = phi ptr [ %33, %52 ], [ %9, %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.lr.ph.i" ] + %32 = phi ptr [ %33, %51 ], [ %9, %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hcdb72bf9299caa68E.exit.lr.ph.i" ] %33 = getelementptr inbounds nuw i8, ptr %32, i64 32 %.sroa.02.0.copyload3.i = load i32, ptr %32, align 8, !noalias !5 %.sroa.8.0..sroa_idx4.i = getelementptr inbounds nuw i8, ptr %32, i64 4 @@ -168,8 +169,7 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R "_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit.i.i.i.i.i.i.i": ; preds = %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17hea0d24b938f00e9dE.exit.thread.i.i.i.i.i" %rhsv.i.i = load i16, ptr %.sroa.8.sroa.6.0.copyload.i, align 2, !noalias !34 %.not.i.i = icmp eq i16 %rhsv.i.i, 24415 - %49 = add nsw i64 %.sroa.5.0.i.i.i.i, -2 - %.not.i5.i.i.i.i.i.i.i = icmp eq i64 %49, %.sroa.6.0 + %.not.i5.i.i.i.i.i.i.i = icmp eq i64 %.sroa.5.0.i.i.i.i, %invariant.op.i %or.cond.i.i.i.i.i.i = select i1 %.not.i.i, i1 %.not.i5.i.i.i.i.i.i.i, i1 false br i1 %or.cond.i.i.i.i.i.i, label %"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R$GT$$u20$as$u20$object..read..traits..Object$GT$21section_by_name_bytes28_$u7b$$u7b$closure$u7d$$u7d$17h852cbae30614f5f5E.exit.i.i", label %52 @@ -238,8 +238,8 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R br i1 %7, label %54, label %56 "_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit.thread": ; preds = %4, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit", %54, %56 - %.sroa.6.0 = phi i64 [ 14, %54 ], [ %57, %56 ], [ undef, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ undef, %4 ] - %.sroa.016.0 = phi ptr [ %55, %54 ], [ %58, %56 ], [ null, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ null, %4 ] + %.sroa.6.0 = phi i64 [ 14, %53 ], [ %57, %55 ], [ undef, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ undef, %4 ] + %.sroa.016.0 = phi ptr [ %55, %53 ], [ %58, %55 ], [ null, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit" ], [ null, %4 ] %8 = getelementptr inbounds nuw i8, ptr %1, i64 32 %9 = load ptr, ptr %8, align 8, !nonnull !4, !noundef !4 %10 = getelementptr inbounds nuw i8, ptr %1, i64 40 @@ -252,6 +252,7 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R "_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.lr.ph.i": ; preds = %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit.thread" %.val2.i.i.fr.i = freeze ptr %.sroa.016.0 %.not.i2.i.i.i.i.i = icmp eq ptr %.val2.i.i.fr.i, null + %invariant.op.i = add i64 %.sroa.6.0, 2 br i1 %.not.i2.i.i.i.i.i, label %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.us.i", label %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.i" "_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.us.i": ; preds = %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.lr.ph.i", %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17hea0d24b938f00e9dE.exit.thread.i.i.i.i.us.i" @@ -304,7 +305,7 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R br i1 %31, label %.loopexit, label %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.us.i" "_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.i": ; preds = %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.lr.ph.i", %52 - %32 = phi ptr [ %33, %52 ], [ %9, %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.lr.ph.i" ] + %32 = phi ptr [ %33, %51 ], [ %9, %"_ZN125_$LT$object..read..macho..section..MachOSectionIterator$LT$Mach$C$R$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hadf23ed5157e6ca4E.exit.lr.ph.i" ] %33 = getelementptr inbounds nuw i8, ptr %32, i64 32 %.sroa.02.0.copyload3.i = load i32, ptr %32, align 8, !noalias !40 %.sroa.8.0..sroa_idx4.i = getelementptr inbounds nuw i8, ptr %32, i64 4 @@ -359,8 +360,7 @@ define hidden void @"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R "_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$11starts_with17hd1805197c97011fbE.exit.i.i.i.i.i.i.i": ; preds = %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17hea0d24b938f00e9dE.exit.thread.i.i.i.i.i" %rhsv.i.i = load i16, ptr %.sroa.8.sroa.6.0.copyload.i, align 2, !noalias !69 %.not.i.i = icmp eq i16 %rhsv.i.i, 24415 - %49 = add nsw i64 %.sroa.5.0.i.i.i.i, -2 - %.not.i5.i.i.i.i.i.i.i = icmp eq i64 %49, %.sroa.6.0 + %.not.i5.i.i.i.i.i.i.i = icmp eq i64 %.sroa.5.0.i.i.i.i, %invariant.op.i %or.cond.i.i.i.i.i.i = select i1 %.not.i.i, i1 %.not.i5.i.i.i.i.i.i.i, i1 false br i1 %or.cond.i.i.i.i.i.i, label %"_ZN101_$LT$object..read..macho..file..MachOFile$LT$Mach$C$R$GT$$u20$as$u20$object..read..traits..Object$GT$21section_by_name_bytes28_$u7b$$u7b$closure$u7d$$u7d$17ha1f41f5f79e4c359E.exit.i.i", label %52 diff --git a/bench/rustfmt-rs/optimized/4gk399kploc9gcsb.ll b/bench/rustfmt-rs/optimized/4gk399kploc9gcsb.ll index 05d0717c429..5979abe7a6d 100644 --- a/bench/rustfmt-rs/optimized/4gk399kploc9gcsb.ll +++ b/bench/rustfmt-rs/optimized/4gk399kploc9gcsb.ll @@ -7413,16 +7413,20 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h .split: %3 = alloca [8 x i8], align 8 %.not50 = icmp eq i64 %1, 0 - br i1 %.not50, label %._crit_edge, label %.lr.ph + br i1 %.not50, label %._crit_edge, label %.lr.ph.preheader -._crit_edge: ; preds = %14, %.split - %.033.lcssa = phi i64 [ 0, %.split ], [ %.2, %14 ] - %.0.lcssa = phi i64 [ 0, %.split ], [ %.1, %14 ] - %4 = icmp ult i64 %.0.lcssa, %1 - br i1 %4, label %6, label %5 +._crit_edge: ; preds = %.split + %4 = add i64 %1, -2 + br label %.lr.ph + +._crit_edge:; preds = %14, %.split + %.033.lcssa = phi i64 [ 0, %.split ], [ %.2, %15 ] + %.0.lcssa = phi i64 [ 0, %.split ], [ %.1, %15 ] + %5 = icmp ult i64 %.0.lcssa, %1 + br i1 %5, label %7, label %6 5: ; preds = %._crit_edge, %6 - %.134 = phi i64 [ %9, %6 ], [ %.033.lcssa, %._crit_edge ] + %.134 = phi i64 [ %9, %7 ], [ %.033.lcssa, %._crit_edge ] call void @llvm.lifetime.start.p0(ptr nonnull %3), !noalias !1374 store i64 %.134, ptr %3, align 8, !noalias !1374 call fastcc void @"_ZN71_$LT$std..hash..random..DefaultHasher$u20$as$u20$core..hash..Hasher$GT$5write17h2da4bae56721e2b3E"(ptr noalias noundef nonnull align 8 dereferenceable(72) %2, ptr noalias noundef nonnull readonly align 1 %3, i64 noundef 8) @@ -7436,10 +7440,10 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h %9 = add i64 %7, %.033.lcssa br label %5 -.lr.ph: ; preds = %.split, %14 - %.048 = phi i64 [ %.1, %14 ], [ 0, %.split ] - %.03347 = phi i64 [ %.2, %14 ], [ 0, %.split ] - %.sroa.09.046 = phi i64 [ %10, %14 ], [ 0, %.split ] +.lr.ph: ; preds = %._crit_edge, %14 + %.048 = phi i64 [ %.1, %15 ], [ 0, %.lr.ph.preheader ] + %.03347 = phi i64 [ %.2, %15 ], [ 0, %.lr.ph.preheader ] + %.sroa.09.046 = phi i64 [ %10, %15 ], [ 0, %.lr.ph.preheader ] %10 = add nuw i64 %.sroa.09.046, 1 %11 = getelementptr inbounds i8, ptr %0, i64 %.sroa.09.046 %12 = load i8, ptr %11, align 1, !noundef !5 @@ -7464,10 +7468,9 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h br label %20 20: ; preds = %15, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h784113f8f73872caE.exit" - %.3 = phi i64 [ %19, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h784113f8f73872caE.exit" ], [ %.03347, %15 ] - %21 = sub nuw i64 %1, %10 - %22 = getelementptr inbounds i8, ptr %0, i64 %10 - %23 = icmp eq i64 %21, 1 + %.3 = phi i64 [ %19, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h784113f8f73872caE.exit" ], [ %.03347, %16 ] + %22 = getelementptr inbounds i8, ptr %0, i64 %11 + %23 = icmp eq i64 %.sroa.09.046, %4 br i1 %23, label %24, label %27 24: ; preds = %20 diff --git a/bench/slurm/optimized/bitstring.ll b/bench/slurm/optimized/bitstring.ll index d002c2ddad0..7e88e3dcf4a 100644 --- a/bench/slurm/optimized/bitstring.ll +++ b/bench/slurm/optimized/bitstring.ll @@ -652,41 +652,44 @@ define dso_local range(i64 -9223372036854775808, 9223372036854775807) i64 @bit_f .preheader: ; preds = %.lr.ph29 %10 = icmp slt i64 %.028, %3 - br i1 %10, label %.lr.ph, label %.critedge + br i1 %10, label %.lr.ph.preheader, label %.critedge + +.lr.ph.preheader: ; preds = %.preheader + %invariant.op = add nsw i64 %6, -2 + br label %.lr.ph 11: ; preds = %.lr.ph29 %12 = add i64 %.028, 64 br label %.critedge, !llvm.loop !14 -.lr.ph: ; preds = %.preheader, %20 - %.220 = phi i64 [ %21, %20 ], [ %.028, %.preheader ] +.lr.ph: ; preds = %.lr.ph.preheader, %19 + %.220 = phi i64 [ %20, %19 ], [ %.028, %.lr.ph.preheader ] %13 = ashr i64 %.220, 6 - %14 = add nsw i64 %13, 2 - %15 = icmp eq i64 %14, %6 - br i1 %15, label %16, label %.critedge - -16: ; preds = %.lr.ph - %17 = and i64 %.220, 63 - %18 = shl nuw i64 1, %17 - %19 = and i64 %8, %18 - %.not = icmp eq i64 %19, 0 - br i1 %.not, label %.critedge, label %20 - -20: ; preds = %16 - %21 = add i64 %.220, 1 - %exitcond.not = icmp eq i64 %21, %3 + %14 = icmp eq i64 %13, %invariant.op + br i1 %14, label %15, label %.critedge + +15: ; preds = %.lr.ph + %16 = and i64 %.220, 63 + %17 = shl nuw i64 1, %16 + %18 = and i64 %8, %17 + %.not = icmp eq i64 %18, 0 + br i1 %.not, label %.critedge, label %19 + +19: ; preds = %15 + %20 = add i64 %.220, 1 + %exitcond.not = icmp eq i64 %20, %3 br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15 -.critedge: ; preds = %16, %.lr.ph, %.preheader, %11 - %.117 = phi i64 [ -1, %11 ], [ -1, %.preheader ], [ %.220, %16 ], [ -1, %.lr.ph ] - %.1 = phi i64 [ %12, %11 ], [ %.028, %.preheader ], [ %.220, %.lr.ph ], [ %.220, %16 ] +.critedge: ; preds = %15, %.lr.ph, %.preheader, %11 + %.117 = phi i64 [ -1, %11 ], [ -1, %.preheader ], [ %.220, %15 ], [ -1, %.lr.ph ] + %.1 = phi i64 [ %12, %11 ], [ %.028, %.preheader ], [ %.220, %.lr.ph ], [ %.220, %15 ] %22 = icmp slt i64 %.1, %3 %23 = icmp eq i64 %.117, -1 %24 = and i1 %23, %22 br i1 %24, label %.lr.ph29, label %._crit_edge -._crit_edge: ; preds = %.critedge, %20, %1 - %.016.lcssa = phi i64 [ -1, %1 ], [ -1, %20 ], [ %.117, %.critedge ] +._crit_edge: ; preds = %.critedge, %19, %1 + %.016.lcssa = phi i64 [ -1, %1 ], [ -1, %19 ], [ %.117, %.critedge ] ret i64 %.016.lcssa } diff --git a/bench/syn/optimized/2tga7oe2tfdpj05w.ll b/bench/syn/optimized/2tga7oe2tfdpj05w.ll index 29bc70b03fb..eaf36281f39 100644 --- a/bench/syn/optimized/2tga7oe2tfdpj05w.ll +++ b/bench/syn/optimized/2tga7oe2tfdpj05w.ll @@ -2054,6 +2054,7 @@ define hidden void @_ZN3syn4path8printing10print_path17h3f3d7e99b2afb1d3E(ptr no "_ZN76_$LT$core..option..Option$LT$T$GT$$u20$as$u20$quote..to_tokens..ToTokens$GT$9to_tokens17h4e43d934e5a0a2fbE.exit6": ; preds = %"_ZN83_$LT$syn..print..TokensOrDefault$LT$T$GT$$u20$as$u20$quote..to_tokens..ToTokens$GT$9to_tokens17h3b94d2bbd049e861E.exit", %75 %77 = getelementptr inbounds nuw i8, ptr %7, i64 16 + %invariant.op = add i64 %.0.sroa.speculated.i, -1 %.promoted = load ptr, ptr %7, align 8 %.promoted114 = load ptr, ptr %77, align 8 %78 = getelementptr inbounds nuw i8, ptr %7, i64 8 @@ -2093,12 +2094,12 @@ define hidden void @_ZN3syn4path8printing10print_path17h3f3d7e99b2afb1d3E(ptr no %90 = getelementptr inbounds nuw i8, ptr %83, i64 104 %91 = getelementptr inbounds nuw i8, ptr %83, i64 96 %92 = add i64 %.sroa.7.0115, 1 - %93 = icmp eq i64 %92, %.0.sroa.speculated.i + %93 = icmp eq i64 %.sroa.7.0116, %invariant.op br i1 %93, label %159, label %131 .thread100: ; preds = %87 %94 = add i64 %.sroa.7.0115, 1 - %95 = icmp eq i64 %94, %.0.sroa.speculated.i + %95 = icmp eq i64 %.sroa.7.0116, %invariant.op br i1 %95, label %159, label %145 "_ZN3syn10punctuated8printing91_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..punctuated..Pair$LT$T$C$P$GT$$GT$9to_tokens17h2f65737e4172ea54E.exit": ; preds = %"_ZN3syn10punctuated8printing91_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..punctuated..Pair$LT$T$C$P$GT$$GT$9to_tokens17h2f65737e4172ea54E.exit.outer", %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit15" @@ -2258,12 +2259,13 @@ define hidden void @_ZN3syn4path8printing10print_path17h3f3d7e99b2afb1d3E(ptr no %.sroa.5.0 = phi ptr [ null, %.thread100 ], [ %91, %89 ] %160 = phi ptr [ null, %.thread100 ], [ %84, %89 ] %161 = phi ptr [ %83, %.thread100 ], [ %90, %89 ] + %162 = phi i64 [ %94, %.thread100 ], [ %92, %89 ] %.sroa.64.1.i108 = phi ptr [ %84, %.thread100 ], [ %83, %89 ] tail call void @"_ZN65_$LT$proc_macro2..Ident$u20$as$u20$quote..to_tokens..ToTokens$GT$9to_tokens17h629b5813b48ddffcE"(ptr noalias noundef nonnull readonly align 8 dereferenceable(96) %.sroa.64.1.i108, ptr noalias noundef nonnull align 8 dereferenceable(32) %0) %162 = getelementptr inbounds nuw i8, ptr %.sroa.64.1.i108, i64 32 %163 = load i64, ptr %162, align 8, !range !77, !alias.scope !526, !noalias !529, !noundef !7 %164 = xor i64 %163, -9223372036854775808 - switch i64 %164, label %167 [ + switch i64 %164, label %168 [ i64 0, label %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" i64 1, label %165 ] @@ -2299,9 +2301,9 @@ define hidden void @_ZN3syn4path8printing10print_path17h3f3d7e99b2afb1d3E(ptr no br label %"_ZN3syn10punctuated8printing91_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..punctuated..Pair$LT$T$C$P$GT$$GT$9to_tokens17h2f65737e4172ea54E.exit7" "_ZN3syn10punctuated8printing91_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..punctuated..Pair$LT$T$C$P$GT$$GT$9to_tokens17h2f65737e4172ea54E.exit7": ; preds = %175, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit", %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19", %151, %156, %145, %149 - %177 = phi ptr [ null, %149 ], [ %84, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19" ], [ null, %151 ], [ null, %156 ], [ null, %145 ], [ %160, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" ], [ %160, %175 ] - %178 = phi ptr [ %83, %149 ], [ %90, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19" ], [ %83, %151 ], [ %83, %156 ], [ %83, %145 ], [ %161, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" ], [ %161, %175 ] - %179 = phi i64 [ %94, %149 ], [ %92, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19" ], [ %94, %151 ], [ %94, %156 ], [ %94, %145 ], [ %.0.sroa.speculated.i, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" ], [ %.0.sroa.speculated.i, %175 ] + %177 = phi ptr [ null, %149 ], [ %84, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19" ], [ null, %151 ], [ null, %156 ], [ null, %145 ], [ %160, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" ], [ %160, %176 ] + %178 = phi ptr [ %83, %149 ], [ %90, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19" ], [ %83, %151 ], [ %83, %156 ], [ %83, %145 ], [ %161, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" ], [ %161, %176 ] + %179 = phi i64 [ %94, %149 ], [ %92, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit19" ], [ %94, %151 ], [ %94, %156 ], [ %94, %145 ], [ %162, %"_ZN3syn4path8printing81_$LT$impl$u20$quote..to_tokens..ToTokens$u20$for$u20$syn..path..PathArguments$GT$9to_tokens17h9597255c2fe3aa38E.exit" ], [ %162, %176 ] %180 = icmp eq i64 %85, 0 br i1 %180, label %"_ZN76_$LT$core..option..Option$LT$T$GT$$u20$as$u20$quote..to_tokens..ToTokens$GT$9to_tokens17h4e43d934e5a0a2fbE.exit.loopexit", label %82 } diff --git a/bench/tev/optimized/Common.ll b/bench/tev/optimized/Common.ll index 2696b0cb597..dedc133f450 100644 --- a/bench/tev/optimized/Common.ll +++ b/bench/tev/optimized/Common.ll @@ -2279,6 +2279,7 @@ _ZNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_I %115 = getelementptr inbounds i8, ptr %109, i64 %114 %116 = ptrtoint ptr %115 to i64 %117 = ptrtoint ptr %109 to i64 + %invariant.op = add i64 %117, -1 br label %125 118: ; preds = %_ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEaSB8ne190000EOS5_.exit28 @@ -2353,8 +2354,7 @@ _ZNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_I _ZNSt3__118__search_substringB8ne190000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i.i: ; preds = %148 %155 = icmp eq ptr %146, %115 %156 = ptrtoint ptr %146 to i64 - %157 = sub i64 %156, %117 - %.not22 = icmp eq i64 %157, -1 + %.not22 = icmp eq i64 %invariant.op, %156 %or.cond = select i1 %155, i1 true, i1 %.not22 br i1 %or.cond, label %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread, label %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread37 @@ -2371,7 +2371,7 @@ _ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000E br i1 %exitcond.not, label %.loopexit, label %125, !llvm.loop !32 .loopexit: ; preds = %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread, %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread37, %158 - %160 = phi i1 [ true, %158 ], [ true, %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread37 ], [ false, %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread ] + %160 = phi i1 [ true, %157 ], [ true, %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread37 ], [ false, %_ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findB8ne190000ERKS5_m.exit.thread ] %.not.i.i30 = icmp eq ptr %98, null br i1 %.not.i.i30, label %_ZNSt3__16vectorINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEENS4_IS6_EEED2B8ne190000Ev.exit, label %.lr.ph.i.i.i.i diff --git a/bench/typst-rs/optimized/avdrw26ojy6f9qt.ll b/bench/typst-rs/optimized/avdrw26ojy6f9qt.ll index e008a72ab88..849254dcba0 100644 --- a/bench/typst-rs/optimized/avdrw26ojy6f9qt.ll +++ b/bench/typst-rs/optimized/avdrw26ojy6f9qt.ll @@ -1764,16 +1764,20 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h .split: %3 = alloca [8 x i8], align 8 %.not49 = icmp eq i64 %1, 0 - br i1 %.not49, label %._crit_edge, label %.lr.ph + br i1 %.not49, label %._crit_edge, label %.lr.ph.preheader -._crit_edge: ; preds = %14, %.split - %.033.lcssa = phi i64 [ 0, %.split ], [ %.2, %14 ] - %.0.lcssa = phi i64 [ 0, %.split ], [ %.1, %14 ] - %4 = icmp ult i64 %.0.lcssa, %1 - br i1 %4, label %6, label %5 +._crit_edge: ; preds = %.split + %4 = add i64 %1, -2 + br label %.lr.ph -5: ; preds = %._crit_edge, %6 - %.134 = phi i64 [ %9, %6 ], [ %.033.lcssa, %._crit_edge ] +5: ; preds = %15, %.split + %.134 = phi i64 [ 0, %.split ], [ %.2, %15 ] + %.0.lcssa = phi i64 [ 0, %.split ], [ %.1, %15 ] + %5 = icmp ult i64 %.0.lcssa, %1 + br i1 %5, label %7, label %6 + +6: ; preds = %._crit_edge, %7 + %.134 = phi i64 [ %10, %7 ], [ %.033.lcssa, %._crit_edge ] call void @llvm.lifetime.start.p0(ptr nonnull %3), !noalias !324 store i64 %.134, ptr %3, align 8, !noalias !324 call fastcc void @"_ZN71_$LT$std..hash..random..DefaultHasher$u20$as$u20$core..hash..Hasher$GT$5write17hc22b36ede7f425b1E"(ptr noalias noundef nonnull align 8 dereferenceable(72) %2, ptr noalias noundef nonnull readonly align 1 %3, i64 noundef 8) @@ -1785,12 +1789,12 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h %8 = getelementptr inbounds i8, ptr %0, i64 %.0.lcssa tail call fastcc void @"_ZN71_$LT$std..hash..random..DefaultHasher$u20$as$u20$core..hash..Hasher$GT$5write17hc22b36ede7f425b1E"(ptr noalias noundef align 8 dereferenceable(72) %2, ptr noalias noundef nonnull readonly align 1 %8, i64 noundef %7) %9 = add i64 %7, %.033.lcssa - br label %5 + br label %6 -.lr.ph: ; preds = %.split, %14 - %.047 = phi i64 [ %.1, %14 ], [ 0, %.split ] - %.03346 = phi i64 [ %.2, %14 ], [ 0, %.split ] - %.sroa.09.045 = phi i64 [ %10, %14 ], [ 0, %.split ] +.lr.ph: ; preds = %5, %14 + %.047 = phi i64 [ %.1, %15 ], [ 0, %.lr.ph.preheader ] + %.03346 = phi i64 [ %.2, %15 ], [ 0, %.lr.ph.preheader ] + %.sroa.09.045 = phi i64 [ %10, %15 ], [ 0, %.lr.ph.preheader ] %10 = add nuw i64 %.sroa.09.045, 1 %11 = getelementptr inbounds i8, ptr %0, i64 %.sroa.09.045 %12 = load i8, ptr %11, align 1, !noundef !7 @@ -1815,10 +1819,9 @@ define hidden void @"_ZN52_$LT$std..path..Path$u20$as$u20$core..hash..Hash$GT$4h br label %20 20: ; preds = %15, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hc32e25b0c86c29bcE.llvm.16628960515194932193.exit" - %.3 = phi i64 [ %19, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hc32e25b0c86c29bcE.llvm.16628960515194932193.exit" ], [ %.03346, %15 ] - %21 = sub nuw i64 %1, %10 - %22 = getelementptr inbounds i8, ptr %0, i64 %10 - %23 = icmp eq i64 %21, 1 + %.3 = phi i64 [ %19, %"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17hc32e25b0c86c29bcE.llvm.16628960515194932193.exit" ], [ %.03346, %16 ] + %22 = getelementptr inbounds i8, ptr %0, i64 %11 + %23 = icmp eq i64 %.sroa.09.045, %4 br i1 %23, label %24, label %27 24: ; preds = %20 diff --git a/bench/typst-rs/optimized/xrijsyrxk2ciyk9.ll b/bench/typst-rs/optimized/xrijsyrxk2ciyk9.ll index 7df775925b2..b84ae1da4e0 100644 --- a/bench/typst-rs/optimized/xrijsyrxk2ciyk9.ll +++ b/bench/typst-rs/optimized/xrijsyrxk2ciyk9.ll @@ -11611,6 +11611,7 @@ _ZN10pdf_writer6object3Ref3new17h6ae42fc50dc8fcf0E.exit: ; preds = %46 store i32 %49, ptr %47, align 8 %56 = load ptr, ptr %12, align 8, !nonnull !4, !noundef !4 %57 = getelementptr inbounds { { { i64, ptr, {} }, i64 }, ptr, i64, i8, [7 x i8] }, ptr %56, i64 %40 + %invariant.op = add i64 %40, -1 br label %58 58: ; preds = %61, %_ZN10pdf_writer6object3Ref3new17h6ae42fc50dc8fcf0E.exit @@ -11628,7 +11629,7 @@ _ZN10pdf_writer6object3Ref3new17h6ae42fc50dc8fcf0E.exit: ; preds = %46 61: ; preds = %58 %62 = getelementptr inbounds nuw i8, ptr %.sroa.087.0, i64 48 %63 = add nuw nsw i64 %.sroa.7.0, 1 - %64 = icmp eq i64 %63, %40 + %64 = icmp eq i64 %.sroa.7.0, %invariant.op %65 = invoke fastcc noundef i32 @_ZN9typst_pdf7outline18write_outline_item17h899067324ce0a2e1E(ptr noalias noundef align 8 dereferenceable(856) %0, ptr noalias noundef readonly align 8 dereferenceable(48) %.sroa.087.0, i32 noundef %48, i32 noundef %.063, i1 noundef zeroext %64) to label %58 unwind label %.loopexit, !range !2025 @@ -12132,6 +12133,7 @@ _ZN10pdf_writer6object3Ref3new17h6ae42fc50dc8fcf0E.exit51: ; preds = %70 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %16, i64 16, i1 false) call void @"_ZN66_$LT$pdf_writer..object..Dict$u20$as$u20$core..ops..drop..Drop$GT$4drop17h9f75d0997aaeb05aE.llvm.17057414408856058071"(ptr noalias noundef nonnull align 8 dereferenceable(16) %9) call void @llvm.lifetime.end.p0(ptr nonnull %9) + %invariant.op = add i64 %46, -1 %132 = icmp eq i64 %.idx, 0 br i1 %132, label %._crit_edge, label %.lr.ph @@ -12236,7 +12238,7 @@ _ZN10pdf_writer6object3Ref3new17h6ae42fc50dc8fcf0E.exit51: ; preds = %70 %.sroa.7.086 = phi i64 [ %170, %.lr.ph ], [ 0, %"_ZN4core3ptr55drop_in_place$LT$pdf_writer..structure..OutlineItem$GT$17h0e61311b8dc54197E.exit" ] %169 = getelementptr inbounds nuw i8, ptr %.sroa.0.087, i64 48 %170 = add nuw nsw i64 %.sroa.7.086, 1 - %171 = icmp eq i64 %170, %46 + %171 = icmp eq i64 %.sroa.7.086, %invariant.op %172 = call fastcc noundef i32 @_ZN9typst_pdf7outline18write_outline_item17h899067324ce0a2e1E(ptr noalias noundef align 8 dereferenceable(856) %0, ptr noalias noundef readonly align 8 dereferenceable(48) %.sroa.0.087, i32 noundef %18, i32 noundef %.03888, i1 noundef zeroext %171), !range !2025 %173 = icmp eq ptr %169, %47 br i1 %173, label %._crit_edge, label %.lr.ph diff --git a/bench/uv-rs/optimized/afb3uo40tnjfqrj7louv4l8in.ll b/bench/uv-rs/optimized/afb3uo40tnjfqrj7louv4l8in.ll index 760631411ba..bbad7af66f4 100644 --- a/bench/uv-rs/optimized/afb3uo40tnjfqrj7louv4l8in.ll +++ b/bench/uv-rs/optimized/afb3uo40tnjfqrj7louv4l8in.ll @@ -1962,12 +1962,15 @@ define internal fastcc void @_ZN8unscanny7Scanner9eat_until17hf2fbad3ff3b79464E( %4 = load i64, ptr %3, align 8, !noundef !3 %5 = getelementptr inbounds nuw i8, ptr %0, i64 8 %6 = load i64, ptr %5, align 8, !noundef !3 + %invariant.op = add i64 %6, -1 + %invariant.op16 = add i64 %6, -2 + %invariant.op17 = add i64 %6, -3 %7 = icmp eq i64 %4, %6 %.val.pre = load ptr, ptr %0, align 8 br i1 %7, label %"_ZN8unscanny96_$LT$impl$u20$unscanny..sealed..Sealed$LT$$LP$$RP$$GT$$u20$for$u20$$u5b$char$u3b$$u20$N$u5d$$GT$7matches17h091ac11f944e3212E.exit.thread", label %.lr.ph .lr.ph: ; preds = %1, %95 - %8 = phi i64 [ %96, %95 ], [ %4, %1 ] + %8 = phi i64 [ %96, %92 ], [ %4, %1 ] %9 = sub nuw i64 %6, %8 %10 = getelementptr inbounds i8, ptr %.val.pre, i64 %8 tail call void @llvm.experimental.noalias.scope.decl(metadata !410) @@ -2070,50 +2073,47 @@ _ZN8unscanny7Scanner4snap17hc50e865a57a26991E.exit: ; preds = %.lr.ph.i, %51, %" %58 = getelementptr inbounds nuw i8, ptr %10, i64 1 %59 = and i8 %11, 31 %60 = zext nneg i8 %59 to i32 - %61 = add nsw i64 %8, 1 - %62 = icmp ne i64 %61, %6 - tail call void @llvm.assume(i1 %62) - %63 = load i8, ptr %58, align 1, !noalias !427, !noundef !3 - %64 = shl nuw nsw i32 %60, 6 - %65 = and i8 %63, 63 - %66 = zext nneg i8 %65 to i32 - %67 = or disjoint i32 %64, %66 - %68 = icmp samesign ugt i8 %11, -33 - br i1 %68, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i", label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread + %61 = icmp ne i64 %8, %invariant.op + tail call void @llvm.assume(i1 %61) + %62 = load i8, ptr %58, align 1, !noalias !427, !noundef !3 + %63 = shl nuw nsw i32 %60, 6 + %64 = and i8 %62, 63 + %65 = zext nneg i8 %64 to i32 + %66 = or disjoint i32 %63, %65 + %67 = icmp samesign ugt i8 %11, -33 + br i1 %67, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i", label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit12.i.i" %69 = getelementptr inbounds nuw i8, ptr %10, i64 2 - %70 = add nsw i64 %8, 2 - %71 = icmp ne i64 %70, %6 - tail call void @llvm.assume(i1 %71) - %72 = load i8, ptr %69, align 1, !noalias !427, !noundef !3 - %73 = shl nuw nsw i32 %66, 6 - %74 = and i8 %72, 63 - %75 = zext nneg i8 %74 to i32 - %76 = or disjoint i32 %73, %75 - %77 = shl nuw nsw i32 %60, 12 - %78 = or disjoint i32 %76, %77 - %79 = icmp samesign ugt i8 %11, -17 - br i1 %79, label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit, label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread + %69 = icmp ne i64 %8, %invariant.op16 + tail call void @llvm.assume(i1 %69) + %70 = load i8, ptr %68, align 1, !noalias !427, !noundef !3 + %71 = shl nuw nsw i32 %65, 6 + %72 = and i8 %70, 63 + %73 = zext nneg i8 %72 to i32 + %74 = or disjoint i32 %71, %73 + %75 = shl nuw nsw i32 %60, 12 + %76 = or disjoint i32 %74, %75 + %77 = icmp samesign ugt i8 %11, -17 + br i1 %77, label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit, label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread _ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit: ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i" %80 = getelementptr inbounds nuw i8, ptr %10, i64 3 - %81 = add nsw i64 %8, 3 - %82 = icmp ne i64 %81, %6 - tail call void @llvm.assume(i1 %82) - %83 = load i8, ptr %80, align 1, !noalias !427, !noundef !3 - %84 = shl nuw nsw i32 %60, 18 - %85 = and i32 %84, 1835008 - %86 = shl nuw nsw i32 %76, 6 - %87 = and i8 %83, 63 - %88 = zext nneg i8 %87 to i32 - %89 = or disjoint i32 %86, %88 - %90 = or disjoint i32 %89, %85 - %91 = icmp eq i32 %90, 1114112 - br i1 %91, label %95, label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread + %79 = icmp ne i64 %8, %invariant.op17 + tail call void @llvm.assume(i1 %79) + %80 = load i8, ptr %78, align 1, !noalias !427, !noundef !3 + %81 = shl nuw nsw i32 %60, 18 + %82 = and i32 %81, 1835008 + %83 = shl nuw nsw i32 %74, 6 + %84 = and i8 %80, 63 + %85 = zext nneg i8 %84 to i32 + %86 = or disjoint i32 %83, %85 + %89 = or disjoint i32 %86, %82 + %88 = icmp eq i32 %89, 1114112 + br i1 %88, label %92, label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread _ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread: ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit12.i.i", %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit - %92 = phi i32 [ %90, %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit ], [ %67, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit12.i.i" ], [ %78, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i" ] + %92 = phi i32 [ %87, %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit ], [ %66, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit12.i.i" ], [ %76, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hde2e180c68aa9c3fE.exit14.i.i" ] %93 = icmp samesign ult i32 %92, 1114112 tail call void @llvm.assume(i1 %93) %94 = icmp samesign ult i32 %92, 128 @@ -2134,7 +2134,7 @@ _ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread: ; preds = %"_ZN91_$LT br label %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread.thread _ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread.thread: ; preds = %57, %98, %100, %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread - %.sroa.04.0 = phi i64 [ 2, %98 ], [ %., %100 ], [ 1, %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread ], [ 1, %57 ] + %.sroa.04.0 = phi i64 [ 2, %95 ], [ %., %97 ], [ 1, %_ZN8unscanny7Scanner4peek17hbb57d3750d6f7627E.exit.thread ], [ 1, %57 ] %102 = add i64 %.sroa.04.0, %8 store i64 %102, ptr %3, align 8 br label %95 diff --git a/bench/wasmtime-rs/optimized/37pex3k1sj15o95m.ll b/bench/wasmtime-rs/optimized/37pex3k1sj15o95m.ll index 5486af6249c..9e6f1adfc6a 100644 --- a/bench/wasmtime-rs/optimized/37pex3k1sj15o95m.ll +++ b/bench/wasmtime-rs/optimized/37pex3k1sj15o95m.ll @@ -20115,6 +20115,7 @@ define { i16, i16 } @_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic %5 = getelementptr inbounds nuw i8, ptr %0, i64 128 %6 = load i64, ptr %5, align 8, !alias.scope !3912, !noundef !4 %7 = getelementptr inbounds { i32, i16, [1 x i16] }, ptr %4, i64 %6 + %invariant.op.i = add i16 %1, -128 br label %8 8: ; preds = %"_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i", %2 @@ -20160,9 +20161,8 @@ _ZN17cranelift_codegen2ir12dynamic_type15DynamicTypeData8concrete17hb4c86d64a2ca unreachable "_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i": ; preds = %_ZN17cranelift_codegen2ir12dynamic_type15DynamicTypeData8concrete17hb4c86d64a2cad37cE.exit.i.i - %25 = add nuw nsw i16 %.val3.i, 128 - %26 = icmp eq i16 %25, %1 - br i1 %26, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17ha652318545bbbdcdE.exit", label %8 + %25 = icmp eq i16 %.val3.i, %invariant.op.i + br i1 %25, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17ha652318545bbbdcdE.exit", label %8 "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$3any17ha652318545bbbdcdE.exit": ; preds = %"_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i", %8 %.sroa.0.0 = phi i16 [ 0, %8 ], [ 1, %"_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i" ] @@ -20305,9 +20305,9 @@ common.resume: ; preds = %42, %32 ret i64 %43 44: ; preds = %.lr.ph, %88 - %45 = phi i64 [ %.sink4.i.i, %.lr.ph ], [ %89, %88 ] - %46 = phi i64 [ 0, %.lr.ph ], [ %90, %88 ] - %.sroa.0.052 = phi ptr [ %3, %.lr.ph ], [ %.sroa.0.147, %88 ] + %45 = phi i64 [ %.sink4.i.i, %.lr.ph ], [ %89, %87 ] + %46 = phi i64 [ 0, %.lr.ph ], [ %90, %87 ] + %.sroa.0.052 = phi ptr [ %3, %.lr.ph ], [ %.sroa.0.147, %87 ] %47 = add i64 %46, 1 store i64 %47, ptr %.sroa.737.0..sroa_idx, align 8, !alias.scope !3951 %48 = load i64, ptr %.sroa.6.0..sroa_idx, align 8, !alias.scope !3954, !noalias !3957, !noundef !4 @@ -20326,6 +20326,7 @@ common.resume: ; preds = %42, %32 %55 = load ptr, ptr %38, align 8, !alias.scope !3962, !nonnull !4, !noundef !4 %56 = load i64, ptr %39, align 8, !alias.scope !3962, !noundef !4 %57 = getelementptr inbounds { i32, i16, [1 x i16] }, ptr %55, i64 %56 + %invariant.op.i.i = add i16 %52, -128 br label %58 58: ; preds = %"_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i.i", %54 @@ -20377,9 +20378,8 @@ _ZN17cranelift_codegen2ir12dynamic_type15DynamicTypeData8concrete17hb4c86d64a2ca unreachable "_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i.i": ; preds = %_ZN17cranelift_codegen2ir12dynamic_type15DynamicTypeData8concrete17hb4c86d64a2cad37cE.exit.i.i.i - %75 = add nuw nsw i16 %.val3.i.i, 128 - %76 = icmp eq i16 %75, %52 - br i1 %76, label %.loopexit, label %58 + %75 = icmp eq i16 %.val3.i.i, %invariant.op.i.i + br i1 %75, label %.loopexit, label %58 .loopexit: ; preds = %"_ZN17cranelift_codegen2ir3dfg13DataFlowGraph18check_dynamic_type28_$u7b$$u7b$closure$u7d$$u7d$17h97c7b40fec240270E.exit.i.i", %44 %77 = icmp eq ptr %.sroa.0.052, %12 @@ -20401,7 +20401,7 @@ _ZN17cranelift_codegen2ir12dynamic_type15DynamicTypeData8concrete17hb4c86d64a2ca %83 = getelementptr inbounds nuw i8, ptr %9, i64 24 store i64 1, ptr %83, align 8, !alias.scope !3972, !noalias !3975 invoke void @_ZN4core9panicking9panic_fmt17ha6effc2775a0749cE(ptr noalias noundef nonnull align 8 captures(none) dereferenceable(48) %9, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.ff4fb00eed5659504e0ec1f2ac65c1d3.484) #33 - to label %84 unwind label %.loopexit.split-lp + to label %83 unwind label %.loopexit.split-lp 84: ; preds = %78 unreachable diff --git a/bench/wireshark/optimized/packet-sip.ll b/bench/wireshark/optimized/packet-sip.ll index c0895198e2d..5f7942d2ea3 100644 --- a/bench/wireshark/optimized/packet-sip.ll +++ b/bench/wireshark/optimized/packet-sip.ll @@ -8169,45 +8169,48 @@ proto_item_set_hidden.exit: ; preds = %49, %50, %53 %.not133136 = icmp eq i32 %137, -1 br i1 %.not133136, label %._crit_edge, label %.lr.ph -.lr.ph: ; preds = %proto_item_set_hidden.exit, %155 - %.1137 = phi i32 [ %157, %155 ], [ %137, %proto_item_set_hidden.exit ] - %138 = add nuw i32 %.1137, 1 - %.not134 = icmp eq i32 %138, %3 - br i1 %.not134, label %155, label %139 - -139: ; preds = %.lr.ph - %140 = add i32 %.1137, 6 - %141 = call i32 @tvb_skip_wsp_return(ptr noundef %0, i32 noundef %.1137) - %142 = load ptr, ptr %28, align 8 - %143 = sub i32 %140, %141 - %144 = call ptr @tvb_get_string_enc(ptr noundef %142, ptr noundef %0, i32 noundef %141, i32 noundef %143, i32 noundef 2) - %145 = call i32 @g_ascii_strcasecmp(ptr noundef %144, ptr noundef nonnull @.str.815) - %146 = icmp eq i32 %145, 0 - br i1 %146, label %147, label %150 - -147: ; preds = %139 - %148 = load i32, ptr @hf_sip_session_id_logme, align 4 - %149 = call ptr @proto_tree_add_boolean(ptr noundef %1, i32 noundef %148, ptr noundef %0, i32 noundef %141, i32 noundef %143, i64 noundef 1) - br label %155 - -150: ; preds = %139 - %.not135 = icmp eq i32 %141, %3 - br i1 %.not135, label %155, label %151 - -151: ; preds = %150 - %152 = load i32, ptr @hf_sip_session_id_param, align 4 - %153 = sub i32 %3, %141 - %154 = call ptr @proto_tree_add_item(ptr noundef %1, i32 noundef %152, ptr noundef %0, i32 noundef %141, i32 noundef %153, i32 noundef 2) - br label %155 - -155: ; preds = %147, %151, %150, %.lr.ph - %.0 = phi i32 [ %3, %.lr.ph ], [ %3, %150 ], [ %141, %151 ], [ %141, %147 ] - %156 = sub i32 %3, %.0 - %157 = call i32 @tvb_find_uint8(ptr noundef %0, i32 noundef %.0, i32 noundef %156, i8 noundef zeroext 59) - %.not133 = icmp eq i32 %157, -1 +.lr.ph: ; preds = %proto_item_set_hidden.exit + %invariant.op = add i32 %3, -1 + br label %.lr.ph + +.lr.ph:; preds = %.lr.ph, %154 + %.1137 = phi i32 [ %156, %154 ], [ %137, %.lr.ph.preheader ] + %.not134 = icmp eq i32 %.1137, %invariant.op + br i1 %.not134, label %154, label %138 + +138:; preds = %.lr.ph + %139 = add i32 %.1137, 6 + %144 = call i32 @tvb_skip_wsp_return(ptr noundef %0, i32 noundef %.1137) + %141 = load ptr, ptr %28, align 8 + %142 = sub i32 %139, %140 + %143 = call ptr @tvb_get_string_enc(ptr noundef %141, ptr noundef %0, i32 noundef %140, i32 noundef %142, i32 noundef 2) + %144 = call i32 @g_ascii_strcasecmp(ptr noundef %143, ptr noundef nonnull @.str.815) + %145 = icmp eq i32 %144, 0 + br i1 %145, label %146, label %149 + +146:; preds = %138 + %147 = load i32, ptr @hf_sip_session_id_logme, align 4 + %148 = call ptr @proto_tree_add_boolean(ptr noundef %1, i32 noundef %147, ptr noundef %0, i32 noundef %140, i32 noundef %142, i64 noundef 1) + br label %154 + +149: ; preds = %138 + %.not135 = icmp eq i32 %140, %3 + br i1 %.not135, label %154, label %150 + +150: ; preds = %149 + %151 = load i32, ptr @hf_sip_session_id_param, align 4 + %152 = sub i32 %3, %140 + %153 = call ptr @proto_tree_add_item(ptr noundef %1, i32 noundef %151, ptr noundef %0, i32 noundef %140, i32 noundef %152, i32 noundef 2) + br label %154 + +154:; preds = %146, %150, %149, %.lr.ph + %.0 = phi i32 [ %3, %.lr.ph ], [ %3, %149 ], [ %140, %150 ], [ %140, %146 ] + %155 = sub i32 %3, %.0 + %156 = call i32 @tvb_find_uint8(ptr noundef %0, i32 noundef %.0, i32 noundef %155, i8 noundef zeroext 59) + %.not133 = icmp eq i32 %156, -1 br i1 %.not133, label %._crit_edge, label %.lr.ph, !llvm.loop !61 -._crit_edge: ; preds = %155, %proto_item_set_hidden.exit +._crit_edge: ; preds = %154, %proto_item_set_hidden.exit call void @llvm.lifetime.end.p0(ptr nonnull %6) br label %162 diff --git a/bench/wireshark/optimized/range.ll b/bench/wireshark/optimized/range.ll index 0f4fcf7e56b..60a1bbfe6e9 100644 --- a/bench/wireshark/optimized/range.ll +++ b/bench/wireshark/optimized/range.ll @@ -377,8 +377,10 @@ define noundef zeroext i1 @range_add_value(ptr noundef %0, ptr noundef captures( .preheader: ; preds = %4 %6 = load i32, ptr %5, align 4 - %.not53 = icmp eq i32 %6, 0 - br i1 %.not53, label %._crit_edge, label %.lr.ph + %invariant.op = add i32 %2, 1 + %invariant.op51 = add i32 %2, -1 + %.not54 = icmp eq i32 %6, 0 + br i1 %.not54, label %._crit_edge, label %.lr.ph .lr.ph: ; preds = %.preheader %7 = getelementptr inbounds nuw i8, ptr %5, i64 4 @@ -386,7 +388,7 @@ define noundef zeroext i1 @range_add_value(ptr noundef %0, ptr noundef captures( br label %8 8: ; preds = %.lr.ph, %25 - %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %25 ] + %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %23 ] %9 = getelementptr %struct.range_admin_tag, ptr %7, i64 %indvars.iv %10 = load i32, ptr %9, align 4 %.not38 = icmp ult i32 %2, %10 @@ -399,9 +401,8 @@ define noundef zeroext i1 @range_add_value(ptr noundef %0, ptr noundef captures( br i1 %.not39, label %14, label %.loopexit 14: ; preds = %11, %8 - %15 = add i32 %10, -1 - %16 = icmp eq i32 %2, %15 - br i1 %16, label %17, label %18 + %15 = icmp eq i32 %10, %invariant.op + br i1 %15, label %16, label %17 17: ; preds = %14 store i32 %2, ptr %9, align 4 @@ -410,9 +411,8 @@ define noundef zeroext i1 @range_add_value(ptr noundef %0, ptr noundef captures( 18: ; preds = %14 %19 = getelementptr inbounds nuw i8, ptr %9, i64 4 %20 = load i32, ptr %19, align 4 - %21 = add i32 %20, 1 - %22 = icmp eq i32 %2, %21 - br i1 %22, label %23, label %25 + %20 = icmp eq i32 %20, %invariant.op51 + br i1 %20, label %21, label %23 23: ; preds = %18 %24 = getelementptr inbounds nuw i8, ptr %9, i64 4 @@ -450,7 +450,7 @@ define noundef zeroext i1 @range_add_value(ptr noundef %0, ptr noundef captures( br label %.loopexit .loopexit: ; preds = %11, %3, %4, %._crit_edge, %23, %17 - %.033 = phi i1 [ false, %3 ], [ true, %17 ], [ true, %23 ], [ true, %._crit_edge ], [ false, %4 ], [ true, %11 ] + %.033 = phi i1 [ false, %3 ], [ true, %16 ], [ true, %21 ], [ true, %._crit_edge ], [ false, %4 ], [ true, %11 ] ret i1 %.033 } diff --git a/bench/z3/optimized/euf_bv_plugin.ll b/bench/z3/optimized/euf_bv_plugin.ll index 8614e9ee0b4..d81ac93af37 100644 --- a/bench/z3/optimized/euf_bv_plugin.ll +++ b/bench/z3/optimized/euf_bv_plugin.ll @@ -3145,8 +3145,12 @@ _ZNK3euf13enode_parents3endEv.exit.i: ; preds = %_ZN3euf9bv_plugin5w %.not2.i = icmp eq i32 %164, 0 br i1 %.not2.i, label %.loopexit, label %.lr.ph.i -.lr.ph.i: ; preds = %_ZNK3euf13enode_parents3endEv.exit.i, %174 - %.0133.i = phi ptr [ %175, %174 ], [ %.val.val, %_ZNK3euf13enode_parents3endEv.exit.i ] +.lr.ph.i: ; preds = %_ZNK3euf13enode_parents3endEv.exit.i + %invariant.op = add i32 %160, -1 + br label %.lr.ph.i + +.lr.ph.i: ; preds = %.lr.ph.i.preheader, %173 + %.0133.i = phi ptr [ %174, %173 ], [ %.val.val, %.lr.ph.i.preheader ] %168 = load ptr, ptr %.0133.i, align 8, !tbaa !116 %.val.i = load ptr, ptr %168, align 8, !tbaa !95 call void @llvm.lifetime.start.p0(ptr nonnull %4) @@ -3166,8 +3170,7 @@ _ZNK3euf13enode_parents3endEv.exit.i: ; preds = %_ZN3euf9bv_plugin5w "_ZZN3euf9bv_plugin23propagate_register_nodeEPNS_5enodeEENK3$_0clES2_.exit.i": ; preds = %.lr.ph.i %172 = load i32, ptr %5, align 4, !tbaa !112 - %173 = add i32 %172, 1 - %.not1.i = icmp eq i32 %173, %160 + %.not1.i = icmp eq i32 %172, %invariant.op call void @llvm.lifetime.end.p0(ptr nonnull %5) call void @llvm.lifetime.end.p0(ptr nonnull %4) br i1 %.not1.i, label %"_Z6all_ofIN3euf13enode_parentsEZNS0_9bv_plugin23propagate_register_nodeEPNS0_5enodeEE3$_0EbRKT_RKT0_.exit", label %174 diff --git a/bench/zed-rs/optimized/13pr1pzdsvcd15h9bn5oaps4z.ll b/bench/zed-rs/optimized/13pr1pzdsvcd15h9bn5oaps4z.ll index 5c5a025aa4a..1e7944e5153 100644 --- a/bench/zed-rs/optimized/13pr1pzdsvcd15h9bn5oaps4z.ll +++ b/bench/zed-rs/optimized/13pr1pzdsvcd15h9bn5oaps4z.ll @@ -654,13 +654,16 @@ default.unreachable: ; preds = %.lr.ph.split, %3 %trunc14.i.i14 = trunc i64 %.sroa.048.0.copyload to i1 br i1 %trunc14.i.i14, label %.lr.ph.split, label %.lr.ph.split.us -.lr.ph.split.us: ; preds = %.lr.ph, %.critedge.backedge.us - %.sroa.0.029.us = phi ptr [ %26, %.critedge.backedge.us ], [ %4, %.lr.ph ] +.lr.ph.split.us: ; preds = %.lr.ph + %invariant.op = add i8 %8, -1 + br label %.lr.ph.split.us + +.lr.ph.split.us: ; preds = %.lr.ph.split.us.preheader, %.critedge.backedge.us + %.sroa.0.029.us = phi ptr [ %25, %.critedge.backedge.us ], [ %4, %.lr.ph.split.us.preheader ] %22 = getelementptr inbounds i8, ptr %.sroa.0.029.us, i64 -8 %23 = load i8, ptr %22, align 8, !range !106, !alias.scope !109, !noalias !114, !noundef !4 - %24 = sub nsw i8 %23, %8 - %25 = icmp eq i8 %24, -1 - br i1 %25, label %.critedge.backedge.us, label %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit19.thread" + %24 = icmp eq i8 %23, %invariant.op + br i1 %24, label %.critedge.backedge.us, label %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit19.thread" .critedge.backedge.us: ; preds = %.lr.ph.split.us %26 = getelementptr inbounds i8, ptr %.sroa.0.029.us, i64 -40 @@ -912,6 +915,7 @@ define hidden void @_ZN4core5slice4sort6shared9smallsort11insert_tail17hd5d53c7e call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.0, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false) %.sroa.725.0..sroa_idx = getelementptr inbounds nuw i8, ptr %1, i64 33 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %.sroa.7, ptr noundef nonnull align 1 dereferenceable(7) %.sroa.725.0..sroa_idx, i64 7, i1 false) + %invariant.op = add nsw i8 %7, -1 br label %27 26: ; preds = %3, %45 @@ -929,24 +933,23 @@ define hidden void @_ZN4core5slice4sort6shared9smallsort11insert_tail17hd5d53c7e tail call void @llvm.experimental.noalias.scope.decl(metadata !245) %30 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 -48 %31 = load i8, ptr %30, align 8, !range !106, !alias.scope !248, !noalias !249, !noundef !4 - %32 = sub nsw i8 %31, %7 - %33 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 -64 - %34 = load ptr, ptr %33, align 8, !alias.scope !248, !noalias !249, !nonnull !4, !noundef !4 - %35 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 -56 - %36 = load i64, ptr %35, align 8, !alias.scope !248, !noalias !249, !noundef !4 - %spec.store.select.i.i12 = tail call i64 @llvm.umin.i64(i64 %12, i64 %36) - %37 = tail call i32 @memcmp(ptr nonnull %10, ptr nonnull %34, i64 %spec.store.select.i.i12), !noalias !252 - %38 = sext i32 %37 to i64 - %39 = icmp eq i32 %37, 0 - %40 = sub i64 %12, %36 - %.sroa.06.0.i.i13 = select i1 %39, i64 %40, i64 %38 - %41 = icmp eq i8 %31, %7 - %42 = icmp slt i64 %.sroa.06.0.i.i13, 0 - %43 = icmp eq i8 %32, -1 - %44 = select i1 %41, i1 %42, i1 %43 - br i1 %44, label %27, label %45 - -45: ; preds = %27, %29 + %32 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 -64 + %33 = load ptr, ptr %32, align 8, !alias.scope !248, !noalias !249, !nonnull !4, !noundef !4 + %34 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 -56 + %35 = load i64, ptr %35, align 8, !alias.scope !248, !noalias !249, !noundef !4 + %spec.store.select.i.i12 = tail call i64 @llvm.umin.i64(i64 %12, i64 %35) + %spec.store.select.i.i12 = tail call i32 @memcmp(ptr nonnull %10, ptr nonnull %33, i64 %spec.store.select.i.i12), !noalias !252 + %37 = sext i32 %spec.store.select.i.i12 to i64 + %38 = icmp eq i32 %37, 0 + %39 = sub i64 %12, %35 + %.sroa.06.0.i.i13 = select i1 %38, i64 %39, i64 %37 + %40 = icmp eq i8 %31, %7 + %41 = icmp slt i64 %.sroa.06.0.i.i13, 0 + %42 = icmp eq i8 %31, %invariant.op + %43 = select i1 %40, i1 %42, i1 %42 + br i1 %44, label %27, label %44 + +44: ; preds = %27, %29 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.0.0, ptr noundef nonnull align 8 dereferenceable(16) %.sroa.0, i64 16, i1 false), !noalias !253 %.sroa.4.0..sroa.0.0.lcssa.sroa_idx = getelementptr inbounds i8, ptr %.sroa.5.0, i64 -24 store ptr %10, ptr %.sroa.4.0..sroa.0.0.lcssa.sroa_idx, align 8, !noalias !253 @@ -1738,15 +1741,18 @@ default.unreachable: ; preds = %.lr.ph, %.lr.ph.spl .lr.ph.i: ; preds = %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit.thread.i" %trunc14.i.i14.i = trunc i64 %.sroa.048.0.copyload.i to i1 - br i1 %trunc14.i.i14.i, label %.lr.ph.split.i, label %.lr.ph.split.us.i + br i1 %trunc14.i.i14.i, label %.lr.ph.split.i, label %.lr.ph.split.us.i.preheader + +.lr.ph.split.us.i.preheader: ; preds = %.lr.ph.i + %invariant.op = add nsw i8 %14, -1 + br label %.lr.ph.split.us.i -.lr.ph.split.us.i: ; preds = %.lr.ph.i, %.critedge.backedge.us.i - %.sroa.0.029.us.i = phi ptr [ %32, %.critedge.backedge.us.i ], [ %10, %.lr.ph.i ] +.lr.ph.split.us.i: ; preds = %.lr.ph.split.us.i.preheader, %.critedge.backedge.us.i + %.sroa.0.029.us.i = phi ptr [ %32, %.critedge.backedge.us.i ], [ %10, %.lr.ph.split.us.i.preheader ] %28 = getelementptr inbounds i8, ptr %.sroa.0.029.us.i, i64 -8 %29 = load i8, ptr %28, align 8, !range !106, !alias.scope !585, !noalias !590, !noundef !4 - %30 = sub nsw i8 %29, %14 - %31 = icmp eq i8 %30, -1 - br i1 %31, label %.critedge.backedge.us.i, label %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit19.thread.i" + %30 = icmp eq i8 %29, %invariant.op + br i1 %30, label %.critedge.backedge.us.i, label %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit19.thread.i" .critedge.backedge.us.i: ; preds = %.lr.ph.split.us.i %32 = getelementptr inbounds i8, ptr %.sroa.0.029.us.i, i64 -40 @@ -1783,7 +1789,7 @@ default.unreachable: ; preds = %.lr.ph, %.lr.ph.spl br i1 %44, label %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit19.thread.i", label %.lr.ph.split.i "_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit19.thread.i": ; preds = %.critedge.backedge.us.i, %.lr.ph.split.us.i, %.critedge.backedge.i, %40, %.lr.ph.split.i, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit.thread.i" - %.sroa.0.0.lcssa.i = phi ptr [ %0, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit.thread.i" ], [ %0, %.critedge.backedge.i ], [ %.sroa.0.029.i, %.lr.ph.split.i ], [ %.sroa.0.029.i, %40 ], [ %0, %.critedge.backedge.us.i ], [ %.sroa.0.029.us.i, %.lr.ph.split.us.i ] + %.sroa.0.0.lcssa.i = phi ptr [ %0, %"_ZN4core5slice29_$LT$impl$u20$$u5b$T$u5d$$GT$22select_nth_unstable_by28_$u7b$$u7b$closure$u7d$$u7d$17h53ffce6b3be1a247E.exit.thread.i" ], [ %0, %.critedge.backedge.i ], [ %.sroa.0.029.i, %.lr.ph.split.i ], [ %.sroa.0.029.i, %39 ], [ %0, %.critedge.backedge.us.i ], [ %.sroa.0.029.us.i, %.lr.ph.split.us.i ] store i64 %.sroa.048.0.copyload.i, ptr %.sroa.0.0.lcssa.i, align 8, !noalias !593 %.sroa.5.0..sroa.0.0.lcssa.sroa_idx.i = getelementptr inbounds nuw i8, ptr %.sroa.0.0.lcssa.i, i64 8 store i64 %.sroa.4.0.copyload.i, ptr %.sroa.5.0..sroa.0.0.lcssa.sroa_idx.i, align 8, !noalias !593 @@ -2746,6 +2752,7 @@ _ZN4core5slice4sort6shared9smallsort19bidirectional_merge17h997d921ddf630864E.ex 125: ; preds = %.lr.ph %126 = getelementptr inbounds nuw i8, ptr %102, i64 33 + %invariant.op.i = add nsw i8 %107, -1 br label %127 127: ; preds = %129, %125 @@ -2753,31 +2760,30 @@ _ZN4core5slice4sort6shared9smallsort19bidirectional_merge17h997d921ddf630864E.ex %.sroa.0.0.i = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -40 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %.sroa.5.0.i, ptr noundef nonnull align 8 dereferenceable(40) %.sroa.0.0.i, i64 40, i1 false) %128 = icmp eq ptr %.sroa.0.0.i, %22 - br i1 %128, label %145, label %129 + br i1 %128, label %144, label %129 129: ; preds = %127 tail call void @llvm.experimental.noalias.scope.decl(metadata !893) tail call void @llvm.experimental.noalias.scope.decl(metadata !896) %130 = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -48 %131 = load i8, ptr %130, align 8, !range !106, !alias.scope !899, !noalias !900, !noundef !4 - %132 = sub nsw i8 %131, %107 - %133 = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -64 - %134 = load ptr, ptr %133, align 8, !alias.scope !899, !noalias !900, !nonnull !4, !noundef !4 - %135 = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -56 - %136 = load i64, ptr %135, align 8, !alias.scope !899, !noalias !900, !noundef !4 - %spec.store.select.i.i12.i = tail call i64 @llvm.umin.i64(i64 %112, i64 %136) - %137 = tail call i32 @memcmp(ptr nonnull %110, ptr nonnull %134, i64 %spec.store.select.i.i12.i), !noalias !903 - %138 = sext i32 %137 to i64 - %139 = icmp eq i32 %137, 0 - %140 = sub i64 %112, %136 - %.sroa.06.0.i.i13.i = select i1 %139, i64 %140, i64 %138 - %141 = icmp eq i8 %131, %107 - %142 = icmp slt i64 %.sroa.06.0.i.i13.i, 0 - %143 = icmp eq i8 %132, -1 - %144 = select i1 %141, i1 %142, i1 %143 - br i1 %144, label %127, label %145 - -145: ; preds = %129, %127 + %132 = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -64 + %133 = load ptr, ptr %132, align 8, !alias.scope !899, !noalias !900, !nonnull !4, !noundef !4 + %134 = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -56 + %135 = load i64, ptr %134, align 8, !alias.scope !899, !noalias !900, !noundef !4 + %spec.store.select.i.i12.i = tail call i64 @llvm.umin.i64(i64 %112, i64 %135) + %spec.store.select.i.i12.i = tail call i32 @memcmp(ptr nonnull %110, ptr nonnull %133, i64 %spec.store.select.i.i12.i), !noalias !903 + %137 = sext i32 %spec.store.select.i.i12.i to i64 + %138 = icmp eq i32 %136, 0 + %139 = sub i64 %112, %135 + %.sroa.06.0.i.i13.i = select i1 %138, i64 %139, i64 %137 + %140 = icmp eq i8 %131, %107 + %141 = icmp slt i64 %.sroa.06.0.i.i13.i, 0 + %142 = icmp eq i8 %131, %invariant.op.i + %143 = select i1 %140, i1 %141, i1 %142 + br i1 %143, label %127, label %144 + +144: ; preds = %129, %127 %.sroa.0.0.i.lcssa = phi ptr [ %.sroa.0.0.i, %129 ], [ %22, %127 ] tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %.sroa.0.0.i.lcssa, ptr noundef nonnull align 8 dereferenceable(16) %102, i64 16, i1 false) %.sroa.4.0..sroa.0.0.lcssa.sroa_idx.i = getelementptr inbounds i8, ptr %.sroa.5.0.i, i64 -24 @@ -2790,7 +2796,7 @@ _ZN4core5slice4sort6shared9smallsort19bidirectional_merge17h997d921ddf630864E.ex tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %.sroa.7.0..sroa.0.0.lcssa.sroa_idx.i, ptr noundef nonnull align 1 dereferenceable(7) %126, i64 7, i1 false) br label %_ZN4core5slice4sort6shared9smallsort11insert_tail17hd5d53c7e5b74d9a2E.llvm.12350006096555145771.exit -_ZN4core5slice4sort6shared9smallsort11insert_tail17hd5d53c7e5b74d9a2E.llvm.12350006096555145771.exit: ; preds = %.lr.ph, %145 +_ZN4core5slice4sort6shared9smallsort11insert_tail17hd5d53c7e5b74d9a2E.llvm.12350006096555145771.exit: ; preds = %.lr.ph, %144 %exitcond.not = icmp eq i64 %101, %.sroa.013.0 br i1 %exitcond.not, label %.loopexit, label %.lr.ph } diff --git a/bench/zed-rs/optimized/9jkx32jki2vcljeo0xctxc8uw.ll b/bench/zed-rs/optimized/9jkx32jki2vcljeo0xctxc8uw.ll index c2ee62586b7..92e52e87a6e 100644 --- a/bench/zed-rs/optimized/9jkx32jki2vcljeo0xctxc8uw.ll +++ b/bench/zed-rs/optimized/9jkx32jki2vcljeo0xctxc8uw.ll @@ -229,10 +229,10 @@ define internal fastcc { ptr, i64 } @"_ZN100_$LT$unicode_segmentation..grapheme. unreachable 82: ; preds = %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread143.i, %.preheader.i - %.sroa.10.0 = phi i64 [ undef, %.preheader.i ], [ %.sroa.10.1, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread143.i ] - %83 = phi i1 [ %81, %.preheader.i ], [ false, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread143.i ] - %.sroa.0.0.i = phi ptr [ %.sroa.0.2.ph140.i, %.preheader.i ], [ %.sroa.0.1.i.ph, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread143.i ] - %.sroa.011.0.i = phi i32 [ %.sroa.4.0.i.ph141.i, %.preheader.i ], [ %.sroa.011.2.i.ph, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread143.i ] + %.sroa.10.0 = phi i64 [ undef, %.preheader.i ], [ %.sroa.10.1, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread144.i ] + %83 = phi i1 [ %81, %.preheader.i ], [ false, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread144.i ] + %.sroa.0.0.i = phi ptr [ %.sroa.0.2.ph140.i, %.preheader.i ], [ %.sroa.0.1.i.ph, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread144.i ] + %.sroa.011.0.i = phi i32 [ %.sroa.4.0.i.ph141.i, %.preheader.i ], [ %.sroa.011.2.i.ph, %_ZN20unicode_segmentation8grapheme14GraphemeCursor11is_boundary17h1cadcf59d1fcb3d4E.exit.thread.thread144.i ] br i1 %83, label %86, label %84 84: ; preds = %82 diff --git a/bench/zed-rs/optimized/dx9yxhk8z0nuczbnxw7yidd6v.ll b/bench/zed-rs/optimized/dx9yxhk8z0nuczbnxw7yidd6v.ll index b5e0d8abcab..277597779b4 100644 --- a/bench/zed-rs/optimized/dx9yxhk8z0nuczbnxw7yidd6v.ll +++ b/bench/zed-rs/optimized/dx9yxhk8z0nuczbnxw7yidd6v.ll @@ -4039,17 +4039,20 @@ define void @_ZN2ui10components5label17highlighted_label16highlight_ranges17h56e %9 = getelementptr inbounds nuw i8, ptr %7, i64 8 store ptr inttoptr (i64 8 to ptr), ptr %9, align 8 %10 = getelementptr inbounds nuw i8, ptr %7, i64 16 + store i64 0, ptr %10, align 8 + %invariant.op = add i64 %2, -1 + %invariant.op59 = add i64 %2, -2 + %invariant.op60 = add i64 %2, -3 br label %11 11: ; preds = %91, %6 - %.sink = phi i64 [ %94, %91 ], [ 0, %6 ] - %.sroa.13.0 = phi ptr [ %.sroa.13.554, %91 ], [ %3, %6 ] - %.sroa.10.0 = phi i64 [ %.sroa.3.0.i.i.i55, %91 ], [ undef, %6 ] - %.sroa.0.038 = phi i64 [ %.sroa.0.0.i.i.i56, %91 ], [ 2, %6 ] - store i64 %.sink, ptr %10, align 8 - switch i64 %.sroa.0.038, label %default.unreachable67 [ - i64 2, label %12 - i64 1, label %22 + %.sink = phi i64 [ 0, %6 ], [ %92, %89 ] + %.sroa.13.0 = phi ptr [ %3, %6 ], [ %.sroa.13.554, %89 ] + %.sroa.10.0 = phi i64 [ undef, %6 ], [ %.sroa.3.0.i.i.i55, %89 ] + %.sroa.0.038 = phi i64 [ 2, %6 ], [ %.sroa.0.0.i.i.i56, %89 ] + switch i64 %.sroa.0.038, label %default.unreachable69 [ + i64 2, label %13 + i64 1, label %23 i64 0, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hae38dfbe34399750E.exit.thread" ] @@ -4101,10 +4104,10 @@ default.unreachable67: ; preds = %11 br label %23 23: ; preds = %84, %22 - %.sroa.13.2 = phi ptr [ %.sroa.13.1, %22 ], [ %85, %84 ] - %.sroa.03.0 = phi i64 [ %.sroa.3.0, %22 ], [ %82, %84 ] + %.sroa.13.2 = phi ptr [ %.sroa.13.1, %23 ], [ %85, %82 ] + %.sroa.03.0 = phi i64 [ %.sroa.3.0, %23 ], [ %82, %82 ] %24 = icmp eq i64 %.sroa.03.0, 0 - br i1 %24, label %34, label %25 + br i1 %24, label %35, label %25 25: ; preds = %23 %26 = icmp ult i64 %.sroa.03.0, %2 @@ -4114,80 +4117,77 @@ default.unreachable67: ; preds = %11 %28 = getelementptr inbounds i8, ptr %1, i64 %.sroa.03.0 %29 = load i8, ptr %28, align 1, !alias.scope !473, !noundef !4 %30 = icmp sgt i8 %29, -65 - br i1 %30, label %34, label %33 + br i1 %30, label %35, label %33 31: ; preds = %25 %32 = icmp eq i64 %.sroa.03.0, %2 - br i1 %32, label %34, label %33 + br i1 %32, label %35, label %33 33: ; preds = %31, %27 invoke void @_ZN4core3str16slice_error_fail17h402ef64b20c243efE(ptr noalias noundef nonnull readonly align 1 %1, i64 noundef %2, i64 noundef %.sroa.03.0, i64 noundef %2, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.f3e1f28aed58eccb2eea10d7b2a997b3.38) #22 - to label %73 unwind label %.loopexit.split-lp + to label %71 unwind label %.loopexit.split-lp -34: ; preds = %31, %27, %23 - %35 = getelementptr inbounds i8, ptr %1, i64 %.sroa.03.0 - %36 = icmp eq i64 %.sroa.03.0, %2 - br i1 %36, label %74, label %37 - -37: ; preds = %34 - %38 = load i8, ptr %35, align 1, !noalias !476, !noundef !4 - %39 = icmp sgt i8 %38, -1 - br i1 %39, label %.thread48, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i" +37: ; preds = %32, %28, %24 + %36 = getelementptr inbounds i8, ptr %1, i64 %.sroa.03.0 + %39 = icmp eq i64 %.sroa.03.0, %2 + br i1 %39, label %74, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i" "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i": ; preds = %37 - %40 = getelementptr inbounds nuw i8, ptr %35, i64 1 - %41 = and i8 %38, 31 - %42 = zext nneg i8 %41 to i32 - %43 = add nsw i64 %.sroa.03.0, 1 - %44 = icmp ne i64 %43, %2 + %39 = load i8, ptr %36, align 1, !noalias !476, !noundef !4 + %40 = icmp sgt i8 %39, -1 + br i1 %40, label %.thread48, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i" + +"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i":; preds = %38 + %41 = getelementptr inbounds nuw i8, ptr %36, i64 1 + %42 = and i8 %39, 31 + %43 = zext nneg i8 %42 to i32 + %44 = icmp ne i64 %.sroa.03.0, %invariant.op call void @llvm.assume(i1 %44) - %45 = load i8, ptr %40, align 1, !noalias !476, !noundef !4 - %46 = shl nuw nsw i32 %42, 6 + %45 = load i8, ptr %41, align 1, !noalias !476, !noundef !4 + %46 = shl nuw nsw i32 %43, 6 %47 = and i8 %45, 63 %48 = zext nneg i8 %47 to i32 %49 = or disjoint i32 %46, %48 - %50 = icmp samesign ugt i8 %38, -33 + %50 = icmp samesign ugt i8 %39, -33 br i1 %50, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit14.i", label %75 "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit14.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i" - %51 = getelementptr inbounds nuw i8, ptr %35, i64 2 - %52 = add nsw i64 %.sroa.03.0, 2 - %53 = icmp ne i64 %52, %2 - call void @llvm.assume(i1 %53) - %54 = load i8, ptr %51, align 1, !noalias !476, !noundef !4 - %55 = shl nuw nsw i32 %48, 6 - %56 = and i8 %54, 63 - %57 = zext nneg i8 %56 to i32 - %58 = or disjoint i32 %55, %57 - %59 = shl nuw nsw i32 %42, 12 - %60 = or disjoint i32 %58, %59 - %61 = icmp samesign ugt i8 %38, -17 - br i1 %61, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit16.i", label %75 + %51 = getelementptr inbounds nuw i8, ptr %36, i64 2 + %52 = icmp ne i64 %.sroa.03.0, %invariant.op59 + call void @llvm.assume(i1 %52) + %53 = load i8, ptr %51, align 1, !noalias !476, !noundef !4 + %54 = shl nuw nsw i32 %48, 6 + %55 = and i8 %53, 63 + %56 = zext nneg i8 %55 to i32 + %57 = or disjoint i32 %54, %56 + %58 = shl nuw nsw i32 %43, 12 + %59 = or disjoint i32 %57, %58 + %60 = icmp samesign ugt i8 %39, -17 + br i1 %60, label %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit16.i", label %73 "_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit16.i": ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit14.i" - %62 = getelementptr inbounds nuw i8, ptr %35, i64 3 - %63 = add nsw i64 %.sroa.03.0, 3 - %64 = icmp ne i64 %63, %2 - call void @llvm.assume(i1 %64) - %65 = load i8, ptr %62, align 1, !noalias !476, !noundef !4 - %66 = shl nuw nsw i32 %42, 18 - %67 = and i32 %66, 1835008 - %68 = shl nuw nsw i32 %58, 6 - %69 = and i8 %65, 63 - %70 = zext nneg i8 %69 to i32 - %71 = or disjoint i32 %68, %70 - %72 = or disjoint i32 %71, %67 - br label %75 - -73: ; preds = %74, %33 + %62 = getelementptr inbounds nuw i8, ptr %36, i64 3 + %62 = icmp ne i64 %.sroa.03.0, %invariant.op60 + call void @llvm.assume(i1 %62) + %63 = load i8, ptr %61, align 1, !noalias !476, !noundef !4 + %64 = shl nuw nsw i32 %43, 17 + %65 = and i32 %64, 1835008 + %66 = shl nuw nsw i32 %57, 6 + %67 = and i8 %63, 63 + %68 = zext nneg i8 %67 to i32 + %69 = or disjoint i32 %66, %68 + %71 = or disjoint i32 %69, %65 + br label %73 + +71: ; preds = %72, %34 unreachable -74: ; preds = %34 +74: ; preds = %35 invoke void @_ZN4core6option13unwrap_failed17hba6b08832f9ce30bE(ptr noalias noundef readonly align 8 dereferenceable(24) @anon.f3e1f28aed58eccb2eea10d7b2a997b3.39) #22 - to label %73 unwind label %.loopexit.split-lp + to label %71 unwind label %.loopexit.split-lp 75: ; preds = %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit16.i", %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit14.i" - %.sroa.4.0.i.ph = phi i32 [ %60, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit14.i" ], [ %72, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit16.i" ], [ %49, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i" ] + %.sroa.4.0.i.ph = phi i32 [ %59, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit14.i" ], [ %70, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit16.i" ], [ %49, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h79ffd0294f5c87feE.exit12.i" ] %76 = icmp samesign ult i32 %.sroa.4.0.i.ph, 1114112 call void @llvm.assume(i1 %76) %77 = icmp samesign ult i32 %.sroa.4.0.i.ph, 128 @@ -4202,8 +4202,8 @@ default.unreachable67: ; preds = %11 %. = select i1 %81, i64 3, i64 4 br label %.thread48 -.thread48: ; preds = %37, %75, %80, %78 - %.sroa.0.0 = phi i64 [ 2, %78 ], [ %., %80 ], [ 1, %75 ], [ 1, %37 ] +.thread48: ; preds = %38, %75, %80, %78 + %.sroa.0.0 = phi i64 [ 2, %76 ], [ %., %78 ], [ 1, %73 ], [ 1, %38 ] %82 = add i64 %.sroa.0.0, %.sroa.03.0 %83 = icmp eq ptr %.sroa.13.2, %8 br i1 %83, label %"_ZN4core6option15Option$LT$T$GT$18get_or_insert_with17h5ce7507d2fb71d89E.exit.thread", label %84 @@ -4215,16 +4215,16 @@ default.unreachable67: ; preds = %11 br i1 %87, label %23, label %"_ZN4core6option15Option$LT$T$GT$18get_or_insert_with17h5ce7507d2fb71d89E.exit.thread" "_ZN4core6option15Option$LT$T$GT$18get_or_insert_with17h5ce7507d2fb71d89E.exit.thread": ; preds = %.thread48, %84 - %.sroa.0.0.i.i.i56 = phi i64 [ 1, %84 ], [ 0, %.thread48 ] - %.sroa.3.0.i.i.i55 = phi i64 [ %86, %84 ], [ undef, %.thread48 ] - %.sroa.13.554 = phi ptr [ %85, %84 ], [ %8, %.thread48 ] + %.sroa.0.0.i.i.i56 = phi i64 [ 1, %82 ], [ 0, %.thread48 ] + %.sroa.3.0.i.i.i55 = phi i64 [ %86, %82 ], [ undef, %.thread48 ] + %.sroa.13.554 = phi ptr [ %85, %82 ], [ %8, %.thread48 ] %88 = load i64, ptr %7, align 8, !alias.scope !487, !noalias !490, !noundef !4 %89 = icmp eq i64 %.sink, %88 br i1 %89, label %90, label %91 90: ; preds = %"_ZN4core6option15Option$LT$T$GT$18get_or_insert_with17h5ce7507d2fb71d89E.exit.thread" invoke void @"_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$8grow_one17h340910f4bc5e85f2E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %7) - to label %91 unwind label %.loopexit + to label %89 unwind label %.loopexit 91: ; preds = %"_ZN4core6option15Option$LT$T$GT$18get_or_insert_with17h5ce7507d2fb71d89E.exit.thread", %90 %92 = load ptr, ptr %9, align 8, !alias.scope !487, !noalias !490, !nonnull !4, !noundef !4 @@ -4235,6 +4235,7 @@ default.unreachable67: ; preds = %11 %.sroa.5.0..sroa_idx = getelementptr inbounds nuw i8, ptr %93, i64 16 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(112) %.sroa.5.0..sroa_idx, ptr noundef nonnull align 4 dereferenceable(112) %5, i64 112, i1 false) %94 = add i64 %.sink, 1 + store i64 %92, ptr %10, align 8, !alias.scope !487, !noalias !490 br label %11 "_ZN4core3ptr118drop_in_place$LT$alloc..vec..Vec$LT$$LP$core..ops..range..Range$LT$usize$GT$$C$gpui..style..HighlightStyle$RP$$GT$$GT$17h2e641723c3fae4fcE.exit": ; preds = %17, %14 diff --git a/scripts/setup_pre_commit_patch.sh b/scripts/setup_pre_commit_patch.sh index c8d0fce0bf7..c69793bcac9 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/183145 export COMPTIME_MODE=0 export STAT_MODE=0 export STAT_NAME=""