diff --git a/bench/clamav/optimized/spin.ll b/bench/clamav/optimized/spin.ll index ff25f9abd5f..4d201063d49 100644 --- a/bench/clamav/optimized/spin.ll +++ b/bench/clamav/optimized/spin.ll @@ -270,34 +270,33 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r %124 = zext i32 %123 to i64 %125 = sub nsw i64 0, %124 %126 = getelementptr inbounds i8, ptr %122, i64 %125 + %.fr804 = freeze ptr %126 %127 = sext i32 %1 to i64 %128 = icmp ugt i32 %1, 3 - br i1 %128, label %129, label %140 + br i1 %128, label %129, label %138 129: ; preds = %110 - %130 = getelementptr inbounds nuw i8, ptr %126, i64 12807 + %130 = getelementptr inbounds nuw i8, ptr %.fr804, i64 12807 %131 = ptrtoint ptr %0 to i64 - %132 = add nuw nsw i64 %121, %25 - %133 = sub nsw i64 %132, %124 - %.not650 = icmp slt i64 %133, -12807 - br i1 %.not650, label %140, label %134 - -134: ; preds = %129 - %135 = ptrtoint ptr %130 to i64 - %136 = add i64 %135, 4 - %137 = add i64 %127, %131 - %.not651 = icmp ule i64 %136, %137 - %138 = icmp ugt i64 %136, %131 - %or.cond701 = and i1 %.not651, %138 - %139 = icmp ugt i64 %137, %135 - %or.cond702 = and i1 %139, %or.cond701 - br i1 %or.cond702, label %141, label %140 - -140: ; preds = %134, %129, %110 + %.not650 = icmp ult ptr %130, %0 + br i1 %.not650, label %138, label %132 + +132: ; preds = %129 + %133 = ptrtoint ptr %130 to i64 + %134 = add i64 %133, 4 + %135 = add i64 %127, %131 + %.not651 = icmp ule i64 %134, %135 + %136 = icmp ugt i64 %134, %131 + %or.cond701 = and i1 %.not651, %136 + %138 = icmp ugt i64 %135, %133 + %or.cond701 = and i1 %137, %or.cond701 + br i1 %or.cond702, label %139, label %138 + +138:; preds = %132, %129, %110 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.7) #8 br label %.critedge713 -141: ; preds = %134 +141: ; preds = %132 %142 = load i32, ptr %130, align 1, !tbaa !10 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.10, i32 noundef %113, i32 noundef %142) #8 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.11) #8 @@ -332,10 +331,10 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r %154 = getelementptr inbounds nuw i8, ptr %0, i64 %153 %155 = ptrtoint ptr %154 to i64 %156 = add i64 %155, %149 - %.not692 = icmp ule i64 %156, %137 + %.not692 = icmp ule i64 %156, %135 %157 = icmp ugt i64 %156, %131 %or.cond704 = and i1 %.not692, %157 - %158 = icmp ugt i64 %137, %155 + %158 = icmp ugt i64 %135, %155 %or.cond705 = and i1 %158, %or.cond704 br i1 %or.cond705, label %.lr.ph, label %.critedge @@ -345,9 +344,9 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br label %.critedge713 .lr.ph: ; preds = %150, %.lr.ph - %.0536754 = phi i32 [ %.1537, %.lr.ph ], [ %113, %150 ] - %.0538753 = phi ptr [ %167, %.lr.ph ], [ %154, %150 ] - %.0539752 = phi i32 [ %160, %.lr.ph ], [ %148, %150 ] + %.0536754 = phi i32 [ %.1537, %.lr.ph ], [ %113, %148 ] + %.0538753 = phi ptr [ %167, %.lr.ph ], [ %154, %148 ] + %.0539752 = phi i32 [ %160, %.lr.ph ], [ %148, %148 ] %160 = add i32 %.0539752, -1 %161 = and i32 %.0536754, 1 %.not694 = icmp eq i32 %161, 0 @@ -370,7 +369,7 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r ._crit_edge: ; preds = %.loopexit738, %141 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.13) #8 - %169 = getelementptr inbounds nuw i8, ptr %126, i64 1604 + %169 = getelementptr inbounds nuw i8, ptr %.fr804, i64 1604 %170 = load i32, ptr %169, align 1, !tbaa !10 %.not652 = icmp eq i32 %170, 384 br i1 %.not652, label %172, label %171 @@ -380,33 +379,33 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br label %.critedge713 172: ; preds = %._crit_edge - %173 = getelementptr inbounds nuw i8, ptr %126, i64 1616 + %173 = getelementptr inbounds nuw i8, ptr %.fr804, i64 1616 %174 = load i32, ptr %173, align 1, !tbaa !10 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.8, i32 noundef %174, i32 noundef 384) #8 - %175 = icmp ult i32 %1, 384 - %.not653 = icmp slt i64 %133, -10451 - %or.cond = or i1 %175, %.not653 - br i1 %or.cond, label %182, label %176 - -176: ; preds = %172 - %177 = getelementptr inbounds nuw i8, ptr %126, i64 10451 - %178 = ptrtoint ptr %177 to i64 + %173 = getelementptr inbounds nuw i8, ptr %.fr804, i64 10451 + %.not653 = icmp ult i32 %1, 384 + %.not653 = icmp ult ptr %173, %0 + %or.cond = select i1 %.not653, i1 true, i1 %.not653 + br i1 %or.cond, label %180, label %175 + +175: ; preds = %170 + %178 = ptrtoint ptr %173 to i64 %179 = add i64 %178, 384 - %.not654 = icmp ule i64 %179, %137 + %.not654 = icmp ule i64 %179, %135 %180 = icmp ugt i64 %179, %131 %or.cond706 = and i1 %.not654, %180 - %181 = icmp ugt i64 %137, %178 + %181 = icmp ugt i64 %135, %178 %or.cond707 = and i1 %181, %or.cond706 br i1 %or.cond707, label %.preheader736, label %182 -182: ; preds = %176, %172 +182: ; preds = %175, %172 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.7) #8 br label %.critedge713 -.preheader736: ; preds = %176, %.preheader736 - %.2549760 = phi i32 [ %183, %.preheader736 ], [ 384, %176 ] - %.2568759 = phi i32 [ %.3569, %.preheader736 ], [ %174, %176 ] - %.2582758 = phi ptr [ %190, %.preheader736 ], [ %177, %176 ] +.preheader736: ; preds = %175, %.preheader736 + %.2549760 = phi i32 [ %183, %.preheader736 ], [ 384, %175 ] + %.2568759 = phi i32 [ %.3569, %.preheader736 ], [ %174, %175 ] + %.2582758 = phi ptr [ %190, %.preheader736 ], [ %173, %175 ] %183 = add nsw i32 %.2549760, -1 %184 = and i32 %.2568759, 1 %.not687 = icmp eq i32 %184, 0 @@ -422,7 +421,7 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br i1 %.not655, label %191, label %.preheader736 191: ; preds = %.preheader736 - %192 = getelementptr inbounds nuw i8, ptr %126, i64 10461 + %192 = getelementptr inbounds nuw i8, ptr %.fr804, i64 10461 %193 = load i32, ptr %192, align 1, !tbaa !10 %.not656 = icmp eq i32 %193, 417 br i1 %.not656, label %195, label %194 @@ -433,38 +432,39 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r 195: ; preds = %191 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.14, i32 noundef 417) #8 - %196 = getelementptr inbounds nuw i8, ptr %126, i64 10476 - %197 = icmp ult i32 %1, 417 - %.not657 = icmp slt i64 %133, -1748 - %or.cond726 = or i1 %197, %.not657 - br i1 %or.cond726, label %204, label %198 - -198: ; preds = %195 - %199 = getelementptr inbounds nuw i8, ptr %126, i64 1748 - %200 = ptrtoint ptr %199 to i64 + %196 = getelementptr inbounds nuw i8, ptr %.fr804, i64 10476 + %195 = getelementptr inbounds nuw i8, ptr %.fr804, i64 1748 + %.not657 = icmp ult i32 %1, 417 + %.not657 = icmp ult ptr %195, %0 + %or.cond726 = select i1 %.not657, i1 true, i1 %.not657 + br i1 %or.cond726, label %202, label %197 + +197: ; preds = %193 + %200 = ptrtoint ptr %195 to i64 %201 = add i64 %200, 417 - %.not658 = icmp ule i64 %201, %137 + %.not658 = icmp ule i64 %201, %135 %202 = icmp ugt i64 %201, %131 %or.cond708 = and i1 %.not658, %202 - %203 = icmp ugt i64 %137, %200 + %203 = icmp ugt i64 %135, %200 %or.cond709 = and i1 %203, %or.cond708 br i1 %or.cond709, label %.preheader735, label %204 -204: ; preds = %198, %195 +204: ; preds = %197, %195 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.15) #8 br label %.critedge713 -.preheader735: ; preds = %198, %209 - %.3550762 = phi i32 [ %210, %209 ], [ 417, %198 ] - %.0583761 = phi ptr [ %211, %209 ], [ %199, %198 ] +.preheader735: ; preds = %197, %209 + %.3550762 = phi i32 [ %210, %207 ], [ 417, %197 ] + %.0583761 = phi ptr [ %211, %207 ], [ %195, %197 ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8 - %205 = load i8, ptr %.0583761, align 1, !tbaa !10 - %206 = trunc i32 %.3550762 to i8 - %207 = call fastcc signext i8 @exec86(i8 noundef zeroext %205, i8 noundef zeroext %206, ptr noundef nonnull %196, ptr noundef %8) - store i8 %207, ptr %.0583761, align 1, !tbaa !10 - %208 = load i32, ptr %8, align 4, !tbaa !11 - %.not686 = icmp eq i32 %208, 0 - br i1 %.not686, label %209, label %.thread + store i32 0, ptr %8, align 4, !tbaa !11 + %203 = load i8, ptr %.0583761, align 1, !tbaa !10 + %204 = trunc i32 %.3550762 to i8 + %205 = call fastcc signext i8 @exec86(i8 noundef zeroext %203, i8 noundef zeroext %204, ptr noundef nonnull %194, ptr noundef %8) + store i8 %205, ptr %.0583761, align 1, !tbaa !10 + %206 = load i32, ptr %8, align 4, !tbaa !11 + %.not686 = icmp eq i32 %206, 0 + br i1 %.not686, label %207, label %.thread .thread: ; preds = %.preheader735 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.16) #8 @@ -479,55 +479,73 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br i1 %.not659, label %212, label %.preheader735 212: ; preds = %209 - %213 = getelementptr inbounds nuw i8, ptr %126, i64 1777 + %213 = getelementptr inbounds nuw i8, ptr %.fr804, i64 1777 %214 = load i32, ptr %213, align 1, !tbaa !10 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.17, i32 noundef %214) #8 - %215 = getelementptr inbounds nuw i8, ptr %126, i64 1877 + %215 = getelementptr i8, ptr %.fr804, i64 1877 br i1 %143, label %.lr.ph770, label %._crit_edge771 .lr.ph770: ; preds = %212 - %216 = ptrtoint ptr %215 to i64 - %217 = add i64 %216, 36 - %.not683 = icmp ule i64 %217, %137 - %218 = icmp ugt i64 %217, %131 - %or.cond710 = and i1 %.not683, %218 - %219 = icmp ugt i64 %137, %216 - %or.cond711 = and i1 %219, %or.cond710 - %wide.trip.count814 = zext nneg i32 %3 to i64 - br label %220 - -220: ; preds = %.lr.ph770, %.loopexit734 - %indvars.iv811 = phi i64 [ 0, %.lr.ph770 ], [ %indvars.iv.next812, %.loopexit734 ] - %.1558768 = phi i32 [ %214, %.lr.ph770 ], [ %238, %.loopexit734 ] - %221 = and i32 %.1558768, 1 - %.not681 = icmp eq i32 %221, 0 - br i1 %.not681, label %.loopexit734, label %222 - -222: ; preds = %220 - br i1 %or.cond711, label %.preheader733, label %230 - -.preheader733: ; preds = %222 - %223 = getelementptr inbounds nuw %struct.cli_exe_section, ptr %2, i64 %indvars.iv811 - %224 = getelementptr inbounds nuw i8, ptr %223, i64 12 - %225 = load i32, ptr %224, align 4, !tbaa !3 - %.not684763 = icmp eq i32 %225, 0 + %.not682 = icmp ult ptr %215, %0 + %214 = ptrtoint ptr %213 to i64 + %215 = add i64 %214, 36 + %218 = icmp ule i64 %215, %135 + %216 = icmp ugt i64 %215, %131 + %or.cond710 = and i1 %218, %216 + %217 = icmp ugt i64 %135, %214 + %or.cond711 = and i1 %217, %or.cond710 + br i1 %.not682, label %.lr.ph770230, label %220 + +220: ; preds = %.lr.ph770 + %wide.trip.count817 = zext nneg i32 %3 to i64 + br label %.lr.ph770.split + +.lr.ph770.split.us:; preds = %.lr.ph770, %219 + %.1558768.us = phi i32 [ %220, %219 ], [ %212, %.lr.ph770 ] + %.1571767.us = phi i32 [ %221, %219 ], [ 0, %.lr.ph770 ] + %218 = and i32 %.1558768.us, 1 + %.not681.us = icmp eq i32 %218, 0 + br i1 %.not681.us, label %219, label %.split.us + +219: ; preds = %.lr.ph770.split.us + %220 = lshr exact i32 %.1558768.us, 1 + %221 = add nuw nsw i32 %.1571767.us, 1 + %.not684763 = icmp eq i32 %221, %3 + br i1 %exitcond819.not, label %._crit_edge771, label %.lr.ph770.split.us + +.lr.ph770.split: ; preds = %.lr.ph770.split.preheader, %.loopexit734 + %indvars.iv814 = phi i64 [ 0, %.lr.ph770.split.preheader ], [ %indvars.iv.next815, %.loopexit734 ] + %.1558768 = phi i32 [ %212, %.lr.ph770.split.preheader ], [ %238, %.loopexit734 ] + %222 = and i32 %.1558768, 1 + %.not681 = icmp eq i32 %222, 0 + br i1 %.not681, label %.loopexit734, label %223 + +223: ; preds = %.lr.ph770.split + br i1 %or.cond711, label %.preheader733, label %.split.us + +.preheader733: ; preds = %223 + %224 = getelementptr inbounds nuw %struct.cli_exe_section, ptr %2, i64 %indvars.iv814 + %225 = getelementptr inbounds nuw i8, ptr %224, i64 12 + %226 = load i32, ptr %225, align 4, !tbaa !3 + %.not684763 = icmp eq i32 %226, 0 br i1 %.not684763, label %.loopexit734, label %.lr.ph766.preheader .lr.ph766.preheader: ; preds = %.preheader733 - %226 = getelementptr inbounds nuw i8, ptr %223, i64 8 + %226 = getelementptr inbounds nuw i8, ptr %224, i64 8 %227 = load i32, ptr %226, align 4, !tbaa !8 %228 = zext i32 %227 to i64 %229 = getelementptr inbounds nuw i8, ptr %0, i64 %228 br label %.lr.ph766 -230: ; preds = %222 +230: ; preds = %223, %.lr.ph770230 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.18) #8 br label %.critedge713 .lr.ph766: ; preds = %.lr.ph766.preheader, %235 - %.0535765 = phi i32 [ %236, %235 ], [ %225, %.lr.ph766.preheader ] + %.0535765 = phi i32 [ %236, %235 ], [ %226, %.lr.ph766.preheader ] %.2585764 = phi ptr [ %237, %235 ], [ %229, %.lr.ph766.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8 + store i32 0, ptr %9, align 4, !tbaa !11 %231 = load i8, ptr %.2585764, align 1, !tbaa !10 %232 = trunc i32 %.0535765 to i8 %233 = call fastcc signext i8 @exec86(i8 noundef zeroext %231, i8 noundef zeroext %232, ptr noundef nonnull %215, ptr noundef %9) @@ -548,15 +566,15 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r %.not684 = icmp eq i32 %236, 0 br i1 %.not684, label %.loopexit734, label %.lr.ph766 -.loopexit734: ; preds = %235, %.preheader733, %220 +.loopexit734: ; preds = %235, %.preheader733, %.lr.ph770.split %238 = lshr i32 %.1558768, 1 - %indvars.iv.next812 = add nuw nsw i64 %indvars.iv811, 1 - %exitcond815.not = icmp eq i64 %indvars.iv.next812, %wide.trip.count814 - br i1 %exitcond815.not, label %._crit_edge771, label %220 + %indvars.iv.next812 = add nuw nsw i64 %indvars.iv814, 1 + %exitcond815.not = icmp eq i64 %indvars.iv.next812, %wide.trip.count817 + br i1 %exitcond815.not, label %._crit_edge771, label %.lr.ph770.split -._crit_edge771: ; preds = %.loopexit734, %212 +._crit_edge771: ; preds = %.loopexit734, %219, %210 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.13) #8 - %239 = getelementptr inbounds nuw i8, ptr %126, i64 12385 + %239 = getelementptr inbounds nuw i8, ptr %.fr804, i64 12385 %240 = load i32, ptr %239, align 1, !tbaa !10 %241 = getelementptr inbounds nuw i8, ptr %6, i64 48 %242 = load ptr, ptr %241, align 8, !tbaa !12 @@ -699,7 +717,7 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br i1 %302, label %309, label %.preheader729 .preheader729: ; preds = %.loopexit.thread850, %.loopexit - %.3573741854 = phi i32 [ %271, %.loopexit.thread850 ], [ %3, %.loopexit ] + %.3573741854 = phi i32 [ %271, %.loopexit.thread854 ], [ %3, %.loopexit ] %.not804 = icmp eq i32 %.3573741854, 0 br i1 %.not804, label %._crit_edge787, label %.lr.ph786.preheader @@ -731,14 +749,14 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br label %.critedge713 309: ; preds = %.loopexit - %310 = getelementptr inbounds nuw i8, ptr %126, i64 12270 + %310 = getelementptr inbounds nuw i8, ptr %.fr804, i64 12270 %311 = load i32, ptr %310, align 1, !tbaa !10 %.not665 = icmp eq i32 %311, 0 br i1 %.not665, label %399, label %.lr.ph789.preheader .thread855: ; preds = %.preheader730 tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.26) #8 - %312 = getelementptr inbounds nuw i8, ptr %126, i64 12270 + %312 = getelementptr inbounds nuw i8, ptr %.fr804, i64 12270 %313 = load i32, ptr %312, align 1, !tbaa !10 %.not665857 = icmp eq i32 %313, 0 br i1 %.not665857, label %399, label %._crit_edge790 @@ -798,9 +816,9 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br label %._crit_edge790 ._crit_edge790: ; preds = %._crit_edge790.loopexit, %.thread855 - %.0577743849858860 = phi i32 [ 0, %.thread855 ], [ %.1578, %._crit_edge790.loopexit ] - %338 = phi i32 [ %313, %.thread855 ], [ %311, %._crit_edge790.loopexit ] - %.4574.lcssa = phi i32 [ 0, %.thread855 ], [ %337, %._crit_edge790.loopexit ] + %.0577743849858860 = phi i32 [ 0, %.thread859 ], [ %.1578, %._crit_edge790.loopexit ] + %338 = phi i32 [ %313, %.thread859 ], [ %311, %._crit_edge790.loopexit ] + %.4574.lcssa = phi i32 [ 0, %.thread859 ], [ %337, %._crit_edge790.loopexit ] %.not671 = icmp eq i32 %.4574.lcssa, %3 br i1 %.not671, label %._crit_edge790.thread, label %339 @@ -893,8 +911,8 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r br label %399 399: ; preds = %.thread855, %._crit_edge790.thread, %387, %390, %395, %309 - %.2579 = phi i32 [ %389, %387 ], [ %394, %390 ], [ %398, %395 ], [ %.0577743849858860864, %._crit_edge790.thread ], [ %.1578, %309 ], [ 0, %.thread855 ] - %.1555 = phi i32 [ %240, %387 ], [ %392, %390 ], [ %240, %395 ], [ %240, %._crit_edge790.thread ], [ %240, %309 ], [ %240, %.thread855 ] + %.2579 = phi i32 [ %389, %387 ], [ %394, %390 ], [ %398, %395 ], [ %.0577743849858860864, %._crit_edge790.thread ], [ %.1578, %309 ], [ 0, %.thread859 ] + %.1555 = phi i32 [ %240, %387 ], [ %392, %390 ], [ %240, %395 ], [ %240, %._crit_edge790.thread ], [ %240, %309 ], [ %240, %.thread859 ] %400 = sext i32 %.2579 to i64 %401 = tail call ptr @cli_max_malloc(i64 noundef %400) #8 %.not674 = icmp eq ptr %401, null @@ -1013,8 +1031,8 @@ define range(i32 0, 3) i32 @unspin(ptr noundef %0, i32 noundef %1, ptr noundef r tail call void @free(ptr noundef %259) #8 br label %.critedge713 -.critedge713: ; preds = %248, %246, %438, %.thread718, %.thread, %230, %.critedge, %._crit_edge802, %._crit_edge787, %261, %204, %194, %182, %171, %140, %109, %91, %87, %57, %43, %39, %33, %17 - %.0531 = phi i32 [ 1, %17 ], [ 1, %33 ], [ 1, %39 ], [ 1, %43 ], [ 1, %91 ], [ 1, %109 ], [ 1, %171 ], [ 1, %194 ], [ 1, %261 ], [ 1, %._crit_edge787 ], [ 1, %._crit_edge802 ], [ %.0, %438 ], [ 1, %204 ], [ 1, %182 ], [ 1, %140 ], [ 1, %87 ], [ 1, %57 ], [ 1, %.critedge ], [ 1, %230 ], [ 1, %.thread ], [ 1, %.thread718 ], [ 2, %246 ], [ 2, %248 ] +.critedge713: ; preds = %248, %246, %438, %.thread718, %.thread, %230, %.critedge, %._crit_edge802, %._crit_edge787, %261, %204, %194, %182, %171, %138, %109, %91, %87, %57, %43, %39, %33, %17 + %.0531 = phi i32 [ 1, %17 ], [ 1, %33 ], [ 1, %39 ], [ 1, %43 ], [ 1, %91 ], [ 1, %109 ], [ 1, %169 ], [ 1, %192 ], [ 1, %261 ], [ 1, %._crit_edge787 ], [ 1, %._crit_edge802 ], [ %.0, %438 ], [ 1, %202 ], [ 1, %180 ], [ 1, %138 ], [ 1, %87 ], [ 1, %57 ], [ 1, %.critedge ], [ 1, %.split.us ], [ 1, %.thread ], [ 1, %.thread718 ], [ 2, %246 ], [ 2, %248 ] ret i32 %.0531 } diff --git a/bench/clamav/optimized/upx.ll b/bench/clamav/optimized/upx.ll index e1572c34f68..284b2608a3d 100644 --- a/bench/clamav/optimized/upx.ll +++ b/bench/clamav/optimized/upx.ll @@ -515,15 +515,13 @@ define internal fastcc range(i32 0, 2) i32 @pefromupx(ptr noundef %0, i32 nounde %15 = zext i32 %14 to i64 %switch = icmp ult i32 %14, 2 %16 = zext i32 %4 to i64 - %17 = zext i32 %6 to i64 - %18 = sub nsw i64 0, %17 - %.neg579 = sub nsw i64 %17, %16 - %invariant.op = add nsw i64 %.neg579, 2 - %19 = ptrtoint ptr %0 to i64 - %20 = getelementptr inbounds nuw i8, ptr %0, i64 %16 - %21 = getelementptr inbounds i8, ptr %20, i64 %18 - %invariant.gep = getelementptr i8, ptr %21, i64 -2 - %22 = add i64 %15, %19 + %17 = getelementptr inbounds nuw i8, ptr %0, i64 %16 + %18 = zext i32 %6 to i64 + %.neg579 = sub nsw i64 0, %18 + %20 = getelementptr inbounds i8, ptr %17, i64 %.neg579 + %invariant.gep = getelementptr i8, ptr %20, i64 -2 + %21 = ptrtoint ptr %0 to i64 + %22 = add i64 %15, %21 %23 = sub i32 %4, %6 %invariant.op506 = add i32 %23, -2 %invariant.op507 = add i32 %23, -1 @@ -546,15 +544,15 @@ define internal fastcc range(i32 0, 2) i32 @pefromupx(ptr noundef %0, i32 nounde %30 = phi i32 [ %52, %48 ], [ %13, %.lr.ph ] %31 = phi i32 [ %49, %48 ], [ 1, %.lr.ph ] %32 = zext i32 %30 to i64 - %.not352 = icmp sgt i64 %invariant.op, %32 + %gep = getelementptr i8, ptr %invariant.gep, i64 %32 + %.not352 = icmp ult ptr %gep, %0 br i1 %.not352, label %48, label %33 33: ; preds = %.lr.ph.split - %gep = getelementptr i8, ptr %invariant.gep, i64 %32 %34 = ptrtoint ptr %gep to i64 %35 = add i64 %34, 2 %.not353 = icmp ule i64 %35, %22 - %36 = icmp ugt i64 %35, %19 + %36 = icmp ugt i64 %35, %21 %or.cond390 = and i1 %.not353, %36 %37 = icmp ugt i64 %22, %34 %or.cond391 = and i1 %37, %or.cond390 @@ -666,9 +664,9 @@ define internal fastcc range(i32 0, 2) i32 @pefromupx(ptr noundef %0, i32 nounde br label %.loopexit .loopexit: ; preds = %.loopexit.loopexit584, %89 - %.pre-phi = phi i64 [ %.pre, %.loopexit.loopexit584 ], [ %76, %89 ] - %100 = phi i32 [ %31, %.loopexit.loopexit584 ], [ %.lcssa502604, %89 ] - %.0441 = phi i32 [ %30, %.loopexit.loopexit584 ], [ %94, %89 ] + %.pre-phi = phi i64 [ %.pre, %.loopexit.loopexit582 ], [ %76, %89 ] + %100 = phi i32 [ %31, %.loopexit.loopexit582 ], [ %.lcssa502604, %89 ] + %.0441 = phi i32 [ %30, %.loopexit.loopexit582 ], [ %94, %89 ] %101 = icmp ne i32 %.0441, 0 %102 = icmp ugt i32 %1, 3 %or.cond8 = and i1 %102, %101 @@ -726,7 +724,7 @@ define internal fastcc range(i32 0, 2) i32 @pefromupx(ptr noundef %0, i32 nounde br label %checkpe.exit .lr.ph532: ; preds = %.lr.ph525, %.critedge10 - %.1281523531 = phi ptr [ %152, %.critedge10 ], [ %126, %.lr.ph525 ] + %.1281523531 = phi ptr [ %152, %.critedge10 ], [ %126, %.lr.ph524 ] %130 = ptrtoint ptr %.1281523531 to i64 %131 = add i64 %130, 8 %.not364 = icmp ule i64 %131, %128 @@ -793,13 +791,13 @@ define internal fastcc range(i32 0, 2) i32 @pefromupx(ptr noundef %0, i32 nounde br i1 %.not369, label %.critedge10, label %.lr.ph517 .critedge10: ; preds = %142, %.critedge12, %.lr.ph517, %136 - %.2282.lcssa = phi ptr [ %137, %136 ], [ %.2282515, %.lr.ph517 ], [ %151, %.critedge12 ], [ %.2282515, %142 ] + %.2282.lcssa = phi ptr [ %137, %136 ], [ %.2282515, %.lr.ph516 ], [ %151, %.critedge12 ], [ %.2282515, %142 ] %152 = getelementptr inbounds nuw i8, ptr %.2282.lcssa, i64 1 %.not363 = icmp ult ptr %152, %2 br i1 %.not363, label %.critedge, label %.lr.ph532 .critedge: ; preds = %.lr.ph532, %.critedge10, %134, %.lr.ph525 - %.1281.lcssa499 = phi ptr [ %126, %.lr.ph525 ], [ %.1281523531, %.lr.ph532 ], [ %152, %.critedge10 ], [ %.1281523531, %134 ] + %.1281.lcssa499 = phi ptr [ %126, %.lr.ph524 ], [ %.1281523531, %.lr.ph531 ], [ %152, %.critedge10 ], [ %.1281523531, %134 ] %153 = getelementptr inbounds nuw i8, ptr %.1281.lcssa499, i64 4 %154 = icmp ult i32 %122, 248 %.not.i = icmp ult ptr %153, %2 @@ -900,9 +898,9 @@ checkpe.exit: ; preds = %.critedge.thread, % br label %checkpe.exit429 .lr.ph545.split.us: ; preds = %.lr.ph545.split.us.preheader, %224 - %.5285543.us = phi ptr [ %225, %224 ], [ %192, %.lr.ph545.split.us.preheader ] - %.3542.us = phi i32 [ %.6444.ph.us, %224 ], [ %.1, %.lr.ph545.split.us.preheader ] - %.3448541.us = phi i32 [ %.7452.ph.us, %224 ], [ %.1446, %.lr.ph545.split.us.preheader ] + %.5285543.us = phi ptr [ %225, %224 ], [ %192, %.lr.ph544.split.us.preheader ] + %.3542.us = phi i32 [ %.6444.ph.us, %224 ], [ %.1, %.lr.ph544.split.us.preheader ] + %.3448541.us = phi i32 [ %.7452.ph.us, %224 ], [ %.1446, %.lr.ph544.split.us.preheader ] %197 = ptrtoint ptr %.5285543.us to i64 %198 = add i64 %197, 248 %.not47.i418.us = icmp ule i64 %198, %191 @@ -953,17 +951,17 @@ checkpe.exit: ; preds = %.critedge.thread, % br i1 %or.cond56.i427.us, label %checkpe.exit429, label %224 224: ; preds = %218, %216, %206, %203, %201, %.lr.ph545.split.us - %.7452.ph.us = phi i32 [ %.3448541.us, %.lr.ph545.split.us ], [ %.3448541.us, %201 ], [ %215, %218 ], [ %215, %216 ], [ 0, %206 ], [ %.3448541.us, %203 ] - %.6444.ph.us = phi i32 [ %.3542.us, %.lr.ph545.split.us ], [ %.3542.us, %201 ], [ %205, %218 ], [ %205, %216 ], [ %205, %206 ], [ 0, %203 ] + %.7452.ph.us = phi i32 [ %.3448541.us, %.lr.ph544.split.us ], [ %.3448541.us, %201 ], [ %215, %218 ], [ %215, %216 ], [ 0, %206 ], [ %.3448541.us, %203 ] + %.6444.ph.us = phi i32 [ %.3542.us, %.lr.ph544.split.us ], [ %.3542.us, %201 ], [ %205, %218 ], [ %205, %216 ], [ %205, %206 ], [ 0, %203 ] %225 = getelementptr inbounds i8, ptr %.5285543.us, i64 -1 %226 = icmp ugt ptr %225, %2 br i1 %226, label %.lr.ph545.split.us, label %checkpe.exit429 checkpe.exit429: ; preds = %224, %218, %.lr.ph545.split.preheader - %.5285.lcssa = phi ptr [ %scevgep601, %.lr.ph545.split.preheader ], [ %.5285543.us, %218 ], [ %225, %224 ] - %.4449 = phi i32 [ %.1446, %.lr.ph545.split.preheader ], [ %215, %218 ], [ %.7452.ph.us, %224 ] - %.4442 = phi i32 [ %.1, %.lr.ph545.split.preheader ], [ %205, %218 ], [ %.6444.ph.us, %224 ] - %.3277 = phi ptr [ null, %.lr.ph545.split.preheader ], [ %207, %218 ], [ null, %224 ] + %.5285.lcssa = phi ptr [ %scevgep601, %.lr.ph544.split.preheader ], [ %.5285543.us, %218 ], [ %225, %224 ] + %.4449 = phi i32 [ %.1446, %.lr.ph544.split.preheader ], [ %215, %218 ], [ %.7452.ph.us, %224 ] + %.4442 = phi i32 [ %.1, %.lr.ph544.split.preheader ], [ %205, %218 ], [ %.6444.ph.us, %224 ] + %.3277 = phi ptr [ null, %.lr.ph544.split.preheader ], [ %207, %218 ], [ null, %224 ] %227 = ptrtoint ptr %.5285.lcssa to i64 %228 = sub i64 %227, %10 %229 = trunc i64 %228 to i32 @@ -1049,9 +1047,9 @@ checkpe.exit429: ; preds = %224, %218, %.lr.ph5 br i1 %262, label %.split, label %.lr.ph567.split .lr.ph567.split: ; preds = %.lr.ph567, %299 - %.4278565 = phi ptr [ %300, %299 ], [ %.1275, %.lr.ph567 ] - %.0286564 = phi i32 [ %301, %299 ], [ 0, %.lr.ph567 ] - %.0293563 = phi i32 [ %297, %299 ], [ %260, %.lr.ph567 ] + %.4278565 = phi ptr [ %300, %299 ], [ %.1275, %.lr.ph566 ] + %.0286564 = phi i32 [ %301, %299 ], [ 0, %.lr.ph566 ] + %.0293563 = phi i32 [ %297, %299 ], [ %260, %.lr.ph566 ] %265 = getelementptr inbounds nuw i8, ptr %.4278565, i64 8 %266 = load i32, ptr %265, align 1, !tbaa !3 br i1 %.not383, label %278, label %267 @@ -1096,7 +1094,7 @@ checkpe.exit429: ; preds = %224, %218, %.lr.ph5 br i1 %or.cond409, label %292, label %.split .split: ; preds = %281, %286, %.lr.ph567 - %.us-phi570 = phi i32 [ 0, %.lr.ph567 ], [ %.0286564, %286 ], [ %.0286564, %281 ] + %.us-phi570 = phi i32 [ 0, %.lr.ph566 ], [ %.0286564, %286 ], [ %.0286564, %281 ] tail call void (ptr, ...) @cli_dbgmsg(ptr noundef nonnull @.str.9, i32 noundef %.us-phi570) #8 br label %.thread472 @@ -1151,8 +1149,8 @@ checkpe.exit429: ; preds = %224, %218, %.lr.ph5 br label %315 315: ; preds = %.lr.ph575, %333 - %.6573 = phi ptr [ %312, %.lr.ph575 ], [ %338, %333 ] - %.1287572 = phi i32 [ 0, %.lr.ph575 ], [ %339, %333 ] + %.6573 = phi ptr [ %312, %.lr.ph574 ], [ %338, %333 ] + %.1287572 = phi i32 [ 0, %.lr.ph574 ], [ %339, %333 ] %316 = getelementptr inbounds nuw i8, ptr %.6573, i64 20 %317 = load i32, ptr %316, align 1, !tbaa !3 %318 = getelementptr inbounds nuw i8, ptr %.6573, i64 16 diff --git a/bench/cmake/optimized/huf_compress.ll b/bench/cmake/optimized/huf_compress.ll index f22ad044713..83a160e0bb9 100644 --- a/bench/cmake/optimized/huf_compress.ll +++ b/bench/cmake/optimized/huf_compress.ll @@ -2614,13 +2614,13 @@ HUF_compress1X_usingCTable_internal_body.exit: ; preds = %865, %HUF_compress1 } ; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable -define dso_local range(i64 -119, 262147) i64 @HUF_compress4X_usingCTable(ptr noundef %0, i64 noundef %1, ptr noundef readonly captures(none) %2, i64 noundef %3, ptr noundef readonly captures(none) %4, i32 noundef %5) local_unnamed_addr #8 { +define dso_local i64 @HUF_compress4X_usingCTable(ptr noundef %0, i64 noundef %1, ptr noundef readonly captures(none) %2, i64 noundef %3, ptr noundef readonly captures(none) %4, i32 noundef %5) local_unnamed_addr #8 { %7 = tail call fastcc i64 @HUF_compress4X_usingCTable_internal(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4) ret i64 %7 } ; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable -define internal fastcc range(i64 -119, 262147) i64 @HUF_compress4X_usingCTable_internal(ptr noundef %0, i64 noundef %1, ptr noundef readonly captures(none) %2, i64 noundef %3, ptr noundef readonly captures(none) %4) unnamed_addr #8 { +define internal fastcc i64 @HUF_compress4X_usingCTable_internal(ptr noundef %0, i64 noundef %1, ptr noundef readonly captures(none) %2, i64 noundef %3, ptr noundef readonly captures(none) %4) unnamed_addr #8 { %6 = add i64 %3, 3 %7 = lshr i64 %6, 2 %8 = icmp ult i64 %1, 17 @@ -2629,9 +2629,11 @@ define internal fastcc range(i64 -119, 262147) i64 @HUF_compress4X_usingCTable_i br i1 %or.cond108, label %.thread, label %10 10: ; preds = %5 - %11 = getelementptr inbounds nuw i8, ptr %0, i64 6 + %11 = getelementptr inbounds nuw i8, ptr %0, i64 %1 + %12 = getelementptr inbounds nuw i8, ptr %0, i64 6 + %13 = ptrtoint ptr %11 to i64 %gepdiff = add i64 %1, -6 - %12 = tail call fastcc i64 @HUF_compress1X_usingCTable_internal(ptr noundef nonnull %11, i64 noundef %gepdiff, ptr noundef %2, i64 noundef %7, ptr noundef %4) + %12 = tail call fastcc i64 @HUF_compress1X_usingCTable_internal(ptr noundef nonnull %12, i64 noundef %gepdiff, ptr noundef %2, i64 noundef %7, ptr noundef %4) %13 = icmp ult i64 %12, -119 br i1 %13, label %14, label %.thread @@ -2643,7 +2645,7 @@ define internal fastcc range(i64 -119, 262147) i64 @HUF_compress4X_usingCTable_i 16: ; preds = %14 %17 = trunc nuw i64 %12 to i16 store i16 %17, ptr %0, align 1, !tbaa !17 - %18 = getelementptr inbounds nuw i8, ptr %11, i64 %12 + %18 = getelementptr inbounds nuw i8, ptr %12, i64 %12 %19 = getelementptr inbounds nuw i8, ptr %2, i64 %7 %gepdiff127 = sub i64 %gepdiff, %12 %20 = tail call fastcc i64 @HUF_compress1X_usingCTable_internal(ptr noundef nonnull %18, i64 noundef %gepdiff127, ptr noundef %19, i64 noundef %7, ptr noundef %4) @@ -2678,8 +2680,8 @@ define internal fastcc range(i64 -119, 262147) i64 @HUF_compress4X_usingCTable_i store i16 %36, ptr %35, align 1, !tbaa !17 %37 = getelementptr inbounds nuw i8, ptr %27, i64 %30 %38 = getelementptr inbounds nuw i8, ptr %28, i64 %7 - %39 = add nuw nsw i64 %29, %30 - %gepdiff129 = sub i64 %gepdiff, %39 + %41 = ptrtoint ptr %37 to i64 + %gepdiff129 = sub i64 %13, %41 %.neg = mul i64 %7, -3 %gepdiff106 = add i64 %.neg, %3 %40 = tail call fastcc i64 @HUF_compress1X_usingCTable_internal(ptr noundef nonnull %37, i64 noundef %gepdiff129, ptr noundef %38, i64 noundef %gepdiff106, ptr noundef %4) @@ -2692,14 +2694,14 @@ define internal fastcc range(i64 -119, 262147) i64 @HUF_compress4X_usingCTable_i br i1 %or.cond10, label %.thread, label %44 44: ; preds = %42 - %45 = add nuw nsw i64 %12, 6 - %46 = add nuw nsw i64 %45, %20 - %47 = add nuw nsw i64 %46, %30 - %48 = add nuw nsw i64 %47, %40 + %48 = getelementptr inbounds nuw i8, ptr %39, i64 %43 + %49 = ptrtoint ptr %48 to i64 + %50 = ptrtoint ptr %0 to i64 + %51 = sub i64 %49, %50 br label %.thread .thread: ; preds = %42, %34, %32, %24, %22, %16, %14, %10, %5, %44 - %.0 = phi i64 [ %48, %44 ], [ 0, %5 ], [ 0, %14 ], [ %12, %10 ], [ 0, %22 ], [ %20, %16 ], [ 0, %32 ], [ %30, %24 ], [ 0, %42 ], [ %40, %34 ] + %.0 = phi i64 [ %51, %47 ], [ 0, %5 ], [ 0, %16 ], [ %12, %10 ], [ 0, %24 ], [ %20, %18 ], [ 0, %34 ], [ %30, %26 ], [ 0, %45 ], [ %40, %36 ] ret i64 %.0 } diff --git a/bench/cmake/optimized/zstd_decompress.ll b/bench/cmake/optimized/zstd_decompress.ll index 0784b1c902b..e55cee63923 100644 --- a/bench/cmake/optimized/zstd_decompress.ll +++ b/bench/cmake/optimized/zstd_decompress.ll @@ -2415,6 +2415,7 @@ define dso_local i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, i64 noun 15: ; preds = %3 %16 = getelementptr inbounds nuw i8, ptr %1, i64 8 %17 = getelementptr inbounds nuw i8, ptr %0, i64 10264 + %18 = ptrtoint ptr %13 to i64 %gepdiff = add i64 %2, -8 %18 = tail call i64 @HUF_readDTableX2_wksp(ptr noundef nonnull %17, ptr noundef nonnull %16, i64 noundef %gepdiff, ptr noundef %0, i64 noundef 10264, i32 noundef 0) #15 %19 = icmp ult i64 %18, -119 @@ -2492,8 +2493,8 @@ define dso_local i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, i64 noun call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #15 store i32 35, ptr %11, align 4, !tbaa !41 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #15 - %46 = add i64 %34, %35 - %gepdiff105 = sub i64 %gepdiff, %46 + %47 = ptrtoint ptr %45 to i64 + %gepdiff105 = sub i64 %18, %47 %47 = call i64 @FSE_readNCount(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %45, i64 noundef %gepdiff105) #15 %48 = icmp ult i64 %47, -119 br i1 %48, label %49, label %.thread97 @@ -2525,29 +2526,28 @@ define dso_local i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, i64 noun br i1 %58, label %.loopexit, label %59 59: ; preds = %55 - %.neg116 = add i64 %2, -20 - %60 = add i64 %46, %47 - %gepdiff106 = sub i64 %.neg116, %60 - %61 = getelementptr inbounds nuw i8, ptr %0, i64 26652 - br label %62 - -62: ; preds = %59, %.critedge - %indvars.iv = phi i64 [ 0, %59 ], [ %indvars.iv.next, %.critedge ] - %.469123 = phi ptr [ %56, %59 ], [ %66, %.critedge ] - %.469.val = load i32, ptr %.469123, align 1, !tbaa !41 - %63 = icmp eq i32 %.469.val, 0 - %64 = zext i32 %.469.val to i64 - %65 = icmp ult i64 %gepdiff106, %64 - %or.cond = or i1 %63, %65 + %62 = ptrtoint ptr %59 to i64 + %63 = sub i64 %18, %62 + %64 = getelementptr inbounds nuw i8, ptr %0, i64 26652 + br label %65 + +65: ; preds = %61, %.critedge + %indvars.iv = phi i64 [ 0, %61 ], [ %indvars.iv.next, %.critedge ] + %indvars.iv = phi ptr [ %58, %61 ], [ %69, %.critedge ] + %.469.val = load i32, ptr %indvars.iv, align 1, !tbaa !41 + %66 = icmp eq i32 %.469.val, 0 + %67 = zext i32 %.469.val to i64 + %68 = icmp ult i64 %63, %67 + %or.cond = select i1 %66, i1 true, i1 %68 br i1 %or.cond, label %.loopexit, label %.critedge -.critedge: ; preds = %62 - %66 = getelementptr inbounds nuw i8, ptr %.469123, i64 4 - %67 = getelementptr inbounds nuw [3 x i32], ptr %61, i64 0, i64 %indvars.iv +.critedge: ; preds = %65 + %66 = getelementptr inbounds nuw i8, ptr %.469111, i64 4 + %67 = getelementptr inbounds nuw [3 x i32], ptr %64, i64 0, i64 %indvars.iv store i32 %.469.val, ptr %67, align 4, !tbaa !41 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, 3 - br i1 %exitcond, label %68, label %62, !llvm.loop !114 + br i1 %exitcond, label %68, label %65, !llvm.loop !114 68: ; preds = %.critedge %69 = ptrtoint ptr %66 to i64 @@ -2555,8 +2555,8 @@ define dso_local i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, i64 noun %71 = sub i64 %69, %70 br label %.loopexit -.loopexit: ; preds = %62, %.thread97, %.thread93, %.thread, %55, %3, %15, %68 - %.0 = phi i64 [ %71, %68 ], [ -30, %15 ], [ -30, %3 ], [ -30, %55 ], [ -30, %.thread ], [ -30, %.thread93 ], [ -30, %.thread97 ], [ -30, %62 ] +.loopexit: ; preds = %65, %.thread97, %.thread93, %.thread, %55, %3, %15, %68 + %.0 = phi i64 [ %71, %71 ], [ -30, %15 ], [ -30, %3 ], [ -30, %57 ], [ -30, %.thread ], [ -30, %.thread93 ], [ -30, %.thread97 ], [ -30, %65 ] ret i64 %.0 } diff --git a/bench/darktable/optimized/export.ll b/bench/darktable/optimized/export.ll index 9269f1bc628..bdc79413e5d 100644 --- a/bench/darktable/optimized/export.ll +++ b/bench/darktable/optimized/export.ll @@ -2939,36 +2939,33 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ 86: ; preds = %67 %87 = getelementptr i8, ptr %80, i64 %81 %88 = getelementptr i8, ptr %87, i64 1 - %89 = add i64 %69, 40 - %90 = add i64 %89, %72 - %91 = add i64 %90, %75 - %92 = add i64 %91, %78 - %93 = add i64 %92, %81 - %94 = add i64 %93, 1 - %95 = load i32, ptr %88, align 4, !tbaa !116 - %96 = getelementptr i8, ptr %87, i64 5 - %97 = load i32, ptr %96, align 4, !tbaa !116 - %98 = getelementptr i8, ptr %87, i64 9 - %99 = load i32, ptr %98, align 4, !tbaa !116 - %100 = getelementptr i8, ptr %87, i64 13 - %101 = load i32, ptr %100, align 4, !tbaa !116 - %102 = getelementptr i8, ptr %87, i64 17 - %103 = sext i32 %99 to i64 - %104 = getelementptr inbounds i8, ptr %102, i64 %103 - %105 = sext i32 %101 to i64 - %106 = getelementptr inbounds nuw i8, ptr %82, i64 48 - %107 = load ptr, ptr %106, align 8, !tbaa !132 + %89 = ptrtoint ptr %88 to i64 + %90 = ptrtoint ptr %33 to i64 + %91 = sub i64 %89, %90 + %92 = load i32, ptr %88, align 4, !tbaa !116 + %93 = getelementptr i8, ptr %87, i64 5 + %94 = load i32, ptr %93, align 4, !tbaa !116 + %95 = getelementptr i8, ptr %87, i64 9 + %96 = load i32, ptr %95, align 4, !tbaa !116 + %97 = getelementptr i8, ptr %87, i64 13 + %98 = load i32, ptr %97, align 4, !tbaa !116 + %99 = getelementptr i8, ptr %87, i64 17 + %100 = sext i32 %96 to i64 + %101 = getelementptr inbounds i8, ptr %99, i64 %100 + %102 = sext i32 %98 to i64 + %103 = getelementptr inbounds nuw i8, ptr %82, i64 48 + %104 = load ptr, ptr %103, align 8, !tbaa !132 + %105 = call i32 (...) %104() #19 + %106 = getelementptr inbounds nuw i8, ptr %83, i64 48 + %107 = load ptr, ptr %106, align 8, !tbaa !133 %108 = call i32 (...) %107() #19 - %109 = getelementptr inbounds nuw i8, ptr %83, i64 48 - %110 = load ptr, ptr %109, align 8, !tbaa !133 - %111 = call i32 (...) %110() #19 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #19 - store i32 %108, ptr %4, align 4, !tbaa !116 + store i32 %105, ptr %4, align 4, !tbaa !116 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #19 store i64 0, ptr %5, align 8, !tbaa !134 - %112 = call noalias ptr @malloc(i64 noundef %103) #22 - call void @llvm.memcpy.p0.p0.i64(ptr align 1 %112, ptr align 1 %102, i64 %103, i1 false) - %113 = icmp slt i32 %95, %108 + %112 = call noalias ptr @malloc(i64 noundef %100) #22 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %112, ptr align 1 %99, i64 %100, i1 false) + %113 = icmp slt i32 %92, %105 br i1 %113, label %.lr.ph, label %._crit_edge .lr.ph: ; preds = %86 @@ -2983,11 +2980,11 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ br i1 %.not183, label %.loopexit, label %.lr.ph235 .lr.ph235: ; preds = %.lr.ph, %116 - %118 = phi ptr [ %117, %116 ], [ %115, %.lr.ph ] - %.0161196234 = phi ptr [ %119, %116 ], [ %112, %.lr.ph ] - %.0159197233 = phi i32 [ %122, %116 ], [ %95, %.lr.ph ] - %.0157198232 = phi i64 [ %121, %116 ], [ %103, %.lr.ph ] - %119 = call ptr %118(ptr noundef nonnull %82, ptr noundef %.0161196234, i64 noundef %.0157198232, i32 noundef %.0159197233, ptr noundef nonnull %4, ptr noundef nonnull %5) #19 + %118 = phi ptr [ %117, %113 ], [ %115, %.lr.ph ] + %.0161196234 = phi ptr [ %119, %113 ], [ %112, %.lr.ph ] + %.0159197233 = phi i32 [ %122, %113 ], [ %92, %.lr.ph ] + %.0157198232 = phi i64 [ %121, %113 ], [ %100, %.lr.ph ] + %119 = call ptr %115(ptr noundef nonnull %82, ptr noundef %.0161196234, i64 noundef %.0157198232, i32 noundef %.0159197233, ptr noundef nonnull %4, ptr noundef nonnull %5) #19 %.not184 = icmp eq ptr %119, null br i1 %.not184, label %.loopexit, label %120 @@ -2995,17 +2992,17 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ call void @free(ptr noundef %.0161196234) #19 %121 = load i64, ptr %5, align 8, !tbaa !134 %122 = load i32, ptr %4, align 4, !tbaa !116 - %123 = icmp slt i32 %122, %108 + %123 = icmp slt i32 %122, %105 br i1 %123, label %116, label %._crit_edge ._crit_edge: ; preds = %120, %86 - %.0157.lcssa = phi i64 [ %103, %86 ], [ %121, %120 ] - %.0153.lcssa = phi ptr [ null, %86 ], [ %119, %120 ] - store i32 %111, ptr %4, align 4, !tbaa !116 + %.0157.lcssa = phi i64 [ %100, %86 ], [ %121, %117 ] + %.0153.lcssa = phi ptr [ null, %86 ], [ %119, %117 ] + store i32 %108, ptr %4, align 4, !tbaa !116 store i64 0, ptr %5, align 8, !tbaa !134 - %124 = call noalias ptr @malloc(i64 noundef %105) #22 - call void @llvm.memcpy.p0.p0.i64(ptr align 1 %124, ptr align 1 %104, i64 %105, i1 false) - %125 = icmp slt i32 %97, %111 + %124 = call noalias ptr @malloc(i64 noundef %102) #22 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %124, ptr align 1 %101, i64 %102, i1 false) + %125 = icmp slt i32 %94, %108 br i1 %125, label %.lr.ph206, label %._crit_edge207 .lr.ph206: ; preds = %._crit_edge @@ -3020,11 +3017,11 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ br i1 %.not181, label %.loopexit, label %.lr.ph242 .lr.ph242: ; preds = %.lr.ph206, %128 - %130 = phi ptr [ %129, %128 ], [ %127, %.lr.ph206 ] - %.1162201241 = phi ptr [ %131, %128 ], [ %124, %.lr.ph206 ] - %.1160202240 = phi i32 [ %134, %128 ], [ %97, %.lr.ph206 ] - %.0158203239 = phi i64 [ %133, %128 ], [ %105, %.lr.ph206 ] - %131 = call ptr %130(ptr noundef nonnull %83, ptr noundef %.1162201241, i64 noundef %.0158203239, i32 noundef %.1160202240, ptr noundef nonnull %4, ptr noundef nonnull %5) #19 + %130 = phi ptr [ %129, %125 ], [ %127, %.lr.ph206 ] + %.1162201241 = phi ptr [ %131, %125 ], [ %124, %.lr.ph206 ] + %.1160202240 = phi i32 [ %134, %125 ], [ %94, %.lr.ph206 ] + %.0158203239 = phi i64 [ %133, %125 ], [ %102, %.lr.ph206 ] + %131 = call ptr %127(ptr noundef nonnull %83, ptr noundef %.1162201241, i64 noundef %.0158203239, i32 noundef %.1160202240, ptr noundef nonnull %4, ptr noundef nonnull %5) #19 %.not182 = icmp eq ptr %131, null br i1 %.not182, label %.loopexit, label %132 @@ -3032,7 +3029,7 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ call void @free(ptr noundef %.1162201241) #19 %133 = load i64, ptr %5, align 8, !tbaa !134 %134 = load i32, ptr %4, align 4, !tbaa !116 - %135 = icmp slt i32 %134, %111 + %135 = icmp slt i32 %134, %108 br i1 %135, label %128, label %._crit_edge207.thread ._crit_edge207.thread: ; preds = %132 @@ -3046,26 +3043,25 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ 137: ; preds = %._crit_edge207.thread, %._crit_edge207 %138 = phi i1 [ %136, %._crit_edge207.thread ], [ true, %._crit_edge207 ] %.1156.lcssa221 = phi ptr [ %131, %._crit_edge207.thread ], [ null, %._crit_edge207 ] - %.0158.lcssa220 = phi i64 [ %133, %._crit_edge207.thread ], [ %105, %._crit_edge207 ] - %139 = add nsw i32 %101, %99 + %.0158.lcssa220 = phi i64 [ %133, %._crit_edge207.thread ], [ %102, %._crit_edge207 ] + %139 = add nsw i32 %98, %96 %140 = sext i32 %139 to i64 %141 = sub nsw i64 %36, %140 %142 = add i64 %.0157.lcssa, %141 %143 = add i64 %142, %.0158.lcssa220 %144 = call noalias ptr @malloc(i64 noundef %143) #22 - call void @llvm.memcpy.p0.p0.i64(ptr align 1 %144, ptr align 1 %33, i64 %94, i1 false) - %145 = getelementptr inbounds nuw i8, ptr %144, i64 %94 - store i32 %108, ptr %145, align 1 - %146 = getelementptr i8, ptr %144, i64 %93 - %147 = getelementptr i8, ptr %146, i64 5 - store i32 %111, ptr %147, align 1 - %148 = getelementptr i8, ptr %146, i64 9 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %144, ptr align 1 %33, i64 %91, i1 false) + %145 = getelementptr inbounds nuw i8, ptr %144, i64 %91 + store i32 %105, ptr %145, align 1 + %146 = getelementptr i8, ptr %142, i64 4 + store i32 %108, ptr %146, align 1 + %144 = getelementptr i8, ptr %142, i64 8 %.0.extract.trunc61 = trunc i64 %.0157.lcssa to i32 - store i32 %.0.extract.trunc61, ptr %148, align 1 - %149 = getelementptr i8, ptr %146, i64 13 + store i32 %.0.extract.trunc61, ptr %144, align 1 + %149 = getelementptr i8, ptr %142, i64 12 %.0.extract.trunc = trunc i64 %.0158.lcssa220 to i32 store i32 %.0.extract.trunc, ptr %149, align 1 - %150 = add i64 %93, 17 + %150 = add i64 %91, 16 %151 = getelementptr inbounds nuw i8, ptr %144, i64 %150 br i1 %138, label %152, label %153 @@ -3074,83 +3070,83 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ br label %154 153: ; preds = %137 - call void @llvm.memcpy.p0.p0.i64(ptr align 1 %151, ptr align 1 %102, i64 %103, i1 false) + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %151, ptr align 1 %99, i64 %100, i1 false) br label %154 154: ; preds = %153, %152 %155 = getelementptr i8, ptr %144, i64 %.0157.lcssa %156 = getelementptr i8, ptr %155, i64 %150 - br i1 %125, label %157, label %158 + br i1 %125, label %157, label %154 157: ; preds = %154 call void @llvm.memcpy.p0.p0.i64(ptr align 1 %156, ptr nonnull align 1 %.1156.lcssa221, i64 %.0158.lcssa220, i1 false) - br label %159 + br label %155 -158: ; preds = %154 - call void @llvm.memcpy.p0.p0.i64(ptr align 1 %156, ptr align 1 %104, i64 %105, i1 false) - br label %159 +154: ; preds = %150 + call void @llvm.memcpy.p0.p0.i64(ptr align 1 %152, ptr align 1 %101, i64 %102, i1 false) + br label %155 -159: ; preds = %158, %157 - call void (ptr, ...) @dt_print_ext(ptr noundef nonnull @.str.109, ptr noundef %38, i32 noundef %95, i32 noundef %97, i32 noundef %108, i32 noundef %111) #19 +155: ; preds = %154, %153 + call void (ptr, ...) @dt_print_ext(ptr noundef nonnull @.str.109, ptr noundef %38, i32 noundef %92, i32 noundef %94, i32 noundef %105, i32 noundef %108) #19 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #19 - %160 = load i32, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 8), align 8, !tbaa !104 - %161 = and i32 %160, 256 - %.not177 = icmp eq i32 %161, 0 - br i1 %.not177, label %163, label %162 + %156 = load i32, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 8), align 8, !tbaa !104 + %157 = and i32 %156, 256 + %.not177 = icmp eq i32 %157, 0 + br i1 %.not177, label %159, label %158 -162: ; preds = %159 +158: ; preds = %155 call void (ptr, ...) @dt_print_ext(ptr noundef nonnull @.str.103, ptr noundef nonnull @.str.28, i32 noundef 2006, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef nonnull @.str.110) #19 - br label %163 - -163: ; preds = %162, %159 - %164 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 - %165 = call ptr @dt_database_get(ptr noundef %164) #19 - %166 = call i32 @sqlite3_prepare_v2(ptr noundef %165, ptr noundef nonnull @.str.110, i32 noundef -1, ptr noundef nonnull %6, ptr noundef null) #19 - %.not178 = icmp eq i32 %166, 0 - br i1 %.not178, label %173, label %167 - -167: ; preds = %163 - %168 = load ptr, ptr @stderr, align 8, !tbaa !119 - %169 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 - %170 = call ptr @dt_database_get(ptr noundef %169) #19 - %171 = call ptr @sqlite3_errmsg(ptr noundef %170) #19 - %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef nonnull @.str.105, ptr noundef nonnull @.str.28, i32 noundef 2006, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef nonnull @.str.110, ptr noundef %171) #23 - br label %173 - -173: ; preds = %167, %163 - %174 = load ptr, ptr %6, align 8, !tbaa !121 - %175 = trunc i64 %143 to i32 - %176 = call i32 @sqlite3_bind_blob(ptr noundef %174, i32 noundef 1, ptr noundef nonnull %144, i32 noundef %175, ptr noundef nonnull inttoptr (i64 -1 to ptr)) #19 - %.not179 = icmp eq i32 %176, 0 - br i1 %.not179, label %183, label %177 - -177: ; preds = %173 - %178 = load ptr, ptr @stderr, align 8, !tbaa !119 - %179 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 - %180 = call ptr @dt_database_get(ptr noundef %179) #19 - %181 = call ptr @sqlite3_errmsg(ptr noundef %180) #19 - %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef nonnull @.str.108, ptr noundef nonnull @.str.28, i32 noundef 2008, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef %181) #23 - br label %183 - -183: ; preds = %177, %173 - %184 = load ptr, ptr %6, align 8, !tbaa !121 - %185 = call i32 @sqlite3_bind_int(ptr noundef %184, i32 noundef 2, i32 noundef %29) #19 - %.not180 = icmp eq i32 %185, 0 - br i1 %.not180, label %192, label %186 - -186: ; preds = %183 - %187 = load ptr, ptr @stderr, align 8, !tbaa !119 - %188 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 - %189 = call ptr @dt_database_get(ptr noundef %188) #19 - %190 = call ptr @sqlite3_errmsg(ptr noundef %189) #19 - %191 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef nonnull @.str.108, ptr noundef nonnull @.str.28, i32 noundef 2009, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef %190) #23 - br label %192 - -192: ; preds = %186, %183 - %193 = load ptr, ptr %6, align 8, !tbaa !121 - %194 = call i32 @sqlite3_step(ptr noundef %193) #19 - %195 = load ptr, ptr %6, align 8, !tbaa !121 - %196 = call i32 @sqlite3_finalize(ptr noundef %195) #19 + br label %159 + +159: ; preds = %158, %155 + %160 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 + %161 = call ptr @dt_database_get(ptr noundef %160) #19 + %162 = call i32 @sqlite3_prepare_v2(ptr noundef %161, ptr noundef nonnull @.str.110, i32 noundef -1, ptr noundef nonnull %6, ptr noundef null) #19 + %.not178 = icmp eq i32 %162, 0 + br i1 %.not178, label %169, label %163 + +163: ; preds = %159 + %164 = load ptr, ptr @stderr, align 8, !tbaa !119 + %165 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 + %166 = call ptr @dt_database_get(ptr noundef %165) #19 + %167 = call ptr @sqlite3_errmsg(ptr noundef %166) #19 + %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef nonnull @.str.105, ptr noundef nonnull @.str.28, i32 noundef 2006, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef nonnull @.str.110, ptr noundef %167) #23 + br label %169 + +169: ; preds = %163, %159 + %170 = load ptr, ptr %6, align 8, !tbaa !121 + %171 = trunc i64 %140 to i32 + %172 = call i32 @sqlite3_bind_blob(ptr noundef %170, i32 noundef 1, ptr noundef nonnull %141, i32 noundef %171, ptr noundef nonnull inttoptr (i64 -1 to ptr)) #19 + %.not179 = icmp eq i32 %172, 0 + br i1 %.not179, label %179, label %173 + +173: ; preds = %169 + %174 = load ptr, ptr @stderr, align 8, !tbaa !119 + %175 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 + %176 = call ptr @dt_database_get(ptr noundef %175) #19 + %177 = call ptr @sqlite3_errmsg(ptr noundef %176) #19 + %178 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef nonnull @.str.108, ptr noundef nonnull @.str.28, i32 noundef 2008, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef %177) #23 + br label %179 + +162: ; preds = %173, %169 + %180 = load ptr, ptr %6, align 8, !tbaa !121 + %181 = call i32 @sqlite3_bind_int(ptr noundef %180, i32 noundef 2, i32 noundef %29) #19 + %.not180 = icmp eq i32 %181, 0 + br i1 %.not180, label %188, label %182 + +182: ; preds = %162 + %183 = load ptr, ptr @stderr, align 8, !tbaa !119 + %184 = load ptr, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 136), align 8, !tbaa !118 + %185 = call ptr @dt_database_get(ptr noundef %184) #19 + %186 = call ptr @sqlite3_errmsg(ptr noundef %185) #19 + %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef nonnull @.str.108, ptr noundef nonnull @.str.28, i32 noundef 2009, ptr noundef nonnull @__FUNCTION__.init_presets, ptr noundef %186) #23 + br label %188 + +188:; preds = %182, %179 + %189 = load ptr, ptr %6, align 8, !tbaa !121 + %172 = call i32 @sqlite3_step(ptr noundef %189) #23 + %191 = load ptr, ptr %6, align 8, !tbaa !121 + %192 = call i32 @sqlite3_finalize(ptr noundef %191) #19 call void @free(ptr noundef %.0153.lcssa) #19 call void @free(ptr noundef %.1156.lcssa221) #19 call void @free(ptr noundef nonnull %144) #19 @@ -3158,11 +3154,11 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ br label %224 .loopexit: ; preds = %.lr.ph235, %116, %.lr.ph242, %128, %.lr.ph, %.lr.ph206 - %.0155 = phi ptr [ null, %.lr.ph206 ], [ null, %.lr.ph ], [ %131, %128 ], [ null, %.lr.ph242 ], [ null, %116 ], [ null, %.lr.ph235 ] - %.1154 = phi ptr [ %.0153.lcssa, %.lr.ph206 ], [ null, %.lr.ph ], [ %.0153.lcssa, %128 ], [ %.0153.lcssa, %.lr.ph242 ], [ null, %.lr.ph235 ], [ %119, %116 ] + %.0155 = phi ptr [ null, %.lr.ph206 ], [ null, %.lr.ph ], [ %131, %125 ], [ null, %.lr.ph242 ], [ null, %113 ], [ null, %.lr.ph235 ] + %.1154 = phi ptr [ %.0153.lcssa, %.lr.ph206 ], [ null, %.lr.ph ], [ %.0153.lcssa, %125 ], [ %.0153.lcssa, %.lr.ph242 ], [ null, %.lr.ph235 ], [ %119, %113 ] call void @free(ptr noundef %.1154) #19 call void @free(ptr noundef %.0155) #19 - call void (ptr, ...) @dt_print_ext(ptr noundef nonnull @.str.111, ptr noundef %38, i32 noundef %95, i32 noundef %97, i32 noundef %108, i32 noundef %111) #19 + call void (ptr, ...) @dt_print_ext(ptr noundef nonnull @.str.111, ptr noundef %38, i32 noundef %92, i32 noundef %94, i32 noundef %105, i32 noundef %108) #19 %197 = load i32, ptr getelementptr inbounds nuw (i8, ptr @darktable, i64 8), align 8, !tbaa !104 %198 = and i32 %197, 256 %.not185 = icmp eq i32 %198, 0 @@ -3208,7 +3204,7 @@ define void @init_presets(ptr noundef readonly captures(none) %0) local_unnamed_ %223 = call i32 @sqlite3_finalize(ptr noundef %222) #19 br label %224 -224: ; preds = %192, %._crit_edge207, %219 +224: ; preds = %188, %._crit_edge207, %219 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #19 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #19 br label %.critedge @@ -3294,9 +3290,9 @@ define noalias noundef ptr @legacy_params(ptr noundef readnone captures(none) %0 23: ; preds = %7 %24 = getelementptr i8, ptr %16, i64 %17 %25 = getelementptr i8, ptr %24, i64 1 - %26 = add i64 %11, 15 - %27 = add i64 %26, %14 - %28 = add i64 %27, %17 + %26 = ptrtoint ptr %25 to i64 + %27 = ptrtoint ptr %1 to i64 + %28 = sub i64 %26, %27 tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %9, ptr nonnull align 1 %1, i64 %28, i1 false) %29 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(7) @.str.112) #21 %30 = icmp eq i32 %29, 0 diff --git a/bench/darktable/optimized/print_settings.ll b/bench/darktable/optimized/print_settings.ll index f45224ec002..89efc09ace3 100644 --- a/bench/darktable/optimized/print_settings.ll +++ b/bench/darktable/optimized/print_settings.ll @@ -5608,10 +5608,10 @@ define noalias noundef ptr @legacy_params(ptr noundef readnone captures(none) %0 %69 = sext i32 %51 to i64 tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %68, ptr nonnull align 1 %.0130, i64 %69, i1 false) %70 = getelementptr i8, ptr %68, i64 %69 - %.neg151 = add i64 %2, -8 - %71 = add nsw i64 %59, %20 - %72 = add nsw i64 %71, %26 - %73 = sub i64 %.neg151, %72 + %71 = ptrtoint ptr %27 to i64 + %72 = ptrtoint ptr %1 to i64 + %72 = add i64 %2, %72 + %73 = sub i64 %.neg, %71 tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %70, ptr nonnull align 1 %27, i64 %73, i1 false) br label %.sink.split diff --git a/bench/duckdb/optimized/huf_compress.ll b/bench/duckdb/optimized/huf_compress.ll index 37762a03a1e..30201c801e7 100644 --- a/bench/duckdb/optimized/huf_compress.ll +++ b/bench/duckdb/optimized/huf_compress.ll @@ -2663,13 +2663,13 @@ _ZN11duckdb_zstdL43HUF_compress1X_usingCTable_internal_defaultEPvmPKvmPKm.exit: } ; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable -define noundef range(i64 -119, 262147) i64 @_ZN11duckdb_zstd26HUF_compress4X_usingCTableEPvmPKvmPKmi(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #8 { +define noundef i64 @_ZN11duckdb_zstd26HUF_compress4X_usingCTableEPvmPKvmPKmi(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i32 noundef %5) local_unnamed_addr #8 { %7 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress4X_usingCTable_internalEPvmPKvmPKmi(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i32 noundef %5) ret i64 %7 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable -define internal fastcc noundef range(i64 -119, 262147) i64 @_ZN11duckdb_zstdL35HUF_compress4X_usingCTable_internalEPvmPKvmPKmi(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i32 noundef %5) unnamed_addr #8 { +define internal fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress4X_usingCTable_internalEPvmPKvmPKmi(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i32 noundef %5) unnamed_addr #8 { %7 = add i64 %3, 3 %8 = lshr i64 %7, 2 %9 = icmp ult i64 %1, 17 @@ -2678,39 +2678,41 @@ define internal fastcc noundef range(i64 -119, 262147) i64 @_ZN11duckdb_zstdL35H br i1 %or.cond108, label %.thread, label %11 11: ; preds = %6 - %12 = getelementptr inbounds nuw i8, ptr %0, i64 6 + %12 = getelementptr inbounds nuw i8, ptr %0, i64 %1 + %13 = getelementptr inbounds nuw i8, ptr %0, i64 6 + %14 = ptrtoint ptr %12 to i64 %gepdiff = add i64 %1, -6 - %13 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress1X_usingCTable_internalEPvmPKvmPKmi(ptr noundef nonnull %12, i64 noundef %gepdiff, ptr noundef %2, i64 noundef %8, ptr noundef %4, i32 noundef %5) + %13 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress1X_usingCTable_internalEPvmPKvmPKmi(ptr noundef nonnull %13, i64 noundef %gepdiff, ptr noundef %2, i64 noundef %8, ptr noundef %4, i32 noundef %5) %14 = icmp ult i64 %13, -119 br i1 %14, label %15, label %.thread 15: ; preds = %11 %16 = add i64 %13, -65536 %or.cond = icmp ult i64 %16, -65535 - br i1 %or.cond, label %.thread, label %17 + br i1 %or.cond, label %.thread, label %19 + +19: ; preds = %17 + %20 = trunc nuw i64 %15 to i16 + store i16 %20, ptr %0, align 1, !tbaa !16 + %21 = getelementptr inbounds nuw i8, ptr %13, i64 %15 + %22 = getelementptr inbounds nuw i8, ptr %2, i64 %8 + %gepdiff127 = sub i64 %gepdiff, %15 + %23 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress1X_usingCTable_internalEPvmPKvmPKmi(ptr noundef nonnull %21, i64 noundef %gepdiff127, ptr noundef %22, i64 noundef %8, ptr noundef %4, i32 noundef %5) + %24 = icmp ult i64 %23, -119 + br i1 %24, label %25, label %.thread -17: ; preds = %15 - %18 = trunc nuw i64 %13 to i16 - store i16 %18, ptr %0, align 1, !tbaa !16 - %19 = getelementptr inbounds nuw i8, ptr %12, i64 %13 - %20 = getelementptr inbounds nuw i8, ptr %2, i64 %8 - %gepdiff127 = sub i64 %gepdiff, %13 - %21 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress1X_usingCTable_internalEPvmPKvmPKmi(ptr noundef nonnull %19, i64 noundef %gepdiff127, ptr noundef %20, i64 noundef %8, ptr noundef %4, i32 noundef %5) - %22 = icmp ult i64 %21, -119 - br i1 %22, label %23, label %.thread - -23: ; preds = %17 - %24 = add i64 %21, -65536 - %or.cond6 = icmp ult i64 %24, -65535 - br i1 %or.cond6, label %.thread, label %25 +17: ; preds = %19 + %26 = add i64 %23, -65536 + %or.cond6 = icmp ult i64 %26, -65535 + br i1 %or.cond6, label %.thread, label %27 -25: ; preds = %23 +25: ; preds = %25 %26 = getelementptr inbounds nuw i8, ptr %0, i64 2 - %27 = trunc nuw i64 %21 to i16 + %27 = trunc nuw i64 %23 to i16 store i16 %27, ptr %26, align 1, !tbaa !16 - %28 = getelementptr inbounds nuw i8, ptr %19, i64 %21 - %29 = getelementptr inbounds nuw i8, ptr %20, i64 %8 - %30 = add nuw nsw i64 %13, %21 + %28 = getelementptr inbounds nuw i8, ptr %21, i64 %23 + %29 = getelementptr inbounds nuw i8, ptr %22, i64 %8 + %30 = add nuw nsw i64 %13, %23 %gepdiff128 = sub i64 %gepdiff, %30 %31 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress1X_usingCTable_internalEPvmPKvmPKmi(ptr noundef nonnull %28, i64 noundef %gepdiff128, ptr noundef %29, i64 noundef %8, ptr noundef %4, i32 noundef %5) %32 = icmp ult i64 %31, -119 @@ -2727,8 +2729,8 @@ define internal fastcc noundef range(i64 -119, 262147) i64 @_ZN11duckdb_zstdL35H store i16 %37, ptr %36, align 1, !tbaa !16 %38 = getelementptr inbounds nuw i8, ptr %28, i64 %31 %39 = getelementptr inbounds nuw i8, ptr %29, i64 %8 - %40 = add nuw nsw i64 %30, %31 - %gepdiff129 = sub i64 %gepdiff, %40 + %42 = ptrtoint ptr %38 to i64 + %gepdiff129 = sub i64 %14, %42 %.neg = mul i64 %8, -3 %gepdiff106 = add i64 %.neg, %3 %41 = tail call fastcc noundef i64 @_ZN11duckdb_zstdL35HUF_compress1X_usingCTable_internalEPvmPKvmPKmi(ptr noundef nonnull %38, i64 noundef %gepdiff129, ptr noundef %39, i64 noundef %gepdiff106, ptr noundef %4, i32 noundef %5) @@ -2741,14 +2743,14 @@ define internal fastcc noundef range(i64 -119, 262147) i64 @_ZN11duckdb_zstdL35H br i1 %or.cond10, label %.thread, label %45 45: ; preds = %43 - %46 = add nuw nsw i64 %13, 6 - %47 = add nuw nsw i64 %46, %21 - %48 = add nuw nsw i64 %47, %31 - %49 = add nuw nsw i64 %48, %41 + %49 = getelementptr inbounds nuw i8, ptr %40, i64 %41 + %50 = ptrtoint ptr %49 to i64 + %51 = ptrtoint ptr %0 to i64 + %52 = sub i64 %50, %51 br label %.thread -.thread: ; preds = %43, %35, %33, %25, %23, %17, %15, %11, %6, %45 - %.0 = phi i64 [ %49, %45 ], [ 0, %6 ], [ 0, %15 ], [ %13, %11 ], [ 0, %23 ], [ %21, %17 ], [ 0, %33 ], [ %31, %25 ], [ 0, %43 ], [ %41, %35 ] +.thread: ; preds = %43, %35, %33, %25, %25, %19, %15, %11, %6, %45 + %.0 = phi i64 [ %52, %48 ], [ 0, %6 ], [ 0, %17 ], [ %13, %11 ], [ 0, %25 ], [ %23, %19 ], [ 0, %35 ], [ %31, %27 ], [ 0, %46 ], [ %41, %37 ] ret i64 %.0 } diff --git a/bench/ffmpeg/optimized/flac_picture.ll b/bench/ffmpeg/optimized/flac_picture.ll index cf592a674a9..99920c3ad92 100644 --- a/bench/ffmpeg/optimized/flac_picture.ll +++ b/bench/ffmpeg/optimized/flac_picture.ll @@ -36,31 +36,33 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr br label %161 13: ; preds = %4 - %14 = getelementptr inbounds nuw i8, ptr %7, i64 4 - %15 = load i32, ptr %7, align 1, !tbaa !25 - %16 = tail call i32 @llvm.bswap.i32(i32 %15) - %17 = icmp ugt i32 %16, 20 - br i1 %17, label %18, label %22 - -18: ; preds = %13 - tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef %0, i32 noundef 16, ptr noundef nonnull @.str.1, i32 noundef %16) #7 - %19 = getelementptr inbounds nuw i8, ptr %0, i64 212 - %20 = load i32, ptr %19, align 4, !tbaa !9 - %21 = and i32 %20, 8 - %.not = icmp eq i32 %21, 0 - br i1 %.not, label %22, label %161 - -22: ; preds = %18, %13 - %.091 = phi i32 [ %16, %13 ], [ 0, %18 ] - %23 = getelementptr inbounds nuw i8, ptr %7, i64 8 - %24 = load i32, ptr %14, align 1, !tbaa !25 - %25 = tail call i32 @llvm.bswap.i32(i32 %24) - %26 = zext i32 %25 to i64 - %27 = add i32 %25, -64 - %or.cond = icmp ult i32 %27, -63 - br i1 %or.cond, label %28, label %32 - -28: ; preds = %22 + %14 = zext nneg i32 %2 to i64 + %15 = getelementptr inbounds nuw i8, ptr %7, i64 %14 + %16 = getelementptr inbounds nuw i8, ptr %7, i64 4 + %17 = load i32, ptr %7, align 1, !tbaa !25 + %18 = tail call i32 @llvm.bswap.i32(i32 %17) + %19 = icmp ugt i32 %18, 20 + br i1 %19, label %20, label %24 + +20: ; preds = %13 + tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef %0, i32 noundef 16, ptr noundef nonnull @.str.1, i32 noundef %18) #7 + %21 = getelementptr inbounds nuw i8, ptr %0, i64 212 + %22 = load i32, ptr %21, align 4, !tbaa !9 + %23 = and i32 %22, 8 + %.not = icmp eq i32 %23, 0 + br i1 %.not, label %24, label %161 + +24: ; preds = %20, %13 + %.091 = phi i32 [ %18, %13 ], [ 0, %20 ] + %25 = getelementptr inbounds nuw i8, ptr %7, i64 8 + %26 = load i32, ptr %16, align 1, !tbaa !25 + %27 = tail call i32 @llvm.bswap.i32(i32 %26) + %28 = zext i32 %27 to i64 + %29 = add i32 %27, -64 + %or.cond = icmp ult i32 %29, -63 + br i1 %or.cond, label %30, label %32 + +30: ; preds = %24 tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef %0, i32 noundef 16, ptr noundef nonnull @.str.2) #7 %29 = getelementptr inbounds nuw i8, ptr %0, i64 212 %30 = load i32, ptr %29, align 4, !tbaa !9 @@ -69,8 +71,9 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr %.119 = select i1 %.not117, i32 0, i32 -1094995529 br label %161 -32: ; preds = %22 - %33 = add nuw nsw i32 %25, 24 +32: ; preds = %24 + %33 = add nuw nsw i32 %27, 24 + %36 = ptrtoint ptr %15 to i64 %gepdiff = add nsw i32 %2, -8 %34 = icmp samesign ugt i32 %33, %gepdiff br i1 %34, label %35, label %39 @@ -85,9 +88,9 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr br label %161 39: ; preds = %32 - call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr nonnull align 1 %23, i64 %26, i1 false) - %40 = getelementptr inbounds nuw i8, ptr %23, i64 %26 - %41 = getelementptr inbounds nuw [64 x i8], ptr %6, i64 0, i64 %26 + call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr nonnull align 1 %25, i64 %28, i1 false) + %40 = getelementptr inbounds nuw i8, ptr %25, i64 %28 + %41 = getelementptr inbounds nuw [64 x i8], ptr %6, i64 0, i64 %28 store i8 0, ptr %41, align 1, !tbaa !25 %42 = load i32, ptr getelementptr inbounds nuw (i8, ptr @ff_id3v2_mime_tags, i64 32), align 4, !tbaa !26 %.not105162 = icmp eq i32 %42, 0 @@ -120,7 +123,7 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr %48 = load i32, ptr %40, align 1, !tbaa !25 %49 = tail call i32 @llvm.bswap.i32(i32 %48) %gepdiff154 = add nsw i32 %2, -32 - %50 = sub i32 %gepdiff154, %25 + %50 = sub i32 %gepdiff154, %27 %51 = icmp ugt i32 %49, %50 br i1 %51, label %52, label %56 @@ -148,27 +151,28 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr %66 = getelementptr inbounds nuw i8, ptr %59, i64 20 %67 = load i32, ptr %65, align 1, !tbaa !25 %68 = tail call i32 @llvm.bswap.i32(i32 %67) - %69 = add i32 %25, %49 - %gepdiff155 = sub i32 %gepdiff154, %69 - %70 = icmp eq i32 %67, 0 - %71 = icmp ugt i32 %68, %gepdiff155 - %or.cond122 = or i1 %70, %71 - br i1 %or.cond122, label %72, label %.thread150 - -72: ; preds = %56 - %73 = icmp ugt i32 %68, 524288000 - br i1 %73, label %74, label %78 - -74: ; preds = %72 - tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef %0, i32 noundef 16, ptr noundef nonnull @.str.4, i32 noundef %68) #7 - %75 = getelementptr inbounds nuw i8, ptr %0, i64 212 - %76 = load i32, ptr %75, align 4, !tbaa !9 - %77 = and i32 %76, 8 - %.not114 = icmp eq i32 %77, 0 + %72 = ptrtoint ptr %66 to i64 + %gepdiff155 = sub i64 %36, %72 + %74 = trunc i64 %73 to i32 + %71 = icmp eq i32 %67, 0 + %76 = icmp ugt i32 %71, %74 + %or.cond122 = select i1 %75, i1 true, i1 %76 + br i1 %or.cond122, label %77, label %.thread150 + +77:; preds = %59 + %78 = icmp ugt i32 %71, 524288000 + br i1 %78, label %79, label %83 + +79: ; preds = %77 + tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef %0, i32 noundef 16, ptr noundef nonnull @.str.4, i32 noundef %71) #7 + %80 = getelementptr inbounds nuw i8, ptr %0, i64 212 + %81 = load i32, ptr %80, align 4, !tbaa !9 + %82 = and i32 %81, 8 + %.not114 = icmp eq i32 %82, 0 %.123 = select i1 %.not114, i32 0, i32 -1094995529 br label %161 -78: ; preds = %72 +78: ; preds = %77 %.not108 = icmp eq i32 %3, 0 br i1 %.not108, label %86, label %79 @@ -177,9 +181,9 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr %81 = load i32, ptr %80, align 8, !tbaa !30 %82 = icmp slt i32 %81, 1 %83 = and i32 %68, 16777215 - %84 = icmp eq i32 %83, %gepdiff155 - %85 = and i1 %84, %82 - %or.cond126 = and i1 %85, %71 + %84 = icmp eq i32 %83, %74 + %85 = and i1 %76, %89 + %or.cond126 = select i1 %87, i1 %85, i1 false br i1 %or.cond126, label %90, label %86 86: ; preds = %79, %78 @@ -192,15 +196,15 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr br label %161 90: ; preds = %79 - tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef nonnull %0, i32 noundef 32, ptr noundef nonnull @.str.5, i32 noundef %gepdiff155, i32 noundef %68) #7 - %91 = sub nuw nsw i32 %68, %gepdiff155 - br label %108 + tail call void (ptr, i32, ptr, ...) @av_log(ptr noundef nonnull %0, i32 noundef 32, ptr noundef nonnull @.str.5, i32 noundef %74, i32 noundef %68) #7 + %91 = sub nuw nsw i32 %68, %74 + br label %113 .thread150: ; preds = %56 %92 = lshr i32 %2, 4 %93 = sub nsw i32 %2, %92 %.not110 = icmp ult i32 %68, %93 - br i1 %.not110, label %108, label %94 + br i1 %.not110, label %113, label %94 94: ; preds = %.thread150 %95 = add nuw nsw i32 %2, 64 @@ -212,104 +216,105 @@ define range(i32 -2147483648, 1) i32 @ff_flac_parse_picture(ptr noundef %0, ptr 98: ; preds = %94 store ptr null, ptr %1, align 8, !tbaa !4 - %99 = add nuw nsw i32 %25, 32 - %100 = add i32 %99, %49 + %104 = ptrtoint ptr %7 to i64 + %105 = sub i64 %72, %104 %101 = getelementptr inbounds nuw i8, ptr %97, i64 8 %102 = load ptr, ptr %101, align 8, !tbaa !33 - %103 = sext i32 %100 to i64 - %104 = getelementptr inbounds i8, ptr %102, i64 %103 - store ptr %104, ptr %101, align 8, !tbaa !33 - %105 = add i32 %68, 64 - %106 = zext i32 %105 to i64 - %107 = getelementptr inbounds nuw i8, ptr %97, i64 16 - store i64 %106, ptr %107, align 8, !tbaa !36 - %.pre = zext i32 %68 to i64 - br label %129 - -108: ; preds = %90, %.thread150 - %.0152 = phi i32 [ 0, %.thread150 ], [ %91, %90 ] - %109 = add i32 %68, 64 - %110 = zext i32 %109 to i64 - %111 = tail call ptr @av_buffer_alloc(i64 noundef %110) #7 - store ptr %111, ptr %5, align 8, !tbaa !31 - %.not111 = icmp eq ptr %111, null - br i1 %.not111, label %161, label %112 - -112: ; preds = %108 - %113 = getelementptr inbounds nuw i8, ptr %111, i64 8 - %114 = load ptr, ptr %113, align 8, !tbaa !33 - br i1 %or.cond122, label %117, label %115 - -115: ; preds = %112 - %116 = zext i32 %68 to i64 - tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %114, ptr nonnull align 1 %66, i64 %116, i1 false) - br label %129 - -117: ; preds = %112 - %118 = zext i32 %gepdiff155 to i64 - tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %114, ptr nonnull align 1 %66, i64 %118, i1 false) - %119 = getelementptr inbounds nuw i8, ptr %0, i64 32 - %120 = load ptr, ptr %119, align 8, !tbaa !37 - %121 = load ptr, ptr %113, align 8, !tbaa !33 - %122 = zext i32 %68 to i64 - %123 = getelementptr inbounds nuw i8, ptr %121, i64 %122 - %124 = zext nneg i32 %.0152 to i64 - %125 = sub nsw i64 0, %124 - %126 = getelementptr inbounds i8, ptr %123, i64 %125 - %127 = tail call i32 @avio_read(ptr noundef %120, ptr noundef nonnull %126, i32 noundef %.0152) #7 - %128 = icmp ult i32 %127, %.0152 - br i1 %128, label %160, label %129 - -129: ; preds = %115, %117, %98 - %.pre-phi = phi i64 [ %116, %115 ], [ %122, %117 ], [ %.pre, %98 ] - %130 = phi ptr [ %111, %115 ], [ %111, %117 ], [ %97, %98 ] - %131 = getelementptr inbounds nuw i8, ptr %130, i64 8 - %132 = load ptr, ptr %131, align 8, !tbaa !33 - %133 = getelementptr inbounds nuw i8, ptr %132, i64 %.pre-phi - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(64) %133, i8 0, i64 64, i1 false) - %134 = load ptr, ptr %131, align 8, !tbaa !33 - %135 = load i64, ptr %134, align 1, !tbaa !25 - %136 = call i32 @ff_add_attached_pic(ptr noundef %0, ptr noundef null, ptr noundef null, ptr noundef nonnull %5, i32 noundef 0) #7 - %137 = icmp slt i32 %136, 0 - br i1 %137, label %160, label %138 - -138: ; preds = %129 - %139 = icmp eq i64 %135, 727905341920923785 - %spec.select = select i1 %139, i32 61, i32 %.lcssa - %140 = getelementptr inbounds nuw i8, ptr %0, i64 48 - %141 = load ptr, ptr %140, align 8, !tbaa !38 - %142 = getelementptr inbounds nuw i8, ptr %0, i64 44 - %143 = load i32, ptr %142, align 4, !tbaa !39 - %144 = add i32 %143, -1 - %145 = zext i32 %144 to i64 - %146 = getelementptr inbounds nuw ptr, ptr %141, i64 %145 - %147 = load ptr, ptr %146, align 8, !tbaa !40 - %148 = getelementptr inbounds nuw i8, ptr %147, i64 16 - %149 = load ptr, ptr %148, align 8, !tbaa !42 - %150 = getelementptr inbounds nuw i8, ptr %149, i64 4 - store i32 %spec.select, ptr %150, align 4, !tbaa !48 - %151 = getelementptr inbounds nuw i8, ptr %149, i64 72 - store i32 %62, ptr %151, align 8, !tbaa !51 - %152 = getelementptr inbounds nuw i8, ptr %149, i64 76 - store i32 %64, ptr %152, align 4, !tbaa !52 - %153 = getelementptr inbounds nuw i8, ptr %147, i64 80 - %154 = zext nneg i32 %.091 to i64 - %155 = getelementptr inbounds nuw [21 x ptr], ptr @ff_id3v2_picture_types, i64 0, i64 %154 - %156 = load ptr, ptr %155, align 8, !tbaa !4 - %157 = call i32 @av_dict_set(ptr noundef nonnull %153, ptr noundef nonnull @.str.6, ptr noundef %156, i32 noundef 0) #7 - br i1 %.not107, label %161, label %158 - -158: ; preds = %138 - %159 = call i32 @av_dict_set(ptr noundef nonnull %153, ptr noundef nonnull @.str.7, ptr noundef nonnull %57, i32 noundef 0) #7 - br label %161 - -160: ; preds = %129, %117 - %.092 = phi i32 [ -1094995529, %117 ], [ %136, %129 ] + %sext = shl i64 %105, 32 + %108 = ashr exact i64 %sext, 32 + %109 = getelementptr inbounds i8, ptr %107, i64 %108 + store ptr %109, ptr %106, align 8, !tbaa !33 + %110 = add i32 %71, 64 + %111 = zext i32 %110 to i64 + %112 = getelementptr inbounds nuw i8, ptr %102, i64 16 + store i64 %111, ptr %112, align 8, !tbaa !36 + %.pre = zext i32 %71 to i64 + br label %134 + +113:; preds = %90, %.thread150 + %.0152 = phi i32 [ 0, %.thread150 ], [ %96, %95 ] + %114 = add i32 %71, 64 + %115 = zext i32 %114 to i64 + %116 = tail call ptr @av_buffer_alloc(i64 noundef %115) #7 + store ptr %116, ptr %5, align 8, !tbaa !31 + %.not111 = icmp eq ptr %116, null + br i1 %.not111, label %166, label %117 + +117: ; preds = %113 + %118 = getelementptr inbounds nuw i8, ptr %116, i64 8 + %119 = load ptr, ptr %118, align 8, !tbaa !33 + br i1 %or.cond122, label %122, label %120 + +120:; preds = %117 + %121 = zext i32 %68 to i64 + tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %119, ptr nonnull align 1 %69, i64 %121, i1 false) + br label %134 + +122:; preds = %117 + %123 = and i64 %gepdiff155, 4294967295 + tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %119, ptr nonnull align 1 %69, i64 %123, i1 false) + %124 = getelementptr inbounds nuw i8, ptr %0, i64 32 + %121 = load ptr, ptr %124, align 8, !tbaa !37 + %126 = load ptr, ptr %118, align 8, !tbaa !33 + %127 = zext i32 %71 to i64 + %128 = getelementptr inbounds nuw i8, ptr %126, i64 %127 + %129 = zext nneg i32 %.0152 to i64 + %130 = sub nsw i64 0, %129 + %131 = getelementptr inbounds i8, ptr %128, i64 %130 + %132 = tail call i32 @avio_read(ptr noundef %125, ptr noundef nonnull %131, i32 noundef %.0152) #7 + %133 = icmp ult i32 %132, %.0152 + br i1 %133, label %165, label %134 + +134:; preds = %120, %122, %98 + %130 = phi i64 [ %121, %120 ], [ %127, %122 ], [ %.pre, %103 ] + %135 = phi ptr [ %116, %120 ], [ %116, %122 ], [ %97, %103 ] + %136 = getelementptr inbounds nuw i8, ptr %135, i64 8 + %137 = load ptr, ptr %136, align 8, !tbaa !33 + %138 = getelementptr inbounds nuw i8, ptr %137, i64 %130 + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(64) %138, i8 0, i64 64, i1 false) + %135 = load ptr, ptr %136, align 8, !tbaa !33 + %140 = load i64, ptr %139, align 1, !tbaa !25 + %141 = call i32 @ff_add_attached_pic(ptr noundef %0, ptr noundef null, ptr noundef null, ptr noundef nonnull %5, i32 noundef 0) #7 + %142 = icmp slt i32 %141, 0 + br i1 %142, label %165, label %143 + +143:; preds = %134 + %144 = icmp eq i64 %140, 727905341920923785 + %spec.select = select i1 %144, i32 61, i32 %.lcssa + %145 = getelementptr inbounds nuw i8, ptr %0, i64 48 + %146 = load ptr, ptr %145, align 8, !tbaa !38 + %147 = getelementptr inbounds nuw i8, ptr %0, i64 44 + %148 = load i32, ptr %147, align 4, !tbaa !39 + %149 = add i32 %148, -1 + %150 = zext i32 %149 to i64 + %151 = getelementptr inbounds nuw ptr, ptr %146, i64 %150 + %152 = load ptr, ptr %151, align 8, !tbaa !40 + %153 = getelementptr inbounds nuw i8, ptr %152, i64 16 + %154 = load ptr, ptr %153, align 8, !tbaa !42 + %155 = getelementptr inbounds nuw i8, ptr %154, i64 4 + store i32 %spec.select, ptr %155, align 4, !tbaa !48 + %156 = getelementptr inbounds nuw i8, ptr %154, i64 72 + store i32 %65, ptr %156, align 8, !tbaa !51 + %157 = getelementptr inbounds nuw i8, ptr %154, i64 76 + store i32 %67, ptr %157, align 4, !tbaa !52 + %158 = getelementptr inbounds nuw i8, ptr %152, i64 80 + %159 = zext nneg i32 %.091 to i64 + %160 = getelementptr inbounds nuw [21 x ptr], ptr @ff_id3v2_picture_types, i64 0, i64 %159 + %161 = load ptr, ptr %160, align 8, !tbaa !4 + %162 = call i32 @av_dict_set(ptr noundef nonnull %158, ptr noundef nonnull @.str.6, ptr noundef %161, i32 noundef 0) #7 + br i1 %.not107, label %166, label %163 + +163:; preds = %143 + %164 = call i32 @av_dict_set(ptr noundef nonnull %158, ptr noundef nonnull @.str.7, ptr noundef nonnull %60, i32 noundef 0) #7 + br label %166 + +165: ; preds = %134, %122 + %.092 = phi i32 [ -1094995529, %122 ], [ %141, %134 ] call void @av_buffer_unref(ptr noundef nonnull %5) #7 br label %161 -161: ; preds = %138, %158, %108, %94, %86, %74, %52, %35, %28, %18, %9, %160, %._crit_edge - %.090 = phi i32 [ 0, %._crit_edge ], [ %.092, %160 ], [ %., %9 ], [ -1094995529, %18 ], [ %.119, %28 ], [ %.120, %35 ], [ %.121, %52 ], [ %.123, %74 ], [ %.127, %86 ], [ -12, %94 ], [ -12, %108 ], [ 0, %158 ], [ 0, %138 ] +161: ; preds = %143, %163, %113, %94, %86, %79, %52, %35, %30, %20, %9, %165, %._crit_edge + %.090 = phi i32 [ 0, %._crit_edge ], [ %.092, %165 ], [ %., %9 ], [ -1094995529, %20 ], [ %.119, %30 ], [ %.120, %38 ], [ %.121, %55 ], [ %.123, %79 ], [ %.127, %91 ], [ -12, %99 ], [ -12, %113 ], [ 0, %163 ], [ 0, %143 ] call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7 ret i32 %.090 diff --git a/bench/freetype/optimized/type1.ll b/bench/freetype/optimized/type1.ll index a4462dbf003..704bf431790 100644 --- a/bench/freetype/optimized/type1.ll +++ b/bench/freetype/optimized/type1.ll @@ -5365,11 +5365,8 @@ define internal fastcc i32 @T1_Read_PFM(ptr noundef %0, ptr noundef readonly cap %46 = getelementptr inbounds nuw i8, ptr %45, i64 %38 %47 = getelementptr inbounds nuw i8, ptr %46, i64 %42 %48 = getelementptr inbounds nuw i8, ptr %47, i64 %44 - %49 = or i64 %37, %33 - %50 = or i64 %49, %41 - %51 = or i64 %50, %44 - %52 = icmp eq i64 %51, 0 - br i1 %52, label %.thread87, label %53 + %49 = icmp eq ptr %48, %8 + br i1 %49, label %.thread87, label %50 53: ; preds = %29 %.ptr = getelementptr inbounds nuw i8, ptr %48, i64 2 @@ -5379,76 +5376,76 @@ define internal fastcc i32 @T1_Read_PFM(ptr noundef %0, ptr noundef readonly cap 55: ; preds = %53 %56 = getelementptr inbounds nuw i8, ptr %48, i64 1 %57 = load i8, ptr %56, align 1, !tbaa !95 + %55 = zext i8 %54 to i32 + %56 = shl nuw nsw i32 %55, 8 + %57 = load i8, ptr %48, align 1, !tbaa !95 %58 = zext i8 %57 to i32 - %59 = shl nuw nsw i32 %58, 8 - %60 = load i8, ptr %48, align 1, !tbaa !95 - %61 = zext i8 %60 to i32 - %62 = or disjoint i32 %59, %61 - %63 = getelementptr inbounds nuw i8, ptr %2, i64 80 - store i32 %62, ptr %63, align 8, !tbaa !249 - %64 = shl nuw nsw i32 %62, 2 - %65 = zext nneg i32 %64 to i64 - %66 = getelementptr inbounds nuw i8, ptr %.ptr, i64 %65 - %67 = icmp ugt ptr %66, %10 - br i1 %67, label %.thread.sink.split, label %68 - -68: ; preds = %55 - %69 = icmp eq i32 %62, 0 - br i1 %69, label %.thread87, label %70 - -70: ; preds = %68 - %71 = zext nneg i32 %62 to i64 - %72 = call ptr @ft_mem_qrealloc(ptr noundef %6, i64 noundef 16, i64 noundef 0, i64 noundef %71, ptr noundef null, ptr noundef nonnull %4) #16 - %73 = getelementptr inbounds nuw i8, ptr %2, i64 72 - store ptr %72, ptr %73, align 8, !tbaa !245 - %74 = load i32, ptr %4, align 4, !tbaa !19 - %.not = icmp eq i32 %74, 0 - br i1 %.not, label %75, label %.thread - -75: ; preds = %70 - %76 = load i32, ptr %63, align 8, !tbaa !249 - %77 = shl i32 %76, 2 - %78 = zext i32 %77 to i64 - %79 = getelementptr inbounds nuw i8, ptr %48, i64 %78 - %.ptr80 = getelementptr inbounds nuw i8, ptr %79, i64 2 - %80 = getelementptr inbounds nuw i8, ptr %0, i64 168 - %81 = load ptr, ptr %80, align 8, !tbaa !446 - %82 = getelementptr inbounds nuw i8, ptr %0, i64 72 - %83 = load i32, ptr %82, align 8, !tbaa !447 - %84 = icmp sgt i32 %83, 0 - br i1 %84, label %.lr.ph, label %.loopexit - -.lr.ph: ; preds = %75 - %85 = getelementptr inbounds nuw i8, ptr %0, i64 80 - %86 = load ptr, ptr %85, align 8, !tbaa !448 - %wide.trip.count = zext nneg i32 %83 to i64 + %59 = or disjoint i32 %56, %58 + %60 = getelementptr inbounds nuw i8, ptr %2, i64 80 + store i32 %59, ptr %60, align 8, !tbaa !249 + %61 = shl nuw nsw i32 %59, 2 + %62 = zext nneg i32 %61 to i64 + %63 = getelementptr inbounds nuw i8, ptr %.ptr, i64 %62 + %64 = icmp ugt ptr %63, %10 + br i1 %64, label %.thread.sink.split, label %65 + +65:; preds = %52 + %66 = icmp eq i32 %59, 0 + br i1 %66, label %.thread87, label %67 + +67:; preds = %65 + %68 = zext nneg i32 %59 to i64 + %69 = call ptr @ft_mem_qrealloc(ptr noundef %6, i64 noundef 16, i64 noundef 0, i64 noundef %68, ptr noundef null, ptr noundef nonnull %4) #16 + %70 = getelementptr inbounds nuw i8, ptr %2, i64 72 + store ptr %69, ptr %70, align 8, !tbaa !245 + %71 = load i32, ptr %4, align 4, !tbaa !19 + %.not = icmp eq i32 %71, 0 + br i1 %.not, label %72, label %.thread + +72:; preds = %67 + %73 = load i32, ptr %60, align 8, !tbaa !249 + %74 = shl i32 %73, 2 + %75 = zext i32 %74 to i64 + %76 = getelementptr inbounds nuw i8, ptr %48, i64 %75 + %.ptr80 = getelementptr inbounds nuw i8, ptr %76, i64 2 + %77 = getelementptr inbounds nuw i8, ptr %0, i64 168 + %78 = load ptr, ptr %77, align 8, !tbaa !446 + %.ptr80 = getelementptr inbounds nuw i8, ptr %0, i64 72 + %80 = load i32, ptr %.ptr80, align 8, !tbaa !447 + %81 = icmp sgt i32 %80, 0 + br i1 %81, label %.lr.ph, label %.loopexit + +.lr.ph:; preds = %72 + %82 = getelementptr inbounds nuw i8, ptr %0, i64 80 + %83 = load ptr, ptr %82, align 8, !tbaa !448 + %wide.trip.count = zext nneg i32 %80 to i64 br label %88 -87: ; preds = %88 +84:; preds = %85 %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 %.loopexit, label %88, !llvm.loop !449 -88: ; preds = %.lr.ph, %87 - %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %87 ] - %89 = getelementptr inbounds nuw ptr, ptr %86, i64 %indvars.iv +88: ; preds = %.lr.ph, %84 + %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %84 ] + %89 = getelementptr inbounds nuw ptr, ptr %83, i64 %indvars.iv %90 = load ptr, ptr %89, align 8, !tbaa !450 %91 = getelementptr inbounds nuw i8, ptr %90, i64 12 %92 = load i16, ptr %91, align 4, !tbaa !235 %93 = icmp eq i16 %92, 7 - br i1 %93, label %94, label %87 + br i1 %93, label %94, label %84 94: ; preds = %88 - store ptr %90, ptr %80, align 8, !tbaa !446 + store ptr %90, ptr %77, align 8, !tbaa !446 br label %.loopexit -.loopexit: ; preds = %87, %75, %94 - %.not81 = icmp eq i32 %77, 0 +.loopexit: ; preds = %84, %72, %94 + %.not81 = icmp eq i32 %74, 0 br i1 %.not81, label %111, label %.lr.ph79 .lr.ph79: ; preds = %.loopexit, %.lr.ph79 %.06878 = phi ptr [ %109, %.lr.ph79 ], [ %.ptr, %.loopexit ] - %.06977 = phi ptr [ %108, %.lr.ph79 ], [ %72, %.loopexit ] + %.06977 = phi ptr [ %108, %.lr.ph79 ], [ %69, %.loopexit ] %95 = load i8, ptr %.06878, align 1, !tbaa !95 %96 = zext i8 %95 to i64 %97 = call i32 @FT_Get_Char_Index(ptr noundef %0, i64 noundef %96) #16 @@ -5472,14 +5469,14 @@ define internal fastcc i32 @T1_Read_PFM(ptr noundef %0, ptr noundef readonly cap br i1 %110, label %.lr.ph79, label %._crit_edge.loopexit, !llvm.loop !451 ._crit_edge.loopexit: ; preds = %.lr.ph79 - %.pre = load ptr, ptr %73, align 8, !tbaa !245 - %.pre84 = load i32, ptr %63, align 8, !tbaa !249 + %.pre = load ptr, ptr %70, align 8, !tbaa !245 + %.pre84 = load i32, ptr %60, align 8, !tbaa !249 br label %111 111: ; preds = %.loopexit, %._crit_edge.loopexit - %112 = phi i32 [ %.pre84, %._crit_edge.loopexit ], [ %76, %.loopexit ] - %113 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %72, %.loopexit ] - store ptr %81, ptr %80, align 8, !tbaa !446 + %112 = phi i32 [ %.pre84, %._crit_edge.loopexit ], [ %73, %.loopexit ] + %113 = phi ptr [ %.pre, %._crit_edge.loopexit ], [ %69, %.loopexit ] + store ptr %78, ptr %77, align 8, !tbaa !446 %114 = zext i32 %112 to i64 call void @qsort(ptr noundef %113, i64 noundef %114, i64 noundef 16, ptr noundef nonnull @compare_kern_pairs) #16 %.pr.pre = load i32, ptr %4, align 4, !tbaa !19 @@ -5490,7 +5487,7 @@ define internal fastcc i32 @T1_Read_PFM(ptr noundef %0, ptr noundef readonly cap store i32 2, ptr %4, align 4, !tbaa !19 br label %.thread -.thread: ; preds = %.thread.sink.split, %70, %111 +.thread: ; preds = %.thread.sink.split, %67, %111 %116 = getelementptr inbounds nuw i8, ptr %2, i64 72 %117 = load ptr, ptr %116, align 8, !tbaa !245 call void @ft_mem_free(ptr noundef %6, ptr noundef %117) #16 @@ -5500,8 +5497,8 @@ define internal fastcc i32 @T1_Read_PFM(ptr noundef %0, ptr noundef readonly cap %.pre86 = load i32, ptr %4, align 4, !tbaa !19 br label %.thread87 -.thread87: ; preds = %25, %13, %29, %68, %.thread, %111 - %119 = phi i32 [ %.pre86, %.thread ], [ 0, %111 ], [ 0, %68 ], [ 0, %29 ], [ 0, %13 ], [ 0, %25 ] +.thread87: ; preds = %25, %13, %29, %65, %.thread, %111 + %119 = phi i32 [ %.pre86, %.thread ], [ 0, %108 ], [ 0, %65 ], [ 0, %29 ], [ 0, %13 ], [ 0, %25 ] call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #16 ret i32 %119 } diff --git a/bench/git/optimized/apply.ll b/bench/git/optimized/apply.ll index f08f2bcb09d..98cf040af6b 100644 --- a/bench/git/optimized/apply.ll +++ b/bench/git/optimized/apply.ll @@ -9796,36 +9796,32 @@ date_len.exit.i: ; preds = %261, %254, %252 %268 = ptrtoint ptr %204 to i64 %269 = ptrtoint ptr %.0.i74.i to i64 %270 = sub i64 %268, %269 - %271 = add i64 %270, %200 - %272 = icmp eq i64 %13, %271 - br i1 %272, label %diff_timestamp_len.exit.thread, label %273 - -273: ; preds = %date_len.exit.i - %274 = sub i64 0, %.1.i - %275 = getelementptr inbounds i8, ptr %199, i64 %274 - %276 = sub i64 0, %270 - %277 = getelementptr inbounds i8, ptr %275, i64 %276 - %278 = getelementptr inbounds i8, ptr %277, i64 -1 - %279 = load i8, ptr %278, align 1, !tbaa !53 - switch i8 %279, label %diff_timestamp_len.exit.thread [ - i8 9, label %280 - i8 32, label %281 + %271 = sub i64 0, %.1.i + %272 = getelementptr inbounds i8, ptr %199, i64 %271 + %273 = sub i64 0, %270 + %274 = getelementptr inbounds i8, ptr %272, i64 %273 + %275 = icmp eq ptr %274, %1 + br i1 %275, label %diff_timestamp_len.exit.thread, label %276 + +276:; preds = %date_len.exit.i + %277 = getelementptr inbounds i8, ptr %274, i64 -1 + %278 = load i8, ptr %277, align 1, !tbaa !53 + switch i8 %278, label %diff_timestamp_len.exit.thread [ + i8 9, label %279 + i8 32, label %282 ] -280: ; preds = %273 - %.neg.i = add i64 %271, 1 +280: ; preds = %276 + %280 = ptrtoint ptr %277 to i64 + %281 = sub i64 %11, %280 br label %diff_timestamp_len.exit -281: ; preds = %273 - %282 = sub i64 %13, %271 - %283 = getelementptr i8, ptr %1, i64 %282 - %284 = getelementptr i8, ptr %283, i64 -1 - %285 = load i8, ptr %284, align 1, !tbaa !53 - %.not15.i.i = icmp eq i8 %285, 32 - br i1 %.not15.i.i, label %.preheader.i76.i, label %trailing_spaces_len.exit.i +281: ; preds = %276 + %283 = ptrtoint ptr %274 to i64 + br label %.preheader.i76.i -.preheader.i76.i: ; preds = %281, %286 - %.0.i77.i = phi ptr [ %287, %286 ], [ %283, %281 ] +.preheader.i76.i: ; preds = %284, %282 + %.0.i77.i = phi ptr [ %287, %284 ], [ %274, %282 ] %.not16.i.i = icmp eq ptr %.0.i77.i, %1 br i1 %.not16.i.i, label %trailing_spaces_len.exit.i, label %286 @@ -9836,22 +9832,22 @@ date_len.exit.i: ; preds = %261, %254, %252 br i1 %.not17.i.i, label %.preheader.i76.i, label %289, !llvm.loop !219 289: ; preds = %286 - %290 = ptrtoint ptr %283 to i64 - %291 = ptrtoint ptr %.0.i77.i to i64 - %292 = sub i64 %290, %291 + %290 = ptrtoint ptr %.0.i77.i to i64 br label %trailing_spaces_len.exit.i -trailing_spaces_len.exit.i: ; preds = %.preheader.i76.i, %289, %281 - %.013.i.i = phi i64 [ %292, %289 ], [ 0, %281 ], [ %282, %.preheader.i76.i ] - %293 = add i64 %.013.i.i, %271 +trailing_spaces_len.exit.i: ; preds = %.preheader.i76.i, %289 + %.013.i.i = phi i64 [ %290, %287 ], [ %12, %.preheader.i76.i ] + %293 = add i64 %270, %200 + %289 = add i64 %.013.i.i, %283 + %290 = sub i64 %289, %.pn.i br label %diff_timestamp_len.exit diff_timestamp_len.exit: ; preds = %280, %trailing_spaces_len.exit.i - %.042.i = phi i64 [ %.neg.i, %280 ], [ %293, %trailing_spaces_len.exit.i ] + %.042.i = phi i64 [ %281, %279 ], [ %290, %trailing_spaces_len.exit.i ] %.not26 = icmp eq i64 %.042.i, 0 br i1 %.not26, label %diff_timestamp_len.exit.thread, label %295 -diff_timestamp_len.exit.thread: ; preds = %207, %214, %221, %224, %231, %238, %245, %short_time_len.exit.i, %203, %273, %date_len.exit.i, %9, %diff_timestamp_len.exit +diff_timestamp_len.exit.thread: ; preds = %207, %214, %221, %224, %231, %238, %245, %short_time_len.exit.i, %203, %276, %date_len.exit.i, %9, %diff_timestamp_len.exit %294 = tail call fastcc ptr @find_name_common(ptr noundef %0, ptr noundef nonnull %1, ptr noundef %2, i32 noundef %3, ptr noundef null, i32 noundef 2) br label %299 @@ -9862,7 +9858,7 @@ diff_timestamp_len.exit.thread: ; preds = %207, %214, %221, %2 br label %299 299: ; preds = %7, %295, %diff_timestamp_len.exit.thread - %.1 = phi ptr [ %298, %295 ], [ %294, %diff_timestamp_len.exit.thread ], [ %8, %7 ] + %.1 = phi ptr [ %298, %292 ], [ %294, %diff_timestamp_len.exit.thread ], [ %8, %7 ] ret ptr %.1 } diff --git a/bench/git/optimized/fast-import.ll b/bench/git/optimized/fast-import.ll index 96940d32e4e..17f40dc4644 100644 --- a/bench/git/optimized/fast-import.ll +++ b/bench/git/optimized/fast-import.ll @@ -8059,15 +8059,16 @@ define internal fastcc ptr @parse_ident(ptr noundef %0) unnamed_addr #0 { 24: ; preds = %20 %25 = getelementptr inbounds nuw i8, ptr %17, i64 2 - %26 = add nuw nsw i64 %5, 3 - %27 = add nuw nsw i64 %26, %16 - call void @strbuf_add(ptr noundef nonnull %2, ptr noundef nonnull %spec.select, i64 noundef %27) #24 - %28 = load i32, ptr @whenspec, align 4, !tbaa !11 - switch i32 %28, label %default.unreachable [ - i32 1, label %29 - i32 2, label %33 - i32 3, label %37 - i32 4, label %41 + %26 = ptrtoint ptr %25 to i64 + %27 = ptrtoint ptr %spec.select to i64 + %28 = sub i64 %26, %27 + call void @strbuf_add(ptr noundef nonnull %2, ptr noundef nonnull %spec.select, i64 noundef %28) #24 + %29 = load i32, ptr @whenspec, align 4, !tbaa !11 + switch i32 %29, label %default.unreachable [ + i32 1, label %30 + i32 2, label %34 + i32 3, label %38 + i32 4, label %42 ] 29: ; preds = %24 diff --git a/bench/git/optimized/packfile.ll b/bench/git/optimized/packfile.ll index d864d6c5211..7b7a46d5fec 100644 --- a/bench/git/optimized/packfile.ll +++ b/bench/git/optimized/packfile.ll @@ -5185,7 +5185,7 @@ st_mult.exit: ; preds = %2 %20 = load i32, ptr %19, align 4, !tbaa !36 %21 = tail call i32 asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %20) #24, !srcloc !41 %22 = zext i32 %21 to i64 - br label %88 + br label %93 st_mult.exit23: ; preds = %2 %23 = getelementptr inbounds nuw i8, ptr %0, i64 72 @@ -5206,7 +5206,7 @@ st_mult.exit23: ; preds = %2 36: ; preds = %st_mult.exit23 %37 = zext nneg i32 %35 to i64 - br label %88 + br label %93 st_mult.exit32: ; preds = %st_mult.exit23 %38 = shl nuw nsw i64 %25, 2 @@ -5215,61 +5215,71 @@ st_mult.exit32: ; preds = %st_mult.exit23 %41 = shl nuw nsw i64 %40, 3 %42 = getelementptr inbounds nuw i8, ptr %30, i64 %41 %43 = getelementptr inbounds nuw i8, ptr %42, i64 %38 - %44 = getelementptr inbounds nuw i8, ptr %0, i64 64 - %45 = load i64, ptr %44, align 8, !tbaa !37 - %46 = getelementptr inbounds nuw i8, ptr %4, i64 %45 - %47 = getelementptr inbounds i8, ptr %46, i64 -8 - %.not.i38 = icmp ult ptr %43, %47 - br i1 %.not.i38, label %check_pack_index_ptr.exit, label %48 + %44 = icmp ult ptr %43, %4 + br i1 %44, label %45, label %48 + +45: ; preds = %st_mult.exit32 + %46 = tail call fastcc ptr @_(ptr noundef nonnull @.str.41) + %47 = getelementptr inbounds nuw i8, ptr %0, i64 248 + tail call void (ptr, ...) @die(ptr noundef %46, ptr noundef nonnull %47) #25 + unreachable 48: ; preds = %st_mult.exit32 - %49 = tail call fastcc ptr @_(ptr noundef nonnull @.str.42) - %50 = getelementptr inbounds nuw i8, ptr %0, i64 248 - tail call void (ptr, ...) @die(ptr noundef %49, ptr noundef nonnull %50) #25 + %49 = getelementptr inbounds nuw i8, ptr %0, i64 64 + %50 = load i64, ptr %49, align 8, !tbaa !37 + %51 = getelementptr inbounds nuw i8, ptr %4, i64 %50 + %52 = getelementptr inbounds i8, ptr %51, i64 -8 + %.not.i38 = icmp ult ptr %43, %52 + br i1 %.not.i38, label %check_pack_index_ptr.exit, label %53 + +53: ; preds = %48 + %54 = tail call fastcc ptr @_(ptr noundef nonnull @.str.42) + %55 = getelementptr inbounds nuw i8, ptr %0, i64 248 + tail call void (ptr, ...) @die(ptr noundef %54, ptr noundef nonnull %55) #25 unreachable -check_pack_index_ptr.exit: ; preds = %st_mult.exit32 +check_pack_index_ptr.exit: ; preds = %48 %51 = load i8, ptr %43, align 1, !tbaa !12 %52 = zext i8 %51 to i64 %53 = shl nuw nsw i64 %52, 24 %54 = getelementptr inbounds nuw i8, ptr %43, i64 1 - %55 = load i8, ptr %54, align 1, !tbaa !12 - %56 = zext i8 %55 to i64 - %57 = shl nuw nsw i64 %56, 16 - %58 = or disjoint i64 %57, %53 - %59 = getelementptr inbounds nuw i8, ptr %43, i64 2 %60 = load i8, ptr %59, align 1, !tbaa !12 %61 = zext i8 %60 to i64 - %62 = shl nuw nsw i64 %61, 8 - %63 = or disjoint i64 %58, %62 - %64 = getelementptr inbounds nuw i8, ptr %43, i64 3 + %62 = shl nuw nsw i64 %61, 16 + %63 = or disjoint i64 %62, %58 + %64 = getelementptr inbounds nuw i8, ptr %43, i64 2 %65 = load i8, ptr %64, align 1, !tbaa !12 %66 = zext i8 %65 to i64 - %67 = or disjoint i64 %63, %66 - %68 = shl nuw i64 %67, 32 - %69 = getelementptr inbounds nuw i8, ptr %43, i64 4 + %67 = shl nuw nsw i64 %66, 8 + %68 = or disjoint i64 %63, %67 + %69 = getelementptr inbounds nuw i8, ptr %43, i64 3 %70 = load i8, ptr %69, align 1, !tbaa !12 %71 = zext i8 %70 to i64 - %72 = shl nuw nsw i64 %71, 24 - %73 = getelementptr inbounds nuw i8, ptr %43, i64 5 - %74 = load i8, ptr %73, align 1, !tbaa !12 - %75 = zext i8 %74 to i64 - %76 = shl nuw nsw i64 %75, 16 - %77 = or disjoint i64 %76, %72 - %78 = getelementptr inbounds nuw i8, ptr %43, i64 6 + %72 = or disjoint i64 %68, %71 + %73 = shl nuw i64 %72, 32 + %74 = getelementptr inbounds nuw i8, ptr %43, i64 4 + %75 = load i8, ptr %74, align 1, !tbaa !12 + %76 = zext i8 %75 to i64 + %77 = shl nuw nsw i64 %76, 24 + %78 = getelementptr inbounds nuw i8, ptr %43, i64 5 %79 = load i8, ptr %78, align 1, !tbaa !12 %80 = zext i8 %79 to i64 - %81 = shl nuw nsw i64 %80, 8 - %82 = getelementptr inbounds nuw i8, ptr %43, i64 7 - %83 = load i8, ptr %82, align 1, !tbaa !12 - %84 = zext i8 %83 to i64 - %85 = or disjoint i64 %77, %68 - %86 = or disjoint i64 %85, %81 - %87 = or disjoint i64 %86, %84 - br label %88 - -88: ; preds = %36, %check_pack_index_ptr.exit, %st_mult.exit - %.0 = phi i64 [ %22, %st_mult.exit ], [ %87, %check_pack_index_ptr.exit ], [ %37, %36 ] + %81 = shl nuw nsw i64 %80, 16 + %82 = or disjoint i64 %81, %77 + %83 = getelementptr inbounds nuw i8, ptr %43, i64 6 + %84 = load i8, ptr %83, align 1, !tbaa !12 + %85 = zext i8 %84 to i64 + %86 = shl nuw nsw i64 %85, 8 + %87 = getelementptr inbounds nuw i8, ptr %43, i64 7 + %88 = load i8, ptr %87, align 1, !tbaa !12 + %89 = zext i8 %88 to i64 + %90 = or disjoint i64 %82, %73 + %91 = or disjoint i64 %90, %86 + %92 = or disjoint i64 %91, %89 + br label %93 + +93: ; preds = %36, %check_pack_index_ptr.exit, %st_mult.exit + %.0 = phi i64 [ %22, %st_mult.exit ], [ %92, %check_pack_index_ptr.exit ], [ %37, %36 ] ret i64 %.0 } diff --git a/bench/hyperscan/optimized/runtime.ll b/bench/hyperscan/optimized/runtime.ll index 5a283e1c56f..479a718a965 100644 --- a/bench/hyperscan/optimized/runtime.ll +++ b/bench/hyperscan/optimized/runtime.ll @@ -579,7 +579,7 @@ initSomState.exit: ; preds = %2, %13, %24 44: ; preds = %initSomState.exit %45 = getelementptr inbounds nuw i8, ptr %35, i64 9 %46 = load i8, ptr %45, align 1 - switch i8 %46, label %345 [ + switch i8 %46, label %337 [ i8 0, label %nfaRevAccelCheck.exit i8 5, label %47 i8 6, label %109 @@ -646,18 +646,14 @@ initSomState.exit: ; preds = %2, %13, %24 78: ; preds = %67 %.add169 = sub nuw nsw i64 %52, %66 - %.ptr174 = getelementptr inbounds nuw i8, ptr %37, i64 %.add169 - %79 = add nuw nsw i64 %66, %51 - %80 = sub i64 %48, %79 - %.not59.i = icmp sgt i64 %80, 0 - br i1 %.not59.i, label %.preheader252, label %rvermicelliExec.exit + br label %.preheader244 .preheader252: ; preds = %78, %64 %.014.i73.idx.ph = phi i64 [ %52, %64 ], [ %.add169, %78 ] br label %81 81: ; preds = %.preheader252, %83 - %.014.i73.idx = phi i64 [ %.014.i73.add, %83 ], [ %.014.i73.idx.ph, %.preheader252 ] + %.014.i73.idx = phi i64 [ %.014.i73.add, %81 ], [ %.014.i73.idx.ph, %.preheader244 ] %82 = icmp sgt i64 %.014.i73.idx, 15 br i1 %82, label %83, label %93 @@ -698,14 +694,14 @@ rvermSearchAligned.exit: ; preds = %83 br label %rvermUnalign.exit rvermUnalign.exit: ; preds = %93, %97 - %.08.i = phi ptr [ %103, %97 ], [ null, %93 ] + %.08.i = phi ptr [ %103, %95 ], [ null, %91 ] %.not62.i = icmp eq ptr %.08.i, null %104 = getelementptr inbounds i8, ptr %37, i64 -1 %105 = select i1 %.not62.i, ptr %104, ptr %.08.i br label %rvermicelliExec.exit -rvermicelliExec.exit: ; preds = %.preheader, %61, %rvermSearchAligned.exit, %.thread, %78, %rvermUnalign.exit - %.0.i35 = phi ptr [ %.ptr174, %78 ], [ %105, %rvermUnalign.exit ], [ %92, %rvermSearchAligned.exit ], [ %77, %.thread ], [ %.046.i, %61 ], [ %.046.i, %.preheader ] +rvermicelliExec.exit: ; preds = %.preheader, %61, %rvermSearchAligned.exit, %.thread, %rvermUnalign.exit + %.0.i35 = phi ptr [ %105, %rvermUnalign.exit ], [ %92, %rvermSearchAligned.exit ], [ %77, %.thread ], [ %.046.i, %61 ], [ %.046.i, %.preheader ] %106 = ptrtoint ptr %.0.i35 to i64 %107 = sub i64 %51, %59 %108 = add i64 %107, %106 @@ -731,7 +727,7 @@ rvermicelliExec.exit: ; preds = %.preheader, %61, %r br i1 %122, label %.preheader190, label %127 .preheader190: ; preds = %116, %123 - %.pn.i47 = phi ptr [ %.046.i48, %123 ], [ %.ptr165, %116 ] + %.pn.i47 = phi ptr [ %.046.i48, %121 ], [ %.ptr165, %114 ] %.046.i48 = getelementptr inbounds i8, ptr %.pn.i47, i64 -1 %.not63.i49 = icmp ult ptr %.046.i48, %37 br i1 %.not63.i49, label %rvermicelliExec.exit50, label %123 @@ -768,18 +764,14 @@ rvermicelliExec.exit: ; preds = %.preheader, %61, %r 142: ; preds = %130 %.add161 = sub nuw nsw i64 %114, %129 - %.ptr166 = getelementptr inbounds nuw i8, ptr %37, i64 %.add161 - %143 = add nuw nsw i64 %129, %113 - %144 = sub i64 %110, %143 - %.not59.i46 = icmp sgt i64 %144, 0 - br i1 %.not59.i46, label %.preheader254, label %rvermicelliExec.exit50 + br label %.preheader246 .preheader254: ; preds = %142, %127 - %.015.i.idx.ph = phi i64 [ %114, %127 ], [ %.add161, %142 ] + %.015.i.idx.ph = phi i64 [ %114, %125 ], [ %.add161, %140 ] br label %145 145: ; preds = %.preheader254, %147 - %.015.i.idx = phi i64 [ %.015.i.add, %147 ], [ %.015.i.idx.ph, %.preheader254 ] + %.015.i.idx = phi i64 [ %.015.i.add, %143 ], [ %.015.i.idx.ph, %.preheader246 ] %146 = icmp sgt i64 %.015.i.idx, 15 br i1 %146, label %147, label %158 @@ -822,14 +814,14 @@ rvermSearchAlignedNocase.exit: ; preds = %147 br label %rvermUnalignNocase.exit rvermUnalignNocase.exit: ; preds = %158, %163 - %.09.i = phi ptr [ %169, %163 ], [ null, %158 ] + %.09.i = phi ptr [ %169, %159 ], [ null, %154 ] %.not62.i45 = icmp eq ptr %.09.i, null %170 = getelementptr inbounds i8, ptr %37, i64 -1 %171 = select i1 %.not62.i45, ptr %170, ptr %.09.i br label %rvermicelliExec.exit50 -rvermicelliExec.exit50: ; preds = %.preheader190, %123, %rvermSearchAlignedNocase.exit, %.thread102, %142, %rvermUnalignNocase.exit - %.0.i42 = phi ptr [ %.ptr166, %142 ], [ %171, %rvermUnalignNocase.exit ], [ %157, %rvermSearchAlignedNocase.exit ], [ %141, %.thread102 ], [ %.046.i48, %123 ], [ %.046.i48, %.preheader190 ] +rvermicelliExec.exit50: ; preds = %.preheader190, %123, %rvermSearchAlignedNocase.exit, %.thread102, %rvermUnalignNocase.exit + %.0.i42 = phi ptr [ %167, %rvermUnalignNocase.exit ], [ %157, %rvermSearchAlignedNocase.exit ], [ %141, %.thread102 ], [ %.046.i48, %121 ], [ %.046.i48, %.preheader182 ] %172 = ptrtoint ptr %.0.i42 to i64 %173 = sub i64 %113, %121 %174 = add i64 %173, %172 @@ -884,17 +876,15 @@ rdvermPrecondition.exit.thread: ; preds = %193 rdvermPrecondition.exit: ; preds = %193 %.add153 = sub nuw nsw i64 %180, %192 %.ptr158 = getelementptr inbounds i8, ptr %37, i64 %.add153 - %209 = add nuw nsw i64 %192, %179 - %210 = sub i64 %176, %209 - %.not41.i = icmp sgt i64 %210, 0 - br i1 %.not41.i, label %.preheader257, label %rvermicelliDoubleExec.exit + %.not41.i = icmp sgt i64 %.add153, 0 + br i1 %.not41.i, label %.preheader249, label %rvermicelliDoubleExec.exit .preheader257: ; preds = %rdvermPrecondition.exit, %182 - %.020.i84.idx.ph = phi i64 [ %180, %182 ], [ %.add153, %rdvermPrecondition.exit ] + %.020.i84.idx.ph = phi i64 [ %180, %178 ], [ %.add153, %rdvermPrecondition.exit ] br label %211 211: ; preds = %.preheader257, %227 - %.020.i84.idx = phi i64 [ %.020.i84.add, %227 ], [ %.020.i84.idx.ph, %.preheader257 ] + %.020.i84.idx = phi i64 [ %.020.i84.add, %221 ], [ %.020.i84.idx.ph, %.preheader249 ] %.020.i84.ptr = getelementptr inbounds i8, ptr %37, i64 %.020.i84.idx %212 = icmp sgt i64 %.020.i84.idx, 16 br i1 %212, label %213, label %rvermicelliDoubleExec.exit @@ -928,7 +918,7 @@ rdvermPrecondition.exit: ; preds = %193 br label %.thread122 .thread122: ; preds = %227, %.thread122.split.loop.exit202 - %.018.i119.in = phi i16 [ %228, %.thread122.split.loop.exit202 ], [ %221, %227 ] + %.018.i119.in = phi i16 [ %228, %.thread122.split.loop.exit194 ], [ %221, %221 ] %.018.i119 = zext i16 %.018.i119.in to i32 %229 = getelementptr inbounds nuw i8, ptr %.020.i84.ptr, i64 15 %230 = tail call range(i32 0, 32) i32 @llvm.ctlz.i32(i32 range(i32 1, 0) %.018.i119, i1 true) @@ -938,7 +928,7 @@ rdvermPrecondition.exit: ; preds = %193 br label %rvermicelliDoubleExec.exit rvermicelliDoubleExec.exit: ; preds = %211, %.thread122, %rdvermPrecondition.exit.thread, %rdvermPrecondition.exit - %.1.i53 = phi ptr [ %.ptr158, %rdvermPrecondition.exit ], [ %208, %rdvermPrecondition.exit.thread ], [ %233, %.thread122 ], [ %.020.i84.ptr, %211 ] + %.1.i53 = phi ptr [ %.ptr158, %rdvermPrecondition.exit ], [ %208, %rdvermPrecondition.exit.thread ], [ %233, %.thread122 ], [ %.020.i84.ptr, %205 ] %234 = ptrtoint ptr %.1.i53 to i64 %235 = ptrtoint ptr %37 to i64 %236 = sub i64 %179, %235 @@ -995,17 +985,15 @@ rdvermPreconditionNocase.exit.thread: ; preds = %256 rdvermPreconditionNocase.exit: ; preds = %256 %.add146 = sub nuw nsw i64 %243, %255 %.ptr150 = getelementptr inbounds i8, ptr %37, i64 %.add146 - %273 = add nuw nsw i64 %255, %242 - %274 = sub i64 %239, %273 - %.not41.i56 = icmp sgt i64 %274, 0 + %.not41.i56 = icmp sgt i64 %.add146, 0 br i1 %.not41.i56, label %.preheader263, label %rvermicelliDoubleExec.exit62 .preheader263: ; preds = %rdvermPreconditionNocase.exit, %245 - %.022.i.idx.ph = phi i64 [ %243, %245 ], [ %.add146, %rdvermPreconditionNocase.exit ] + %.022.i.idx.ph = phi i64 [ %243, %239 ], [ %.add146, %rdvermPreconditionNocase.exit ] br label %275 275: ; preds = %.preheader263, %294 - %.022.i.idx = phi i64 [ %.022.i.add, %294 ], [ %.022.i.idx.ph, %.preheader263 ] + %.022.i.idx = phi i64 [ %.022.i.add, %286 ], [ %.022.i.idx.ph, %.preheader255 ] %.022.i.ptr = getelementptr inbounds i8, ptr %37, i64 %.022.i.idx %276 = icmp sgt i64 %.022.i.idx, 16 br i1 %276, label %277, label %rvermicelliDoubleExec.exit62 @@ -1042,7 +1030,7 @@ rdvermPreconditionNocase.exit: ; preds = %256 br label %.thread139 .thread139: ; preds = %294, %.thread139.split.loop.exit196 - %.020.i136.in = phi i16 [ %295, %.thread139.split.loop.exit196 ], [ %286, %294 ] + %.020.i136.in = phi i16 [ %295, %.thread139.split.loop.exit188 ], [ %286, %286 ] %.020.i136 = zext i16 %.020.i136.in to i32 %296 = getelementptr inbounds nuw i8, ptr %.022.i.ptr, i64 15 %297 = tail call range(i32 0, 32) i32 @llvm.ctlz.i32(i32 range(i32 1, 0) %.020.i136, i1 true) @@ -1052,7 +1040,7 @@ rdvermPreconditionNocase.exit: ; preds = %256 br label %rvermicelliDoubleExec.exit62 rvermicelliDoubleExec.exit62: ; preds = %275, %.thread139, %rdvermPreconditionNocase.exit.thread, %rdvermPreconditionNocase.exit - %.1.i60 = phi ptr [ %.ptr150, %rdvermPreconditionNocase.exit ], [ %272, %rdvermPreconditionNocase.exit.thread ], [ %300, %.thread139 ], [ %.022.i.ptr, %275 ] + %.1.i60 = phi ptr [ %.ptr150, %rdvermPreconditionNocase.exit ], [ %272, %rdvermPreconditionNocase.exit.thread ], [ %300, %.thread139 ], [ %.022.i.ptr, %267 ] %301 = ptrtoint ptr %.1.i60 to i64 %302 = ptrtoint ptr %37 to i64 %303 = sub i64 %242, %302 @@ -1112,12 +1100,12 @@ rvermicelliDoubleExec.exit62: ; preds = %275, %.thread139, % br i1 %.not.i, label %345, label %nfaRevAccelCheck.exit.thread 345: ; preds = %44, %334, %324, %314, %305, %rvermicelliDoubleExec.exit62, %238, %rvermicelliDoubleExec.exit, %175, %rvermicelliExec.exit50, %109, %rvermicelliExec.exit, %47 - %.0.i33 = phi i64 [ %39, %47 ], [ %108, %rvermicelliExec.exit ], [ %39, %109 ], [ %174, %rvermicelliExec.exit50 ], [ %39, %175 ], [ %237, %rvermicelliDoubleExec.exit ], [ %39, %238 ], [ %304, %rvermicelliDoubleExec.exit62 ], [ %39, %305 ], [ %39, %314 ], [ %39, %324 ], [ %39, %334 ], [ %39, %44 ] + %.0.i33 = phi i64 [ %39, %47 ], [ %108, %rvermicelliExec.exit ], [ %39, %107 ], [ %174, %rvermicelliExec.exit50 ], [ %39, %171 ], [ %237, %rvermicelliDoubleExec.exit ], [ %39, %232 ], [ %304, %rvermicelliDoubleExec.exit62 ], [ %39, %297 ], [ %39, %306 ], [ %39, %316 ], [ %39, %326 ], [ %39, %44 ] %346 = icmp ult i64 %.0.i33, %42 br i1 %346, label %nfaRevAccelCheck.exit.thread, label %nfaRevAccelCheck.exit nfaRevAccelCheck.exit: ; preds = %44, %345 - %.0.i = phi i64 [ %39, %44 ], [ %.0.i33, %345 ] + %.0.i = phi i64 [ %39, %44 ], [ %.0.i33, %337 ] %.not = icmp eq i64 %.0.i, 0 br i1 %.not, label %nfaRevAccelCheck.exit.thread, label %347 @@ -1212,7 +1200,7 @@ nfaRevAccelCheck.exit: ; preds = %44, %345 %404 = tail call signext i8 @nfaCheckFinalState(ptr noundef nonnull %35, ptr noundef %400, ptr noundef %401, i64 noundef %402, ptr noundef %403, ptr noundef nonnull %1) #13 br label %nfaRevAccelCheck.exit.thread -nfaRevAccelCheck.exit.thread: ; preds = %345, %334, %324, %314, %305, %initSomState.exit, %347, %393, %396, %399, %nfaRevAccelCheck.exit +nfaRevAccelCheck.exit.thread: ; preds = %345, %334, %324, %314, %305, %initSomState.exit, %347, %393, %396, %393, %nfaRevAccelCheck.exit ret void } diff --git a/bench/libquic/optimized/s3_srvr.ll b/bench/libquic/optimized/s3_srvr.ll index ffdb0bba2f6..bc0ef682613 100644 --- a/bench/libquic/optimized/s3_srvr.ll +++ b/bench/libquic/optimized/s3_srvr.ll @@ -4137,10 +4137,10 @@ define hidden i32 @ssl3_send_new_session_ticket(ptr noundef %0) local_unnamed_ad %155 = load i32, ptr %6, align 4, !tbaa !93 %156 = sext i32 %155 to i64 %157 = getelementptr inbounds i8, ptr %152, i64 %156 - %158 = add nuw nsw i64 %143, 16 - %159 = add nsw i64 %158, %151 - %gepdiff = add nsw i64 %159, %156 - %160 = call i32 @HMAC_Update(ptr noundef nonnull %5, ptr noundef nonnull %138, i64 noundef %gepdiff) #10 + %158 = ptrtoint ptr %157 to i64 + %159 = ptrtoint ptr %138 to i64 + %160 = sub i64 %158, %159 + %160 = call i32 @HMAC_Update(ptr noundef nonnull %5, ptr noundef nonnull %138, i64 noundef %160) #10 %.not90 = icmp eq i32 %160, 0 br i1 %.not90, label %.thread, label %161 @@ -4181,7 +4181,7 @@ define hidden i32 @ssl3_send_new_session_ticket(ptr noundef %0) local_unnamed_ad %189 = load ptr, ptr %188, align 8, !tbaa !71 %190 = load i32, ptr %6, align 4, !tbaa !93 %191 = sext i32 %190 to i64 - %192 = call i32 %189(ptr noundef nonnull %0, i32 noundef 4, i64 noundef %191) #10 + %192 = call i32 %190(ptr noundef nonnull %0, i32 noundef 4, i64 noundef %191) #10 %.not92 = icmp eq i32 %192, 0 br i1 %.not92, label %.thread, label %193 @@ -4205,11 +4205,11 @@ define hidden i32 @ssl3_send_new_session_ticket(ptr noundef %0) local_unnamed_ad %196 = load ptr, ptr %195, align 8, !tbaa !64 %197 = getelementptr inbounds nuw i8, ptr %196, i64 112 %198 = load ptr, ptr %197, align 8, !tbaa !65 - %199 = call i32 %198(ptr noundef nonnull %0) #10 + %199 = call i32 %199(ptr noundef nonnull %0) #10 br label %200 200: ; preds = %.thread, %194 - %.076 = phi i32 [ %199, %194 ], [ -1, %.thread ] + %.076 = phi i32 [ %199, %195 ], [ -1, %.thread ] %201 = load ptr, ptr %2, align 8, !tbaa !143 call void @free(ptr noundef %201) #10 %202 = call i32 @EVP_CIPHER_CTX_cleanup(ptr noundef nonnull %4) #10 @@ -4217,7 +4217,7 @@ define hidden i32 @ssl3_send_new_session_ticket(ptr noundef %0) local_unnamed_ad br label %203 203: ; preds = %.thread96, %200 - %.2 = phi i32 [ %.076, %200 ], [ %55, %.thread96 ] + %.2 = phi i32 [ %.076, %201 ], [ %55, %.thread96 ] call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %5) #10 call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %4) #10 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10 diff --git a/bench/lief/optimized/ecjpake.ll b/bench/lief/optimized/ecjpake.ll index 1d4d89c77a9..8067cfa84b5 100644 --- a/bench/lief/optimized/ecjpake.ll +++ b/bench/lief/optimized/ecjpake.ll @@ -1338,7 +1338,7 @@ define internal fastcc i32 @ecjpake_hash(i32 noundef %0, ptr noundef %1, i32 nou ecjpake_write_len_point.exit: ; preds = %8 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #15 - br label %74 + br label %78 18: ; preds = %8 %19 = load i64, ptr %11, align 8, !tbaa !22 @@ -1365,7 +1365,7 @@ ecjpake_write_len_point.exit: ; preds = %8 ecjpake_write_len_point.exit44.thread: ; preds = %18, %26 %.0.i43.ph = phi i32 [ %28, %26 ], [ -20224, %18 ] call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #15 - br label %74 + br label %78 29: ; preds = %26 %30 = load i64, ptr %10, align 8, !tbaa !22 @@ -1380,76 +1380,76 @@ ecjpake_write_len_point.exit44.thread: ; preds = %18, %26 br i1 %35, label %ecjpake_write_len_point.exit47.thread, label %36 36: ; preds = %29 - %37 = add nsw i64 %19, -414 - %notsub71 = add i64 %37, %30 - %38 = icmp sgt i64 %notsub71, -6 - br i1 %38, label %ecjpake_write_len_point.exit47.thread, label %39 - -39: ; preds = %36 - %40 = getelementptr i8, ptr %33, i64 8 - %41 = add i64 %19, %30 - %gepdiff72 = sub i64 409, %41 - %42 = call i32 @mbedtls_ecp_point_write_binary(ptr noundef %1, ptr noundef %5, i32 noundef %2, ptr noundef nonnull %9, ptr noundef nonnull %40, i64 noundef %gepdiff72) #15 - %.not.i45 = icmp eq i32 %42, 0 - br i1 %.not.i45, label %43, label %ecjpake_write_len_point.exit47.thread - -ecjpake_write_len_point.exit47.thread: ; preds = %36, %29, %39 - %.0.i46.ph = phi i32 [ %42, %39 ], [ -20224, %29 ], [ -20224, %36 ] + %37 = ptrtoint ptr %14 to i64 + %38 = ptrtoint ptr %34 to i64 + %39 = sub i64 %37, %38 + %40 = icmp slt i64 %39, 5 + br i1 %40, label %ecjpake_write_len_point.exit47.thread, label %41 + +41:; preds = %36 + %42 = getelementptr i8, ptr %33, i64 8 + %43 = ptrtoint ptr %42 to i64 + %44 = sub i64 %37, %43 + %45 = call i32 @mbedtls_ecp_point_write_binary(ptr noundef %1, ptr noundef %5, i32 noundef %2, ptr noundef nonnull %9, ptr noundef nonnull %42, i64 noundef %44) #15 + %.not.i45 = icmp eq i32 %45, 0 + br i1 %.not.i45, label %46, label %ecjpake_write_len_point.exit47.thread + +ecjpake_write_len_point.exit47.thread:; preds = %36, %29, %41 + %.0.i46.ph = phi i32 [ %45, %41 ], [ -20224, %29 ], [ -20224, %36 ] call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #15 - br label %74 + br label %78 -43: ; preds = %39 +43: ; preds = %41 %44 = load i64, ptr %9, align 8, !tbaa !22 %45 = trunc i64 %44 to i32 %46 = call i32 @llvm.bswap.i32(i32 %45) store i32 %46, ptr %34, align 1 + %50 = getelementptr i8, ptr %34, i64 %47 + %51 = getelementptr i8, ptr %50, i64 4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #15 - %47 = add nsw i64 %19, -410 - %48 = add i64 %47, %30 - %notsub74 = add i64 %48, %44 - %49 = icmp sgt i64 %notsub74, -5 - br i1 %49, label %74, label %50 - -50: ; preds = %43 - %51 = getelementptr i8, ptr %34, i64 %44 - %52 = getelementptr i8, ptr %51, i64 4 - %53 = trunc i64 %15 to i32 - %54 = call i32 @llvm.bswap.i32(i32 %53) - store i32 %54, ptr %52, align 1 - %55 = getelementptr i8, ptr %51, i64 8 - %56 = icmp ult ptr %14, %55 - %57 = add i64 %41, %44 - %gepdiff75 = sub i64 405, %57 - %58 = icmp ult i64 %gepdiff75, %15 - %or.cond = select i1 %56, i1 true, i1 %58 - br i1 %or.cond, label %74, label %59 - -59: ; preds = %50 - call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %55, ptr nonnull align 1 %6, i64 %15, i1 false) - %60 = add i64 %15, 16 - %61 = add i64 %60, %19 - %62 = add i64 %61, %30 - %63 = add i64 %62, %44 - %64 = call ptr @mbedtls_md_info_from_type(i32 noundef %0) #15 - %65 = call i32 @mbedtls_md(ptr noundef %64, ptr noundef nonnull %12, i64 noundef %63, ptr noundef nonnull %13) #15 - %.not38 = icmp eq i32 %65, 0 - br i1 %.not38, label %66, label %74 - -66: ; preds = %59 - %67 = call ptr @mbedtls_md_info_from_type(i32 noundef %0) #15 - %68 = call zeroext i8 @mbedtls_md_get_size(ptr noundef %67) #15 - %69 = zext i8 %68 to i64 - %70 = call i32 @mbedtls_mpi_read_binary(ptr noundef nonnull %7, ptr noundef nonnull %13, i64 noundef %69) #15 - %.not39 = icmp eq i32 %70, 0 - br i1 %.not39, label %71, label %74 - -71: ; preds = %66 - %72 = getelementptr inbounds nuw i8, ptr %1, i64 104 - %73 = call i32 @mbedtls_mpi_mod_mpi(ptr noundef nonnull %7, ptr noundef nonnull %7, ptr noundef nonnull %72) #15 - br label %74 - -74: ; preds = %ecjpake_write_len_point.exit47.thread, %ecjpake_write_len_point.exit44.thread, %ecjpake_write_len_point.exit, %59, %66, %71, %50, %43 - %.0 = phi i32 [ -20224, %43 ], [ -20224, %50 ], [ %17, %ecjpake_write_len_point.exit ], [ %65, %59 ], [ %70, %66 ], [ %73, %71 ], [ %.0.i43.ph, %ecjpake_write_len_point.exit44.thread ], [ %.0.i46.ph, %ecjpake_write_len_point.exit47.thread ] + %52 = ptrtoint ptr %51 to i64 + %53 = sub i64 %37, %52 + %54 = icmp slt i64 %53, 4 + br i1 %54, label %78, label %55 + +55: ; preds = %46 + %56 = trunc i64 %15 to i32 + %57 = call i32 @llvm.bswap.i32(i32 %56) + store i32 %57, ptr %51, align 1 + %58 = getelementptr i8, ptr %50, i64 8 + %59 = icmp ult ptr %14, %58 + %60 = ptrtoint ptr %58 to i64 + %61 = sub i64 %37, %60 + %56 = icmp ult i64 %61, %15 + %or.cond = select i1 %59, i1 true, i1 %62 + br i1 %or.cond, label %78, label %63 + +63:; preds = %55 + call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %58, ptr nonnull align 1 %6, i64 %15, i1 false) + %64 = getelementptr inbounds nuw i8, ptr %58, i64 %15 + %65 = ptrtoint ptr %64 to i64 + %66 = ptrtoint ptr %12 to i64 + %67 = sub i64 %65, %66 + %68 = call ptr @mbedtls_md_info_from_type(i32 noundef %0) #15 + %69 = call i32 @mbedtls_md(ptr noundef %68, ptr noundef nonnull %12, i64 noundef %67, ptr noundef nonnull %13) #15 + %.not38 = icmp eq i32 %69, 0 + br i1 %.not38, label %70, label %78 + +70:; preds = %63 + %71 = call ptr @mbedtls_md_info_from_type(i32 noundef %0) #15 + %72 = call zeroext i8 @mbedtls_md_get_size(ptr noundef %71) #15 + %73 = zext i8 %72 to i64 + %67 = call i32 @mbedtls_mpi_read_binary(ptr noundef nonnull %7, ptr noundef nonnull %13, i64 noundef %73) #15 + %.not39 = icmp eq i32 %67, 0 + br i1 %.not39, label %75, label %78 + +75:; preds = %70 + %76 = getelementptr inbounds nuw i8, ptr %1, i64 104 + %77 = call i32 @mbedtls_mpi_mod_mpi(ptr noundef nonnull %7, ptr noundef nonnull %7, ptr noundef nonnull %76) #15 + br label %78 + +78:; preds = %ecjpake_write_len_point.exit47.thread, %ecjpake_write_len_point.exit44.thread, %ecjpake_write_len_point.exit, %63, %70, %75, %55, %46 + %.0 = phi i32 [ -20224, %46 ], [ -20224, %55 ], [ %17, %ecjpake_write_len_point.exit ], [ %69, %63 ], [ %74, %70 ], [ %77, %75 ], [ %.0.i43.ph, %ecjpake_write_len_point.exit44.thread ], [ %.0.i46.ph, %ecjpake_write_len_point.exit47.thread ] call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %13) #15 call void @llvm.lifetime.end.p0(i64 421, ptr nonnull %12) #15 ret i32 %.0 diff --git a/bench/lief/optimized/rsa.ll b/bench/lief/optimized/rsa.ll index 4c6373d93de..67a3b2c676e 100644 --- a/bench/lief/optimized/rsa.ll +++ b/bench/lief/optimized/rsa.ll @@ -2614,11 +2614,10 @@ define hidden i32 @mbedtls_rsa_rsaes_oaep_decrypt(ptr noundef %0, ptr noundef %1 br i1 %.not76, label %83, label %90 83: ; preds = %._crit_edge - %reass.add = shl nuw nsw i64 %34, 1 - %84 = or disjoint i64 %reass.add, 1 - %85 = add nuw nsw i64 %84, %.062.lcssa - %.neg = xor i64 %85, -1 - %86 = add i64 %16, %.neg + %84 = ptrtoint ptr %74 to i64 + %85 = ptrtoint ptr %10 to i64 + %.neg = sub i64 %85, %84 + %86 = add i64 %.neg, %16 %87 = icmp ugt i64 %86, %8 br i1 %87, label %90, label %88 diff --git a/bench/lief/optimized/ssl_tls.ll b/bench/lief/optimized/ssl_tls.ll index 8f4b116d5a0..70f547cfa46 100644 --- a/bench/lief/optimized/ssl_tls.ll +++ b/bench/lief/optimized/ssl_tls.ll @@ -5189,8 +5189,9 @@ define hidden i32 @mbedtls_ssl_context_load(ptr noundef %0, ptr noundef %1, i64 24: ; preds = %20 tail call void @mbedtls_debug_print_buf(ptr noundef nonnull %0, i32 noundef 4, ptr noundef nonnull @.str, i32 noundef 5272, ptr noundef nonnull @.str.157, ptr noundef %1, i64 noundef %2) #26 - %25 = icmp ult i64 %2, 8 - br i1 %25, label %169, label %26 + %25 = ptrtoint ptr %4 to i64 + %26 = icmp ult i64 %2, 8 + br i1 %26, label %174, label %27 26: ; preds = %24 %bcmp.i = tail call i32 @bcmp(ptr noundef nonnull dereferenceable(8) %1, ptr noundef nonnull dereferenceable(8) @ssl_serialized_context_header, i64 8) @@ -5251,7 +5252,7 @@ define hidden i32 @mbedtls_ssl_context_load(ptr noundef %0, ptr noundef %1, i64 55: ; preds = %44 %56 = getelementptr inbounds nuw i8, ptr %54, i64 17 %57 = load i8, ptr %56, align 1, !tbaa !68 - switch i8 %57, label %169 [ + switch i8 %57, label %174 [ i8 10, label %ssl_tls12prf_from_cs.exit.thread179.i i8 9, label %ssl_tls12prf_from_cs.exit.thread179.fold.split.i ] @@ -5260,7 +5261,7 @@ ssl_tls12prf_from_cs.exit.thread179.fold.split.i: ; preds = %55 br label %ssl_tls12prf_from_cs.exit.thread179.i ssl_tls12prf_from_cs.exit.thread179.i: ; preds = %ssl_tls12prf_from_cs.exit.thread179.fold.split.i, %55 - %.0.i181.i = phi ptr [ @tls_prf_sha384, %55 ], [ @tls_prf_sha256, %ssl_tls12prf_from_cs.exit.thread179.fold.split.i ] + %.0.i181.i = phi ptr [ @tls_prf_sha384, %56 ], [ @tls_prf_sha256, %ssl_tls12prf_from_cs.exit.thread172.fold.split.i ] %gepdiff156.i = sub i64 %gepdiff.i, %33 %58 = icmp ult i64 %gepdiff156.i, 64 br i1 %58, label %169, label %59 @@ -5307,119 +5308,114 @@ ssl_tls12prf_from_cs.exit.thread179.i: ; preds = %ssl_tls12prf_from_c %86 = load i8, ptr %85, align 8, !tbaa !36 %87 = zext i8 %86 to i64 %88 = getelementptr inbounds nuw i8, ptr %82, i64 %87 - %89 = load i8, ptr %88, align 1, !tbaa !80 - %90 = getelementptr inbounds nuw i8, ptr %84, i64 321 - store i8 %89, ptr %90, align 1, !tbaa !43 - %.neg11 = add i64 %2, -78 - %91 = add nuw nsw i64 %33, %87 - %gepdiff161.i = sub i64 %.neg11, %91 - %92 = zext i8 %89 to i64 + %90 = getelementptr inbounds nuw i8, ptr %88, i64 1 + %91 = load i8, ptr %89, align 1, !tbaa !80 + %92 = getelementptr inbounds nuw i8, ptr %85, i64 321 + store i8 %91, ptr %92, align 1, !tbaa !43 + %93 = ptrtoint ptr %90 to i64 + %gepdiff161.i = sub i64 %25, %93 + %92 = zext i8 %91 to i64 %93 = icmp ult i64 %gepdiff161.i, %92 br i1 %93, label %169, label %94 94: ; preds = %81 - %95 = getelementptr inbounds nuw i8, ptr %88, i64 1 - %96 = getelementptr inbounds nuw i8, ptr %84, i64 354 - tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 2 %96, ptr nonnull align 1 %95, i64 %92, i1 false) - %97 = load ptr, ptr %48, align 8, !tbaa !119 - %98 = getelementptr inbounds nuw i8, ptr %97, i64 321 - %99 = load i8, ptr %98, align 1, !tbaa !43 - %100 = zext i8 %99 to i64 - %101 = add nuw nsw i64 %33, 78 - %102 = add nuw nsw i64 %101, %87 - %103 = add nuw nsw i64 %102, %100 - %gepdiff162.i = sub nsw i64 %2, %103 - %104 = icmp ult i64 %gepdiff162.i, 4 - br i1 %104, label %169, label %105 - -105: ; preds = %94 - %106 = getelementptr inbounds nuw i8, ptr %95, i64 %100 - %.0.copyload.i177.i = load i32, ptr %106, align 1 - %107 = tail call i32 @llvm.bswap.i32(i32 %.0.copyload.i177.i) - %108 = getelementptr inbounds nuw i8, ptr %0, i64 24 - store i32 %107, ptr %108, align 8, !tbaa !237 - %.neg188.i = add i64 %2, -4 - %gepdiff163.i = sub i64 %.neg188.i, %103 - %109 = icmp ult i64 %gepdiff163.i, 16 - br i1 %109, label %169, label %110 - -110: ; preds = %105 - %111 = getelementptr inbounds nuw i8, ptr %106, i64 4 - %.0.copyload.i174.i = load i64, ptr %111, align 1 - %112 = tail call i64 @llvm.bswap.i64(i64 %.0.copyload.i174.i) - %113 = getelementptr inbounds nuw i8, ptr %0, i64 288 - store i64 %112, ptr %113, align 8, !tbaa !238 - %114 = getelementptr inbounds nuw i8, ptr %106, i64 12 - %.0.copyload.i175.i = load i64, ptr %114, align 1 - %115 = tail call i64 @llvm.bswap.i64(i64 %.0.copyload.i175.i) - %116 = getelementptr inbounds nuw i8, ptr %0, i64 296 - store i64 %115, ptr %116, align 8, !tbaa !239 - %117 = add nuw nsw i64 %103, 20 - %118 = icmp eq i64 %2, %117 - br i1 %118, label %169, label %119 - -119: ; preds = %110 - %120 = getelementptr inbounds nuw i8, ptr %106, i64 20 - %121 = load i8, ptr %120, align 1, !tbaa !80 - %122 = getelementptr inbounds nuw i8, ptr %0, i64 328 - store i8 %121, ptr %122, align 8, !tbaa !130 - %.neg189.i = add i64 %2, -21 - %gepdiff165.i = sub i64 %.neg189.i, %103 - %123 = icmp ult i64 %gepdiff165.i, 8 - br i1 %123, label %169, label %124 - -124: ; preds = %119 - %125 = getelementptr inbounds nuw i8, ptr %106, i64 21 - %126 = getelementptr inbounds nuw i8, ptr %0, i64 416 - %127 = load i64, ptr %125, align 1 - store i64 %127, ptr %126, align 8 - %.neg190.i = add i64 %2, -29 - %gepdiff166.i = sub i64 %.neg190.i, %103 - %128 = icmp ult i64 %gepdiff166.i, 2 - br i1 %128, label %169, label %129 - -129: ; preds = %124 - %130 = getelementptr inbounds nuw i8, ptr %106, i64 29 - %.0.copyload.i.i = load i16, ptr %130, align 1 - %131 = tail call i16 @llvm.bswap.i16(i16 %.0.copyload.i.i) - %132 = getelementptr inbounds nuw i8, ptr %0, i64 424 - store i16 %131, ptr %132, align 8, !tbaa !143 - %133 = add nuw nsw i64 %103, 31 - %134 = icmp eq i64 %2, %133 - br i1 %134, label %169, label %135 - -135: ; preds = %129 - %136 = getelementptr inbounds nuw i8, ptr %106, i64 31 - %137 = getelementptr inbounds nuw i8, ptr %106, i64 32 - %138 = load i8, ptr %136, align 1, !tbaa !80 - %.not168.i = icmp eq i8 %138, 0 - br i1 %.not168.i, label %159, label %139 - -139: ; preds = %135 - %140 = load ptr, ptr %0, align 8, !tbaa !23 - %141 = getelementptr inbounds nuw i8, ptr %140, i64 328 - %142 = load ptr, ptr %141, align 8, !tbaa !193 + %95 = getelementptr inbounds nuw i8, ptr %85, i64 354 + tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 2 %98, ptr nonnull align 1 %90, i64 %95, i1 false) + %99 = load ptr, ptr %49, align 8, !tbaa !119 + %100 = getelementptr inbounds nuw i8, ptr %99, i64 321 + %101 = load i8, ptr %100, align 1, !tbaa !43 + %102 = zext i8 %101 to i64 + %103 = getelementptr inbounds nuw i8, ptr %90, i64 %102 + %104 = ptrtoint ptr %103 to i64 + %105 = sub i64 %25, %104 + %106 = icmp ult i64 %105, 4 + br i1 %106, label %174, label %107 + +107:; preds = %97 + %.0.copyload.i170.i = load i32, ptr %103, align 1 + %108 = tail call i32 @llvm.bswap.i32(i32 %.0.copyload.i170.i) + %106 = getelementptr inbounds nuw i8, ptr %0, i64 24 + store i32 %108, ptr %106, align 8, !tbaa !237 + %110 = getelementptr inbounds nuw i8, ptr %103, i64 4 + %111 = ptrtoint ptr %110 to i64 + %112 = sub i64 %25, %111 + %113 = icmp ult i64 %112, 16 + br i1 %113, label %174, label %114 + +114:; preds = %107 + %.0.copyload.i167.i = load i64, ptr %110, align 1 + %115 = tail call i64 @llvm.bswap.i64(i64 %.0.copyload.i167.i) + %111 = getelementptr inbounds nuw i8, ptr %0, i64 288 + store i64 %115, ptr %111, align 8, !tbaa !238 + %117 = getelementptr inbounds nuw i8, ptr %103, i64 12 + %.0.copyload.i168.i = load i64, ptr %117, align 1 + %118 = tail call i64 @llvm.bswap.i64(i64 %.0.copyload.i168.i) + %114 = getelementptr inbounds nuw i8, ptr %0, i64 296 + store i64 %118, ptr %114, align 8, !tbaa !239 + %120 = getelementptr inbounds nuw i8, ptr %103, i64 20 + %121 = icmp eq ptr %4, %120 + br i1 %121, label %169, label %122 + +122:; preds = %114 + %123 = getelementptr inbounds nuw i8, ptr %103, i64 21 + %124 = load i8, ptr %120, align 1, !tbaa !80 + %125 = getelementptr inbounds nuw i8, ptr %0, i64 328 + store i8 %124, ptr %125, align 8, !tbaa !130 + %126 = ptrtoint ptr %123 to i64 + %127 = sub i64 %25, %126 + %128 = icmp ult i64 %127, 8 + br i1 %128, label %174, label %129 + +129:; preds = %122 + %130 = getelementptr inbounds nuw i8, ptr %0, i64 416 + %131 = load i64, ptr %123, align 1 + store i64 %131, ptr %130, align 8 + %125 = getelementptr inbounds nuw i8, ptr %103, i64 29 + %133 = ptrtoint ptr %132 to i64 + %134 = sub i64 %25, %133 + %135 = icmp ult i64 %134, 2 + br i1 %135, label %169, label %136 + +136:; preds = %129 + %.0.copyload.i.i = load i16, ptr %132, align 1 + %137 = tail call i16 @llvm.bswap.i16(i16 %.0.copyload.i.i) + %138 = getelementptr inbounds nuw i8, ptr %0, i64 424 + store i16 %137, ptr %138, align 8, !tbaa !142 + %139 = getelementptr inbounds nuw i8, ptr %103, i64 31 + %140 = icmp eq ptr %4, %139 + br i1 %140, label %174, label %141 + +141:; preds = %136 + %142 = getelementptr inbounds nuw i8, ptr %103, i64 32 + %143 = load i8, ptr %139, align 1, !tbaa !80 + %.not161.i = icmp eq i8 %143, 0 + br i1 %.not161.i, label %159, label %144 + +144: ; preds = %141 + %138 = load ptr, ptr %0, align 8, !tbaa !23 + %146 = getelementptr inbounds nuw i8, ptr %138, i64 328 + %147 = load ptr, ptr %146, align 8, !tbaa !193 + %.not162.i = icmp eq ptr %147, null + br i1 %.not162.i, label %.loopexit.i, label %.preheader.i + +.preheader.i:; preds = %144 + %142 = load ptr, ptr %147, align 8, !tbaa !64 %.not169.i = icmp eq ptr %142, null - br i1 %.not169.i, label %.loopexit.i, label %.preheader.i - -.preheader.i: ; preds = %139 - %143 = load ptr, ptr %142, align 8, !tbaa !64 - %.not170192.i = icmp eq ptr %143, null - br i1 %.not170192.i, label %.loopexit.i, label %.lr.ph.i + br i1 %.not169.i, label %.loopexit.i, label %.lr.ph.i .lr.ph.i: ; preds = %.preheader.i - %144 = zext i8 %138 to i64 + %144 = zext i8 %143 to i64 br label %145 145: ; preds = %153, %.lr.ph.i - %146 = phi ptr [ %143, %.lr.ph.i ], [ %155, %153 ] - %.0193.i = phi ptr [ %142, %.lr.ph.i ], [ %154, %153 ] + %146 = phi ptr [ %148, %.lr.ph.i ], [ %159, %158 ] + %.0193.i = phi ptr [ %147, %.lr.ph.i ], [ %154, %158 ] %147 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %146) #28 %148 = icmp eq i64 %147, %144 br i1 %148, label %149, label %153 149: ; preds = %145 - %bcmp171.i = tail call i32 @bcmp(ptr nonnull %137, ptr nonnull %146, i64 %144) + %bcmp171.i = tail call i32 @bcmp(ptr nonnull %142, ptr nonnull %146, i64 %144) %150 = icmp eq i32 %bcmp171.i, 0 br i1 %150, label %151, label %153 @@ -5431,22 +5427,22 @@ ssl_tls12prf_from_cs.exit.thread179.i: ; preds = %ssl_tls12prf_from_c 153: ; preds = %149, %145 %154 = getelementptr inbounds nuw i8, ptr %.0193.i, i64 8 %155 = load ptr, ptr %154, align 8, !tbaa !64 - %.not170.i = icmp eq ptr %155, null + %.not170.i = icmp eq ptr %159, null br i1 %.not170.i, label %.loopexit.i, label %145, !llvm.loop !241 -.loopexit.i: ; preds = %153, %151, %.preheader.i, %139 +.loopexit.i: ; preds = %153, %151, %.preheader.i, %144 %156 = getelementptr inbounds nuw i8, ptr %0, i64 440 %157 = load ptr, ptr %156, align 8, !tbaa !126 %158 = icmp eq ptr %157, null br i1 %158, label %169, label %159 -159: ; preds = %.loopexit.i, %135 - %160 = zext i8 %138 to i64 - %161 = getelementptr inbounds nuw i8, ptr %137, i64 %160 +159: ; preds = %.loopexit.i, %141 + %160 = zext i8 %143 to i64 + %161 = getelementptr inbounds nuw i8, ptr %142, i64 %160 store i32 27, ptr %5, align 8, !tbaa !34 %162 = getelementptr inbounds nuw i8, ptr %0, i64 20 store i32 771, ptr %162, align 4, !tbaa !84 - tail call void @mbedtls_ssl_update_out_pointers(ptr noundef nonnull %0, ptr noundef %97) #26 + tail call void @mbedtls_ssl_update_out_pointers(ptr noundef nonnull %0, ptr noundef %99) #26 %163 = getelementptr inbounds nuw i8, ptr %0, i64 272 store i16 1, ptr %163, align 8, !tbaa !115 %164 = getelementptr inbounds nuw i8, ptr %0, i64 112 @@ -5465,13 +5461,13 @@ ssl_tls12prf_from_cs.exit.thread179.i: ; preds = %ssl_tls12prf_from_c %.not173.i = icmp eq ptr %161, %4 br i1 %.not173.i, label %ssl_context_load.exit, label %169 -169: ; preds = %42, %7, %3, %20, %17, %14, %10, %24, %26, %27, %30, %ssl_tls12prf_from_cs.exit.thread179.i, %59, %72, %75, %81, %94, %105, %110, %119, %124, %168, %44, %129, %.loopexit.i, %55 - %.0140.i.ph = phi i32 [ -28928, %55 ], [ -28928, %.loopexit.i ], [ -28928, %129 ], [ -28928, %44 ], [ -28928, %168 ], [ -28928, %124 ], [ -28928, %119 ], [ -28928, %110 ], [ -28928, %105 ], [ -28928, %94 ], [ -28928, %81 ], [ -28928, %75 ], [ -28928, %72 ], [ %71, %59 ], [ -28928, %ssl_tls12prf_from_cs.exit.thread179.i ], [ -28928, %30 ], [ -28928, %27 ], [ -24320, %26 ], [ -28928, %24 ], [ -28928, %10 ], [ -28928, %14 ], [ -28928, %17 ], [ -28928, %20 ], [ -28928, %3 ], [ -28928, %7 ], [ %41, %42 ] +169: ; preds = %42, %7, %3, %20, %17, %14, %10, %24, %26, %27, %30, %ssl_tls12prf_from_cs.exit.thread179.i, %59, %72, %75, %81, %94, %107, %114, %122, %129, %168, %44, %136, %.loopexit.i, %55 + %.0140.i.ph = phi i32 [ -28928, %56 ], [ -28928, %.loopexit.i ], [ -28928, %136 ], [ -28928, %45 ], [ -28928, %173 ], [ -28928, %129 ], [ -28928, %122 ], [ -28928, %114 ], [ -28928, %107 ], [ -28928, %97 ], [ -28928, %82 ], [ -28928, %76 ], [ -28928, %73 ], [ %72, %60 ], [ -28928, %ssl_tls12prf_from_cs.exit.thread172.i ], [ -28928, %31 ], [ -28928, %28 ], [ -24320, %27 ], [ -28928, %24 ], [ -28928, %10 ], [ -28928, %14 ], [ -28928, %17 ], [ -28928, %20 ], [ -28928, %3 ], [ -28928, %7 ], [ %41, %43 ] tail call void @mbedtls_ssl_free(ptr noundef nonnull %0) br label %ssl_context_load.exit ssl_context_load.exit: ; preds = %168, %169 - %.0140.i8 = phi i32 [ %.0140.i.ph, %169 ], [ 0, %168 ] + %.0140.i8 = phi i32 [ %.0140.i.ph, %174 ], [ 0, %173 ] ret i32 %.0140.i8 } diff --git a/bench/lief/optimized/ssl_tls13_client.ll b/bench/lief/optimized/ssl_tls13_client.ll index 5ed755f38d4..e0c6dbda6db 100644 --- a/bench/lief/optimized/ssl_tls13_client.ll +++ b/bench/lief/optimized/ssl_tls13_client.ll @@ -968,7 +968,7 @@ define hidden i32 @mbedtls_ssl_tls13_handshake_client_step(ptr noundef %0) local %11 = alloca i64, align 8 %12 = getelementptr inbounds nuw i8, ptr %0, i64 8 %13 = load i32, ptr %12, align 8, !tbaa !68 - switch i32 %13, label %572 [ + switch i32 %13, label %575 [ i32 0, label %14 i32 1, label %15 i32 2, label %17 @@ -2199,8 +2199,9 @@ ssl_tls13_process_certificate_request.exit: ; preds = %ssl_tls13_certifica %472 = load ptr, ptr %2, align 8, !tbaa !69 %473 = load i64, ptr %3, align 8, !tbaa !3 %474 = getelementptr inbounds nuw i8, ptr %472, i64 %473 - %475 = icmp ugt i64 %473, 8 - br i1 %475, label %477, label %476 + %475 = ptrtoint ptr %474 to i64 + %476 = icmp ugt i64 %473, 8 + br i1 %476, label %478, label %477 476: ; preds = %468 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 2858, ptr noundef nonnull @.str.34, ptr noundef nonnull @__func__.ssl_tls13_parse_new_session_ticket) #12 @@ -2308,7 +2309,7 @@ ssl_tls13_process_certificate_request.exit: ; preds = %ssl_tls13_certifica %519 = and i8 %518, -14 store i8 %519, ptr %517, align 4, !tbaa !38 %520 = icmp ule ptr %515, %474 - %521 = add nuw nsw i64 %498, %489 + %521 = add nuw nsw i64 %490, %499 %gepdiff37.i = sub i64 %.neg40.i, %521 %522 = icmp ugt i64 %gepdiff37.i, 1 %narrow.i102.not.i.i = and i1 %520, %522 @@ -2325,8 +2326,8 @@ ssl_tls13_process_certificate_request.exit: ; preds = %ssl_tls13_certifica %526 = zext i16 %525 to i64 %527 = getelementptr inbounds nuw i8, ptr %515, i64 2 %528 = icmp ule ptr %527, %474 - %.neg45.i = add i64 %473, -13 - %gepdiff38.i = sub i64 %.neg45.i, %521 + %530 = ptrtoint ptr %528 to i64 + %gepdiff38.i = sub i64 %475, %530 %529 = icmp uge i64 %gepdiff38.i, %526 %narrow.i103.not.i.i61 = and i1 %528, %529 br i1 %narrow.i103.not.i.i61, label %531, label %530 @@ -2405,7 +2406,7 @@ ssl_tls13_parse_new_session_ticket.exit.i: ; preds = %531 br label %552 552: ; preds = %.fold.split61.i.i, %.fold.split54.i.i, %.fold.split53.i.i, %.fold.split52.i.i, %.fold.split.i.i, %547 - %.ph.i.i = phi i32 [ 48, %.fold.split54.i.i ], [ 32, %.fold.split53.i.i ], [ 28, %.fold.split52.i.i ], [ 20, %.fold.split.i.i ], [ 16, %547 ], [ 0, %.fold.split61.i.i ] + %.ph.i.i = phi i32 [ 48, %.fold.split54.i.i ], [ 32, %.fold.split53.i.i ], [ 28, %.fold.split52.i.i ], [ 20, %.fold.split.i.i ], [ 16, %550 ], [ 0, %.fold.split61.i.i ] %553 = zext nneg i32 %.ph.i.i to i64 %554 = getelementptr inbounds nuw i8, ptr %535, i64 428 call void @mbedtls_debug_print_buf(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 2972, ptr noundef nonnull @.str.109, ptr noundef nonnull %554, i64 noundef %553) #12 @@ -2454,7 +2455,7 @@ ssl_tls13_postprocess_new_session_ticket.exit.thread28.thread32.i: ; preds = %ss br label %ssl_tls13_process_new_session_ticket.exit ssl_tls13_process_new_session_ticket.exit: ; preds = %466, %476, %482, %491, %494, %502, %513, %523, %530, %534, %546, %547, %547, %ssl_tls13_postprocess_new_session_ticket.exit.i, %571 - %.0.i57 = phi i32 [ %467, %466 ], [ %556, %ssl_tls13_postprocess_new_session_ticket.exit.i ], [ %.1.i65, %571 ], [ %533, %534 ], [ -29440, %530 ], [ -29440, %523 ], [ -32512, %513 ], [ -29440, %502 ], [ -29440, %494 ], [ -29440, %491 ], [ -26112, %482 ], [ -29440, %476 ], [ -27648, %546 ], [ -27648, %547 ], [ -27648, %547 ] + %.0.i57 = phi i32 [ %467, %466 ], [ %556, %ssl_tls13_postprocess_new_session_ticket.exit.i ], [ %.1.i65, %574 ], [ %536, %537 ], [ -29440, %533 ], [ -29440, %524 ], [ -32512, %514 ], [ -29440, %503 ], [ -29440, %495 ], [ -29440, %492 ], [ -26112, %483 ], [ -29440, %477 ], [ -27648, %549 ], [ -27648, %550 ], [ -27648, %550 ] call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 2, ptr noundef nonnull @.str, i32 noundef 3064, ptr noundef nonnull @.str.100) #12 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #12 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #12 @@ -2465,7 +2466,7 @@ ssl_tls13_process_new_session_ticket.exit: ; preds = %466, %476, %482, %4 br label %ssl_tls13_process_server_certificate.exit ssl_tls13_process_server_certificate.exit: ; preds = %457, %456, %452, %451, %448, %.sink.split.i, %434, %425, %424, %420, %419, %417, %416, %414, %14, %15, %ssl_tls13_process_server_hello.exit, %ssl_tls13_process_encrypted_extensions.exit, %ssl_tls13_process_certificate_request.exit, %458, %459, %462, %465, %ssl_tls13_process_new_session_ticket.exit, %460, %463, %572 - %.024 = phi i32 [ -28928, %572 ], [ 0, %14 ], [ %16, %15 ], [ %.02461.i, %ssl_tls13_process_server_hello.exit ], [ %.0.i30, %ssl_tls13_process_encrypted_extensions.exit ], [ %.016.i, %ssl_tls13_process_certificate_request.exit ], [ 0, %458 ], [ 0, %459 ], [ %461, %460 ], [ 0, %462 ], [ %464, %463 ], [ 0, %465 ], [ %.0.i57, %ssl_tls13_process_new_session_ticket.exit ], [ %415, %414 ], [ 0, %416 ], [ %418, %417 ], [ 0, %419 ], [ %423, %424 ], [ 0, %425 ], [ %421, %420 ], [ %435, %434 ], [ 0, %.sink.split.i ], [ %449, %448 ], [ 0, %451 ], [ %455, %456 ], [ 0, %457 ], [ %453, %452 ] + %.024 = phi i32 [ -28928, %575 ], [ 0, %14 ], [ %16, %15 ], [ %.02461.i, %ssl_tls13_process_server_hello.exit ], [ %.0.i30, %ssl_tls13_process_encrypted_extensions.exit ], [ %.016.i, %ssl_tls13_process_certificate_request.exit ], [ 0, %458 ], [ 0, %459 ], [ %461, %460 ], [ 0, %462 ], [ %464, %463 ], [ 0, %465 ], [ %.0.i57, %ssl_tls13_process_new_session_ticket.exit ], [ %415, %414 ], [ 0, %416 ], [ %418, %417 ], [ 0, %419 ], [ %423, %424 ], [ 0, %425 ], [ %421, %420 ], [ %435, %434 ], [ 0, %.sink.split.i ], [ %449, %448 ], [ 0, %451 ], [ %455, %456 ], [ 0, %457 ], [ %453, %452 ] ret i32 %.024 } diff --git a/bench/lief/optimized/ssl_tls13_server.ll b/bench/lief/optimized/ssl_tls13_server.ll index 68402f187ec..4524800771c 100644 --- a/bench/lief/optimized/ssl_tls13_server.ll +++ b/bench/lief/optimized/ssl_tls13_server.ll @@ -376,9 +376,10 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam %13 = load ptr, ptr %12, align 8, !tbaa !16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false) - %14 = ptrtoint ptr %9 to i64 - %15 = icmp ugt i64 %10, 37 - br i1 %15, label %17, label %16 + %14 = ptrtoint ptr %11 to i64 + %15 = ptrtoint ptr %9 to i64 + %16 = icmp ugt i64 %10, 37 + br i1 %16, label %18, label %17 16: ; preds = %8 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1295, ptr noundef nonnull @.str.11, ptr noundef nonnull @__func__.ssl_tls13_parse_client_hello) #9 @@ -449,14 +450,13 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam %47 = zext i8 %46 to i64 %48 = add nuw nsw i64 %47, 2 %49 = icmp ule ptr %45, %11 - %.neg43 = add i64 %10, -38 - %50 = add nuw nsw i64 %29, %35 - %gepdiff39 = sub i64 %.neg43, %50 - %51 = icmp ule i64 %48, %gepdiff39 - %narrow.i328.not.i = and i1 %49, %51 - br i1 %narrow.i328.not.i, label %53, label %52 + %51 = ptrtoint ptr %46 to i64 + %52 = sub i64 %14, %51 + %53 = icmp ule i64 %49, %52 + %narrow.i328.not.i = and i1 %48, %53 + br i1 %narrow.i328.not.i, label %55, label %54 -52: ; preds = %43 +54: ; preds = %44 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1367, ptr noundef nonnull @.str.11, ptr noundef nonnull @__func__.ssl_tls13_parse_client_hello) #9 call void @mbedtls_ssl_pend_fatal_alert(ptr noundef nonnull %0, i8 noundef zeroext 50, i32 noundef -29440) #9 br label %ssl_tls13_parse_client_hello.exit.thread @@ -472,7 +472,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam br label %ssl_tls13_parse_client_hello.exit.thread 58: ; preds = %53 - switch i32 %55, label %67 [ + switch i32 %55, label %69 [ i32 0, label %ssl_tls13_parse_client_hello.exit.thread31 i32 1, label %59 ] @@ -546,29 +546,29 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam %94 = getelementptr inbounds nuw i8, ptr %87, i64 8 %95 = load ptr, ptr %94, align 8, !tbaa !57 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 2, ptr noundef nonnull @.str, i32 noundef 1458, ptr noundef nonnull @.str.19, i32 noundef %91, ptr noundef %95) #9 - %96 = load i8, ptr %44, align 1, !tbaa !47 - %.not300.i = icmp eq i8 %96, 1 - br i1 %.not300.i, label %97, label %99 - -97: ; preds = %90 %98 = load i8, ptr %45, align 1, !tbaa !47 - %.not301.i = icmp eq i8 %98, 0 - br i1 %.not301.i, label %100, label %99 + %.not301.i = icmp eq i8 %98, 1 + br i1 %.not301.i, label %99, label %101 + +99: ; preds = %90 + %100 = load i8, ptr %46, align 1, !tbaa !47 + %.not301.i = icmp eq i8 %100, 0 + br i1 %.not301.i, label %102, label %101 -99: ; preds = %97, %90 +101: ; preds = %99, %92 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1465, ptr noundef nonnull @.str.20) #9 call void @mbedtls_ssl_pend_fatal_alert(ptr noundef nonnull %0, i8 noundef zeroext 47, i32 noundef -26112) #9 br label %ssl_tls13_parse_client_hello.exit.thread -100: ; preds = %97 +100: ; preds = %99 %101 = getelementptr inbounds nuw i8, ptr %44, i64 2 %.0.copyload.i323.i = load i16, ptr %101, align 1 %102 = call i16 @llvm.bswap.i16(i16 %.0.copyload.i323.i) %103 = zext i16 %102 to i64 %.ptr.i = getelementptr inbounds nuw i8, ptr %44, i64 4 %104 = icmp ule ptr %.ptr.i, %11 - %.neg45 = add i64 %10, -41 - %gepdiff40 = sub i64 %.neg45, %50 + %107 = ptrtoint ptr %.ptr.i to i64 + %gepdiff40 = sub i64 %14, %107 %105 = icmp uge i64 %gepdiff40, %103 %narrow.i329.not.i = and i1 %104, %105 br i1 %narrow.i329.not.i, label %107, label %106 @@ -592,10 +592,10 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam br label %111 111: ; preds = %166, %.lr.ph.i - %.0261414.i = phi ptr [ %.ptr.i, %.lr.ph.i ], [ %136, %166 ] - %.0264413.i = phi ptr [ null, %.lr.ph.i ], [ %.1265.i, %166 ] - %.0267412.i = phi ptr [ null, %.lr.ph.i ], [ %.1268.i, %166 ] - %.0271411.i = phi i32 [ 0, %.lr.ph.i ], [ %.1272.i, %166 ] + %.0261414.i = phi ptr [ %.ptr.i, %.lr.ph.i ], [ %139, %170 ] + %.0264413.i = phi ptr [ null, %.lr.ph.i ], [ %.1265.i, %170 ] + %.0267412.i = phi ptr [ null, %.lr.ph.i ], [ %.1268.i, %170 ] + %.0271411.i = phi i32 [ 0, %.lr.ph.i ], [ %.1272.i, %170 ] %112 = load ptr, ptr %12, align 8, !tbaa !16 %113 = getelementptr inbounds nuw i8, ptr %112, i64 57 %114 = load i8, ptr %113, align 1, !tbaa !59 @@ -644,13 +644,13 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam br label %ssl_tls13_parse_client_hello.exit.thread 135: ; preds = %123 - %136 = getelementptr inbounds nuw i8, ptr %129, i64 %128 + %136 = getelementptr inbounds nuw i8, ptr %132, i64 %128 %137 = call i32 @mbedtls_ssl_tls13_check_received_extension(ptr noundef nonnull %0, i32 noundef 1, i32 noundef %125, i32 noundef %spec.select.i) #9 %.not317.i = icmp eq i32 %137, 0 br i1 %.not317.i, label %138, label %ssl_tls13_parse_client_hello.exit 138: ; preds = %135 - switch i16 %124, label %165 [ + switch i16 %124, label %169 [ i16 0, label %139 i16 10, label %142 i16 51, label %145 @@ -663,7 +663,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 139: ; preds = %138 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1534, ptr noundef nonnull @.str.23) #9 - %140 = call i32 @mbedtls_ssl_parse_server_name_ext(ptr noundef nonnull %0, ptr noundef nonnull %129, ptr noundef nonnull %136) #9 + %140 = call i32 @mbedtls_ssl_parse_server_name_ext(ptr noundef nonnull %0, ptr noundef nonnull %132, ptr noundef nonnull %139) #9 %.not322.i = icmp eq i32 %140, 0 br i1 %.not322.i, label %166, label %141 @@ -673,7 +673,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 142: ; preds = %138 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1547, ptr noundef nonnull @.str.25) #9 - %143 = call fastcc i32 @ssl_tls13_parse_supported_groups_ext(ptr noundef nonnull %0, ptr noundef nonnull %129, ptr noundef nonnull %136) + %143 = call fastcc i32 @ssl_tls13_parse_supported_groups_ext(ptr noundef nonnull %0, ptr noundef nonnull %132, ptr noundef nonnull %139) %.not321.i = icmp eq i32 %143, 0 br i1 %.not321.i, label %166, label %144 @@ -683,7 +683,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 145: ; preds = %138 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1568, ptr noundef nonnull @.str.27) #9 - %146 = call fastcc i32 @ssl_tls13_parse_key_shares_ext(ptr noundef nonnull %0, ptr noundef nonnull %129, ptr noundef nonnull %136) + %146 = call fastcc i32 @ssl_tls13_parse_key_shares_ext(ptr noundef nonnull %0, ptr noundef nonnull %132, ptr noundef nonnull %139) %147 = icmp eq i32 %146, 1 br i1 %147, label %.thread.i, label %148 @@ -701,7 +701,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 151: ; preds = %138 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1600, ptr noundef nonnull @.str.30) #9 - %152 = call fastcc i32 @ssl_tls13_parse_key_exchange_modes_ext(ptr noundef nonnull %0, ptr noundef nonnull %129, ptr noundef nonnull %136) + %152 = call fastcc i32 @ssl_tls13_parse_key_exchange_modes_ext(ptr noundef nonnull %0, ptr noundef nonnull %132, ptr noundef nonnull %139) %.not320.i = icmp eq i32 %152, 0 br i1 %.not320.i, label %166, label %153 @@ -722,7 +722,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 159: ; preds = %138 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1634, ptr noundef nonnull @.str.33) #9 - %160 = call i32 @mbedtls_ssl_parse_alpn_ext(ptr noundef nonnull %0, ptr noundef nonnull %129, ptr noundef nonnull %136) #9 + %160 = call i32 @mbedtls_ssl_parse_alpn_ext(ptr noundef nonnull %0, ptr noundef nonnull %132, ptr noundef nonnull %139) #9 %.not319.i = icmp eq i32 %160, 0 br i1 %.not319.i, label %166, label %161 @@ -732,7 +732,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 162: ; preds = %138 call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1647, ptr noundef nonnull @.str.35) #9 - %163 = call i32 @mbedtls_ssl_parse_sig_alg_ext(ptr noundef nonnull %0, ptr noundef nonnull %129, ptr noundef nonnull %136) #9 + %163 = call i32 @mbedtls_ssl_parse_sig_alg_ext(ptr noundef nonnull %0, ptr noundef nonnull %132, ptr noundef nonnull %139) #9 %.not318.i = icmp eq i32 %163, 0 br i1 %.not318.i, label %166, label %164 @@ -744,33 +744,33 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam call void @mbedtls_ssl_print_extension(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1676, i32 noundef 1, i32 noundef %125, ptr noundef nonnull @.str.37, ptr noundef null) #9 br label %166 -166: ; preds = %165, %162, %159, %154, %151, %148, %.thread.i, %142, %139, %138 - %.1272.i = phi i32 [ %.0271411.i, %165 ], [ %.0271411.i, %139 ], [ %.0271411.i, %142 ], [ %.0271411.i, %148 ], [ %.0271411.i, %138 ], [ %.0271411.i, %151 ], [ %.0271411.i, %159 ], [ %.0271411.i, %162 ], [ %.0271411.i, %154 ], [ 1, %.thread.i ] - %.1268.i = phi ptr [ %.0267412.i, %165 ], [ %.0267412.i, %139 ], [ %.0267412.i, %142 ], [ %.0267412.i, %148 ], [ %.0267412.i, %138 ], [ %.0267412.i, %151 ], [ %.0267412.i, %159 ], [ %.0267412.i, %162 ], [ %129, %154 ], [ %.0267412.i, %.thread.i ] - %.1265.i = phi ptr [ %.0264413.i, %165 ], [ %.0264413.i, %139 ], [ %.0264413.i, %142 ], [ %.0264413.i, %148 ], [ %.0264413.i, %138 ], [ %.0264413.i, %151 ], [ %.0264413.i, %159 ], [ %.0264413.i, %162 ], [ %136, %154 ], [ %.0264413.i, %.thread.i ] - %167 = icmp ult ptr %136, %.ptr418.i +166: ; preds = %165, %164, %159, %154, %151, %148, %.thread.i, %142, %139, %138 + %.1272.i = phi i32 [ %.0271411.i, %169 ], [ %.0271411.i, %143 ], [ %.0271411.i, %146 ], [ %.0271411.i, %152 ], [ %.0271411.i, %142 ], [ %.0271411.i, %155 ], [ %.0271411.i, %163 ], [ %.0271411.i, %166 ], [ %.0271411.i, %158 ], [ 1, %.thread.i ] + %.1268.i = phi ptr [ %.0267412.i, %169 ], [ %.0267412.i, %143 ], [ %.0267412.i, %146 ], [ %.0267412.i, %152 ], [ %.0267412.i, %142 ], [ %.0267412.i, %155 ], [ %.0267412.i, %163 ], [ %.0267412.i, %166 ], [ %133, %158 ], [ %.0267412.i, %.thread.i ] + %.1265.i = phi ptr [ %.0264413.i, %169 ], [ %.0264413.i, %143 ], [ %.0264413.i, %146 ], [ %.0264413.i, %152 ], [ %.0264413.i, %142 ], [ %.0264413.i, %155 ], [ %.0264413.i, %163 ], [ %.0264413.i, %166 ], [ %140, %158 ], [ %.0264413.i, %.thread.i ] + %167 = icmp ult ptr %139, %.ptr418.i br i1 %167, label %111, label %._crit_edge.loopexit.i, !llvm.loop !60 ._crit_edge.loopexit.i: ; preds = %166 %.pre.i = load i32, ptr %109, align 4, !tbaa !58 - %168 = icmp ne i32 %.1272.i, 0 + %.pre444.i = ptrtoint ptr %140 to i64 + %172 = icmp ne i32 %.1272.i, 0 br label %._crit_edge.i ._crit_edge.i: ; preds = %._crit_edge.loopexit.i, %107 - %.pre-phi.i.in = phi ptr [ %136, %._crit_edge.loopexit.i ], [ %.ptr.i, %107 ] - %169 = phi i32 [ %.pre.i, %._crit_edge.loopexit.i ], [ 0, %107 ] - %.0271.lcssa.i = phi i1 [ %168, %._crit_edge.loopexit.i ], [ false, %107 ] - %.0267.lcssa.i = phi ptr [ %.1268.i, %._crit_edge.loopexit.i ], [ null, %107 ] - %.0264.lcssa.i = phi ptr [ %.1265.i, %._crit_edge.loopexit.i ], [ null, %107 ] - %.pre-phi.i = ptrtoint ptr %.pre-phi.i.in to i64 - call void @mbedtls_ssl_print_extensions(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1684, i32 noundef 1, i32 noundef %169, ptr noundef null) #9 - %170 = sub i64 %.pre-phi.i, %14 - %171 = call i32 @mbedtls_ssl_add_hs_hdr_to_checksum(ptr noundef nonnull %0, i32 noundef 1, i64 noundef %170) #9 - %.not303.i = icmp eq i32 %171, 0 - br i1 %.not303.i, label %173, label %172 - -172: ; preds = %._crit_edge.i - call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1690, ptr noundef nonnull @.str.38, i32 noundef %171) #9 + %.pre-phi.i.in = phi i64 [ %.pre444.i, %._crit_edge.loopexit.i ], [ %107, %111 ] + %169 = phi i32 [ %.pre.i, %._crit_edge.loopexit.i ], [ 0, %111 ] + %.0271.lcssa.i = phi i1 [ %172, %._crit_edge.loopexit.i ], [ false, %111 ] + %.0267.lcssa.i = phi ptr [ %.1268.i, %._crit_edge.loopexit.i ], [ null, %111 ] + %.0264.lcssa.i = phi ptr [ %.1265.i, %._crit_edge.loopexit.i ], [ null, %111 ] + call void @mbedtls_ssl_print_extensions(ptr noundef nonnull %0, i32 noundef 3, ptr noundef nonnull @.str, i32 noundef 1684, i32 noundef 1, i32 noundef %173, ptr noundef null) #9 + %174 = sub i64 %.pre-phi.i, %15 + %175 = call i32 @mbedtls_ssl_add_hs_hdr_to_checksum(ptr noundef nonnull %0, i32 noundef 1, i64 noundef %174) #9 + %.not303.i = icmp eq i32 %175, 0 + br i1 %.not303.i, label %177, label %176 + +176: ; preds = %._crit_edge.i + call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1690, ptr noundef nonnull @.str.38, i32 noundef %175) #9 br label %ssl_tls13_parse_client_hello.exit 173: ; preds = %._crit_edge.i @@ -783,8 +783,8 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 178: ; preds = %173 %179 = ptrtoint ptr %.0267.lcssa.i to i64 - %180 = sub i64 %179, %14 - %181 = call i32 %177(ptr noundef nonnull %0, ptr noundef %9, i64 noundef %180) #9 + %180 = sub i64 %179, %15 + %181 = call i32 %181(ptr noundef nonnull %0, ptr noundef %9, i64 noundef %180) #9 %.not306.i = icmp eq i32 %181, 0 br i1 %.not306.i, label %183, label %182 @@ -794,7 +794,7 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam 183: ; preds = %178 %184 = call fastcc i32 @ssl_tls13_parse_pre_shared_key_ext(ptr noundef nonnull %0, ptr noundef %.0267.lcssa.i, ptr noundef %.0264.lcssa.i, ptr noundef nonnull %36, ptr noundef nonnull %44, ptr noundef %4) - switch i32 %184, label %185 [ + switch i32 %184, label %189 [ i32 0, label %189 i32 -27776, label %..thread341_crit_edge.i ] @@ -809,12 +809,12 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam br label %ssl_tls13_parse_client_hello.exit 186: ; preds = %173 - %187 = call i32 %177(ptr noundef nonnull %0, ptr noundef %9, i64 noundef %170) #9 - %.not305.i = icmp eq i32 %187, 0 + %187 = call i32 %181(ptr noundef nonnull %0, ptr noundef %9, i64 noundef %174) #9 + %.not305.i = icmp eq i32 %189, 0 br i1 %.not305.i, label %.thread341.i, label %188 188: ; preds = %186 - call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1727, ptr noundef nonnull @.str.39, i32 noundef %187) #9 + call void @mbedtls_debug_print_ret(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1727, ptr noundef nonnull @.str.39, i32 noundef %189) #9 br label %ssl_tls13_parse_client_hello.exit 189: ; preds = %183 @@ -830,8 +830,8 @@ define internal fastcc i32 @ssl_tls13_process_client_hello(ptr noundef %0) unnam br label %207 .thread341.i: ; preds = %189, %186, %..thread341_crit_edge.i - %195 = phi i32 [ %191, %189 ], [ %.pre443.i, %..thread341_crit_edge.i ], [ 0, %186 ] - %196 = phi i1 [ true, %189 ], [ false, %..thread341_crit_edge.i ], [ false, %186 ] + %195 = phi i32 [ %191, %193 ], [ %.pre443.i, %..thread341_crit_edge.i ], [ 0, %190 ] + %196 = phi i1 [ true, %193 ], [ false, %..thread341_crit_edge.i ], [ false, %190 ] %.val.i.i = load ptr, ptr %0, align 8, !tbaa !40 %197 = getelementptr i8, ptr %.val.i.i, i64 32 %.val.val.i.i = load i32, ptr %197, align 8, !tbaa !64 @@ -886,7 +886,7 @@ ssl_tls13_key_exchange_is_ephemeral_available.exit.thread.i: ; preds = %ssl_tls1 store i32 %214, ptr %216, align 8, !tbaa !56 %217 = getelementptr inbounds nuw i8, ptr %213, i64 8 %218 = load ptr, ptr %217, align 8, !tbaa !57 - call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 2, ptr noundef nonnull @.str, i32 noundef 1785, ptr noundef nonnull @.str.45, i32 noundef %214, ptr noundef %218) #9 + call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 2, ptr noundef nonnull @.str, i32 noundef 1785, ptr noundef nonnull @.str.45, i32 noundef %217, ptr noundef %218) #9 %219 = load i32, ptr %4, align 8, !tbaa !67 %220 = icmp eq i32 %219, 1 br i1 %220, label %221, label %222 @@ -904,22 +904,22 @@ ssl_tls13_key_exchange_is_ephemeral_available.exit.thread.i: ; preds = %ssl_tls1 call void @mbedtls_ssl_optimize_checksum(ptr noundef nonnull %0, ptr noundef %224) #9 br label %ssl_tls13_parse_client_hello.exit.thread31 -ssl_tls13_parse_client_hello.exit.thread: ; preds = %16, %23, %31, %38, %42, %52, %57, %64, %80, %89, %99, %106, %206, %158, %153, %150, %144, %134, %122, %117 - %.0260.i.ph = phi i32 [ -26112, %117 ], [ -29440, %122 ], [ -29440, %134 ], [ %143, %144 ], [ %146, %150 ], [ %152, %153 ], [ -26112, %158 ], [ -26112, %206 ], [ -29440, %106 ], [ -26112, %99 ], [ -28160, %89 ], [ -29440, %80 ], [ %62, %64 ], [ %55, %57 ], [ -29440, %52 ], [ -29440, %42 ], [ -29440, %38 ], [ -29440, %31 ], [ -28288, %23 ], [ -29440, %16 ] +ssl_tls13_parse_client_hello.exit.thread: ; preds = %16, %23, %31, %38, %42, %54, %57, %64, %80, %89, %101, %106, %206, %158, %153, %150, %144, %134, %122, %117 + %.0260.i.ph = phi i32 [ -26112, %121 ], [ -29440, %126 ], [ -29440, %138 ], [ %143, %148 ], [ %150, %154 ], [ %156, %157 ], [ -26112, %162 ], [ -26112, %210 ], [ -29440, %110 ], [ -26112, %101 ], [ -28160, %91 ], [ -29440, %82 ], [ %64, %66 ], [ %57, %59 ], [ -29440, %54 ], [ -29440, %43 ], [ -29440, %39 ], [ -29440, %32 ], [ -28288, %24 ], [ -29440, %17 ] call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9 br label %ssl_tls13_postprocess_client_hello.exit.thread ssl_tls13_parse_client_hello.exit.thread31: ; preds = %222, %58, %65 - %.0260.i.ph30 = phi i32 [ 2, %65 ], [ 2, %58 ], [ %.0274.i, %222 ] + %.0260.i.ph30 = phi i32 [ 2, %67 ], [ 2, %60 ], [ %.0274.i, %226 ] call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9 br label %226 -ssl_tls13_parse_client_hello.exit: ; preds = %135, %67, %141, %161, %164, %172, %182, %185, %188 - %.0260.i = phi i32 [ %171, %172 ], [ %181, %182 ], [ %184, %185 ], [ %187, %188 ], [ %76, %67 ], [ %163, %164 ], [ %160, %161 ], [ %140, %141 ], [ %137, %135 ] +ssl_tls13_parse_client_hello.exit: ; preds = %135, %67, %141, %161, %164, %176, %182, %185, %188 + %.0260.i = phi i32 [ %175, %176 ], [ %181, %186 ], [ %184, %189 ], [ %189, %192 ], [ %76, %69 ], [ %163, %168 ], [ %160, %165 ], [ %140, %145 ], [ %137, %139 ] call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9 @@ -932,25 +932,25 @@ ssl_tls13_parse_client_hello.exit: ; preds = %135, %67, %141, %16 %228 = load ptr, ptr %0, align 8, !tbaa !40 br i1 %227, label %229, label %238 -229: ; preds = %226 +232: ; preds = %226 %230 = getelementptr inbounds nuw i8, ptr %228, i64 4 %231 = load i32, ptr %230, align 4, !tbaa !69 %232 = icmp ult i32 %231, 772 br i1 %232, label %mbedtls_ssl_conf_is_tls12_enabled.exit, label %mbedtls_ssl_conf_is_tls12_enabled.exit.thread -mbedtls_ssl_conf_is_tls12_enabled.exit: ; preds = %229 +mbedtls_ssl_conf_is_tls12_enabled.exit: ; preds = %232 %233 = load i32, ptr %228, align 8, !tbaa !70 %234 = icmp ult i32 %233, 771 br i1 %234, label %mbedtls_ssl_conf_is_tls12_enabled.exit.thread, label %235 -mbedtls_ssl_conf_is_tls12_enabled.exit.thread: ; preds = %229, %mbedtls_ssl_conf_is_tls12_enabled.exit +mbedtls_ssl_conf_is_tls12_enabled.exit.thread: ; preds = %232, %mbedtls_ssl_conf_is_tls12_enabled.exit call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull @.str, i32 noundef 1980, ptr noundef nonnull @.str.9) #9 call void @mbedtls_ssl_pend_fatal_alert(ptr noundef nonnull %0, i8 noundef zeroext 70, i32 noundef -28288) #9 br label %253 235: ; preds = %mbedtls_ssl_conf_is_tls12_enabled.exit %236 = getelementptr inbounds nuw i8, ptr %0, i64 316 - store i32 1, ptr %236, align 4, !tbaa !71 + store i32 1, ptr %239, align 4, !tbaa !71 %237 = getelementptr inbounds nuw i8, ptr %0, i64 20 store i32 771, ptr %237, align 4, !tbaa !48 br label %253 @@ -962,7 +962,7 @@ mbedtls_ssl_conf_is_tls12_enabled.exit.thread: ; preds = %229, %mbedtls_ssl_c br i1 %.not.i27, label %244, label %241 241: ; preds = %238 - %242 = call i32 %240(ptr noundef nonnull %0) #9 + %242 = call i32 %244(ptr noundef nonnull %0) #9 %.not16.i = icmp eq i32 %242, 0 br i1 %.not16.i, label %244, label %243 @@ -996,12 +996,12 @@ ssl_tls13_postprocess_client_hello.exit: ; preds = %244 br label %ssl_tls13_postprocess_client_hello.exit.thread ssl_tls13_postprocess_client_hello.exit.thread: ; preds = %248, %243, %ssl_tls13_parse_client_hello.exit.thread, %251, %252, %ssl_tls13_parse_client_hello.exit, %1 - %.020 = phi i32 [ %7, %1 ], [ %.0260.i, %ssl_tls13_parse_client_hello.exit ], [ 0, %251 ], [ 0, %252 ], [ %.0260.i.ph, %ssl_tls13_parse_client_hello.exit.thread ], [ %247, %248 ], [ %242, %243 ] + %.020 = phi i32 [ %7, %1 ], [ %.0260.i, %ssl_tls13_parse_client_hello.exit ], [ 0, %255 ], [ 0, %256 ], [ %.0260.i.ph, %ssl_tls13_parse_client_hello.exit.thread ], [ %247, %252 ], [ %242, %247 ] call void (ptr, i32, ptr, i32, ptr, ...) @mbedtls_debug_print_msg(ptr noundef %0, i32 noundef 2, ptr noundef nonnull @.str, i32 noundef 2003, ptr noundef nonnull @.str.10) #9 br label %253 253: ; preds = %ssl_tls13_postprocess_client_hello.exit.thread, %235, %mbedtls_ssl_conf_is_tls12_enabled.exit.thread - %.0 = phi i32 [ %.020, %ssl_tls13_postprocess_client_hello.exit.thread ], [ 0, %235 ], [ -28288, %mbedtls_ssl_conf_is_tls12_enabled.exit.thread ] + %.0 = phi i32 [ %.020, %ssl_tls13_postprocess_client_hello.exit.thread ], [ 0, %239 ], [ -28288, %mbedtls_ssl_conf_is_tls12_enabled.exit.thread ] call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9 ret i32 %.0 diff --git a/bench/linux/optimized/decompress_unlzo.ll b/bench/linux/optimized/decompress_unlzo.ll index 0794c02b913..65630b71b9f 100644 --- a/bench/linux/optimized/decompress_unlzo.ll +++ b/bench/linux/optimized/decompress_unlzo.ll @@ -15,71 +15,72 @@ target triple = "x86_64-unknown-linux-gnu" @.str.8 = private unnamed_addr constant [26 x i8] c"Compressed data violation\00", align 1 ; Function Attrs: cold fn_ret_thunk_extern inlinehint nofree norecurse nosync nounwind null_pointer_is_valid optsize memory(argmem: readwrite) -define dso_local noundef range(i64 0, 2) i64 @parse_header(ptr noundef readonly captures(none) %0, ptr noundef writeonly captures(none) %1, i64 noundef %2) local_unnamed_addr #0 section ".init.text" align 16 { - %4 = icmp slt i64 %2, 33 - br i1 %4, label %.loopexit, label %5 - -5: ; preds = %3 - %6 = getelementptr i8, ptr %0, i64 9 - br label %7 - -7: ; preds = %14, %5 - %8 = phi i64 [ 0, %5 ], [ %16, %14 ] - %9 = phi ptr [ %0, %5 ], [ %15, %14 ] - %10 = load i8, ptr %9, align 1 - %11 = getelementptr [9 x i8], ptr @lzop_magic, i64 0, i64 %8 - %12 = load i8, ptr %11, align 1 - %13 = icmp eq i8 %10, %12 - br i1 %13, label %14, label %.loopexit - -14: ; preds = %7 - %15 = getelementptr i8, ptr %9, i64 1 - %16 = add nuw nsw i64 %8, 1 - %17 = icmp eq i64 %16, 9 - br i1 %17, label %18, label %7, !llvm.loop !5 - -18: ; preds = %14 - %19 = load i16, ptr %6, align 1 - %20 = tail call i16 @llvm.bswap.i16(i16 %19) - %21 = icmp ugt i16 %20, 2367 - %22 = select i1 %21, i64 8, i64 7 - %23 = getelementptr i8, ptr %6, i64 %22 - %24 = load i32, ptr %23, align 1 - %25 = and i32 %24, 524288 - %26 = icmp eq i32 %25, 0 - %27 = select i1 %26, i64 4, i64 8 - %28 = add nuw nsw i64 %27, %22 - %29 = add nuw nsw i64 %28, 9 - %gepdiff = sub nsw i64 %2, %29 - %30 = icmp slt i64 %gepdiff, 13 - br i1 %30, label %.loopexit, label %31 - -31: ; preds = %18 - %.neg8 = select i1 %26, i64 -4, i64 -8 - %.neg = select i1 %21, i64 -8, i64 -7 - %32 = getelementptr i8, ptr %23, i64 %27 - %.neg7 = select i1 %21, i64 -12, i64 -8 - %33 = select i1 %21, i64 12, i64 8 - %34 = getelementptr i8, ptr %32, i64 %33 - %35 = load i8, ptr %34, align 1 - %36 = zext i8 %35 to i64 - %.neg5 = add nsw i64 %2, -10 - %.neg6 = add i64 %.neg5, %.neg - %reass.sub = add i64 %.neg6, %.neg7 - %gepdiff2 = add i64 %reass.sub, %.neg8 - %37 = add nuw nsw i64 %36, 4 - %38 = icmp slt i64 %gepdiff2, %37 +define dso_local noundef range(i64 0, 2) i64 @parse_header(ptr noundef %0, ptr noundef writeonly captures(none) %1, i64 noundef %2) local_unnamed_addr #0 section ".init.text" align 16 { + %4 = getelementptr i8, ptr %0, i64 %2 + %5 = icmp slt i64 %2, 33 + br i1 %5, label %.loopexit, label %6 + +6:; preds = %3 + %7 = getelementptr i8, ptr %0, i64 9 + br label %8 + +8:; preds = %15, %6 + %9 = phi i64 [ 0, %6 ], [ %17, %15 ] + %10 = phi ptr [ %0, %6 ], [ %16, %15 ] + %11 = load i8, ptr %10, align 1 + %12 = getelementptr [9 x i8], ptr @lzop_magic, i64 0, i64 %9 + %13 = load i8, ptr %12, align 1 + %14 = icmp eq i8 %11, %13 + br i1 %14, label %15, label %.loopexit + +15:; preds = %8 + %16 = getelementptr i8, ptr %10, i64 1 + %17 = add nuw nsw i64 %9, 1 + %18 = icmp eq i64 %17, 9 + br i1 %18, label %19, label %8, !llvm.loop !5 + +19:; preds = %15 + %20 = load i16, ptr %7, align 1 + %21 = tail call i16 @llvm.bswap.i16(i16 %20) + %22 = icmp ugt i16 %21, 2367 + %.neg5 = select i1 %22, i64 -8, i64 -7 + %23 = select i1 %22, i64 8, i64 7 + %24 = getelementptr i8, ptr %7, i64 %23 + %25 = load i32, ptr %24, align 1 + %26 = and i32 %25, 524288 + %27 = icmp eq i32 %26, 0 + %.neg = select i1 %27, i64 -4, i64 -8 + %.neg2 = add nsw i64 %2, -9 + %.neg4 = add i64 %.neg2, %.neg5 + %gepdiff = add i64 %.neg4, %.neg + %28 = icmp slt i64 %gepdiff, 13 + br i1 %28, label %.loopexit, label %29 + +29:; preds = %19 + %30 = select i1 %27, i64 4, i64 8 + %31 = getelementptr i8, ptr %24, i64 %30 + %32 = ptrtoint ptr %4 to i64 + %33 = select i1 %22, i64 12, i64 8 + %34 = getelementptr i8, ptr %31, i64 %33 + %35 = getelementptr i8, ptr %34, i64 1 + %36 = load i8, ptr %34, align 1 + %37 = zext i8 %36 to i64 + %38 = ptrtoint ptr %35 to i64 + %39 = sub i64 %32, %38 + %37 = add nuw nsw i64 %37, 4 + %38 = icmp slt i64 %39, %37 br i1 %38, label %.loopexit, label %39 -39: ; preds = %31 - %40 = or disjoint i64 %33, 1 - %41 = add nuw nsw i64 %40, %29 - %42 = add nuw nsw i64 %41, %37 - store i64 %42, ptr %1, align 8 +39: ; preds = %29 + %43 = getelementptr i8, ptr %35, i64 %37 + %44 = ptrtoint ptr %43 to i64 + %45 = ptrtoint ptr %0 to i64 + %46 = sub i64 %44, %45 + store i64 %46, ptr %1, align 8 br label %.loopexit -.loopexit: ; preds = %7, %39, %31, %18, %3 - %43 = phi i64 [ 1, %39 ], [ 0, %3 ], [ 0, %18 ], [ 0, %31 ], [ 0, %7 ] +.loopexit: ; preds = %8, %39, %29, %19, %3 + %43 = phi i64 [ 1, %42 ], [ 0, %3 ], [ 0, %19 ], [ 0, %29 ], [ 0, %8 ] ret i64 %43 } diff --git a/bench/linux/optimized/nf_nat_helper.ll b/bench/linux/optimized/nf_nat_helper.ll index c73cec07771..8caf41c79dc 100644 --- a/bench/linux/optimized/nf_nat_helper.ll +++ b/bench/linux/optimized/nf_nat_helper.ll @@ -149,10 +149,10 @@ define internal fastcc void @mangle_contents(ptr noundef %0, i32 noundef %1, i32 %26 = getelementptr inbounds nuw i8, ptr %0, i64 184 %27 = load i32, ptr %26, align 8 %28 = zext i32 %27 to i64 - %29 = add nuw nsw i64 %20, %18 - %30 = add nuw nsw i64 %29, %24 - %31 = add nuw nsw i64 %30, %16 - %gepdiff = sub nsw i64 %28, %31 + %29 = getelementptr i8, ptr %13, i64 %28 + %30 = ptrtoint ptr %29 to i64 + %31 = ptrtoint ptr %25 to i64 + %gepdiff = sub i64 %30, %31 tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %23, ptr align 1 %25, i64 %gepdiff, i1 false) tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %21, ptr align 1 %4, i64 %22, i1 false) %32 = icmp ugt i32 %5, %3 @@ -161,7 +161,7 @@ define internal fastcc void @mangle_contents(ptr noundef %0, i32 noundef %1, i32 33: ; preds = %11 %34 = sub nuw i32 %5, %3 %35 = tail call ptr @skb_put(ptr noundef %0, i32 noundef %34) #5 - br label %53 + br label %54 36: ; preds = %11 %37 = load i32, ptr %7, align 4 @@ -172,7 +172,7 @@ define internal fastcc void @mangle_contents(ptr noundef %0, i32 noundef %1, i32 tail call void asm sideeffect "414: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 414b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 414) #5, !srcloc !8 tail call void asm sideeffect "1:\09.byte 0x0f, 0x0b\0A.pushsection __bug_table,\22aw\22\0A2:\09.long 1b - .\09# bug_entry::bug_addr\0A\09.long ${0:c} - .\09# bug_entry::file\0A\09.word ${1:c}\09# bug_entry::line\0A\09.word ${2:c}\09# bug_entry::flags\0A\09.org 2b+${3:c}\0A.popsection\0A998:\0A\09.pushsection .discard.reachable\0A\09.long 998b\0A\09.popsection\0A\09", "i,i,i,i,~{dirflag},~{fpsr},~{flags}"(ptr nonnull @.str.1, i32 3061, i32 2305, i64 12) #5, !srcloc !9 tail call void asm sideeffect "415: nop\0A\09.pushsection .discard.instr_end\0A\09.long 415b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 415) #5, !srcloc !10 - br label %53 + br label %54 40: ; preds = %36 %41 = getelementptr inbounds nuw i8, ptr %0, i64 112 @@ -183,54 +183,54 @@ define internal fastcc void @mangle_contents(ptr noundef %0, i32 noundef %1, i32 %45 = getelementptr inbounds nuw i8, ptr %0, i64 200 %46 = load ptr, ptr %45, align 8 %47 = load ptr, ptr %12, align 8 - %48 = ptrtoint ptr %46 to i64 %49 = ptrtoint ptr %47 to i64 - %50 = sub i64 %48, %49 - %51 = trunc i64 %50 to i32 - %52 = add i32 %44, %51 - store i32 %52, ptr %26, align 8 - br label %53 - -53: ; preds = %40, %39, %33 - %54 = getelementptr inbounds nuw i8, ptr %0, i64 104 - %55 = load i64, ptr %54, align 8 - %56 = and i64 %55, -8 - %57 = inttoptr i64 %56 to ptr - %58 = getelementptr inbounds nuw i8, ptr %57, i64 50 - %59 = load i16, ptr %58, align 2 - %60 = icmp eq i16 %59, 2 - %61 = getelementptr inbounds nuw i8, ptr %0, i64 112 - %62 = load i32, ptr %61, align 8 - %63 = trunc i32 %62 to i16 - br i1 %60, label %64, label %75 - -64: ; preds = %53 - %65 = tail call i16 @llvm.bswap.i16(i16 %63) - %66 = load ptr, ptr %12, align 8 - %67 = load i16, ptr %14, align 4 - %68 = zext i16 %67 to i64 - %69 = getelementptr i8, ptr %66, i64 %68 - %70 = getelementptr inbounds nuw i8, ptr %69, i64 2 - store i16 %65, ptr %70, align 2 - %71 = load ptr, ptr %12, align 8 - %72 = load i16, ptr %14, align 4 - %73 = zext i16 %72 to i64 - %74 = getelementptr i8, ptr %71, i64 %73 - tail call void @ip_send_check(ptr noundef %74) #5 - br label %83 - -75: ; preds = %53 - %76 = add i16 %63, -40 - %77 = tail call i16 @llvm.bswap.i16(i16 %76) - %78 = load ptr, ptr %12, align 8 - %79 = load i16, ptr %14, align 4 - %80 = zext i16 %79 to i64 - %81 = getelementptr i8, ptr %78, i64 %80 - %82 = getelementptr inbounds nuw i8, ptr %81, i64 4 - store i16 %77, ptr %82, align 4 - br label %83 - -83: ; preds = %75, %64 + %50 = ptrtoint ptr %48 to i64 + %51 = sub i64 %49, %50 + %52 = trunc i64 %51 to i32 + %53 = add i32 %45, %52 + store i32 %53, ptr %26, align 8 + br label %54 + +54: ; preds = %40, %40, %34 + %55 = getelementptr inbounds nuw i8, ptr %0, i64 104 + %56 = load i64, ptr %55, align 8 + %57 = and i64 %56, -8 + %58 = inttoptr i64 %57 to ptr + %59 = getelementptr inbounds nuw i8, ptr %58, i64 50 + %60 = load i16, ptr %59, align 2 + %61 = icmp eq i16 %60, 2 + %62 = getelementptr inbounds nuw i8, ptr %0, i64 112 + %63 = load i32, ptr %62, align 8 + %64 = trunc i32 %63 to i16 + br i1 %61, label %65, label %76 + +65:; preds = %54 + %66 = tail call i16 @llvm.bswap.i16(i16 %64) + %67 = load ptr, ptr %12, align 8 + %68 = load i16, ptr %14, align 4 + %69 = zext i16 %68 to i64 + %70 = getelementptr i8, ptr %67, i64 %69 + %71 = getelementptr inbounds nuw i8, ptr %70, i64 2 + store i16 %66, ptr %71, align 2 + %72 = load ptr, ptr %12, align 8 + %73 = load i16, ptr %14, align 4 + %74 = zext i16 %73 to i64 + %75 = getelementptr i8, ptr %72, i64 %74 + tail call void @ip_send_check(ptr noundef %75) #5 + br label %84 + +76:; preds = %54 + %77 = add i16 %64, -40 + %78 = tail call i16 @llvm.bswap.i16(i16 %77) + %79 = load ptr, ptr %12, align 8 + %80 = load i16, ptr %14, align 4 + %81 = zext i16 %80 to i64 + %82 = getelementptr i8, ptr %79, i64 %81 + %83 = getelementptr inbounds nuw i8, ptr %82, i64 4 + store i16 %78, ptr %83, align 4 + br label %84 + +84: ; preds = %76, %65 ret void } diff --git a/bench/linux/optimized/zstd_decompress.ll b/bench/linux/optimized/zstd_decompress.ll index 0b3b2023a9a..083ac86b238 100644 --- a/bench/linux/optimized/zstd_decompress.ll +++ b/bench/linux/optimized/zstd_decompress.ll @@ -2117,26 +2117,27 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, 15: ; preds = %3 %16 = getelementptr i8, ptr %1, i64 8 %17 = getelementptr inbounds nuw i8, ptr %0, i64 10264 - %18 = add i64 %2, -8 - %19 = tail call i64 @HUF_readDTableX2_wksp(ptr noundef nonnull %17, ptr noundef %16, i64 noundef %18, ptr noundef %0, i64 noundef 10264) #10 - %20 = icmp ult i64 %19, -119 - %21 = select i1 %20, i64 %19, i64 0 - %22 = getelementptr i8, ptr %16, i64 %21 - br i1 %20, label %23, label %.thread18 - -23: ; preds = %15 + %18 = ptrtoint ptr %13 to i64 + %19 = add i64 %2, -8 + %20 = tail call i64 @HUF_readDTableX2_wksp(ptr noundef nonnull %17, ptr noundef %16, i64 noundef %19, ptr noundef %0, i64 noundef 10264) #10 + %21 = icmp ult i64 %20, -119 + %22 = select i1 %21, i64 %20, i64 0 + %23 = getelementptr i8, ptr %16, i64 %22 + br i1 %21, label %24, label %.thread18 + +24: ; preds = %15 call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %4) #10 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %4, i8 0, i64 64, i1 false), !annotation !11 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10 store i32 31, ptr %5, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #10 store i32 0, ptr %6, align 4, !annotation !11 - %gepdiff = sub i64 %18, %19 - %24 = call i64 @FSE_readNCount(ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef %22, i64 noundef %gepdiff) #10 + %gepdiff = sub i64 %19, %20 + %24 = call i64 @FSE_readNCount(ptr noundef nonnull %4, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef %23, i64 noundef %gepdiff) #10 %25 = icmp ult i64 %24, -119 br i1 %25, label %26, label %.thread -26: ; preds = %23 +26: ; preds = %24 %27 = load i32, ptr %5, align 4 %28 = icmp ugt i32 %27, 31 br i1 %28, label %.thread, label %29 @@ -2146,7 +2147,7 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, %31 = icmp ugt i32 %30, 8 br i1 %31, label %.thread, label %32 -.thread: ; preds = %23, %26, %29 +.thread: ; preds = %24, %26, %29 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10 call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #10 @@ -2156,7 +2157,7 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, %33 = getelementptr inbounds nuw i8, ptr %0, i64 4104 %34 = getelementptr inbounds nuw i8, ptr %0, i64 26664 call void @ZSTD_buildFSETable(ptr noundef nonnull %33, ptr noundef nonnull %4, i32 noundef %27, ptr noundef nonnull @OF_base, ptr noundef nonnull @OF_bits, i32 noundef %30, ptr noundef nonnull %34, i64 noundef 628, i32 noundef 0) #10 - %35 = getelementptr i8, ptr %22, i64 %24 + %35 = getelementptr i8, ptr %23, i64 %24 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10 call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %4) #10 @@ -2166,8 +2167,8 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, store i32 52, ptr %8, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #10 store i32 0, ptr %9, align 4, !annotation !11 - %36 = add i64 %19, %24 - %gepdiff20 = sub i64 %18, %36 + %36 = add i64 %20, %24 + %gepdiff20 = sub i64 %19, %36 %37 = call i64 @FSE_readNCount(ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef %35, i64 noundef %gepdiff20) #10 %38 = icmp ult i64 %37, -119 br i1 %38, label %39, label %.thread15 @@ -2201,8 +2202,8 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, store i32 35, ptr %11, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #10 store i32 0, ptr %12, align 4, !annotation !11 - %48 = add i64 %36, %37 - %gepdiff21 = sub i64 %18, %48 + %49 = ptrtoint ptr %47 to i64 + %gepdiff21 = sub i64 %18, %49 %49 = call i64 @FSE_readNCount(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef %47, i64 noundef %gepdiff21) #10 %50 = icmp ult i64 %49, -119 br i1 %50, label %51, label %.thread17 @@ -2234,19 +2235,18 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, br i1 %60, label %.thread18, label %61 61: ; preds = %57 - %.neg33 = add i64 %2, -20 - %62 = add i64 %48, %49 - %gepdiff22 = sub i64 %.neg33, %62 - %63 = getelementptr inbounds nuw i8, ptr %0, i64 26652 - %64 = load i32, ptr %58, align 1 - %65 = icmp eq i32 %64, 0 - %66 = zext i32 %64 to i64 - %67 = icmp ult i64 %gepdiff22, %66 - %68 = or i1 %65, %67 - br i1 %68, label %.thread18, label %.preheader.preheader - -.preheader.preheader: ; preds = %61 - %69 = getelementptr i8, ptr %58, i64 4 + %64 = ptrtoint ptr %61 to i64 + %65 = sub i64 %18, %64 + %66 = getelementptr inbounds nuw i8, ptr %0, i64 26652 + %67 = load i32, ptr %60, align 1 + %68 = icmp eq i32 %67, 0 + %69 = zext i32 %67 to i64 + %70 = icmp ult i64 %65, %69 + %71 = or i1 %68, %70 + br i1 %71, label %.thread18, label %.preheader.preheader + +.preheader.preheader: ; preds = %63 + %72 = getelementptr i8, ptr %60, i64 4 br label %.preheader 70: ; preds = %.preheader @@ -2254,15 +2254,15 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, %72 = getelementptr i8, ptr %77, i64 4 %73 = icmp eq i32 %71, 0 %74 = zext i32 %71 to i64 - %75 = icmp ult i64 %gepdiff22, %74 + %75 = icmp ult i64 %65, %74 %76 = or i1 %73, %75 br i1 %76, label %83, label %.preheader, !llvm.loop !14 .preheader: ; preds = %.preheader.preheader, %70 - %77 = phi ptr [ %72, %70 ], [ %69, %.preheader.preheader ] - %78 = phi i32 [ %71, %70 ], [ %64, %.preheader.preheader ] - %79 = phi i64 [ %81, %70 ], [ 0, %.preheader.preheader ] - %80 = getelementptr [3 x i32], ptr %63, i64 0, i64 %79 + %77 = phi ptr [ %72, %73 ], [ %72, %.preheader.preheader ] + %78 = phi i32 [ %71, %73 ], [ %67, %.preheader.preheader ] + %79 = phi i64 [ %81, %73 ], [ 0, %.preheader.preheader ] + %80 = getelementptr [3 x i32], ptr %66, i64 0, i64 %79 store i32 %78, ptr %80, align 4 %81 = add nuw nsw i64 %79, 1 %82 = icmp eq i64 %81, 3 @@ -2273,14 +2273,14 @@ define dso_local noundef i64 @ZSTD_loadDEntropy(ptr noundef %0, ptr noundef %1, br i1 %84, label %.thread19, label %.thread18 .thread19: ; preds = %.preheader, %83 - %85 = phi ptr [ %72, %83 ], [ %77, %.preheader ] + %85 = phi ptr [ %72, %86 ], [ %77, %.preheader ] %86 = ptrtoint ptr %85 to i64 %87 = ptrtoint ptr %1 to i64 %88 = sub i64 %86, %87 br label %.thread18 .thread18: ; preds = %61, %.thread17, %.thread15, %.thread, %.thread19, %83, %57, %15, %3 - %89 = phi i64 [ %88, %.thread19 ], [ -30, %83 ], [ -30, %15 ], [ -30, %3 ], [ -30, %57 ], [ -30, %.thread ], [ -30, %.thread15 ], [ -30, %.thread17 ], [ -30, %61 ] + %89 = phi i64 [ %88, %.thread19 ], [ -30, %86 ], [ -30, %15 ], [ -30, %3 ], [ -30, %59 ], [ -30, %.thread ], [ -30, %.thread15 ], [ -30, %.thread17 ], [ -30, %63 ] ret i64 %89 } diff --git a/bench/llvm/optimized/PPCaching.ll b/bench/llvm/optimized/PPCaching.ll index 7e918a923b7..8261093932f 100644 --- a/bench/llvm/optimized/PPCaching.ll +++ b/bench/llvm/optimized/PPCaching.ll @@ -1356,24 +1356,22 @@ define dso_local void @_ZN5clang12Preprocessor26ReplacePreviousCachedTokenEN4llv %11 = tail call noundef ptr @_ZN4llvm15SmallVectorImplIN5clang5TokenEE6insertIPKS2_vEEPS2_S7_T_S8_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull %9, ptr noundef %1, ptr noundef %10) %12 = load ptr, ptr %4, align 8, !tbaa !21 %13 = load i64, ptr %6, align 8, !tbaa !267 - %.idx4 = mul nuw nsw i64 %13, 24 - %14 = getelementptr inbounds nuw i8, ptr %12, i64 %.idx4 + %14 = getelementptr inbounds nuw %"class.clang::Token", ptr %12, i64 %13 %15 = getelementptr inbounds i8, ptr %14, i64 -24 - %.idx5 = mul nuw nsw i64 %2, 24 - %16 = getelementptr inbounds nuw i8, ptr %15, i64 %.idx5 + %16 = getelementptr inbounds nuw %"class.clang::Token", ptr %15, i64 %2 %17 = getelementptr inbounds nuw i8, ptr %16, i64 24 %18 = getelementptr inbounds nuw i8, ptr %0, i64 2896 %19 = load i32, ptr %18, align 8, !tbaa !14 %20 = zext i32 %19 to i64 - %.idx = mul nuw nsw i64 %20, 24 - %21 = getelementptr inbounds nuw i8, ptr %12, i64 %.idx + %21 = getelementptr inbounds nuw %"class.clang::Token", ptr %12, i64 %20 %.not.i.i.i.i.i.i = icmp eq ptr %21, %17 br i1 %.not.i.i.i.i.i.i, label %_ZN4llvm15SmallVectorImplIN5clang5TokenEE5eraseEPKS2_.exit, label %22 22: ; preds = %3 - %23 = add nuw i64 %.idx4, %.idx5 - %gepdiff = sub i64 %.idx, %23 - tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 8 %16, ptr nonnull align 8 %17, i64 %gepdiff, i1 false) + %23 = ptrtoint ptr %21 to i64 + %24 = ptrtoint ptr %17 to i64 + %25 = sub i64 %23, %24 + tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 8 %16, ptr nonnull align 8 %17, i64 %25, i1 false) %.pre.i = load i32, ptr %18, align 8, !tbaa !14 %.pre = load i64, ptr %6, align 8, !tbaa !267 br label %_ZN4llvm15SmallVectorImplIN5clang5TokenEE5eraseEPKS2_.exit diff --git a/bench/oiio/optimized/deepdata.ll b/bench/oiio/optimized/deepdata.ll index a523771dc71..319a159749c 100644 --- a/bench/oiio/optimized/deepdata.ll +++ b/bench/oiio/optimized/deepdata.ll @@ -3589,7 +3589,7 @@ define void @_ZN11OpenImageIO6v3_1_08DeepData11set_samplesEli(ptr noundef nonnul %6 = load i64, ptr %5, align 8 %.not = icmp slt i64 %1, %6 %or.cond = select i1 %4, i1 %.not, i1 false - br i1 %or.cond, label %7, label %67 + br i1 %or.cond, label %7, label %69 7: ; preds = %3 %8 = load ptr, ptr %0, align 8, !tbaa !35 @@ -3599,7 +3599,7 @@ define void @_ZN11OpenImageIO6v3_1_08DeepData11set_samplesEli(ptr noundef nonnul %12 = getelementptr inbounds nuw i8, ptr %8, i64 72 %13 = load ptr, ptr %12, align 8, !tbaa !54 %14 = getelementptr inbounds nuw i32, ptr %13, i64 %1 - br i1 %11, label %15, label %62 + br i1 %11, label %15, label %64 15: ; preds = %7 %16 = load i32, ptr %14, align 4, !tbaa !85 @@ -3630,11 +3630,11 @@ _ZN11OpenImageIO6v3_1_08DeepData14insert_samplesElii.exit: ; preds = %_ZNK11Open %27 = getelementptr inbounds nuw i32, ptr %26, i64 %1 %28 = add i32 %18, %25 store i32 %28, ptr %27, align 4, !tbaa !85 - br label %67 + br label %69 29: ; preds = %15 %30 = icmp slt i32 %2, %16 - br i1 %30, label %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24, label %67 + br i1 %30, label %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24, label %69 _ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24: ; preds = %29 %31 = sub nsw i32 %16, %2 @@ -3667,35 +3667,36 @@ _ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24: ; preds = %29 br i1 %.not.i.i.i.i.i.i27, label %_ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit, label %56 56: ; preds = %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24 - %57 = add i64 %40, %52 - %gepdiff.i28 = sub i64 %46, %57 - tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %50, ptr align 1 %53, i64 %gepdiff.i28, i1 false) - %.pre.i29 = load ptr, ptr %0, align 8, !tbaa !35 - %.phi.trans.insert.i = getelementptr inbounds nuw i8, ptr %.pre.i29, i64 72 - %.pre25.i = load ptr, ptr %.phi.trans.insert.i, align 8, !tbaa !54 - %.phi.trans.insert26.i = getelementptr inbounds nuw i32, ptr %.pre25.i, i64 %1 - %.pre27.i30 = load i32, ptr %.phi.trans.insert26.i, align 4, !tbaa !85 + %57 = ptrtoint ptr %55 to i67 + %58 = ptrtoint ptr %53 to i67 + %59 = sub i64 %57, %58 + tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %50, ptr align 1 %53, i64 %59, i1 false) + %.pre.i28 = load ptr, ptr %0, align 8, !tbaa !35 + %.phi.trans.insert.i = getelementptr inbounds nuw i8, ptr %.pre.i28, i64 72 + %.pre21.i = load ptr, ptr %.phi.trans.insert.i, align 8, !tbaa !54 + %.phi.trans.insert26.i = getelementptr inbounds nuw i32, ptr %.pre21.i, i64 %1 + %.pre23.i = load i32, ptr %.phi.trans.insert22.i, align 4, !tbaa !85 br label %_ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit _ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit: ; preds = %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24, %56 - %58 = phi i32 [ %.pre27.i30, %56 ], [ %16, %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24 ] + %58 = phi i32 [ %.pre27.i, %56 ], [ %16, %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24 ] %59 = phi ptr [ %.pre25.i, %56 ], [ %13, %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i24 ] %60 = getelementptr inbounds nuw i32, ptr %59, i64 %1 %61 = sub i32 %58, %.sroa.speculated.i store i32 %61, ptr %60, align 4, !tbaa !85 - br label %67 + br label %69 -62: ; preds = %7 +67: ; preds = %7 store i32 %2, ptr %14, align 4, !tbaa !85 - %63 = getelementptr inbounds nuw i8, ptr %8, i64 96 - %64 = load ptr, ptr %63, align 8, !tbaa !54 - %65 = getelementptr inbounds nuw i32, ptr %64, i64 %1 - %66 = load i32, ptr %65, align 4, !tbaa !85 - %.sroa.speculated = tail call i32 @llvm.umax.i32(i32 %2, i32 %66) - store i32 %.sroa.speculated, ptr %65, align 4, !tbaa !85 - br label %67 - -67: ; preds = %_ZN11OpenImageIO6v3_1_08DeepData14insert_samplesElii.exit, %_ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit, %29, %3, %62 + %65 = getelementptr inbounds nuw i8, ptr %8, i64 96 + %66 = load ptr, ptr %65, align 8, !tbaa !54 + %67 = getelementptr inbounds nuw i32, ptr %66, i64 %1 + %68 = load i32, ptr %67, align 4, !tbaa !85 + %.sroa.speculated = tail call i32 @llvm.umax.i32(i32 %2, i32 %68) + store i32 %.sroa.speculated, ptr %67, align 4, !tbaa !85 + br label %69 + +69: ; preds = %_ZN11OpenImageIO6v3_1_08DeepData14insert_samplesElii.exit, %_ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit, %29, %3, %64 ret void } @@ -3835,9 +3836,10 @@ _ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit: ; preds = %4 br i1 %.not.i.i.i.i.i, label %_ZSt4copyIN9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEES6_ET0_T_S8_S7_.exit, label %40 40: ; preds = %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit - %41 = add i64 %24, %36 - %gepdiff = sub i64 %30, %41 - tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %34, ptr align 1 %37, i64 %gepdiff, i1 false) + %41 = ptrtoint ptr %39 to i67 + %42 = ptrtoint ptr %37 to i64 + %43 = sub i64 %41, %42 + tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %34, ptr align 1 %37, i64 %43, i1 false) %.pre = load ptr, ptr %0, align 8, !tbaa !35 %.phi.trans.insert = getelementptr inbounds nuw i8, ptr %.pre, i64 72 %.pre25 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !54 @@ -6285,7 +6287,7 @@ define void @_ZN11OpenImageIO6v3_1_08DeepData14merge_overlapsEl(ptr noundef nonn br label %17 17: ; preds = %722, %7 - %.0105 = phi i32 [ 1, %7 ], [ %723, %722 ] + %.0105 = phi i32 [ 1, %7 ], [ %723, %724 ] %18 = load i64, ptr %14, align 8 %.not.i = icmp slt i64 %1, %18 %or.cond.i = select i1 %13, i1 %.not.i, i1 false @@ -7137,9 +7139,10 @@ _ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i: ; preds = %._crit_edge br i1 %.not.i.i.i.i.i.i, label %_ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit, label %505 505: ; preds = %_ZNK11OpenImageIO6v3_1_08DeepData7samplesEl.exit.i - %506 = add i64 %489, %501 - %gepdiff.i = sub i64 %495, %506 - tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %499, ptr align 1 %502, i64 %gepdiff.i, i1 false) + %506 = ptrtoint ptr %504 to i64 + %507 = ptrtoint ptr %502 to i64 + %508 = sub i64 %506, %507 + tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %499, ptr align 1 %502, i64 %508, i1 false) %.pre.i = load ptr, ptr %0, align 8, !tbaa !35 %.phi.trans.insert.i = getelementptr inbounds nuw i8, ptr %.pre.i, i64 72 %.pre25.i = load ptr, ptr %.phi.trans.insert.i, align 8, !tbaa !54 @@ -7156,7 +7159,7 @@ _ZN11OpenImageIO6v3_1_08DeepData13erase_samplesElii.exit: ; preds = %._crit_edge br label %722 511: ; preds = %.lr.ph262, %721 - %indvars.iv264 = phi i64 [ 0, %.lr.ph262 ], [ %indvars.iv.next265, %721 ] + %indvars.iv264 = phi i64 [ 0, %.lr.ph260 ], [ %indvars.iv.next265, %723 ] %512 = load ptr, ptr %0, align 8, !tbaa !35 %513 = getelementptr inbounds nuw i8, ptr %512, i64 192 %514 = load ptr, ptr %513, align 8, !tbaa !38 @@ -7223,8 +7226,8 @@ _ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit.i190: ; preds = %_ZNK11Ope %553 = load i64, ptr %552, align 4 %.sroa.01.0.extract.trunc.i191 = trunc i64 %553 to i8 switch i8 %.sroa.01.0.extract.trunc.i191, label %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 [ - i8 11, label %554 - i8 10, label %556 + i8 11, label %556 + i8 10, label %558 i8 6, label %580 i8 2, label %584 i8 3, label %588 @@ -7235,49 +7238,49 @@ _ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit.i190: ; preds = %_ZNK11Ope i8 9, label %608 ] -554: ; preds = %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit.i190 - %555 = load float, ptr %550, align 4, !tbaa !138 - br label %616 - 556: ; preds = %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit.i190 - %557 = load i16, ptr %550, align 2, !tbaa !140 - %558 = zext i16 %557 to i32 - %559 = shl nuw nsw i32 %558, 13 - %560 = and i32 %559, 268427264 - %.signext.i.i.i192 = sext i16 %557 to i32 - %561 = and i32 %.signext.i.i.i192, -2147483648 - %562 = icmp samesign ugt i32 %560, 8388607 - br i1 %562, label %563, label %570, !prof !143 - -563: ; preds = %556 - %564 = or disjoint i32 %560, %561 - %565 = icmp samesign ult i32 %560, 260046848 - br i1 %565, label %566, label %568, !prof !143 - -566: ; preds = %563 - %567 = add nuw nsw i32 %564, 939524096 + %557 = load float, ptr %550, align 4, !tbaa !138 + br label %618 + +558:; preds = %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit.i190 + %559 = load i16, ptr %552, align 2, !tbaa !140 + %560 = zext i16 %559 to i32 + %561 = shl nuw nsw i32 %560, 13 + %562 = and i32 %561, 268427264 + %.signext.i.i.i192 = sext i16 %559 to i32 + %563 = and i32 %.signext.i.i.i192, -2147483648 + %564 = icmp samesign ugt i32 %562, 8388607 + br i1 %564, label %565, label %572, !prof !143 + +565: ; preds = %558 + %566 = or disjoint i32 %562, %563 + %567 = icmp samesign ult i32 %562, 260046848 + br i1 %567, label %568, label %570, !prof !143 + +568: ; preds = %565 + %569 = add nuw nsw i32 %566, 939524096 br label %_ZNK9Imath_3_14halfcvfEv.exit.i194 -568: ; preds = %563 - %569 = or i32 %564, 2139095040 +568: ; preds = %565 + %569 = or i32 %566, 2139095040 br label %_ZNK9Imath_3_14halfcvfEv.exit.i194 -570: ; preds = %556 - %.not.i.i.i193 = icmp eq i32 %560, 0 +570: ; preds = %558 + %.not.i.i.i193 = icmp eq i32 %562, 0 br i1 %.not.i.i.i193, label %_ZNK9Imath_3_14halfcvfEv.exit.i194, label %571 571: ; preds = %570 - %572 = tail call range(i32 9, 33) i32 @llvm.ctlz.i32(i32 %560, i1 true) + %572 = tail call range(i32 9, 33) i32 @llvm.ctlz.i32(i32 %562, i1 true) %573 = add nsw i32 %572, -8 - %574 = shl i32 %560, %573 - %575 = or i32 %561, %574 + %574 = shl i32 %562, %573 + %575 = or i32 %563, %574 %576 = or i32 %575, 947912704 %577 = shl nuw nsw i32 %573, 23 %578 = sub nuw i32 %576, %577 br label %_ZNK9Imath_3_14halfcvfEv.exit.i194 -_ZNK9Imath_3_14halfcvfEv.exit.i194: ; preds = %571, %570, %568, %566 - %.sroa.0.0.i.i.i195 = phi i32 [ %567, %566 ], [ %569, %568 ], [ %578, %571 ], [ %561, %570 ] +_ZNK9Imath_3_14halfcvfEv.exit.i194: ; preds = %571, %570, %568, %568 + %.sroa.0.0.i.i.i195 = phi i32 [ %569, %568 ], [ %569, %570 ], [ %578, %573 ], [ %563, %572 ] %579 = bitcast i32 %.sroa.0.0.i.i.i195 to float br label %616 @@ -7338,10 +7341,10 @@ _ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196: ; preds = %_ZNK11O %.pre275 = load i32, ptr %11, align 8 br label %616 -616: ; preds = %521, %525, %531, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188, %554, %_ZNK9Imath_3_14halfcvfEv.exit.i194, %580, %584, %588, %592, %596, %600, %604, %608, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 - %617 = phi i32 [ %524, %521 ], [ %524, %525 ], [ %524, %531 ], [ %524, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188 ], [ %524, %608 ], [ %524, %604 ], [ %524, %600 ], [ %524, %596 ], [ %524, %592 ], [ %524, %588 ], [ %524, %584 ], [ %524, %580 ], [ %524, %_ZNK9Imath_3_14halfcvfEv.exit.i194 ], [ %524, %554 ], [ %.pre275, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 ] - %618 = phi i64 [ %522, %521 ], [ %522, %525 ], [ %522, %531 ], [ %522, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188 ], [ %522, %608 ], [ %522, %604 ], [ %522, %600 ], [ %522, %596 ], [ %522, %592 ], [ %522, %588 ], [ %522, %584 ], [ %522, %580 ], [ %522, %_ZNK9Imath_3_14halfcvfEv.exit.i194 ], [ %522, %554 ], [ %.pre274, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 ] - %.0.i184.ph = phi float [ 0.000000e+00, %521 ], [ 0.000000e+00, %525 ], [ 0.000000e+00, %531 ], [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188 ], [ %611, %608 ], [ %607, %604 ], [ %603, %600 ], [ %599, %596 ], [ %595, %592 ], [ %591, %588 ], [ %587, %584 ], [ %583, %580 ], [ %579, %_ZNK9Imath_3_14halfcvfEv.exit.i194 ], [ %555, %554 ], [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 ] +616: ; preds = %521, %525, %531, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188, %556, %_ZNK9Imath_3_14halfcvfEv.exit.i194, %580, %584, %588, %592, %596, %600, %604, %608, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 + %617 = phi i32 [ %524, %523 ], [ %526, %527 ], [ %526, %533 ], [ %524, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188 ], [ %524, %610 ], [ %526, %606 ], [ %526, %602 ], [ %526, %598 ], [ %526, %594 ], [ %526, %590 ], [ %526, %586 ], [ %526, %582 ], [ %524, %_ZNK9Imath_3_14halfcvfEv.exit.i194 ], [ %524, %556 ], [ %.pre275, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 ] + %618 = phi i64 [ %522, %523 ], [ %524, %527 ], [ %524, %533 ], [ %522, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188 ], [ %522, %610 ], [ %524, %606 ], [ %524, %602 ], [ %524, %598 ], [ %524, %594 ], [ %524, %590 ], [ %524, %586 ], [ %524, %582 ], [ %522, %_ZNK9Imath_3_14halfcvfEv.exit.i194 ], [ %522, %556 ], [ %.pre274, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 ] + %.0.i184.ph = phi float [ 0.000000e+00, %523 ], [ 0.000000e+00, %527 ], [ 0.000000e+00, %533 ], [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i188 ], [ %611, %610 ], [ %607, %606 ], [ %605, %602 ], [ %599, %598 ], [ %597, %594 ], [ %593, %590 ], [ %589, %586 ], [ %585, %582 ], [ %579, %_ZNK9Imath_3_14halfcvfEv.exit.i194 ], [ %557, %556 ], [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i196 ] %.inv = fcmp oge float %.0.i184.ph, 0.000000e+00 %.0.i120250 = select i1 %.inv, float %.0.i184.ph, float 0.000000e+00 %619 = fcmp ogt float %.0.i120250, 1.000000e+00 @@ -7452,7 +7455,7 @@ _ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit.i207: ; preds = %_ZNK11Ope br label %_ZNK9Imath_3_14halfcvfEv.exit.i211 _ZNK9Imath_3_14halfcvfEv.exit.i211: ; preds = %669, %668, %666, %664 - %.sroa.0.0.i.i.i212 = phi i32 [ %665, %664 ], [ %667, %666 ], [ %676, %669 ], [ %659, %668 ] + %.sroa.0.0.i.i.i212 = phi i32 [ %667, %666 ], [ %669, %668 ], [ %678, %671 ], [ %659, %670 ] %677 = bitcast i32 %.sroa.0.0.i.i.i212 to float br label %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 @@ -7512,8 +7515,8 @@ _ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i213: ; preds = %_ZNK11O br label %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 _ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214: ; preds = %520, %616, %621, %623, %629, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i205, %652, %_ZNK9Imath_3_14halfcvfEv.exit.i211, %678, %682, %686, %690, %694, %698, %702, %706, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i213 - %.1.i121253 = phi float [ %.1.i121251, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i213 ], [ %.1.i121251, %652 ], [ %.1.i121251, %_ZNK9Imath_3_14halfcvfEv.exit.i211 ], [ %.1.i121251, %678 ], [ %.1.i121251, %682 ], [ %.1.i121251, %686 ], [ %.1.i121251, %690 ], [ %.1.i121251, %694 ], [ %.1.i121251, %698 ], [ %.1.i121251, %702 ], [ %.1.i121251, %706 ], [ %.1.i121251, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i205 ], [ %.1.i121251, %629 ], [ %.1.i121251, %623 ], [ %.1.i121251, %621 ], [ %.1.i121251, %616 ], [ 0.000000e+00, %520 ] - %.0.i201 = phi float [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i213 ], [ %653, %652 ], [ %677, %_ZNK9Imath_3_14halfcvfEv.exit.i211 ], [ %681, %678 ], [ %685, %682 ], [ %689, %686 ], [ %693, %690 ], [ %697, %694 ], [ %701, %698 ], [ %705, %702 ], [ %709, %706 ], [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i205 ], [ 0.000000e+00, %629 ], [ 0.000000e+00, %623 ], [ 0.000000e+00, %621 ], [ 0.000000e+00, %616 ], [ 0.000000e+00, %520 ] + %.1.i121253 = phi float [ %.1.i121251, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i213 ], [ %.1.i121251, %654 ], [ %.1.i121251, %_ZNK9Imath_3_14halfcvfEv.exit.i211 ], [ %.1.i121251, %680 ], [ %.1.i121251, %684 ], [ %.1.i121251, %688 ], [ %.1.i121251, %692 ], [ %.1.i121251, %696 ], [ %.1.i121251, %700 ], [ %.1.i121251, %704 ], [ %.1.i121251, %708 ], [ %.1.i121251, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i205 ], [ %.1.i121251, %631 ], [ %.1.i121251, %625 ], [ %.1.i121251, %623 ], [ %.1.i121251, %618 ], [ 0.000000e+00, %522 ] + %.0.i201 = phi float [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData11channeltypeEi.exit24.i213 ], [ %653, %654 ], [ %677, %_ZNK9Imath_3_14halfcvfEv.exit.i211 ], [ %681, %680 ], [ %687, %684 ], [ %691, %688 ], [ %695, %692 ], [ %699, %696 ], [ %703, %700 ], [ %707, %704 ], [ %711, %708 ], [ 0.000000e+00, %_ZNK11OpenImageIO6v3_1_08DeepData8data_ptrElii.exit.i205 ], [ 0.000000e+00, %631 ], [ 0.000000e+00, %625 ], [ 0.000000e+00, %623 ], [ 0.000000e+00, %618 ], [ 0.000000e+00, %522 ] %.inv254 = fcmp oge float %.0.i201, 0.000000e+00 %.0.i = select i1 %.inv254, float %.0.i201, float 0.000000e+00 %714 = fcmp ogt float %.0.i, 1.000000e+00 @@ -7521,8 +7524,8 @@ _ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214: ; preds = %520, %616, br label %.thread .thread: ; preds = %518, %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 - %715 = phi float [ %.1.i121253, %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 ], [ 1.000000e+00, %518 ] - %716 = phi float [ %.1.i, %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 ], [ 1.000000e+00, %518 ] + %715 = phi float [ %.1.i121253, %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 ], [ 1.000000e+00, %520 ] + %716 = phi float [ %.1.i, %_ZNK11OpenImageIO6v3_1_08DeepData10deep_valueElii.exit214 ], [ 1.000000e+00, %520 ] %717 = fadd float %715, %716 %718 = fneg float %715 %719 = tail call float @llvm.fmuladd.f32(float %718, float %716, float %717) diff --git a/bench/openssl/optimized/cipher_aes_cbc_hmac_sha1_hw.ll b/bench/openssl/optimized/cipher_aes_cbc_hmac_sha1_hw.ll index 49e51f44904..376c2a4a1e2 100644 --- a/bench/openssl/optimized/cipher_aes_cbc_hmac_sha1_hw.ll +++ b/bench/openssl/optimized/cipher_aes_cbc_hmac_sha1_hw.ll @@ -339,7 +339,7 @@ sha1_update.exit405: ; preds = %121, %.thread445 %149 = and i64 %148, -32 %150 = inttoptr i64 %149 to ptr %.not372 = icmp eq i64 %7, -1 - br i1 %.not372, label %456, label %151 + br i1 %.not372, label %460, label %151 151: ; preds = %146 %152 = getelementptr inbounds nuw i8, ptr %0, i64 724 @@ -538,9 +538,9 @@ sha1_update.exit423: ; preds = %266, %267 br label %272 272: ; preds = %sha1_update.exit423, %sha1_update.exit414 - %.0350 = phi i64 [ %271, %sha1_update.exit423 ], [ %196, %sha1_update.exit414 ] - %.1342 = phi i64 [ %270, %sha1_update.exit423 ], [ %233, %sha1_update.exit414 ] - %.1339 = phi ptr [ %269, %sha1_update.exit423 ], [ %.0338, %sha1_update.exit414 ] + %.0350 = phi i64 [ %271, %sha1_update.exit421 ], [ %196, %sha1_update.exit412 ] + %.1342 = phi i64 [ %270, %sha1_update.exit421 ], [ %233, %sha1_update.exit412 ] + %.1339 = phi ptr [ %269, %sha1_update.exit421 ], [ %.0338, %sha1_update.exit412 ] %273 = getelementptr inbounds nuw i8, ptr %0, i64 716 %274 = load i32, ptr %273, align 4, !tbaa !27 %.0350.tr = trunc i64 %.0350 to i32 @@ -566,8 +566,8 @@ sha1_update.exit423: ; preds = %266, %267 br label %289 289: ; preds = %.lr.ph466, %336 - %.0351464 = phi i64 [ 0, %.lr.ph466 ], [ %337, %336 ] - %.0356463 = phi i32 [ %282, %.lr.ph466 ], [ %.1357, %336 ] + %.0351464 = phi i64 [ 0, %.lr.ph463 ], [ %337, %336 ] + %.0356463 = phi i32 [ %282, %.lr.ph463 ], [ %.1357, %336 ] %290 = getelementptr inbounds nuw i8, ptr %.1339, i64 %.0351464 %291 = load i8, ptr %290, align 1, !tbaa !8 %292 = zext i8 %291 to i64 @@ -652,7 +652,7 @@ sha1_update.exit423: ; preds = %266, %267 br i1 %344, label %._crit_edge473.thread, label %380 ._crit_edge473.thread: ; preds = %._crit_edge467, %._crit_edge473 - %.1352.lcssa486 = phi i64 [ %343, %._crit_edge473 ], [ %.1342, %._crit_edge467 ] + %.1352.lcssa486 = phi i64 [ %343, %._crit_edge470 ], [ %.1342, %._crit_edge464 ] %345 = add i64 %.0350, 8 %346 = sub i64 %345, %.1352.lcssa486 %.neg = ashr i64 %346, 63 @@ -702,7 +702,7 @@ sha1_update.exit423: ; preds = %266, %267 br label %380 380: ; preds = %._crit_edge473.thread, %._crit_edge473 - %.2353 = phi i64 [ %379, %._crit_edge473.thread ], [ %343, %._crit_edge473 ] + %.2353 = phi i64 [ %379, %._crit_edge470.thread ], [ %343, %._crit_edge470 ] %381 = getelementptr inbounds nuw i8, ptr %0, i64 784 store i32 %277, ptr %381, align 4, !tbaa !8 call void @sha1_block_data_order(ptr noundef nonnull %8, ptr noundef nonnull %152, i64 noundef 1) #9 @@ -772,107 +772,108 @@ sha1_update.exit423: ; preds = %266, %267 sha1_update.exit432: ; preds = %415, %.thread453 %423 = call i32 @SHA1_Final(ptr noundef nonnull %150, ptr noundef nonnull %8) #9 - %424 = getelementptr i8, ptr %.1339, i64 %.1342 - %425 = getelementptr i8, ptr %424, i64 19 - %426 = zext nneg i32 %185 to i64 - %427 = sub nsw i64 0, %426 - %428 = getelementptr inbounds i8, ptr %425, i64 %427 - %429 = getelementptr inbounds i8, ptr %428, i64 -20 - %.neg376 = add nuw nsw i64 %426, 1 - %.neg377 = add i64 %.neg376, %.0350 - %gepdiff = sub i64 %.neg377, %.1342 - %430 = add nuw nsw i32 %185, 20 - %431 = zext nneg i32 %430 to i64 - br label %432 - -432: ; preds = %sha1_update.exit432, %432 - %.3477 = phi i64 [ 0, %sha1_update.exit432 ], [ %455, %432 ] - %.1355476 = phi i64 [ 0, %sha1_update.exit432 ], [ %454, %432 ] - %.2358475 = phi i32 [ 0, %sha1_update.exit432 ], [ %451, %432 ] - %433 = getelementptr inbounds nuw i8, ptr %429, i64 %.3477 - %434 = load i8, ptr %433, align 1, !tbaa !8 - %435 = zext i8 %434 to i32 - %436 = sub i64 %.3477, %gepdiff - %437 = trunc i64 %436 to i32 - %438 = add i32 %437, -20 - %439 = xor i32 %193, %435 - %isneg = icmp slt i32 %438, 0 - %440 = select i1 %isneg, i32 0, i32 %439 - %441 = xor i64 %.3477, -1 - %442 = add i64 %gepdiff, %441 - %443 = trunc i64 %442 to i32 - %444 = and i32 %438, %443 - %445 = getelementptr inbounds nuw [52 x i8], ptr %150, i64 0, i64 %.1355476 - %446 = load i8, ptr %445, align 1, !tbaa !8 - %447 = xor i8 %446, %434 - %448 = zext i8 %447 to i32 - %isneg379 = icmp slt i32 %444, 0 - %449 = select i1 %isneg379, i32 %448, i32 0 - %450 = or i32 %440, %.2358475 - %451 = or i32 %450, %449 - %452 = lshr i32 %444, 31 - %453 = zext nneg i32 %452 to i64 - %454 = add i64 %.1355476, %453 - %455 = add nuw nsw i64 %.3477, 1 - %exitcond484.not = icmp eq i64 %455, %431 - br i1 %exitcond484.not, label %sha1_update.exit441, label %432, !llvm.loop !43 - -456: ; preds = %146 - %457 = getelementptr inbounds nuw i8, ptr %0, i64 192 - %458 = getelementptr inbounds nuw i8, ptr %0, i64 32 - call void @aesni_cbc_encrypt(ptr noundef %2, ptr noundef %1, i64 noundef %3, ptr noundef nonnull %457, ptr noundef nonnull %458, i32 noundef 0) #9 - %459 = load i32, ptr %9, align 4, !tbaa !28 - %.not.i433 = icmp eq i32 %459, 0 - br i1 %.not.i433, label %466, label %460 - -460: ; preds = %456 - %461 = zext i32 %459 to i64 - %462 = sub nsw i64 64, %461 - %spec.select.i434 = call i64 @llvm.umin.i64(i64 %3, i64 %462) - %463 = call i32 @SHA1_Update(ptr noundef nonnull %8, ptr noundef %1, i64 noundef %spec.select.i434) #9 - %464 = getelementptr inbounds nuw i8, ptr %1, i64 %spec.select.i434 - %465 = sub i64 %3, %spec.select.i434 - br label %466 - -466: ; preds = %460, %456 - %.033.i435 = phi i64 [ %465, %460 ], [ %3, %456 ] - %.032.i436 = phi ptr [ %464, %460 ], [ %1, %456 ] - %467 = and i64 %.033.i435, 63 - %468 = and i64 %.033.i435, -64 - %.not39.i437 = icmp eq i64 %468, 0 - br i1 %.not39.i437, label %484, label %469 - -469: ; preds = %466 - %470 = lshr i64 %.033.i435, 6 - call void @sha1_block_data_order(ptr noundef nonnull %8, ptr noundef %.032.i436, i64 noundef %470) #9 - %471 = getelementptr inbounds nuw i8, ptr %.032.i436, i64 %468 - %472 = lshr i64 %.033.i435, 29 - %473 = getelementptr inbounds nuw i8, ptr %0, i64 720 - %474 = load i32, ptr %473, align 4, !tbaa !24 - %475 = trunc i64 %472 to i32 - %476 = add i32 %474, %475 - store i32 %476, ptr %473, align 4, !tbaa !24 - %477 = getelementptr inbounds nuw i8, ptr %0, i64 716 - %478 = load i32, ptr %477, align 4, !tbaa !25 - %.tr.i438 = trunc i64 %468 to i32 - %479 = shl i32 %.tr.i438, 3 + %424 = getelementptr inbounds nuw i8, ptr %.1339, i64 %.0350 + %425 = getelementptr i8, ptr %.1339, i64 %.1342 + %426 = getelementptr i8, ptr %425, i64 19 + %427 = zext nneg i32 %185 to i64 + %428 = sub nsw i64 0, %427 + %429 = getelementptr inbounds i8, ptr %426, i64 %428 + %430 = getelementptr inbounds i8, ptr %429, i64 -20 + %431 = ptrtoint ptr %424 to i64 + %432 = ptrtoint ptr %430 to i64 + %433 = sub i64 %431, %432 + %434 = add nuw nsw i32 %185, 20 + %435 = zext nneg i32 %434 to i64 + br label %436 + +436: ; preds = %sha1_update.exit432, %436 + %.1355476 = phi i64 [ 0, %sha1_update.exit430 ], [ %459, %436 ] + %.2358475 = phi i64 [ 0, %sha1_update.exit430 ], [ %458, %436 ] + %.2358472 = phi i32 [ 0, %sha1_update.exit430 ], [ %455, %436 ] + %437 = getelementptr inbounds nuw i8, ptr %430, i64 %.1355476 + %438 = load i8, ptr %437, align 1, !tbaa !8 + %439 = zext i8 %438 to i32 + %440 = sub i64 %.3474, %433 + %441 = trunc i64 %440 to i32 + %442 = add i32 %441, -20 + %443 = xor i32 %193, %439 + %isneg = icmp slt i32 %442, 0 + %444 = select i1 %isneg, i32 0, i32 %443 + %445 = xor i64 %.3474, -1 + %446 = add i64 %433, %445 + %447 = trunc i64 %446 to i32 + %448 = and i32 %442, %447 + %449 = getelementptr inbounds nuw [52 x i8], ptr %150, i64 0, i64 %.2358475 + %450 = load i8, ptr %449, align 1, !tbaa !8 + %451 = xor i8 %450, %438 + %452 = zext i8 %451 to i32 + %isneg377 = icmp slt i32 %448, 0 + %453 = select i1 %isneg377, i32 %452, i32 0 + %451 = or i32 %444, %.2358472 + %455 = or i32 %454, %453 + %456 = lshr i32 %448, 31 + %457 = zext nneg i32 %456 to i64 + %455 = add i64 %.1355473, %457 + %459 = add nuw nsw i64 %.1355476, 1 + %exitcond481.not = icmp eq i64 %459, %435 + br i1 %exitcond481.not, label %sha1_update.exit439, label %436, !llvm.loop !43 + +460: ; preds = %146 + %458 = getelementptr inbounds nuw i8, ptr %0, i64 192 + %462 = getelementptr inbounds nuw i8, ptr %0, i64 32 + call void @aesni_cbc_encrypt(ptr noundef %2, ptr noundef %1, i64 noundef %3, ptr noundef nonnull %461, ptr noundef nonnull %462, i32 noundef 0) #9 + %463 = load i32, ptr %9, align 4, !tbaa !28 + %.not.i431 = icmp eq i32 %463, 0 + br i1 %.not.i431, label %470, label %464 + +464:; preds = %460 + %465 = zext i32 %463 to i64 + %466 = sub nsw i64 64, %465 + %463 = call i64 @llvm.umin.i64(i64 %3, i64 %466) + %467 = call i32 @SHA1_Update(ptr noundef nonnull %8, ptr noundef %1, i64 noundef %spec.select.i432) #9 + %468 = getelementptr inbounds nuw i8, ptr %1, i64 %spec.select.i432 + %469 = sub i64 %3, %463 + br label %470 + +470: ; preds = %464, %460 + %.032.i436 = phi i64 [ %469, %464 ], [ %3, %460 ] + %.032.i434 = phi ptr [ %468, %464 ], [ %1, %460 ] + %468 = and i64 %.033.i433, 63 + %472 = and i64 %.032.i436, -64 + %.not39.i435 = icmp eq i64 %472, 0 + br i1 %.not39.i435, label %488, label %473 + +473:; preds = %470 + %474 = lshr i64 %.032.i436, 6 + call void @sha1_block_data_order(ptr noundef nonnull %8, ptr noundef %.032.i434, i64 noundef %474) #9 + %475 = getelementptr inbounds nuw i8, ptr %.032.i434, i64 %472 + %476 = lshr i64 %.033.i433, 29 + %477 = getelementptr inbounds nuw i8, ptr %0, i64 720 + %478 = load i32, ptr %477, align 4, !tbaa !24 + %479 = trunc i64 %476 to i32 %480 = add i32 %478, %479 - store i32 %480, ptr %477, align 4, !tbaa !25 - %481 = icmp ult i32 %480, %479 - br i1 %481, label %482, label %484 - -482: ; preds = %469 - %483 = add i32 %476, 1 - store i32 %483, ptr %473, align 4, !tbaa !24 - br label %484 - -484: ; preds = %482, %469, %466 - %.1.i439 = phi ptr [ %471, %482 ], [ %471, %469 ], [ %.032.i436, %466 ] - %.not40.i440 = icmp eq i64 %467, 0 + store i32 %480, ptr %477, align 4, !tbaa !24 + %481 = getelementptr inbounds nuw i8, ptr %0, i64 716 + %482 = load i32, ptr %481, align 4, !tbaa !25 + %.tr.i436 = trunc i64 %472 to i32 + %483 = shl i32 %.tr.i436, 3 + %483 = add i32 %482, %483 + store i32 %483, ptr %481, align 4, !tbaa !25 + %485 = icmp ult i32 %484, %483 + br i1 %485, label %486, label %488 + +486: ; preds = %473 + %487 = add i32 %480, 1 + store i32 %487, ptr %477, align 4, !tbaa !24 + br label %488 + +484: ; preds = %486, %473, %470 + %.1.i439 = phi ptr [ %475, %486 ], [ %475, %473 ], [ %.032.i434, %470 ] + %.not40.i440 = icmp eq i64 %471, 0 br i1 %.not40.i440, label %sha1_update.exit441.thread, label %485 485: ; preds = %484 - %486 = call i32 @SHA1_Update(ptr noundef nonnull %8, ptr noundef %.1.i439, i64 noundef %467) #9 + %486 = call i32 @SHA1_Update(ptr noundef nonnull %8, ptr noundef %.1.i439, i64 noundef %471) #9 br label %sha1_update.exit441.thread sha1_update.exit441.thread: ; preds = %485, %484 @@ -883,15 +884,15 @@ sha1_update.exit441.thread459: ; preds = %165, %172 call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %5) #9 br label %488 -sha1_update.exit441: ; preds = %432 - %.inv = icmp slt i32 %451, 1 +sha1_update.exit441: ; preds = %436 + %.inv = icmp slt i32 %455, 1 %narrow = select i1 %.inv, i1 %186, i1 false %487 = zext i1 %narrow to i32 call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %5) #9 br label %488 488: ; preds = %140, %._crit_edge, %sha1_update.exit441.thread, %sha1_update.exit441, %sha1_update.exit441.thread459, %20, %4 - %.0 = phi i32 [ %487, %sha1_update.exit441 ], [ 0, %4 ], [ 0, %20 ], [ 0, %sha1_update.exit441.thread459 ], [ 1, %sha1_update.exit441.thread ], [ 1, %._crit_edge ], [ 1, %140 ] + %.0 = phi i32 [ %487, %sha1_update.exit439 ], [ 0, %4 ], [ 0, %20 ], [ 0, %sha1_update.exit439.thread457 ], [ 1, %sha1_update.exit439.thread ], [ 1, %._crit_edge ], [ 1, %140 ] ret i32 %.0 } diff --git a/bench/openssl/optimized/cipher_aes_cbc_hmac_sha256_hw.ll b/bench/openssl/optimized/cipher_aes_cbc_hmac_sha256_hw.ll index 4267eb11b4a..e225cd4a64d 100644 --- a/bench/openssl/optimized/cipher_aes_cbc_hmac_sha256_hw.ll +++ b/bench/openssl/optimized/cipher_aes_cbc_hmac_sha256_hw.ll @@ -377,7 +377,7 @@ sha256_update.exit446: ; preds = %133, %.thread486 %164 = getelementptr inbounds nuw i8, ptr %0, i64 32 call void @aesni_cbc_encrypt(ptr noundef %2, ptr noundef %1, i64 noundef %3, ptr noundef nonnull %163, ptr noundef nonnull %164, i32 noundef 0) #8 %.not409 = icmp eq i64 %7, -1 - br i1 %.not409, label %514, label %165 + br i1 %.not409, label %518, label %165 165: ; preds = %158 %166 = getelementptr inbounds nuw i8, ptr %0, i64 768 @@ -563,9 +563,9 @@ sha256_update.exit464: ; preds = %273, %274 br label %279 279: ; preds = %sha256_update.exit464, %sha256_update.exit455 - %.0387 = phi i64 [ %278, %sha256_update.exit464 ], [ %203, %sha256_update.exit455 ] - %.0378 = phi i64 [ %277, %sha256_update.exit464 ], [ %240, %sha256_update.exit455 ] - %.0377 = phi ptr [ %276, %sha256_update.exit464 ], [ %182, %sha256_update.exit455 ] + %.0387 = phi i64 [ %278, %sha256_update.exit462 ], [ %203, %sha256_update.exit453 ] + %.0378 = phi i64 [ %277, %sha256_update.exit462 ], [ %240, %sha256_update.exit453 ] + %.0377 = phi ptr [ %276, %sha256_update.exit462 ], [ %182, %sha256_update.exit453 ] %280 = getelementptr inbounds nuw i8, ptr %0, i64 760 %281 = load i32, ptr %280, align 8, !tbaa !28 %.0387.tr = trunc i64 %.0387 to i32 @@ -597,8 +597,8 @@ sha256_update.exit464: ; preds = %273, %274 br label %302 302: ; preds = %.lr.ph506, %361 - %.0388504 = phi i64 [ 0, %.lr.ph506 ], [ %362, %361 ] - %.0393503 = phi i32 [ %292, %.lr.ph506 ], [ %.1394, %361 ] + %.0388504 = phi i64 [ 0, %.lr.ph503 ], [ %362, %361 ] + %.0393503 = phi i32 [ %292, %.lr.ph503 ], [ %.1394, %361 ] %303 = getelementptr inbounds nuw i8, ptr %.0377, i64 %.0388504 %304 = load i8, ptr %303, align 1, !tbaa !18 %305 = zext i8 %304 to i64 @@ -698,7 +698,7 @@ sha256_update.exit464: ; preds = %273, %274 br i1 %369, label %._crit_edge513.thread, label %420 ._crit_edge513.thread: ; preds = %._crit_edge507, %._crit_edge513 - %.1389.lcssa526 = phi i64 [ %368, %._crit_edge513 ], [ %.0378, %._crit_edge507 ] + %.1389.lcssa526 = phi i64 [ %368, %._crit_edge510 ], [ %.0378, %._crit_edge504 ] %370 = add i64 %.0387, 8 %371 = sub i64 %370, %.1389.lcssa526 %.neg = ashr i64 %371, 63 @@ -766,7 +766,7 @@ sha256_update.exit464: ; preds = %273, %274 br label %420 420: ; preds = %._crit_edge513.thread, %._crit_edge513 - %.2390 = phi i64 [ %419, %._crit_edge513.thread ], [ %368, %._crit_edge513 ] + %.2390 = phi i64 [ %419, %._crit_edge510.thread ], [ %368, %._crit_edge510 ] %421 = getelementptr inbounds nuw i8, ptr %0, i64 828 store i32 %284, ptr %421, align 4, !tbaa !18 call void @sha256_block_data_order(ptr noundef nonnull %8, ptr noundef nonnull %166, i64 noundef 1) #8 @@ -860,119 +860,120 @@ sha256_update.exit464: ; preds = %273, %274 sha256_update.exit473: ; preds = %473, %.thread494 %481 = call i32 @SHA256_Final(ptr noundef nonnull %162, ptr noundef nonnull %8) #8 - %482 = getelementptr i8, ptr %.0377, i64 %.0378 - %483 = getelementptr i8, ptr %482, i64 31 - %484 = zext nneg i32 %192 to i64 - %485 = sub nsw i64 0, %484 - %486 = getelementptr inbounds i8, ptr %483, i64 %485 - %487 = getelementptr inbounds i8, ptr %486, i64 -32 - %.neg413 = add nuw nsw i64 %484, 1 - %.neg414 = add i64 %.neg413, %.0387 - %gepdiff = sub i64 %.neg414, %.0378 - %488 = add nuw nsw i32 %192, 32 - %489 = zext nneg i32 %488 to i64 - br label %490 - -490: ; preds = %sha256_update.exit473, %490 - %.3517 = phi i64 [ 0, %sha256_update.exit473 ], [ %513, %490 ] - %.1392516 = phi i64 [ 0, %sha256_update.exit473 ], [ %512, %490 ] - %.2395515 = phi i32 [ 0, %sha256_update.exit473 ], [ %509, %490 ] - %491 = getelementptr inbounds nuw i8, ptr %487, i64 %.3517 - %492 = load i8, ptr %491, align 1, !tbaa !18 - %493 = zext i8 %492 to i32 - %494 = sub i64 %.3517, %gepdiff - %495 = trunc i64 %494 to i32 - %496 = add i32 %495, -32 - %497 = xor i32 %200, %493 - %isneg = icmp slt i32 %496, 0 - %498 = select i1 %isneg, i32 0, i32 %497 - %499 = xor i64 %.3517, -1 - %500 = add i64 %gepdiff, %499 - %501 = trunc i64 %500 to i32 - %502 = and i32 %496, %501 - %503 = getelementptr inbounds nuw [96 x i8], ptr %162, i64 0, i64 %.1392516 - %504 = load i8, ptr %503, align 1, !tbaa !18 - %505 = xor i8 %504, %492 - %506 = zext i8 %505 to i32 - %isneg416 = icmp slt i32 %502, 0 - %507 = select i1 %isneg416, i32 %506, i32 0 - %508 = or i32 %498, %.2395515 - %509 = or i32 %508, %507 - %510 = lshr i32 %502, 31 - %511 = zext nneg i32 %510 to i64 - %512 = add i64 %.1392516, %511 - %513 = add nuw nsw i64 %.3517, 1 - %exitcond524.not = icmp eq i64 %513, %489 - br i1 %exitcond524.not, label %sha256_update.exit482, label %490, !llvm.loop !42 - -514: ; preds = %158 - %515 = load i32, ptr %9, align 4, !tbaa !29 - %.not.i474 = icmp eq i32 %515, 0 - br i1 %.not.i474, label %522, label %516 - -516: ; preds = %514 - %517 = zext i32 %515 to i64 - %518 = sub nsw i64 64, %517 - %spec.select.i475 = call i64 @llvm.umin.i64(i64 %3, i64 %518) - %519 = call i32 @SHA256_Update(ptr noundef nonnull %8, ptr noundef %1, i64 noundef %spec.select.i475) #8 - %520 = getelementptr inbounds nuw i8, ptr %1, i64 %spec.select.i475 - %521 = sub i64 %3, %spec.select.i475 - br label %522 - -522: ; preds = %516, %514 - %.033.i476 = phi i64 [ %521, %516 ], [ %3, %514 ] - %.032.i477 = phi ptr [ %520, %516 ], [ %1, %514 ] - %523 = and i64 %.033.i476, 63 - %524 = and i64 %.033.i476, -64 - %.not39.i478 = icmp eq i64 %524, 0 - br i1 %.not39.i478, label %540, label %525 - -525: ; preds = %522 - %526 = lshr i64 %.033.i476, 6 - call void @sha256_block_data_order(ptr noundef nonnull %8, ptr noundef %.032.i477, i64 noundef %526) #8 - %527 = getelementptr inbounds nuw i8, ptr %.032.i477, i64 %524 - %528 = lshr i64 %.033.i476, 29 - %529 = getelementptr inbounds nuw i8, ptr %0, i64 764 - %530 = load i32, ptr %529, align 4, !tbaa !25 - %531 = trunc i64 %528 to i32 - %532 = add i32 %530, %531 - store i32 %532, ptr %529, align 4, !tbaa !25 - %533 = getelementptr inbounds nuw i8, ptr %0, i64 760 - %534 = load i32, ptr %533, align 4, !tbaa !26 - %.tr.i479 = trunc i64 %524 to i32 - %535 = shl i32 %.tr.i479, 3 + %482 = getelementptr inbounds nuw i8, ptr %.0377, i64 %.0387 + %483 = getelementptr i8, ptr %.0377, i64 %.0378 + %484 = getelementptr i8, ptr %483, i64 31 + %485 = zext nneg i32 %192 to i64 + %486 = sub nsw i64 0, %485 + %487 = getelementptr inbounds i8, ptr %484, i64 %486 + %488 = getelementptr inbounds i8, ptr %487, i64 -32 + %489 = ptrtoint ptr %482 to i64 + %490 = ptrtoint ptr %488 to i64 + %491 = sub i64 %489, %490 + %492 = add nuw nsw i32 %192, 32 + %493 = zext nneg i32 %492 to i64 + br label %494 + +494: ; preds = %sha256_update.exit471, %494 + %.1392516 = phi i64 [ 0, %sha256_update.exit471 ], [ %517, %494 ] + %.2395515 = phi i64 [ 0, %sha256_update.exit471 ], [ %516, %494 ] + %.2395512 = phi i32 [ 0, %sha256_update.exit471 ], [ %513, %494 ] + %495 = getelementptr inbounds nuw i8, ptr %488, i64 %.1392516 + %496 = load i8, ptr %495, align 1, !tbaa !18 + %497 = zext i8 %496 to i32 + %498 = sub i64 %.3514, %491 + %499 = trunc i64 %498 to i32 + %500 = add i32 %499, -32 + %501 = xor i32 %200, %497 + %isneg = icmp slt i32 %500, 0 + %502 = select i1 %isneg, i32 0, i32 %501 + %503 = xor i64 %.3514, -1 + %504 = add i64 %491, %503 + %505 = trunc i64 %504 to i32 + %506 = and i32 %500, %505 + %507 = getelementptr inbounds nuw [96 x i8], ptr %162, i64 0, i64 %.1392513 + %508 = load i8, ptr %507, align 1, !tbaa !18 + %509 = xor i8 %508, %496 + %510 = zext i8 %509 to i32 + %isneg414 = icmp slt i32 %506, 0 + %511 = select i1 %isneg414, i32 %510, i32 0 + %509 = or i32 %502, %.2395512 + %513 = or i32 %512, %511 + %514 = lshr i32 %506, 31 + %515 = zext nneg i32 %514 to i64 + %513 = add i64 %.1392513, %515 + %517 = add nuw nsw i64 %.3514, 1 + %exitcond521.not = icmp eq i64 %517, %493 + br i1 %exitcond521.not, label %sha256_update.exit480, label %494, !llvm.loop !42 + +518:; preds = %158 + %519 = load i32, ptr %9, align 4, !tbaa !29 + %.not.i472 = icmp eq i32 %519, 0 + br i1 %.not.i472, label %526, label %520 + +520:; preds = %518 + %521 = zext i32 %519 to i64 + %522 = sub nsw i64 64, %521 + %519 = call i64 @llvm.umin.i64(i64 %3, i64 %522) + %523 = call i32 @SHA256_Update(ptr noundef nonnull %8, ptr noundef %1, i64 noundef %spec.select.i473) #8 + %524 = getelementptr inbounds nuw i8, ptr %1, i64 %spec.select.i473 + %525 = sub i64 %3, %519 + br label %526 + +526: ; preds = %520, %518 + %.032.i477 = phi i64 [ %525, %520 ], [ %3, %518 ] + %.032.i475 = phi ptr [ %524, %520 ], [ %1, %518 ] + %524 = and i64 %.033.i474, 63 + %528 = and i64 %.032.i477, -64 + %.not39.i476 = icmp eq i64 %528, 0 + br i1 %.not39.i476, label %544, label %529 + +529:; preds = %526 + %530 = lshr i64 %.032.i477, 6 + call void @sha256_block_data_order(ptr noundef nonnull %8, ptr noundef %.032.i475, i64 noundef %530) #8 + %531 = getelementptr inbounds nuw i8, ptr %.032.i475, i64 %528 + %532 = lshr i64 %.033.i474, 29 + %533 = getelementptr inbounds nuw i8, ptr %0, i64 764 + %534 = load i32, ptr %533, align 4, !tbaa !25 + %535 = trunc i64 %532 to i32 %536 = add i32 %534, %535 - store i32 %536, ptr %533, align 4, !tbaa !26 - %537 = icmp ult i32 %536, %535 - br i1 %537, label %538, label %540 - -538: ; preds = %525 - %539 = add i32 %532, 1 - store i32 %539, ptr %529, align 4, !tbaa !25 - br label %540 - -540: ; preds = %538, %525, %522 - %.1.i480 = phi ptr [ %527, %538 ], [ %527, %525 ], [ %.032.i477, %522 ] - %.not40.i481 = icmp eq i64 %523, 0 + store i32 %536, ptr %533, align 4, !tbaa !25 + %537 = getelementptr inbounds nuw i8, ptr %0, i64 760 + %538 = load i32, ptr %537, align 4, !tbaa !26 + %.tr.i477 = trunc i64 %528 to i32 + %539 = shl i32 %.tr.i477, 3 + %539 = add i32 %538, %539 + store i32 %539, ptr %537, align 4, !tbaa !26 + %541 = icmp ult i32 %540, %539 + br i1 %541, label %542, label %544 + +542: ; preds = %529 + %543 = add i32 %536, 1 + store i32 %543, ptr %533, align 4, !tbaa !25 + br label %544 + +540: ; preds = %542, %529, %526 + %.1.i480 = phi ptr [ %531, %542 ], [ %531, %529 ], [ %.032.i475, %526 ] + %.not40.i481 = icmp eq i64 %527, 0 br i1 %.not40.i481, label %sha256_update.exit482.thread, label %541 541: ; preds = %540 - %542 = call i32 @SHA256_Update(ptr noundef nonnull %8, ptr noundef %.1.i480, i64 noundef %523) #8 + %542 = call i32 @SHA256_Update(ptr noundef nonnull %8, ptr noundef %.1.i480, i64 noundef %527) #8 br label %sha256_update.exit482.thread sha256_update.exit482.thread: ; preds = %541, %540 call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #8 br label %544 -sha256_update.exit482: ; preds = %490 - %.inv = icmp slt i32 %509, 1 +sha256_update.exit482: ; preds = %494 + %.inv = icmp slt i32 %513, 1 %narrow = select i1 %.inv, i1 %193, i1 false %543 = zext i1 %narrow to i32 call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %5) #8 br label %544 544: ; preds = %152, %._crit_edge, %sha256_update.exit482.thread, %sha256_update.exit482, %sha256_update.exit482.thread499, %20, %4 - %.0 = phi i32 [ %543, %sha256_update.exit482 ], [ 0, %4 ], [ 0, %20 ], [ 0, %sha256_update.exit482.thread499 ], [ 1, %sha256_update.exit482.thread ], [ 1, %._crit_edge ], [ 1, %152 ] + %.0 = phi i32 [ %543, %sha256_update.exit480 ], [ 0, %4 ], [ 0, %20 ], [ 0, %sha256_update.exit480.thread497 ], [ 1, %sha256_update.exit480.thread ], [ 1, %._crit_edge ], [ 1, %152 ] ret i32 %.0 } diff --git a/bench/openssl/optimized/e_aes_cbc_hmac_sha1.ll b/bench/openssl/optimized/e_aes_cbc_hmac_sha1.ll index b047f43b31f..51b5718b7d6 100644 --- a/bench/openssl/optimized/e_aes_cbc_hmac_sha1.ll +++ b/bench/openssl/optimized/e_aes_cbc_hmac_sha1.ll @@ -349,7 +349,7 @@ sha1_update.exit404: ; preds = %120, %.thread444 %146 = and i64 %145, -32 %147 = inttoptr i64 %146 to ptr %.not371 = icmp eq i64 %8, -1 - br i1 %.not371, label %452, label %148 + br i1 %.not371, label %456, label %148 148: ; preds = %143 %149 = getelementptr inbounds nuw i8, ptr %6, i64 464 @@ -547,9 +547,9 @@ sha1_update.exit422: ; preds = %262, %263 br label %268 268: ; preds = %sha1_update.exit422, %sha1_update.exit413 - %.0349 = phi i64 [ %267, %sha1_update.exit422 ], [ %192, %sha1_update.exit413 ] - %.1341 = phi i64 [ %266, %sha1_update.exit422 ], [ %229, %sha1_update.exit413 ] - %.1338 = phi ptr [ %265, %sha1_update.exit422 ], [ %.0337, %sha1_update.exit413 ] + %.0349 = phi i64 [ %267, %sha1_update.exit420 ], [ %192, %sha1_update.exit411 ] + %.1341 = phi i64 [ %266, %sha1_update.exit420 ], [ %229, %sha1_update.exit411 ] + %.1338 = phi ptr [ %265, %sha1_update.exit420 ], [ %.0337, %sha1_update.exit411 ] %269 = getelementptr inbounds nuw i8, ptr %6, i64 456 %270 = load i32, ptr %269, align 4, !tbaa !19 %.0349.tr = trunc i64 %.0349 to i32 @@ -575,8 +575,8 @@ sha1_update.exit422: ; preds = %262, %263 br label %285 285: ; preds = %.lr.ph465, %332 - %.0350463 = phi i64 [ 0, %.lr.ph465 ], [ %333, %332 ] - %.0355462 = phi i32 [ %278, %.lr.ph465 ], [ %.1356, %332 ] + %.0350463 = phi i64 [ 0, %.lr.ph462 ], [ %333, %332 ] + %.0355462 = phi i32 [ %278, %.lr.ph462 ], [ %.1356, %332 ] %286 = getelementptr inbounds nuw i8, ptr %.1338, i64 %.0350463 %287 = load i8, ptr %286, align 1, !tbaa !8 %288 = zext i8 %287 to i64 @@ -661,7 +661,7 @@ sha1_update.exit422: ; preds = %262, %263 br i1 %340, label %._crit_edge472.thread, label %376 ._crit_edge472.thread: ; preds = %._crit_edge466, %._crit_edge472 - %.1351.lcssa485 = phi i64 [ %339, %._crit_edge472 ], [ %.1341, %._crit_edge466 ] + %.1351.lcssa485 = phi i64 [ %339, %._crit_edge469 ], [ %.1341, %._crit_edge463 ] %341 = add i64 %.0349, 8 %342 = sub i64 %341, %.1351.lcssa485 %.neg = ashr i64 %342, 63 @@ -711,7 +711,7 @@ sha1_update.exit422: ; preds = %262, %263 br label %376 376: ; preds = %._crit_edge472.thread, %._crit_edge472 - %.2352 = phi i64 [ %375, %._crit_edge472.thread ], [ %339, %._crit_edge472 ] + %.2352 = phi i64 [ %375, %._crit_edge469.thread ], [ %339, %._crit_edge469 ] %377 = getelementptr inbounds nuw i8, ptr %6, i64 524 store i32 %273, ptr %377, align 4, !tbaa !8 call void @sha1_block_data_order(ptr noundef nonnull %9, ptr noundef nonnull %149, i64 noundef 1) #7 @@ -781,106 +781,107 @@ sha1_update.exit422: ; preds = %262, %263 sha1_update.exit431: ; preds = %411, %.thread452 %419 = call i32 @SHA1_Final(ptr noundef nonnull %147, ptr noundef nonnull %9) #7 - %420 = getelementptr i8, ptr %.1338, i64 %.1341 - %421 = getelementptr i8, ptr %420, i64 19 - %422 = zext nneg i32 %181 to i64 - %423 = sub nsw i64 0, %422 - %424 = getelementptr inbounds i8, ptr %421, i64 %423 - %425 = getelementptr inbounds i8, ptr %424, i64 -20 - %.neg375 = add nuw nsw i64 %422, 1 - %.neg376 = add i64 %.neg375, %.0349 - %gepdiff = sub i64 %.neg376, %.1341 - %426 = add nuw nsw i32 %181, 20 - %427 = zext nneg i32 %426 to i64 - br label %428 - -428: ; preds = %sha1_update.exit431, %428 - %.3476 = phi i64 [ 0, %sha1_update.exit431 ], [ %451, %428 ] - %.1354475 = phi i64 [ 0, %sha1_update.exit431 ], [ %450, %428 ] - %.2357474 = phi i32 [ 0, %sha1_update.exit431 ], [ %447, %428 ] - %429 = getelementptr inbounds nuw i8, ptr %425, i64 %.3476 - %430 = load i8, ptr %429, align 1, !tbaa !8 - %431 = zext i8 %430 to i32 - %432 = sub i64 %.3476, %gepdiff - %433 = trunc i64 %432 to i32 - %434 = add i32 %433, -20 - %435 = xor i32 %189, %431 - %isneg = icmp slt i32 %434, 0 - %436 = select i1 %isneg, i32 0, i32 %435 - %437 = xor i64 %.3476, -1 - %438 = add i64 %gepdiff, %437 - %439 = trunc i64 %438 to i32 - %440 = and i32 %434, %439 - %441 = getelementptr inbounds nuw [52 x i8], ptr %147, i64 0, i64 %.1354475 - %442 = load i8, ptr %441, align 1, !tbaa !8 - %443 = xor i8 %442, %430 - %444 = zext i8 %443 to i32 - %isneg378 = icmp slt i32 %440, 0 - %445 = select i1 %isneg378, i32 %444, i32 0 - %446 = or i32 %436, %.2357474 - %447 = or i32 %446, %445 - %448 = lshr i32 %440, 31 - %449 = zext nneg i32 %448 to i64 - %450 = add i64 %.1354475, %449 - %451 = add nuw nsw i64 %.3476, 1 - %exitcond483.not = icmp eq i64 %451, %427 - br i1 %exitcond483.not, label %sha1_update.exit440, label %428, !llvm.loop !34 - -452: ; preds = %143 - %453 = getelementptr inbounds nuw i8, ptr %0, i64 40 - call void @aesni_cbc_encrypt(ptr noundef %2, ptr noundef %1, i64 noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %453, i32 noundef 0) #7 - %454 = load i32, ptr %10, align 4, !tbaa !15 - %.not.i432 = icmp eq i32 %454, 0 - br i1 %.not.i432, label %461, label %455 - -455: ; preds = %452 - %456 = zext i32 %454 to i64 - %457 = sub nsw i64 64, %456 - %spec.select.i433 = call i64 @llvm.umin.i64(i64 %3, i64 %457) - %458 = call i32 @SHA1_Update(ptr noundef nonnull %9, ptr noundef %1, i64 noundef %spec.select.i433) #7 - %459 = getelementptr inbounds nuw i8, ptr %1, i64 %spec.select.i433 - %460 = sub i64 %3, %spec.select.i433 - br label %461 - -461: ; preds = %455, %452 - %.033.i434 = phi i64 [ %460, %455 ], [ %3, %452 ] - %.032.i435 = phi ptr [ %459, %455 ], [ %1, %452 ] - %462 = and i64 %.033.i434, 63 - %463 = and i64 %.033.i434, -64 - %.not39.i436 = icmp eq i64 %463, 0 - br i1 %.not39.i436, label %479, label %464 - -464: ; preds = %461 - %465 = lshr i64 %.033.i434, 6 - call void @sha1_block_data_order(ptr noundef nonnull %9, ptr noundef %.032.i435, i64 noundef %465) #7 - %466 = getelementptr inbounds nuw i8, ptr %.032.i435, i64 %463 - %467 = lshr i64 %.033.i434, 29 - %468 = getelementptr inbounds nuw i8, ptr %6, i64 460 - %469 = load i32, ptr %468, align 4, !tbaa !16 - %470 = trunc i64 %467 to i32 - %471 = add i32 %469, %470 - store i32 %471, ptr %468, align 4, !tbaa !16 - %472 = getelementptr inbounds nuw i8, ptr %6, i64 456 - %473 = load i32, ptr %472, align 4, !tbaa !17 - %.tr.i437 = trunc i64 %463 to i32 - %474 = shl i32 %.tr.i437, 3 + %420 = getelementptr inbounds nuw i8, ptr %.1338, i64 %.0349 + %421 = getelementptr i8, ptr %.1338, i64 %.1341 + %422 = getelementptr i8, ptr %421, i64 19 + %423 = zext nneg i32 %181 to i64 + %424 = sub nsw i64 0, %423 + %425 = getelementptr inbounds i8, ptr %422, i64 %424 + %426 = getelementptr inbounds i8, ptr %425, i64 -20 + %427 = ptrtoint ptr %420 to i64 + %428 = ptrtoint ptr %426 to i64 + %429 = sub i64 %427, %428 + %430 = add nuw nsw i32 %181, 20 + %431 = zext nneg i32 %430 to i64 + br label %432 + +432: ; preds = %sha1_update.exit431, %432 + %.1354475 = phi i64 [ 0, %sha1_update.exit429 ], [ %455, %432 ] + %.2357474 = phi i64 [ 0, %sha1_update.exit429 ], [ %454, %432 ] + %.2357471 = phi i32 [ 0, %sha1_update.exit429 ], [ %451, %432 ] + %433 = getelementptr inbounds nuw i8, ptr %426, i64 %.1354475 + %434 = load i8, ptr %433, align 1, !tbaa !8 + %435 = zext i8 %434 to i32 + %436 = sub i64 %.3473, %429 + %437 = trunc i64 %436 to i32 + %438 = add i32 %437, -20 + %439 = xor i32 %189, %435 + %isneg = icmp slt i32 %438, 0 + %440 = select i1 %isneg, i32 0, i32 %439 + %441 = xor i64 %.3473, -1 + %442 = add i64 %429, %441 + %443 = trunc i64 %442 to i32 + %444 = and i32 %438, %443 + %445 = getelementptr inbounds nuw [52 x i8], ptr %147, i64 0, i64 %.1354472 + %446 = load i8, ptr %445, align 1, !tbaa !8 + %447 = xor i8 %446, %434 + %448 = zext i8 %447 to i32 + %isneg376 = icmp slt i32 %444, 0 + %449 = select i1 %isneg376, i32 %448, i32 0 + %447 = or i32 %440, %.2357471 + %451 = or i32 %450, %449 + %452 = lshr i32 %444, 31 + %453 = zext nneg i32 %452 to i64 + %451 = add i64 %.1354472, %453 + %455 = add nuw nsw i64 %.3473, 1 + %exitcond480.not = icmp eq i64 %455, %431 + br i1 %exitcond480.not, label %sha1_update.exit438, label %432, !llvm.loop !34 + +456: ; preds = %143 + %457 = getelementptr inbounds nuw i8, ptr %0, i64 40 + call void @aesni_cbc_encrypt(ptr noundef %2, ptr noundef %1, i64 noundef %3, ptr noundef nonnull %6, ptr noundef nonnull %457, i32 noundef 0) #7 + %458 = load i32, ptr %10, align 4, !tbaa !15 + %.not.i430 = icmp eq i32 %458, 0 + br i1 %.not.i430, label %465, label %459 + +459:; preds = %456 + %460 = zext i32 %458 to i64 + %461 = sub nsw i64 64, %460 + %458 = call i64 @llvm.umin.i64(i64 %3, i64 %461) + %462 = call i32 @SHA1_Update(ptr noundef nonnull %9, ptr noundef %1, i64 noundef %spec.select.i431) #7 + %463 = getelementptr inbounds nuw i8, ptr %1, i64 %spec.select.i431 + %464 = sub i64 %3, %458 + br label %465 + +465:; preds = %459, %456 + %.032.i435 = phi i64 [ %464, %459 ], [ %3, %456 ] + %.032.i433 = phi ptr [ %463, %459 ], [ %1, %456 ] + %463 = and i64 %.033.i432, 63 + %467 = and i64 %.033.i432, -64 + %.not39.i434 = icmp eq i64 %467, 0 + br i1 %.not39.i434, label %483, label %468 + +468:; preds = %465 + %469 = lshr i64 %.032.i435, 6 + call void @sha1_block_data_order(ptr noundef nonnull %9, ptr noundef %.032.i433, i64 noundef %469) #7 + %470 = getelementptr inbounds nuw i8, ptr %.032.i433, i64 %467 + %471 = lshr i64 %.033.i432, 29 + %472 = getelementptr inbounds nuw i8, ptr %6, i64 460 + %473 = load i32, ptr %472, align 4, !tbaa !16 + %474 = trunc i64 %471 to i32 %475 = add i32 %473, %474 - store i32 %475, ptr %472, align 4, !tbaa !17 - %476 = icmp ult i32 %475, %474 - br i1 %476, label %477, label %479 - -477: ; preds = %464 - %478 = add i32 %471, 1 - store i32 %478, ptr %468, align 4, !tbaa !16 - br label %479 - -479: ; preds = %477, %464, %461 - %.1.i438 = phi ptr [ %466, %477 ], [ %466, %464 ], [ %.032.i435, %461 ] - %.not40.i439 = icmp eq i64 %462, 0 + store i32 %475, ptr %472, align 4, !tbaa !16 + %476 = getelementptr inbounds nuw i8, ptr %6, i64 456 + %477 = load i32, ptr %476, align 4, !tbaa !17 + %.tr.i435 = trunc i64 %467 to i32 + %478 = shl i32 %.tr.i435, 3 + %478 = add i32 %477, %478 + store i32 %478, ptr %476, align 4, !tbaa !17 + %480 = icmp ult i32 %479, %478 + br i1 %480, label %481, label %483 + +481: ; preds = %468 + %482 = add i32 %475, 1 + store i32 %482, ptr %472, align 4, !tbaa !16 + br label %483 + +479: ; preds = %481, %468, %465 + %.1.i438 = phi ptr [ %470, %481 ], [ %470, %468 ], [ %.032.i433, %465 ] + %.not40.i439 = icmp eq i64 %466, 0 br i1 %.not40.i439, label %sha1_update.exit440.thread, label %480 480: ; preds = %479 - %481 = call i32 @SHA1_Update(ptr noundef nonnull %9, ptr noundef %.1.i438, i64 noundef %462) #7 + %481 = call i32 @SHA1_Update(ptr noundef nonnull %9, ptr noundef %.1.i438, i64 noundef %466) #7 br label %sha1_update.exit440.thread sha1_update.exit440.thread: ; preds = %480, %479 @@ -891,15 +892,15 @@ sha1_update.exit440.thread458: ; preds = %162, %169 call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %5) #7 br label %483 -sha1_update.exit440: ; preds = %428 - %.inv = icmp slt i32 %447, 1 +sha1_update.exit440: ; preds = %432 + %.inv = icmp slt i32 %451, 1 %narrow = select i1 %.inv, i1 %182, i1 false %482 = zext i1 %narrow to i32 call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %5) #7 br label %483 483: ; preds = %138, %._crit_edge, %sha1_update.exit440.thread, %sha1_update.exit440, %sha1_update.exit440.thread458, %19, %4 - %.0 = phi i32 [ %482, %sha1_update.exit440 ], [ 0, %4 ], [ 0, %19 ], [ 0, %sha1_update.exit440.thread458 ], [ 1, %sha1_update.exit440.thread ], [ 1, %._crit_edge ], [ 1, %138 ] + %.0 = phi i32 [ %482, %sha1_update.exit438 ], [ 0, %4 ], [ 0, %19 ], [ 0, %sha1_update.exit438.thread456 ], [ 1, %sha1_update.exit438.thread ], [ 1, %._crit_edge ], [ 1, %138 ] ret i32 %.0 } diff --git a/bench/openusd/optimized/zipFile.ll b/bench/openusd/optimized/zipFile.ll index 896cc55a47f..3459d8b0eac 100644 --- a/bench/openusd/optimized/zipFile.ll +++ b/bench/openusd/optimized/zipFile.ll @@ -1234,12 +1234,12 @@ define noundef nonnull align 8 dereferenceable(8) ptr @_ZN32pxrInternal_v0_24__p %.neg.i.i = add i64 %9, %14 %15 = sub i64 %.neg.i.i, %13 %16 = icmp ult i64 %15, 30 - br i1 %16, label %68, label %17 + br i1 %16, label %67, label %17 17: ; preds = %4 %18 = load i32, ptr %12, align 1, !noalias !15 %19 = icmp eq i32 %18, 67324752 - br i1 %19, label %20, label %68 + br i1 %19, label %20, label %67 20: ; preds = %17 %21 = getelementptr inbounds nuw i8, ptr %12, i64 4 @@ -1267,7 +1267,7 @@ define noundef nonnull align 8 dereferenceable(8) ptr @_ZN32pxrInternal_v0_24__p %43 = sub i64 %.neg.i.i, %42 %44 = zext i16 %38 to i64 %45 = icmp ult i64 %43, %44 - br i1 %45, label %68, label %46 + br i1 %45, label %67, label %46 46: ; preds = %20 %47 = getelementptr inbounds nuw i8, ptr %41, i64 %44 @@ -1275,7 +1275,7 @@ define noundef nonnull align 8 dereferenceable(8) ptr @_ZN32pxrInternal_v0_24__p %49 = sub i64 %.neg.i.i, %48 %50 = zext i16 %40 to i64 %51 = icmp ult i64 %49, %50 - br i1 %51, label %68, label %52 + br i1 %51, label %67, label %52 52: ; preds = %46 %53 = getelementptr inbounds nuw i8, ptr %47, i64 %50 @@ -1283,52 +1283,51 @@ define noundef nonnull align 8 dereferenceable(8) ptr @_ZN32pxrInternal_v0_24__p %55 = sub i64 %.neg.i.i, %54 %56 = zext i32 %34 to i64 %57 = icmp ult i64 %55, %56 - br i1 %57, label %68, label %58 + br i1 %57, label %67, label %58 58: ; preds = %52 - %59 = getelementptr inbounds nuw i8, ptr %3, i64 8 - store i64 %11, ptr %59, align 8 - %60 = load ptr, ptr %0, align 8 - %61 = getelementptr inbounds nuw i8, ptr %60, i64 16 - store i32 67324752, ptr %61, align 8 - %.sroa.8.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 20 + %59 = getelementptr inbounds nuw i8, ptr %53, i64 %56 + %60 = getelementptr inbounds nuw i8, ptr %3, i64 8 + store i64 %11, ptr %60, align 8 + %61 = load ptr, ptr %0, align 8 + %62 = getelementptr inbounds nuw i8, ptr %61, i64 16 + store i32 67324752, ptr %62, align 8 + %.sroa.8.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 20 store i16 %22, ptr %.sroa.8.0..sroa_idx, align 4 - %.sroa.9.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 22 + %.sroa.9.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 22 store i16 %24, ptr %.sroa.9.0..sroa_idx, align 2 - %.sroa.10.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 24 + %.sroa.10.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 24 store i16 %26, ptr %.sroa.10.0..sroa_idx, align 8 - %.sroa.11.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 26 + %.sroa.11.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 26 store i16 %28, ptr %.sroa.11.0..sroa_idx, align 2 - %.sroa.12.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 28 + %.sroa.12.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 28 store i16 %30, ptr %.sroa.12.0..sroa_idx, align 4 - %.sroa.13.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 30 + %.sroa.13.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 30 store i16 0, ptr %.sroa.13.0..sroa_idx, align 2 - %.sroa.133.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 32 + %.sroa.133.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 32 store i32 %32, ptr %.sroa.133.0..sroa_idx, align 8 - %.sroa.14.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 36 + %.sroa.14.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 36 store i32 %34, ptr %.sroa.14.0..sroa_idx, align 4 - %.sroa.15.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 40 + %.sroa.15.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 40 store i32 %36, ptr %.sroa.15.0..sroa_idx, align 8 - %.sroa.16.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 44 + %.sroa.16.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 44 store i16 %38, ptr %.sroa.16.0..sroa_idx, align 4 - %.sroa.17.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 46 + %.sroa.17.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 46 store i16 %40, ptr %.sroa.17.0..sroa_idx, align 2 - %.sroa.18.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 48 + %.sroa.18.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 48 store ptr %41, ptr %.sroa.18.0..sroa_idx, align 8 - %.sroa.19.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 56 + %.sroa.19.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 56 store ptr %47, ptr %.sroa.19.0..sroa_idx, align 8 - %.sroa.20.0..sroa_idx = getelementptr inbounds nuw i8, ptr %60, i64 64 + %.sroa.20.0..sroa_idx = getelementptr inbounds nuw i8, ptr %61, i64 64 store ptr %53, ptr %.sroa.20.0..sroa_idx, align 8 - %62 = add nsw i64 %11, 30 - %63 = add i64 %62, %56 - %64 = add i64 %63, %44 - %65 = add i64 %64, %50 - %66 = load ptr, ptr %0, align 8 - %67 = getelementptr inbounds nuw i8, ptr %66, i64 72 - store i64 %65, ptr %67, align 8 - br label %71 - -68: ; preds = %17, %4, %20, %46, %52 + %63 = ptrtoint ptr %59 to i64 + %64 = sub i64 %63, %14 + %65 = load ptr, ptr %0, align 8 + %66 = getelementptr inbounds nuw i8, ptr %65, i64 72 + store i64 %64, ptr %66, align 8 + br label %70 + +67:; preds = %17, %4, %20, %46, %52 call void @_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratorC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) %69 = load ptr, ptr %2, align 8 store ptr null, ptr %2, align 8 @@ -1337,11 +1336,11 @@ define noundef nonnull align 8 dereferenceable(8) ptr @_ZN32pxrInternal_v0_24__p %.not.i.i.i.i.i = icmp eq ptr %70, null br i1 %.not.i.i.i.i.i, label %_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratoraSEOS1_.exit, label %_ZNKSt14default_deleteIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataEEclEPS3_.exit.i.i.i.i.i -_ZNKSt14default_deleteIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataEEclEPS3_.exit.i.i.i.i.i: ; preds = %68 +_ZNKSt14default_deleteIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataEEclEPS3_.exit.i.i.i.i.i: ; preds = %67 call void @_ZdlPvm(ptr noundef nonnull %70, i64 noundef 80) #24 br label %_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratoraSEOS1_.exit -_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratoraSEOS1_.exit: ; preds = %68, %_ZNKSt14default_deleteIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataEEclEPS3_.exit.i.i.i.i.i +_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratoraSEOS1_.exit: ; preds = %67, %_ZNKSt14default_deleteIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataEEclEPS3_.exit.i.i.i.i.i call void @_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratorD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #22 br label %71 @@ -1780,7 +1779,8 @@ define void @_ZN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8IteratorC2EPKNS0_ to label %_ZNSt10unique_ptrIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataESt14default_deleteIS3_EE5resetEPS3_.exit unwind label %_ZNSt10unique_ptrIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataESt14default_deleteIS3_EED2Ev.exit _ZNSt10unique_ptrIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataESt14default_deleteIS3_EE5resetEPS3_.exit: ; preds = %54 - %56 = getelementptr inbounds nuw i8, ptr %55, i64 32 + %56 = getelementptr inbounds nuw i8, ptr %49, i64 %52 + %57 = getelementptr inbounds nuw i8, ptr %55, i64 32 store ptr %55, ptr %0, align 8 store ptr %1, ptr %55, align 8 %57 = getelementptr inbounds nuw i8, ptr %55, i64 8 @@ -1799,7 +1799,7 @@ _ZNSt10unique_ptrIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_Ite store i16 %26, ptr %.sroa.12.0..sroa_idx, align 4 %.sroa.13.0..sroa_idx = getelementptr inbounds nuw i8, ptr %55, i64 30 store i16 0, ptr %.sroa.13.0..sroa_idx, align 2 - store i32 %28, ptr %56, align 8 + store i32 %28, ptr %57, align 8 %.sroa.14.0..sroa_idx = getelementptr inbounds nuw i8, ptr %55, i64 36 store i32 %30, ptr %.sroa.14.0..sroa_idx, align 4 %.sroa.15.0..sroa_idx = getelementptr inbounds nuw i8, ptr %55, i64 40 @@ -1814,12 +1814,10 @@ _ZNSt10unique_ptrIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_Ite store ptr %43, ptr %.sroa.19.0..sroa_idx, align 8 %.sroa.20.0..sroa_idx = getelementptr inbounds nuw i8, ptr %55, i64 64 store ptr %49, ptr %.sroa.20.0..sroa_idx, align 8 - %59 = add nsw i64 %2, 30 - %60 = add i64 %59, %52 - %61 = add i64 %60, %40 - %62 = add i64 %61, %46 - %63 = getelementptr inbounds nuw i8, ptr %55, i64 72 - store i64 %62, ptr %63, align 8 + %60 = ptrtoint ptr %56 to i64 + %61 = sub i64 %60, %10 + %62 = getelementptr inbounds nuw i8, ptr %55, i64 72 + store i64 %61, ptr %62, align 8 br label %_ZN32pxrInternal_v0_24__pxrReserved__12_GLOBAL__N_120_ReadLocalFileHeaderERNS0_12_InputStreamE.exit.thread _ZNSt10unique_ptrIN32pxrInternal_v0_24__pxrReserved__10UsdZipFile8Iterator13_IteratorDataESt14default_deleteIS3_EED2Ev.exit: ; preds = %54 diff --git a/bench/redis/optimized/listpack.ll b/bench/redis/optimized/listpack.ll index 6558337354b..17e47e30a6c 100644 --- a/bench/redis/optimized/listpack.ll +++ b/bench/redis/optimized/listpack.ll @@ -640,10 +640,10 @@ define dso_local ptr @lpLast(ptr noundef %0) local_unnamed_addr #3 { %19 = getelementptr inbounds nuw i8, ptr %18, i64 %12 %20 = getelementptr inbounds nuw i8, ptr %19, i64 %16 %21 = getelementptr inbounds i8, ptr %20, i64 -1 - %22 = or disjoint i64 %8, %4 - %23 = or disjoint i64 %22, %12 - %24 = or disjoint i64 %23, %16 - %25 = icmp eq i64 %24, 7 + %22 = ptrtoint ptr %21 to i64 + %23 = ptrtoint ptr %0 to i64 + %24 = sub i64 %22, %23 + %25 = icmp eq i64 %24, 6 br i1 %25, label %lpPrev.exit, label %.preheader .preheader: ; preds = %1, %31 diff --git a/bench/zstd/optimized/zstd_v07.ll b/bench/zstd/optimized/zstd_v07.ll index 45cf7657007..6ef4bd08c1c 100644 --- a/bench/zstd/optimized/zstd_v07.ll +++ b/bench/zstd/optimized/zstd_v07.ll @@ -7484,17 +7484,19 @@ define range(i64 -30, 1) i64 @ZSTDv07_decompressBegin_usingDict(ptr noundef capt 74: ; preds = %71 %75 = load i32, ptr %11, align 4, !tbaa !3 %76 = call i64 @FSEv07_buildDTable(ptr noundef nonnull %0, ptr noundef nonnull %10, i32 noundef %75, i32 noundef %72) - %77 = icmp ugt i64 %76, -120 + %77 = icmp ult i64 %76, -119 %78 = getelementptr inbounds nuw i8, ptr %66, i64 %69 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #26 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #26 call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %10) #26 - %79 = getelementptr inbounds nuw i8, ptr %78, i64 12 - %80 = icmp ugt ptr %79, %38 - %or.cond116.i.i = select i1 %77, i1 true, i1 %80 - br i1 %or.cond116.i.i, label %ZSTDv07_decompress_insertDictionary.exit.thread, label %81 + br i1 %77, label %81, label %ZSTDv07_decompress_insertDictionary.exit.thread 81: ; preds = %74 + %80 = getelementptr inbounds nuw i8, ptr %78, i64 12 + %81 = icmp ugt ptr %80, %38 + br i1 %81, label %ZSTDv07_decompress_insertDictionary.exit.thread, label %82 + +82: ; preds = %79 %.371.val.i.i = load i32, ptr %78, align 1 store i32 %.371.val.i.i, ptr %20, align 8, !tbaa !3 %82 = icmp ne i32 %.371.val.i.i, 0 @@ -7503,7 +7505,7 @@ define range(i64 -30, 1) i64 @ZSTDv07_decompressBegin_usingDict(ptr noundef capt %or.cond.i.i = and i1 %82, %.not92.i.i br i1 %or.cond.i.i, label %84, label %ZSTDv07_decompress_insertDictionary.exit.thread -84: ; preds = %81 +84: ; preds = %82 %85 = getelementptr inbounds nuw i8, ptr %78, i64 4 %.val102.i.i = load i32, ptr %85, align 1 %86 = getelementptr inbounds nuw i8, ptr %0, i64 21564 @@ -7528,32 +7530,30 @@ define range(i64 -30, 1) i64 @ZSTDv07_decompressBegin_usingDict(ptr noundef capt ZSTDv07_loadEntropy.exit.i: ; preds = %89 store i32 1, ptr %17, align 4, !tbaa !69 store i32 1, ptr %18, align 8, !tbaa !70 - %94 = add nuw nsw i64 %39, 12 - %95 = add nuw nsw i64 %94, %43 - %96 = add nuw nsw i64 %95, %56 - %97 = add nuw nsw i64 %96, %69 + %95 = ptrtoint ptr %80 to i64 + %96 = ptrtoint ptr %36 to i64 + %97 = sub i64 %95, %96 %98 = icmp ult i64 %97, -119 br i1 %98, label %99, label %ZSTDv07_decompress_insertDictionary.exit.thread 99: ; preds = %ZSTDv07_loadEntropy.exit.i - %100 = getelementptr inbounds nuw i8, ptr %36, i64 %97 - %101 = load ptr, ptr %15, align 8, !tbaa !81 - %102 = getelementptr inbounds nuw i8, ptr %0, i64 21544 - store ptr %101, ptr %102, align 8, !tbaa !82 - %103 = getelementptr inbounds nuw i8, ptr %0, i64 21528 - %104 = load ptr, ptr %103, align 8, !tbaa !83 - %105 = ptrtoint ptr %101 to i64 - %106 = ptrtoint ptr %104 to i64 - %.neg.i36.i = sub i64 %106, %105 - %107 = getelementptr inbounds i8, ptr %100, i64 %.neg.i36.i - %108 = getelementptr inbounds nuw i8, ptr %0, i64 21536 - store ptr %107, ptr %108, align 8, !tbaa !84 - store ptr %100, ptr %103, align 8, !tbaa !83 + %100 = load ptr, ptr %15, align 8, !tbaa !81 + %101 = getelementptr inbounds nuw i8, ptr %0, i64 21544 + store ptr %100, ptr %101, align 8, !tbaa !82 + %102 = getelementptr inbounds nuw i8, ptr %0, i64 21528 + %103 = load ptr, ptr %102, align 8, !tbaa !83 + %104 = ptrtoint ptr %100 to i64 + %105 = ptrtoint ptr %103 to i64 + %.neg.i36.i = sub i64 %105, %104 + %106 = getelementptr inbounds i8, ptr %80, i64 %.neg.i36.i + %107 = getelementptr inbounds nuw i8, ptr %0, i64 21536 + store ptr %106, ptr %107, align 8, !tbaa !84 + store ptr %80, ptr %102, align 8, !tbaa !83 store ptr %38, ptr %15, align 8, !tbaa !81 br label %ZSTDv07_decompress_insertDictionary.exit.thread -ZSTDv07_decompress_insertDictionary.exit.thread: ; preds = %99, %30, %25, %.thread110.i.i, %.thread106.i.i, %.thread.i.i, %89, %84, %81, %34, %48, %61, %74, %ZSTDv07_loadEntropy.exit.i, %3 - %.1 = phi i64 [ 0, %3 ], [ -30, %ZSTDv07_loadEntropy.exit.i ], [ -30, %74 ], [ -30, %61 ], [ -30, %48 ], [ -30, %34 ], [ -30, %81 ], [ -30, %84 ], [ -30, %89 ], [ -30, %.thread.i.i ], [ -30, %.thread106.i.i ], [ -30, %.thread110.i.i ], [ 0, %25 ], [ 0, %30 ], [ 0, %99 ] +ZSTDv07_decompress_insertDictionary.exit.thread: ; preds = %99, %30, %25, %.thread110.i.i, %.thread106.i.i, %.thread.i.i, %89, %84, %82, %81, %34, %48, %61, %74, %ZSTDv07_loadEntropy.exit.i, %3 + %.1 = phi i64 [ 0, %3 ], [ -30, %ZSTDv07_loadEntropy.exit.i ], [ -30, %74 ], [ -30, %61 ], [ -30, %48 ], [ -30, %34 ], [ -30, %79 ], [ -30, %82 ], [ -30, %85 ], [ -30, %90 ], [ -30, %.thread.i.i ], [ -30, %.thread106.i.i ], [ -30, %.thread110.i.i ], [ 0, %25 ], [ 0, %30 ], [ 0, %99 ] ret i64 %.1 } diff --git a/scripts/setup_pre_commit_patch.sh b/scripts/setup_pre_commit_patch.sh index c5409e09ef4..d567dab7164 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/147065 export COMPTIME_MODE=0 # Please rebase manually