diff --git a/bench/abc/optimized/cecSynth.ll b/bench/abc/optimized/cecSynth.ll index 233ee035677..48156ab049d 100644 --- a/bench/abc/optimized/cecSynth.ll +++ b/bench/abc/optimized/cecSynth.ll @@ -801,25 +801,25 @@ Gia_ManAppendAnd.exit: ; preds = %336, %338 %.val216.val = load ptr, ptr %394, align 8, !tbaa !21 %wide.trip.count318 = zext nneg i32 %.val173 to i64 %.val204.val.pre = load i32, ptr %393, align 4, !tbaa !16 + %invariant.op = sub i32 %.val204.val.pre, %.val203 br label %395 395: ; preds = %.lr.ph285, %395 %indvars.iv315 = phi i64 [ 0, %.lr.ph285 ], [ %indvars.iv.next316, %395 ] %396 = getelementptr inbounds nuw i32, ptr %.val180, i64 %indvars.iv315 %397 = load i32, ptr %396, align 4, !tbaa !22 - %398 = sub i32 %397, %.val203 - %399 = add i32 %398, %.val204.val.pre - %400 = sext i32 %399 to i64 - %401 = getelementptr inbounds i32, ptr %.val216.val, i64 %400 - %402 = load i32, ptr %401, align 4, !tbaa !22 - %403 = sext i32 %402 to i64 - %404 = getelementptr inbounds %struct.Gia_Obj_t_, ptr %.val215, i64 %403 - %405 = getelementptr i8, ptr %404, i64 8 - %.val223 = load i32, ptr %405, align 4, !tbaa !52 - %406 = ashr i32 %.val223, 1 - %407 = sext i32 %406 to i64 - %408 = getelementptr inbounds i32, ptr %378, i64 %407 - store i32 %402, ptr %408, align 4, !tbaa !22 + %.reass = add i32 %397, %invariant.op + %398 = sext i32 %.reass to i64 + %399 = getelementptr inbounds i32, ptr %.val216.val, i64 %398 + %400 = load i32, ptr %399, align 4, !tbaa !22 + %401 = sext i32 %400 to i64 + %402 = getelementptr inbounds %struct.Gia_Obj_t_, ptr %.val215, i64 %401 + %404 = getelementptr i8, ptr %402, i64 8 + %.val223 = load i32, ptr %404, align 4, !tbaa !52 + %404 = ashr i32 %.val223, 1 + %405 = sext i32 %404 to i64 + %406 = getelementptr inbounds i32, ptr %378, i64 %405 + store i32 %400, ptr %406, align 4, !tbaa !22 %indvars.iv.next316 = add nuw nsw i64 %indvars.iv315, 1 %exitcond319.not = icmp eq i64 %indvars.iv.next316, %wide.trip.count318 br i1 %exitcond319.not, label %.critedge18, label %395, !llvm.loop !64 diff --git a/bench/abseil-cpp/optimized/fnmatch.ll b/bench/abseil-cpp/optimized/fnmatch.ll index 32b899ca42d..bdf077cc683 100644 --- a/bench/abseil-cpp/optimized/fnmatch.ll +++ b/bench/abseil-cpp/optimized/fnmatch.ll @@ -20,11 +20,11 @@ define dso_local noundef zeroext i1 @_ZN4absl12log_internal7FNMatchESt17basic_st br label %.critedge .lr.ph: ; preds = %4, %58 - %.0880 = phi i8 [ %.19, %58 ], [ 0, %4 ] - %.sroa.023.079 = phi i64 [ %.sroa.023.1, %58 ], [ %2, %4 ] - %.sroa.1029.078 = phi ptr [ %.sroa.1029.1, %58 ], [ %3, %4 ] - %.sroa.034.077 = phi i64 [ %.sroa.034.1, %58 ], [ %0, %4 ] - %.sroa.12.076 = phi ptr [ %.sroa.12.1, %58 ], [ %1, %4 ] + %.0880 = phi i8 [ %.19, %59 ], [ 0, %4 ] + %.sroa.023.079 = phi i64 [ %.sroa.023.1, %59 ], [ %2, %4 ] + %.sroa.1029.078 = phi ptr [ %.sroa.1029.1, %59 ], [ %3, %4 ] + %.sroa.034.077 = phi i64 [ %.sroa.034.1, %59 ], [ %0, %4 ] + %.sroa.12.076 = phi ptr [ %.sroa.12.1, %59 ], [ %1, %4 ] %8 = icmp eq i64 %.sroa.023.079, 0 br i1 %8, label %.lr.ph.i, label %15 @@ -103,31 +103,35 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE13find_first_ofEPKcm.exit.thread.t %33 = getelementptr inbounds nuw i8, ptr %.sroa.1029.078, i64 %.sroa.023.079 %34 = sext i8 %16 to i32 %35 = ptrtoint ptr %33 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17 - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17: ; preds = %39, %.lr.ph.i.i - %.033.i.i = phi i64 [ %.sroa.023.079, %.lr.ph.i.i ], [ %42, %39 ] - %.02132.i.i = phi ptr [ %.sroa.1029.078, %.lr.ph.i.i ], [ %40, %39 ] - %reass.sub = sub i64 %.033.i.i, %.sroa.0.0 - %36 = add i64 %reass.sub, 1 - %37 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %34, i64 noundef %36) #4 - %.not26.i.i = icmp eq ptr %37, null + %invariant.op = sub i64 1, %.sroa.0.0 + br label %36 + +36:; preds = %39, %.lr.ph.i.i + %.02132.i.i = phi i64 [ %.sroa.023.078, %.lr.ph.i.i ], [ %43, %40 ] + %.02132.i.i = phi ptr [ %.sroa.1029.077, %.lr.ph.i.i ], [ %41, %40 ] + %36 = add i64 %.033.i.i, %invariant.op + %37 = icmp eq i64 %36, 0 + br i1 %37, label %.critedge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17 + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17: ; preds = %36 + %38 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %34, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #4 + %.not26.i.i = icmp eq ptr %38, null br i1 %.not26.i.i, label %.critedge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17 - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %37, ptr nonnull %.sroa.12.076, i64 %.sroa.0.0) + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %38, ptr nonnull %.sroa.12.076, i64 %.sroa.0.0) %38 = icmp eq i32 %bcmp.i.i, 0 br i1 %38, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %39 39: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %40 = getelementptr inbounds nuw i8, ptr %37, i64 1 + %40 = getelementptr inbounds nuw i8, ptr %38, i64 1 %41 = ptrtoint ptr %40 to i64 %42 = sub i64 %35, %41 %.not25.i.i = icmp ult i64 %42, %.sroa.0.0 - br i1 %.not25.i.i, label %.critedge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17, !llvm.loop !10 + br i1 %.not25.i.i, label %.critedge, label %36, !llvm.loop !10 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %43 = ptrtoint ptr %37 to i64 + %43 = ptrtoint ptr %38 to i64 %44 = ptrtoint ptr %.sroa.1029.078 to i64 %45 = sub i64 %43, %44 %.not15 = icmp eq i64 %45, -1 @@ -155,16 +159,16 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51: ; preds br label %58 58: ; preds = %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51, %53, %20, %17 - %.sroa.12.1 = phi ptr [ %46, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %54, %53 ], [ %18, %17 ], [ %21, %20 ] - %.sroa.034.1 = phi i64 [ %47, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %55, %53 ], [ %19, %17 ], [ %22, %20 ] - %.sroa.1029.1 = phi ptr [ %49, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %56, %53 ], [ %.sroa.1029.078, %17 ], [ %23, %20 ] - %.sroa.023.1 = phi i64 [ %50, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %57, %53 ], [ %.sroa.023.079, %17 ], [ %24, %20 ] - %.19 = phi i8 [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ 0, %53 ], [ 1, %17 ], [ %.0880, %20 ] + %.sroa.12.1 = phi ptr [ %46, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %54, %54 ], [ %18, %17 ], [ %21, %20 ] + %.sroa.034.1 = phi i64 [ %47, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %55, %54 ], [ %19, %17 ], [ %22, %20 ] + %.sroa.1029.1 = phi ptr [ %49, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %56, %54 ], [ %.sroa.1029.078, %17 ], [ %23, %20 ] + %.sroa.023.1 = phi i64 [ %50, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ %57, %54 ], [ %.sroa.023.079, %17 ], [ %24, %20 ] + %.19 = phi i8 [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread51 ], [ 0, %54 ], [ 1, %17 ], [ %.0880, %20 ] %59 = icmp eq i64 %.sroa.034.1, 0 br i1 %59, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !11 -.critedge: ; preds = %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE13find_first_ofEPKcm.exit.thread.thread, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %51, %39, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17, %._crit_edge, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE17find_first_not_ofEcm.exit - %.1 = phi i1 [ %spec.select, %._crit_edge ], [ %14, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE17find_first_not_ofEcm.exit ], [ false, %39 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17 ], [ false, %51 ], [ false, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ false, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE13find_first_ofEPKcm.exit.thread.thread ] +.critedge: ; preds = %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE13find_first_ofEPKcm.exit.thread.thread, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %51, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17, %40, %36, %._crit_edge, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE17find_first_not_ofEcm.exit + %.1 = phi i1 [ %spec.select, %._crit_edge ], [ %14, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE17find_first_not_ofEcm.exit ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i17 ], [ false, %36 ], [ false, %40 ], [ false, %52 ], [ false, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ false, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE13find_first_ofEPKcm.exit.thread.thread ] ret i1 %.1 } diff --git a/bench/abseil-cpp/optimized/spinlock_test_common.ll b/bench/abseil-cpp/optimized/spinlock_test_common.ll index 306483f0c7e..691dc1f6219 100644 --- a/bench/abseil-cpp/optimized/spinlock_test_common.ll +++ b/bench/abseil-cpp/optimized/spinlock_test_common.ll @@ -4745,6 +4745,7 @@ _ZN7testing15AssertionResultD2Ev.exit: ; preds = %133, %_ZNKSt14defau define internal void @_ZN4absl13base_internal12_GLOBAL__N_112TestFunctionEjPNS0_8SpinLockE(i32 noundef %0, ptr noundef %1) #3 personality ptr @__gxx_personality_v0 { %3 = zext i32 %0 to i64 %4 = lshr i32 %0, 13 + %invariant.op = sub i32 1640531527, %0 br label %6 5: ; preds = %_ZN4absl13base_internal14SpinLockHolderD2Ev.exit @@ -4796,50 +4797,49 @@ _ZN4absl13base_internal14SpinLockHolderD2Ev.exit: ; preds = %13, %17 br i1 %exitcond28.not, label %5, label %6, !llvm.loop !153 _ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit: ; preds = %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit.preheader, %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit - %.0926 = phi i64 [ %61, %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit ], [ 0, %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit.preheader ] + %.0926 = phi i64 [ %60, %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit ], [ 0, %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit.preheader ] %22 = add nuw nsw i64 %.0926, %3 %23 = urem i64 %22, 10 %24 = getelementptr inbounds nuw i32, ptr @_ZN4absl13base_internal12_GLOBAL__N_16valuesE, i64 %23 %25 = load i32, ptr %24, align 4, !tbaa !27 - %reass.sub = sub i32 %25, %0 - %26 = add i32 %reass.sub, 1640531527 - %27 = xor i32 %26, %4 - %28 = add i32 %0, %27 - %29 = sub i32 -1640531527, %28 - %30 = shl i32 %27, 8 - %31 = xor i32 %29, %30 - %32 = add i32 %27, %31 - %33 = sub i32 %0, %32 - %34 = lshr i32 %31, 13 - %35 = xor i32 %33, %34 - %36 = add i32 %31, %35 - %37 = sub i32 %27, %36 - %38 = lshr i32 %35, 12 - %39 = xor i32 %37, %38 - %40 = add i32 %35, %39 - %41 = sub i32 %31, %40 - %42 = shl i32 %39, 16 - %43 = xor i32 %41, %42 - %44 = add i32 %39, %43 - %45 = sub i32 %35, %44 - %46 = lshr i32 %43, 5 - %47 = xor i32 %45, %46 - %48 = add i32 %43, %47 - %49 = sub i32 %39, %48 - %50 = lshr i32 %47, 3 - %51 = xor i32 %49, %50 - %52 = add i32 %47, %51 - %53 = sub i32 %43, %52 - %54 = shl i32 %51, 10 - %55 = xor i32 %53, %54 - %56 = add i32 %51, %55 - %57 = sub i32 %47, %56 - %58 = lshr i32 %55, 15 - %59 = xor i32 %57, %58 - store i32 %59, ptr %24, align 4, !tbaa !27 - %60 = tail call noundef i32 @sched_yield() #20 - %61 = add nuw nsw i64 %.0926, 1 - %exitcond.not = icmp eq i64 %61, 10 + %.reass.reass = add i32 %25, %invariant.op + %26 = xor i32 %.reass.reass, %4 + %27 = add i32 %0, %26 + %28 = sub i32 -1640531527, %27 + %29 = shl i32 %26, 8 + %30 = xor i32 %28, %29 + %31 = add i32 %26, %30 + %32 = sub i32 %0, %31 + %33 = lshr i32 %30, 13 + %34 = xor i32 %32, %33 + %35 = add i32 %30, %34 + %36 = sub i32 %26, %35 + %37 = lshr i32 %34, 12 + %38 = xor i32 %36, %37 + %39 = add i32 %34, %38 + %40 = sub i32 %30, %39 + %41 = shl i32 %38, 16 + %42 = xor i32 %40, %41 + %43 = add i32 %38, %42 + %44 = sub i32 %34, %43 + %45 = lshr i32 %42, 5 + %46 = xor i32 %44, %45 + %47 = add i32 %42, %46 + %48 = sub i32 %38, %47 + %49 = lshr i32 %46, 3 + %50 = xor i32 %48, %49 + %51 = add i32 %46, %50 + %52 = sub i32 %42, %51 + %53 = shl i32 %50, 10 + %54 = xor i32 %52, %53 + %55 = add i32 %50, %54 + %56 = sub i32 %46, %55 + %57 = lshr i32 %54, 15 + %58 = xor i32 %56, %57 + store i32 %58, ptr %24, align 4, !tbaa !27 + %59 = tail call noundef i32 @sched_yield() #20 + %60 = add nuw nsw i64 %.0926, 1 + %exitcond.not = icmp eq i64 %60, 10 br i1 %exitcond.not, label %13, label %_ZN4absl13base_internal14SpinLockHolderC2EPNS0_8SpinLockE.exit, !llvm.loop !154 } diff --git a/bench/abseil-cpp/optimized/str_split.ll b/bench/abseil-cpp/optimized/str_split.ll index f74a01597f0..2ed9b8a248d 100644 --- a/bench/abseil-cpp/optimized/str_split.ll +++ b/bench/abseil-cpp/optimized/str_split.ll @@ -148,31 +148,35 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit: ; preds = %21 %39 = load i8, ptr %27, align 1, !tbaa !14 %40 = sext i8 %39 to i32 %41 = ptrtoint ptr %35 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i: ; preds = %45, %.lr.ph.i.i.i.i - %.033.i.i.i.i = phi i64 [ %37, %.lr.ph.i.i.i.i ], [ %48, %45 ] - %.02132.i.i.i.i = phi ptr [ %38, %.lr.ph.i.i.i.i ], [ %46, %45 ] - %reass.sub = sub i64 %.033.i.i.i.i, %6 - %42 = add i64 %reass.sub, 1 - %43 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i.i.i, i32 noundef %40, i64 noundef %42) #11 - %.not26.i.i.i.i = icmp eq ptr %43, null + %invariant.op = sub i64 1, %6 + br label %42 + +42:; preds = %46, %.lr.ph.i.i.i.i + %.02132.i.i.i.i = phi i64 [ %37, %.lr.ph.i.i.i.i ], [ %49, %46 ] + %.02132.i.i.i.i = phi ptr [ %38, %.lr.ph.i.i.i.i ], [ %47, %46 ] + %42 = add i64 %.033.i.i.i.i, %invariant.op + %43 = icmp eq i64 %42, 0 + br i1 %43, label %_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i: ; preds = %42 + %44 = tail call ptr @memchr(ptr noundef %.02132.i.i.i.i, i32 noundef %40, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass) #11 + %.not26.i.i.i.i = icmp eq ptr %44, null br i1 %.not26.i.i.i.i, label %_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i - %bcmp.i.i.i.i = tail call i32 @bcmp(ptr nonnull %43, ptr nonnull readonly %27, i64 %6) + %bcmp.i.i.i.i = tail call i32 @bcmp(ptr nonnull %44, ptr nonnull readonly %27, i64 %6) %44 = icmp eq i32 %bcmp.i.i.i.i, 0 br i1 %44, label %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i, label %45 45: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i.i - %46 = getelementptr inbounds nuw i8, ptr %43, i64 1 + %46 = getelementptr inbounds nuw i8, ptr %44, i64 1 %47 = ptrtoint ptr %46 to i64 %48 = sub i64 %41, %47 %.not25.i.i.i.i = icmp ult i64 %48, %6 - br i1 %.not25.i.i.i.i, label %_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i, !llvm.loop !16 + br i1 %.not25.i.i.i.i, label %_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit, label %42, !llvm.loop !16 _ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i.i - %49 = ptrtoint ptr %43 to i64 + %49 = ptrtoint ptr %44 to i64 %50 = ptrtoint ptr %2 to i64 %51 = sub i64 %49, %50 %.not8.i = icmp eq i64 %51, -1 @@ -183,9 +187,9 @@ _ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_trait %52 = getelementptr inbounds nuw i8, ptr %2, i64 %.020.i.i.i27.i br label %_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit -_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit: ; preds = %45, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.thread24.i, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i, %36, %34, %33, %30, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit.thread, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit - %.sroa.016.0 = phi i64 [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit.thread ], [ %.sroa.speculated.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit ], [ 0, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i ], [ %6, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.thread24.i ], [ 0, %30 ], [ 0, %34 ], [ 0, %36 ], [ 0, %33 ], [ 0, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ 0, %45 ] - %.sroa.4.0 = phi ptr [ %20, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit.thread ], [ %25, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit ], [ %35, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i ], [ %52, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.thread24.i ], [ %32, %30 ], [ %35, %34 ], [ %35, %36 ], [ %2, %33 ], [ %35, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %35, %45 ] +_ZN4absl12_GLOBAL__N_111GenericFindINS0_13LiteralPolicyEEESt17basic_string_viewIcSt11char_traitsIcEES6_S6_mT_.exit: ; preds = %45, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i, %42, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.thread24.i, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i, %36, %34, %33, %30, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit.thread, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit + %.sroa.016.0 = phi i64 [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit.thread ], [ %.sroa.speculated.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit ], [ 0, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i ], [ %6, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.thread24.i ], [ 0, %30 ], [ 0, %34 ], [ 0, %36 ], [ 0, %33 ], [ 0, %42 ], [ 0, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ 0, %46 ] + %.sroa.4.0 = phi ptr [ %20, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit.thread ], [ %25, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit ], [ %35, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.i ], [ %52, %_ZN4absl12_GLOBAL__N_113LiteralPolicy4FindESt17basic_string_viewIcSt11char_traitsIcEES5_m.exit.thread24.i ], [ %32, %30 ], [ %35, %34 ], [ %35, %36 ], [ %2, %33 ], [ %35, %42 ], [ %35, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %35, %46 ] %.fca.0.insert = insertvalue { i64, ptr } poison, i64 %.sroa.016.0, 0 %.fca.1.insert = insertvalue { i64, ptr } %.fca.0.insert, ptr %.sroa.4.0, 1 ret { i64, ptr } %.fca.1.insert diff --git a/bench/abseil-cpp/optimized/stripping_test.ll b/bench/abseil-cpp/optimized/stripping_test.ll index 21fa5649f8c..82eac30d67d 100644 --- a/bench/abseil-cpp/optimized/stripping_test.ll +++ b/bench/abseil-cpp/optimized/stripping_test.ll @@ -6810,31 +6810,35 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEmcRKS3_.exit: %38 = load i8, ptr %33, align 1, !tbaa !18 %39 = sext i8 %38 to i32 %40 = ptrtoint ptr %37 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %44, %.lr.ph.i.i - %.033.i.i = phi i64 [ %.237, %.lr.ph.i.i ], [ %47, %44 ] - %.02132.i.i = phi ptr [ %32, %.lr.ph.i.i ], [ %45, %44 ] - %reass.sub = sub i64 %.033.i.i, %34 - %41 = add i64 %reass.sub, 1 - %42 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %39, i64 noundef %41) #33 - %.not26.i.i = icmp eq ptr %42, null + %invariant.op = sub i64 1, %34 + br label %41 + +41:; preds = %45, %.lr.ph.i.i + %.02132.i.i = phi i64 [ %.237, %.lr.ph.i.i ], [ %48, %45 ] + %.02132.i.i = phi ptr [ %32, %.lr.ph.i.i ], [ %46, %45 ] + %41 = add i64 %.033.i.i, %invariant.op + %42 = icmp eq i64 %41, 0 + br i1 %42, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %41 + %43 = call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %39, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #33 + %.not26.i.i = icmp eq ptr %43, null br i1 %.not26.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = call i32 @bcmp(ptr nonnull %42, ptr nonnull %33, i64 %34) + %bcmp.i.i = call i32 @bcmp(ptr nonnull %43, ptr nonnull %33, i64 %34) %43 = icmp eq i32 %bcmp.i.i, 0 br i1 %43, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %44 44: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %45 = getelementptr inbounds nuw i8, ptr %42, i64 1 + %45 = getelementptr inbounds nuw i8, ptr %43, i64 1 %46 = ptrtoint ptr %45 to i64 %47 = sub i64 %40, %46 %.not25.i.i = icmp ult i64 %47, %34 - br i1 %.not25.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !253 + br i1 %.not25.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread, label %41, !llvm.loop !253 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %48 = ptrtoint ptr %42 to i64 + %48 = ptrtoint ptr %43 to i64 %49 = ptrtoint ptr %32 to i64 %50 = sub i64 %48, %49 %.not40 = icmp eq i64 %50, -1 @@ -6871,7 +6875,7 @@ _ZN7testing19MatchResultListenerlsIA24_cEERS0_RKT_.exit: ; preds = %53 cleanup br label %79 -_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread: ; preds = %44, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %36, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit +_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %45, %41, %36, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit %62 = call i32 @feof(ptr noundef %1) #33 %.not41 = icmp eq i32 %62, 0 br i1 %.not41, label %_ZN7testing19MatchResultListenerlsImEERS0_RKT_.exit, label %63 @@ -6898,7 +6902,7 @@ _ZN7testing19MatchResultListenerlsImEERS0_RKT_.exit: ; preds = %_ZNKSt17basic_st br label %11, !llvm.loop !254 _ZN7testing19MatchResultListenerlsIA19_cEERS0_RKT_.exit: ; preds = %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread62, %63, %66, %_ZN7testing19MatchResultListenerlsIA24_cEERS0_RKT_.exit, %55, %26, %29 - %.1 = phi i1 [ false, %26 ], [ false, %29 ], [ false, %63 ], [ false, %66 ], [ true, %55 ], [ true, %_ZN7testing19MatchResultListenerlsIA24_cEERS0_RKT_.exit ], [ true, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread62 ] + %.1 = phi i1 [ false, %26 ], [ false, %29 ], [ false, %64 ], [ false, %67 ], [ true, %56 ], [ true, %_ZN7testing19MatchResultListenerlsIA24_cEERS0_RKT_.exit ], [ true, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread62 ] %75 = load ptr, ptr %3, align 8, !tbaa !20 %76 = icmp eq ptr %75, %8 br i1 %76, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i @@ -6914,7 +6918,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit: ; preds = %_ZN7t ret i1 %.1 79: ; preds = %58, %60, %22 - %.pn43 = phi { ptr, i32 } [ %23, %22 ], [ %61, %60 ], [ %59, %58 ] + %.pn43 = phi { ptr, i32 } [ %23, %22 ], [ %61, %61 ], [ %59, %59 ] %80 = load ptr, ptr %3, align 8, !tbaa !20 %81 = icmp eq ptr %80, %8 br i1 %81, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit54, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i52 diff --git a/bench/arrow/optimized/UriQuery.ll b/bench/arrow/optimized/UriQuery.ll index 68f95dfba41..1cd5208322c 100644 --- a/bench/arrow/optimized/UriQuery.ll +++ b/bench/arrow/optimized/UriQuery.ll @@ -158,13 +158,14 @@ define range(i32 0, 5) i32 @uriComposeQueryExA(ptr noundef %0, ptr noundef reado %14 = ptrtoint ptr %0 to i64 %15 = add nsw i32 %2, -1 %16 = zext nneg i32 %15 to i64 + %invariant.op = sub i64 1, %14 br label %.split.i .split.i: ; preds = %61, %.split.preheader.i - %.06395.i = phi ptr [ %63, %61 ], [ %1, %.split.preheader.i ] - %17 = phi i1 [ false, %61 ], [ true, %.split.preheader.i ] - %.06994.i = phi i32 [ %.372.i, %61 ], [ 0, %.split.preheader.i ] - %.07393.i = phi ptr [ %.275.i, %61 ], [ %0, %.split.preheader.i ] + %.06395.i = phi ptr [ %63, %60 ], [ %1, %.split.preheader.i ] + %17 = phi i1 [ false, %60 ], [ true, %.split.preheader.i ] + %.06994.i = phi i32 [ %.372.i, %60 ], [ 0, %.split.preheader.i ] + %.07393.i = phi ptr [ %.275.i, %60 ], [ %0, %.split.preheader.i ] %18 = load ptr, ptr %.06395.i, align 8, !tbaa !7 %19 = getelementptr inbounds nuw i8, ptr %.06395.i, i64 8 %20 = load ptr, ptr %19, align 8, !tbaa !12 @@ -224,11 +225,10 @@ define range(i32 0, 5) i32 @uriComposeQueryExA(ptr noundef %0, ptr noundef reado 50: ; preds = %46 %51 = ptrtoint ptr %49 to i64 %52 = sext i32 %35 to i64 - %reass.sub = sub i64 %52, %14 - %53 = add i64 %reass.sub, 1 - %54 = add i64 %53, %51 - %55 = icmp sgt i64 %54, %16 - br i1 %55, label %uriComposeQueryEngineA.exit, label %56 + %.reass.i.reass.reass = add i64 %52, %invariant.op + %53 = add i64 %.reass.i.reass.reass, %51 + %54 = icmp sgt i64 %53, %16 + br i1 %54, label %uriComposeQueryEngineA.exit, label %56 56: ; preds = %50 store i8 61, ptr %49, align 1, !tbaa !16 @@ -239,7 +239,7 @@ define range(i32 0, 5) i32 @uriComposeQueryExA(ptr noundef %0, ptr noundef reado br label %61 61: ; preds = %56, %46 - %.275.i = phi ptr [ %49, %46 ], [ %60, %56 ] + %.275.i = phi ptr [ %49, %46 ], [ %60, %55 ] %62 = getelementptr inbounds nuw i8, ptr %.06395.i, i64 16 %63 = load ptr, ptr %62, align 8, !tbaa !13 %.not.i = icmp eq ptr %63, null @@ -259,7 +259,7 @@ define range(i32 0, 5) i32 @uriComposeQueryExA(ptr noundef %0, ptr noundef reado br label %uriComposeQueryEngineA.exit uriComposeQueryEngineA.exit: ; preds = %50, %33, %31, %64, %.split97.us.i, %9, %6 - %.0 = phi i32 [ 4, %9 ], [ 2, %6 ], [ 0, %64 ], [ 0, %.split97.us.i ], [ 4, %31 ], [ 4, %33 ], [ 4, %50 ] + %.0 = phi i32 [ 4, %9 ], [ 2, %6 ], [ 0, %63 ], [ 0, %.split97.us.i ], [ 4, %31 ], [ 4, %33 ], [ 4, %50 ] ret i32 %.0 } diff --git a/bench/arrow/optimized/datetime.ll b/bench/arrow/optimized/datetime.ll index 118e113fd6b..bfd97c95c32 100644 --- a/bench/arrow/optimized/datetime.ll +++ b/bench/arrow/optimized/datetime.ll @@ -6544,11 +6544,11 @@ _ZNSt12system_errorC2EiRKNSt3_V214error_categoryEPKc.exit: ; preds = %3 %17 = ptrtoint ptr %16 to i64 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %21, %.lr.ph.i.i - %.033.i.i = phi i64 [ %13, %.lr.ph.i.i ], [ %24, %21 ] - %.02132.i.i = phi ptr [ %14, %.lr.ph.i.i ], [ %22, %21 ] +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %.lr.ph.i.i, %20 + %.033.i.i = phi i64 [ %13, %.lr.ph.i.i ], [ %24, %20 ] + %.02132.i.i = phi ptr [ %14, %.lr.ph.i.i ], [ %22, %20 ] %18 = add i64 %.033.i.i, -4 - %19 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef 112, i64 noundef %18) #33 + %19 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef 112, i64 noundef %18) #33 %.not26.i.i = icmp eq ptr %19, null br i1 %.not26.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -6568,7 +6568,7 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit: ; preds = %_ZNSt1 %25 = icmp eq ptr %19, %14 br i1 %25, label %_ZNSt10unique_ptrIcPDoFvPvEED2Ev.exit, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread -_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread: ; preds = %21, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit +_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit %26 = icmp eq i64 %13, 10 br i1 %26, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i, label %_ZNSt10unique_ptrIcPDoFvPvEED2Ev.exit @@ -6589,7 +6589,7 @@ _ZNSt10unique_ptrIcPDoFvPvEED2Ev.exit: ; preds = %12, %_ZNSt11char_tr br label %_ZNSt10unique_ptrIcPDoFvPvEED2Ev.exit8 _ZNSt10unique_ptrIcPDoFvPvEED2Ev.exit8: ; preds = %8, %28 - %.pn13 = phi { ptr, i32 } [ %29, %28 ], [ %9, %8 ] + %.pn13 = phi { ptr, i32 } [ %29, %27 ], [ %9, %8 ] resume { ptr, i32 } %.pn13 } diff --git a/bench/arrow/optimized/uri.ll b/bench/arrow/optimized/uri.ll index 365df63ac1d..a1f01bdce41 100644 --- a/bench/arrow/optimized/uri.ll +++ b/bench/arrow/optimized/uri.ll @@ -335,7 +335,7 @@ define void @_ZN5arrow4util13UriEncodeHostB5cxx11ESt17basic_string_viewIcSt11cha _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %10, %.lr.ph.i.i %.033.i.i = phi i64 [ %1, %.lr.ph.i.i ], [ %13, %10 ] %.02132.i.i = phi ptr [ %2, %.lr.ph.i.i ], [ %11, %10 ] - %8 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef 58, i64 noundef %.033.i.i) #25 + %8 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef 58, i64 noundef %.033.i.i) #25 %.not26.i.i = icmp eq ptr %8, null br i1 %.not26.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -429,7 +429,7 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i: tail call void @_ZdlPvm(ptr noundef %39, i64 noundef %42) #23 br label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit -_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread: ; preds = %10, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit +_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %10, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit %43 = getelementptr inbounds nuw i8, ptr %0, i64 16 store ptr %43, ptr %0, align 8, !tbaa !3 %44 = icmp eq ptr %2, null diff --git a/bench/clamav/optimized/bytecode_api.ll b/bench/clamav/optimized/bytecode_api.ll index 2520a6de8a4..a88a164d549 100644 --- a/bench/clamav/optimized/bytecode_api.ll +++ b/bench/clamav/optimized/bytecode_api.ll @@ -979,7 +979,11 @@ fmap_readn.exit.us: ; preds = %47, %37 .split: ; preds = %16 %54 = icmp eq i32 %2, 1 - br i1 %54, label %.split.split.us, label %.split.split + br i1 %54, label %.split.split.us, label %.split.split.preheader + +.split.split.preheader: ; preds = %.split + %invariant.op = sub i32 1, %2 + br label %.split.split .split.split.us: ; preds = %.split, %cli_memmem.exit.us %.045.us73 = phi i32 [ %81, %cli_memmem.exit.us ], [ %19, %.split ] @@ -1038,8 +1042,8 @@ cli_memmem.exit.us: ; preds = %fmap_readn.exit.us7 %81 = add i32 %.045.us73, %77 br i1 %.not.us, label %.split.split.us, label %cli_memmem.exit.thread61 -.split.split: ; preds = %.split, %cli_memmem.exit.thread.loopexit - %.045 = phi i32 [ %123, %cli_memmem.exit.thread.loopexit ], [ %19, %.split ] +.split.split: ; preds = %.split.split.preheader, %cli_memmem.exit.thread.loopexit + %.045 = phi i32 [ %123, %cli_memmem.exit.thread.loopexit ], [ %19, %.split.split.preheader ] %82 = zext i32 %.045 to i64 %83 = add nuw nsw i64 %82, 4096 %84 = icmp samesign ugt i64 %83, %20 @@ -1093,33 +1097,32 @@ fmap_readn.exit: ; preds = %89, %99 br label %107 107: ; preds = %113, %.preheader.i - %.02537.i = phi ptr [ %5, %.preheader.i ], [ %112, %113 ] - %.02636.i = phi i32 [ %104, %.preheader.i ], [ %117, %113 ] - %reass.sub = sub i32 %.02636.i, %2 - %108 = add i32 %reass.sub, 1 - %109 = zext i32 %108 to i64 - %110 = call ptr @memchr(ptr noundef nonnull %.02537.i, i32 noundef %106, i64 noundef %109) #29 - %.not32.i = icmp eq ptr %110, null - br i1 %.not32.i, label %cli_memmem.exit.thread.loopexit, label %111 - -111: ; preds = %107 - %112 = getelementptr inbounds nuw i8, ptr %110, i64 1 - %bcmp.i = call i32 @bcmp(ptr nonnull %112, ptr nonnull readonly %27, i64 %29) + %.02537.i = phi ptr [ %5, %.preheader.i ], [ %111, %112 ] + %.02636.i = phi i32 [ %104, %.preheader.i ], [ %117, %112 ] + %.reass.i.reass.reass = add i32 %.02636.i, %invariant.op + %108 = zext i32 %.reass.i.reass.reass to i64 + %109 = call ptr @memchr(ptr noundef nonnull %.02537.i, i32 noundef %106, i64 noundef %108) #29 + %.not32.i = icmp eq ptr %109, null + br i1 %.not32.i, label %cli_memmem.exit.thread.loopexit, label %110 + +110: ; preds = %107 + %111 = getelementptr inbounds nuw i8, ptr %109, i64 1 + %bcmp.i = call i32 @bcmp(ptr nonnull %111, ptr nonnull readonly %27, i64 %29) %.not33.i = icmp eq i32 %bcmp.i, 0 br i1 %.not33.i, label %cli_memmem.exit.thread61, label %113 -113: ; preds = %111 +113: ; preds = %110 %114 = ptrtoint ptr %.02537.i to i64 - %115 = ptrtoint ptr %112 to i64 + %115 = ptrtoint ptr %111 to i64 %.neg.i = sub i64 %114, %115 %116 = trunc i64 %.neg.i to i32 %117 = add i32 %.02636.i, %116 %.not31.i = icmp ult i32 %117, %2 br i1 %.not31.i, label %cli_memmem.exit.thread.loopexit, label %107 -cli_memmem.exit.thread61: ; preds = %111, %cli_memmem.exit.us - %.04572 = phi i32 [ %.045.us73, %cli_memmem.exit.us ], [ %.045, %111 ] - %.0.i5664 = phi ptr [ %80, %cli_memmem.exit.us ], [ %110, %111 ] +cli_memmem.exit.thread61: ; preds = %110, %cli_memmem.exit.us + %.04572 = phi i32 [ %.045.us73, %cli_memmem.exit.us ], [ %.045, %110 ] + %.0.i5664 = phi ptr [ %80, %cli_memmem.exit.us ], [ %109, %110 ] %118 = ptrtoint ptr %.0.i5664 to i64 %119 = ptrtoint ptr %5 to i64 %120 = sub i64 %118, %119 diff --git a/bench/clamav/optimized/pe.ll b/bench/clamav/optimized/pe.ll index 3443cff0101..1a95f4ce8af 100644 --- a/bench/clamav/optimized/pe.ll +++ b/bench/clamav/optimized/pe.ll @@ -1806,7 +1806,7 @@ get_pe_property.exit: ; preds = %26, %31, %36 br label %256 256: ; preds = %.preheader3688, %281 - %indvars.iv127.i = phi i64 [ %indvars.iv.next128.i, %281 ], [ 0, %.preheader3688 ] + %indvars.iv127.i = phi i64 [ %indvars.iv.next128.i, %281 ], [ 0, %.preheader3689 ] %257 = getelementptr inbounds nuw i32, ptr %4, i64 %indvars.iv127.i %258 = load i32, ptr %257, align 4, !tbaa !10 %.not101.i = icmp eq i32 %258, 0 @@ -4677,6 +4677,7 @@ cli_rawaddr.exit2936: ; preds = %1638 %1694 = load ptr, ptr %13, align 8 %1695 = getelementptr inbounds nuw %struct.cli_exe_section, ptr %1694, i64 %1653 %1696 = getelementptr inbounds nuw i8, ptr %1695, i64 4 + %invariant.op = sub i32 -8192, %1693 br label %1698 1697: ; preds = %1687 @@ -4704,15 +4705,14 @@ cli_rawaddr.exit2936: ; preds = %1638 1711: ; preds = %1698 %1712 = shl nsw i32 %1709, 12 - %reass.sub3325 = sub i32 %1712, %1693 - %.reass = add i32 %reass.sub3325, -8192 + %.reass.reass.reass = add i32 %1712, %invariant.op %1713 = add nuw nsw i32 %.021653273, 1 %1714 = load i32, ptr %1695, align 4, !tbaa !8 - %1715 = icmp ult i32 %.reass, %1714 + %1715 = icmp ult i32 %.reass.reass.reass, %1714 br i1 %1715, label %1719, label %1716 1716: ; preds = %1711 - %1717 = sub nuw i32 %.reass, %1714 + %1717 = sub nuw i32 %.reass.reass.reass, %1714 %1718 = load i32, ptr %1696, align 4, !tbaa !59 %.not2651 = icmp ult i32 %1717, %1718 br i1 %.not2651, label %1720, label %1719 diff --git a/bench/cmake/optimized/cmQtAutoGenerator.ll b/bench/cmake/optimized/cmQtAutoGenerator.ll index 54e0d98d3d8..86cc66fdc2e 100644 --- a/bench/cmake/optimized/cmQtAutoGenerator.ll +++ b/bench/cmake/optimized/cmQtAutoGenerator.ll @@ -4183,31 +4183,35 @@ define dso_local void @_ZN17cmQtAutoGenerator12SettingsFindB5cxx11ESt17basic_str %22 = load i8, ptr %16, align 1, !tbaa !13 %23 = sext i8 %22 to i32 %24 = ptrtoint ptr %21 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %28, %.lr.ph.i.i - %.033.i.i = phi i64 [ %1, %.lr.ph.i.i ], [ %31, %28 ] - %.02132.i.i = phi ptr [ %2, %.lr.ph.i.i ], [ %29, %28 ] - %reass.sub = sub i64 %.033.i.i, %18 - %25 = add i64 %reass.sub, 1 - %26 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %23, i64 noundef %25) #24 - %.not26.i.i = icmp eq ptr %26, null + %invariant.op = sub i64 1, %18 + br label %25 + +25:; preds = %29, %.lr.ph.i.i + %.02132.i.i = phi i64 [ %1, %.lr.ph.i.i ], [ %32, %29 ] + %.02132.i.i = phi ptr [ %2, %.lr.ph.i.i ], [ %30, %29 ] + %25 = add i64 %.033.i.i, %invariant.op + %26 = icmp eq i64 %25, 0 + br i1 %26, label %._crit_edge.i.i.i.i.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %25 + %27 = call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %23, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #24 + %.not26.i.i = icmp eq ptr %27, null br i1 %.not26.i.i, label %._crit_edge.i.i.i.i.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = call i32 @bcmp(ptr nonnull %26, ptr nonnull %16, i64 %18) + %bcmp.i.i = call i32 @bcmp(ptr nonnull %27, ptr nonnull %16, i64 %18) %27 = icmp eq i32 %bcmp.i.i, 0 br i1 %27, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %28 28: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %29 = getelementptr inbounds nuw i8, ptr %26, i64 1 + %29 = getelementptr inbounds nuw i8, ptr %27, i64 1 %30 = ptrtoint ptr %29 to i64 %31 = sub i64 %24, %30 %.not25.i.i = icmp ult i64 %31, %18 - br i1 %.not25.i.i, label %._crit_edge.i.i.i.i.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !397 + br i1 %.not25.i.i, label %._crit_edge.i.i.i.i.thread, label %25, !llvm.loop !397 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %32 = ptrtoint ptr %26 to i64 + %32 = ptrtoint ptr %27 to i64 %33 = ptrtoint ptr %2 to i64 %34 = sub i64 %32, %33 %.not = icmp eq i64 %34, -1 @@ -4233,7 +4237,7 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit: ; preds = %_ZNKSt17 %or.cond = or i1 %.not16, %.not17 br i1 %or.cond, label %._crit_edge.i.i.i.i.thread, label %44 -._crit_edge.i.i.i.i.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %28, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread39, %20 +._crit_edge.i.i.i.i.thread: ; preds = %25, %29, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.thread39, %20 %43 = getelementptr inbounds nuw i8, ptr %0, i64 16 store ptr %43, ptr %0, align 8, !tbaa !4 call void @llvm.lifetime.start.p0(ptr nonnull %6) @@ -4272,8 +4276,8 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEcm.exit: ; preds = %_ZNKSt17 br label %._crit_edge.i.i.i.i ._crit_edge.i.i.i.i: ; preds = %.noexc25, %49 - %53 = phi ptr [ %51, %.noexc25 ], [ %46, %49 ] - switch i64 %.sroa.speculated.i, label %56 [ + %53 = phi ptr [ %51, %.noexc25 ], [ %46, %50 ] + switch i64 %.sroa.speculated.i, label %57 [ i64 1, label %54 i64 0, label %57 ] diff --git a/bench/cmake/optimized/cmSystemTools.ll b/bench/cmake/optimized/cmSystemTools.ll index 0256a71cffb..368186854bf 100644 --- a/bench/cmake/optimized/cmSystemTools.ll +++ b/bench/cmake/optimized/cmSystemTools.ll @@ -23444,7 +23444,11 @@ define internal fastcc noundef i64 @_ZL22cmSystemToolsFindRPathRKSt17basic_strin %2 = getelementptr inbounds nuw i8, ptr %.8.val, i64 %.0.val %3 = ptrtoint ptr %2 to i64 %4 = ptrtoint ptr %.8.val to i64 - br i1 %1, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, label %.lr.ph.split + br i1 %1, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, label %.lr.ph.split.preheader + +.lr.ph.split.preheader: ; preds = %.lr.ph + %invariant.op = sub i64 1, %.0.val1 + br label %.lr.ph.split _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us: ; preds = %.lr.ph, %12 %.02111.us = phi i64 [ %.122.us, %12 ], [ 0, %.lr.ph ] @@ -23471,8 +23475,8 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us: ; preds = %.lr %exitcond.not = icmp eq i64 %.122.us, %.0.val br i1 %exitcond.not, label %.thread, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us -.lr.ph.split: ; preds = %.lr.ph, %36 - %.02111 = phi i64 [ %.122, %36 ], [ 0, %.lr.ph ] +.lr.ph.split: ; preds = %.lr.ph.split.preheader, %36 + %.02111 = phi i64 [ %.122, %37 ], [ 0, %.lr.ph.split.preheader ] %13 = sub nuw i64 %.0.val, %.02111 %.not2531.i.i = icmp ult i64 %13, %.0.val1 br i1 %.not2531.i.i, label %.thread, label %.lr.ph.i.i @@ -23484,29 +23488,32 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us: ; preds = %.lr br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %22, %.lr.ph.i.i - %.033.i.i = phi i64 [ %13, %.lr.ph.i.i ], [ %25, %22 ] - %.02132.i.i = phi ptr [ %14, %.lr.ph.i.i ], [ %23, %22 ] - %reass.sub = sub i64 %.033.i.i, %.0.val1 - %17 = add i64 %reass.sub, 1 - %18 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %16, i64 noundef %17) #40 - %.not26.i.i = icmp eq ptr %18, null + %.033.i.i = phi i64 [ %13, %.lr.ph.i.i ], [ %25, %23 ] + %.02132.i.i = phi ptr [ %14, %.lr.ph.i.i ], [ %23, %23 ] + %.reass.reass.i.reass.reass.i.reass.reass.reass = add i64 %.033.i.i, %invariant.op + %18 = icmp eq i64 %.reass.reass.i.reass.reass.i.reass.reass.reass, 0 + br i1 %18, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %17 + %19 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %16, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #40 + %.not26.i.i = icmp eq ptr %19, null br i1 %.not26.i.i, label %.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %18, ptr nonnull %.8.val3, i64 %.0.val1) + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %19, ptr nonnull %.8.val3, i64 %.0.val1) %19 = icmp eq i32 %bcmp.i.i, 0 br i1 %19, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %22 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %20 = ptrtoint ptr %18 to i64 + %20 = ptrtoint ptr %19 to i64 %21 = sub i64 %20, %4 - switch i64 %21, label %26 [ + switch i64 %21, label %27 [ i64 -1, label %.thread i64 0, label %30 ] 22: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %23 = getelementptr inbounds nuw i8, ptr %18, i64 1 + %23 = getelementptr inbounds nuw i8, ptr %19, i64 1 %24 = ptrtoint ptr %23 to i64 %25 = sub i64 %3, %24 %.not25.i.i = icmp ult i64 %25, %.0.val1 @@ -23536,11 +23543,11 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt1 br i1 %37, label %.lr.ph.split, label %.thread ..thread.loopexit9_crit_edge13: ; preds = %33, %9 - %.us-phi20 = phi i64 [ %.02111.us, %9 ], [ %21, %33 ] + %.us-phi20 = phi i64 [ %.02111.us, %9 ], [ %21, %34 ] br label %.thread, !llvm.loop !745 -.thread: ; preds = %36, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %30, %.lr.ph.split, %22, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %12, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, %0, %..thread.loopexit9_crit_edge13 - %.3 = phi i64 [ -1, %0 ], [ -1, %12 ], [ -1, %22 ], [ %.us-phi20, %..thread.loopexit9_crit_edge13 ], [ %.02111.us, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us ], [ -1, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ -1, %36 ], [ %21, %30 ], [ %21, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ -1, %.lr.ph.split ] +.thread: ; preds = %36, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %30, %.lr.ph.split, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %23, %17, %12, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, %0, %..thread.loopexit9_crit_edge13 + %.3 = phi i64 [ -1, %0 ], [ %.us-phi20, %..thread.loopexit9_crit_edge12 ], [ -1, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ -1, %12 ], [ %.02111.us, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us ], [ -1, %17 ], [ -1, %23 ], [ -1, %37 ], [ %21, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ %22, %31 ], [ -1, %.lr.ph.split ] ret i64 %.3 } @@ -24242,11 +24249,11 @@ _ZN5cmsys17RegularExpressionC2EPKc.exit: ; preds = %15 %25 = ptrtoint ptr %24 to i64 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %29, %.lr.ph.i.i - %.033.i.i = phi i64 [ %.pre, %.lr.ph.i.i ], [ %32, %29 ] - %.02132.i.i = phi ptr [ %.sroa.411.0.copyload12.pre.pre, %.lr.ph.i.i ], [ %30, %29 ] +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %.lr.ph.i.i, %28 + %.033.i.i = phi i64 [ %.pre, %.lr.ph.i.i ], [ %32, %28 ] + %.02132.i.i = phi ptr [ %.sroa.411.0.copyload12.pre.pre, %.lr.ph.i.i ], [ %30, %28 ] %26 = add i64 %.033.i.i, -7 - %27 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef 107, i64 noundef %26) #40 + %27 = call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef 107, i64 noundef %26) #40 %.not26.i.i = icmp eq ptr %27, null br i1 %.not26.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -24276,9 +24283,9 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split: store ptr %.str.84.sink, ptr @_ZZN13cmSystemTools13GetSystemNameEvE10systemName.1, align 8, !tbaa !22 br label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread -_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread: ; preds = %29, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split, %23, %22, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit - %.sroa.411.0.copyload12 = phi ptr [ %.sroa.411.0.copyload12.pre.pre, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit ], [ %.sroa.411.0.copyload12.pre.pre, %23 ], [ %.sroa.411.0.copyload12.pre.pre, %22 ], [ %.str.84.sink, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split ], [ %.sroa.411.0.copyload12.pre.pre, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ %.sroa.411.0.copyload12.pre.pre, %29 ] - %.sroa.09.0.copyload10 = phi i64 [ %.pre, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit ], [ %.pre, %23 ], [ 0, %22 ], [ %.sink, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split ], [ %.pre, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ %.pre, %29 ] +_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %28, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split, %23, %22, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit + %.sroa.411.0.copyload12 = phi ptr [ %.sroa.411.0.copyload12.pre.pre, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit ], [ %.sroa.411.0.copyload12.pre.pre, %23 ], [ %.sroa.411.0.copyload12.pre.pre, %22 ], [ %.str.84.sink, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split ], [ %.sroa.411.0.copyload12.pre.pre, %28 ], [ %.sroa.411.0.copyload12.pre.pre, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] + %.sroa.09.0.copyload10 = phi i64 [ %.pre, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit ], [ %.pre, %23 ], [ 0, %22 ], [ %.sink, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit.thread.sink.split ], [ %.pre, %28 ], [ %.pre, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] call void @llvm.lifetime.end.p0(ptr nonnull %1) br label %36 diff --git a/bench/coreutils-rs/optimized/4dx3xgc2q0yp2q7n.ll b/bench/coreutils-rs/optimized/4dx3xgc2q0yp2q7n.ll index 521f8cff6e1..5cb91c2ad12 100644 --- a/bench/coreutils-rs/optimized/4dx3xgc2q0yp2q7n.ll +++ b/bench/coreutils-rs/optimized/4dx3xgc2q0yp2q7n.ll @@ -1146,6 +1146,7 @@ _ZN4core3str11validations15next_code_point17h24423c71b47f8f25E.exit.thread.i.i.i %224 = getelementptr inbounds nuw i8, ptr %6, i64 24 %225 = load i64, ptr %224, align 8, !alias.scope !163, !noalias !170 %226 = sub i64 %216, %225 + %invariant.op = sub i64 1, %223 br label %227 227: ; preds = %.sink.split.i.i, %.lr.ph.i44.i @@ -1171,7 +1172,7 @@ _ZN4core3str11validations15next_code_point17h24423c71b47f8f25E.exit.thread.i.i.i .sink.split.i.i: ; preds = %271, %258, %238 %.sink.i.i = phi i64 [ 0, %271 ], [ %226, %258 ], [ 0, %238 ] - %.ph87.i.i = phi i64 [ %273, %271 ], [ %259, %258 ], [ %239, %238 ] + %.ph87.i.i = phi i64 [ %272, %271 ], [ %259, %258 ], [ %239, %238 ] %241 = add i64 %.ph87.i.i, %219 %.not34.i.i = icmp ult i64 %241, %212 br i1 %.not34.i.i, label %227, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit.i" @@ -1237,9 +1238,8 @@ _ZN4core3str11validations15next_code_point17h24423c71b47f8f25E.exit.thread.i.i.i unreachable 271: ; preds = %263 - %reass.sub = sub i64 %228, %223 - %272 = add i64 %reass.sub, 1 - %273 = add i64 %272, %.sroa.04.0.i.i + %.reass.i.reass.reass = add i64 %228, %invariant.op + %272 = add i64 %.reass.i.reass.reass, %.sroa.04.0.i.i br label %.sink.split.i.i 274: ; preds = %205 @@ -1249,7 +1249,7 @@ _ZN4core3str11validations15next_code_point17h24423c71b47f8f25E.exit.thread.i.i.i br label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit.i" "_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit.i": ; preds = %196, %.sink.split.i.i, %.preheader.i, %274, %217, %.loopexit11.i.i, %.thread.i.i.i, %.preheader.i39.i - %276 = phi i8 [ %275, %274 ], [ 0, %.thread.i.i.i ], [ 1, %.loopexit11.i.i ], [ 0, %.preheader.i39.i ], [ 1, %.preheader.i ], [ 0, %217 ], [ 0, %.sink.split.i.i ], [ 0, %196 ] + %276 = phi i8 [ %275, %273 ], [ 0, %.thread.i.i.i ], [ 1, %.loopexit11.i.i ], [ 0, %.preheader.i39.i ], [ 1, %.preheader.i ], [ 0, %217 ], [ 0, %.sink.split.i.i ], [ 0, %196 ] call void @llvm.lifetime.end.p0(ptr nonnull %6), !noalias !140 call void @llvm.lifetime.end.p0(ptr nonnull %7), !noalias !140 br label %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$15is_contained_in17h04515ee06e6bece1E.exit" @@ -1266,7 +1266,7 @@ _ZN4core3str11validations15next_code_point17h24423c71b47f8f25E.exit.thread.i.i.i br i1 %280, label %285, label %281 _ZN4core5slice6memchr12memchr_naive17hc161699a4e4d4b77E.exit: ; preds = %.lr.ph.i, %281, %285, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$15is_contained_in17h04515ee06e6bece1E.exit" - %.0.in = phi i1 [ %277, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$15is_contained_in17h04515ee06e6bece1E.exit" ], [ %284, %281 ], [ false, %285 ], [ %288, %.lr.ph.i ] + %.0.in = phi i1 [ %277, %"_ZN55_$LT$$RF$str$u20$as$u20$core..str..pattern..Pattern$GT$15is_contained_in17h04515ee06e6bece1E.exit" ], [ %284, %280 ], [ false, %284 ], [ %288, %.lr.ph.i ] ret i1 %.0.in 281: ; preds = %278 @@ -1280,7 +1280,7 @@ _ZN4core5slice6memchr12memchr_naive17hc161699a4e4d4b77E.exit: ; preds = %.lr.ph. br i1 %.not.i, label %_ZN4core5slice6memchr12memchr_naive17hc161699a4e4d4b77E.exit, label %.lr.ph.i .lr.ph.i: ; preds = %285, %.lr.ph.i - %.05.i = phi i64 [ %289, %.lr.ph.i ], [ 0, %285 ] + %.05.i = phi i64 [ %289, %.lr.ph.i ], [ 0, %284 ] %286 = getelementptr inbounds nuw i8, ptr %1, i64 %.05.i %287 = load i8, ptr %286, align 1, !alias.scope !175, !noundef !9 %288 = icmp eq i8 %287, %279 diff --git a/bench/curl/optimized/tool_cb_dbg.ll b/bench/curl/optimized/tool_cb_dbg.ll index bca9536a369..30ef7a615c1 100644 --- a/bench/curl/optimized/tool_cb_dbg.ll +++ b/bench/curl/optimized/tool_cb_dbg.ll @@ -394,7 +394,7 @@ log_line_start.exit102: ; preds = %159, %157, %148 br label %251 163: ; preds = %78 - switch i32 %1, label %251 [ + switch i32 %1, label %249 [ i32 0, label %164 i32 2, label %172 i32 4, label %167 @@ -516,7 +516,7 @@ log_line_start.exit102: ; preds = %159, %157, %148 br label %222 .loopexit.us106.i: ; preds = %232, %.critedge78.us.i - %.190.us.i = phi i64 [ %221, %.critedge78.us.i ], [ 0, %232 ] + %.190.us.i = phi i64 [ %221, %.critedge78.us.i ], [ 0, %230 ] %214 = add nuw i64 %.190.us.i, %.068101.us103.i %215 = icmp ult i64 %214, %3 br i1 %215, label %.critedge78.us.i, label %.critedge.loopexit.split.us.i @@ -534,7 +534,7 @@ log_line_start.exit102: ; preds = %159, %157, %148 br i1 %exitcond114.not.i, label %.critedge.loopexit.split.us.i, label %.loopexit.us106.i, !llvm.loop !47 222: ; preds = %232, %.preheader.us105.i - %.086.us104.i = phi i64 [ 0, %.preheader.us105.i ], [ %233, %232 ] + %.086.us104.i = phi i64 [ 0, %.preheader.us105.i ], [ %233, %230 ] %223 = add i64 %.086.us104.i, %.068101.us103.i %224 = icmp ult i64 %223, %3 br i1 %224, label %227, label %225 diff --git a/bench/darktable/optimized/identify_tools.ll b/bench/darktable/optimized/identify_tools.ll index 501173e2cd1..88e3363535b 100644 --- a/bench/darktable/optimized/identify_tools.ll +++ b/bench/darktable/optimized/identify_tools.ll @@ -470,6 +470,7 @@ define void @_ZN6LibRaw17remove_caseSubstrEPcS0_(ptr noundef %0, ptr noundef %1) %4 = ptrtoint ptr %0 to i64 %5 = trunc i64 %4 to i32 %6 = add i32 %5, -1 + %invariant.op = sub i32 1, %5 br label %8 .loopexit: ; preds = %.lr.ph.preheader, %8 @@ -493,14 +494,13 @@ define void @_ZN6LibRaw17remove_caseSubstrEPcS0_(ptr noundef %0, ptr noundef %1) %17 = ashr exact i64 %sext, 32 %scevgep = getelementptr i8, ptr %0, i64 %17 %18 = trunc i64 %13 to i32 - %reass.sub = sub i32 %18, %5 - %19 = add i32 %reass.sub, 1 - %smax = tail call i32 @llvm.smax.i32(i32 %16, i32 %19) - %20 = add i32 %6, %smax - %21 = sub i32 %20, %18 - %22 = zext i32 %21 to i64 - %23 = add nuw nsw i64 %22, 1 - tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 32, i64 %23, i1 false), !tbaa !73 + %.reass.reass = add i32 %18, %invariant.op + %smax = tail call i32 @llvm.smax.i32(i32 %16, i32 %.reass.reass) + %19 = add i32 %6, %smax + %20 = sub i32 %19, %18 + %21 = zext i32 %20 to i64 + %22 = add nuw nsw i64 %21, 1 + tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 32, i64 %22, i1 false), !tbaa !73 br label %.loopexit ._crit_edge: ; preds = %.loopexit, %2 @@ -543,9 +543,9 @@ define void @_ZN6LibRaw17remove_caseSubstrEPcS0_(ptr noundef %0, ptr noundef %1) br i1 %.not16.i, label %.preheader.loopexit.i, label %.lr.ph.i, !llvm.loop !85 .lr.ph25.i: ; preds = %.preheader.i, %42 - %39 = phi i8 [ %45, %42 ], [ %33, %.preheader.i ] - %.124.i = phi i32 [ %44, %42 ], [ %.0.lcssa.i, %.preheader.i ] - %.01323.i = phi ptr [ %43, %42 ], [ %0, %.preheader.i ] + %39 = phi i8 [ %45, %41 ], [ %33, %.preheader.i ] + %.124.i = phi i32 [ %44, %41 ], [ %.0.lcssa.i, %.preheader.i ] + %.01323.i = phi ptr [ %43, %41 ], [ %0, %.preheader.i ] %40 = sext i8 %39 to i32 %41 = tail call i32 @isspace(i32 noundef %40) #13 %.not18.i = icmp eq i32 %41, 0 @@ -559,8 +559,8 @@ define void @_ZN6LibRaw17remove_caseSubstrEPcS0_(ptr noundef %0, ptr noundef %1) br i1 %.not17.i, label %.critedge.i, label %.lr.ph25.i, !llvm.loop !86 .critedge.i: ; preds = %42, %.lr.ph25.i, %.preheader.i - %.013.lcssa.i = phi ptr [ %0, %.preheader.i ], [ %.01323.i, %.lr.ph25.i ], [ %43, %42 ] - %.1.lcssa.i = phi i32 [ %.0.lcssa.i, %.preheader.i ], [ %.124.i, %.lr.ph25.i ], [ %44, %42 ] + %.013.lcssa.i = phi ptr [ %0, %.preheader.i ], [ %.01323.i, %.lr.ph25.i ], [ %43, %41 ] + %.1.lcssa.i = phi i32 [ %.0.lcssa.i, %.preheader.i ], [ %.124.i, %.lr.ph25.i ], [ %44, %41 ] %46 = add nsw i32 %.1.lcssa.i, 1 %47 = sext i32 %46 to i64 tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 1 %0, ptr nonnull align 1 %.013.lcssa.i, i64 %47, i1 false) diff --git a/bench/eastl/optimized/EATextUtil.ll b/bench/eastl/optimized/EATextUtil.ll index de27b36ec95..58dfa72e2cc 100644 --- a/bench/eastl/optimized/EATextUtil.ll +++ b/bench/eastl/optimized/EATextUtil.ll @@ -3125,6 +3125,7 @@ _ZN2EA4StdCL26BoyerMooreBadCharacterCalcEPKciPii.exit: ; preds = %for.body3.i, % while.cond.preheader.us.preheader: ; preds = %_ZN2EA4StdCL26BoyerMooreBadCharacterCalcEPKciPii.exit %19 = zext nneg i32 %nPatternLength to i64 + %invariant.op = sub i32 1, %nPatternLength br label %while.cond.preheader.us while.cond.preheader.us: ; preds = %while.cond.preheader.us.preheader, %for.inc.us @@ -3198,9 +3199,8 @@ if.else.us: ; preds = %land.rhs.us74, %if. %idxprom21.us = sext i8 %24 to i64 %arrayidx22.us = getelementptr inbounds i32, ptr %pAlphabetBuffer, i64 %idxprom21.us %25 = load i32, ptr %arrayidx22.us, align 4 - %reass.sub = sub i32 %.us-phi.us, %nPatternLength - %add24.us = add i32 %reass.sub, 1 - %add25.us = add i32 %add24.us, %25 + %add24.us.reass.reass = add i32 %.us-phi.us, %invariant.op + %add24.us = add i32 %add24.us.reass.reass, %25 %cond.us = tail call i32 @llvm.smax.i32(i32 %sub16.us, i32 %add25.us) %arrayidx28.us = getelementptr inbounds nuw i32, ptr %pPatternBuffer1, i64 %idxprom27.us.pre-phi %26 = load i32, ptr %arrayidx28.us, align 4 diff --git a/bench/faiss/optimized/PolysemousTraining.ll b/bench/faiss/optimized/PolysemousTraining.ll index 391748166d5..1742ccc7ac6 100644 --- a/bench/faiss/optimized/PolysemousTraining.ll +++ b/bench/faiss/optimized/PolysemousTraining.ll @@ -3951,23 +3951,26 @@ _ZSt4sortIPiN5faiss12IndirectSortEEvT_S3_T0_.exit: ; preds = %.noexc46 %84 = icmp ult i64 %.1.lcssa.i.us, %76 br i1 %84, label %.lr.ph34.i.us, label %._crit_edge.i.us -.lr.ph34.i.us: ; preds = %.critedge.i.us, %.lr.ph34.i.us - %.033.i.us = phi i64 [ %91, %.lr.ph34.i.us ], [ %.1.lcssa.i.us, %.critedge.i.us ] - %.02532.i.us = phi double [ %90, %.lr.ph34.i.us ], [ 0.000000e+00, %.critedge.i.us ] +.lr.ph34.i.us: ; preds = %.critedge.i.us + %invariant.op = sub i32 1, %78 + br label %.lr.ph34.i.us + +.lr.ph34.i.us: ; preds = %.lr.ph34.i.us.preheader, %.lr.ph34.i.us + %.033.i.us = phi i64 [ %90, %.lr.ph34.i.us ], [ %.1.lcssa.i.us, %.lr.ph34.i.us.preheader ] + %.02532.i.us = phi double [ %89, %.lr.ph34.i.us ], [ 0.000000e+00, %.lr.ph34.i.us.preheader ] %85 = getelementptr inbounds nuw i32, ptr %72, i64 %.033.i.us %86 = load i32, ptr %85, align 4, !tbaa !11 - %reass.sub = sub i32 %86, %78 - %87 = add i32 %reass.sub, 1 - %88 = sitofp i32 %87 to double - %89 = fdiv double 1.000000e+00, %88 - %90 = fadd double %.02532.i.us, %89 - %91 = add nuw i64 %.033.i.us, 1 - %exitcond45.not.i.us = icmp eq i64 %91, %76 + %.reass.i.us.reass.reass = add i32 %86, %invariant.op + %87 = sitofp i32 %.reass.i.us.reass.reass to double + %88 = fdiv double 1.000000e+00, %87 + %89 = fadd double %.02532.i.us, %88 + %90 = add nuw i64 %.033.i.us, 1 + %exitcond45.not.i.us = icmp eq i64 %90, %76 br i1 %exitcond45.not.i.us, label %._crit_edge.i.us, label %.lr.ph34.i.us, !llvm.loop !141 ._crit_edge.i.us: ; preds = %82, %.lr.ph34.i.us, %.critedge.i.us %.1.lcssa51.i.us = phi i64 [ %.1.lcssa.i.us, %.critedge.i.us ], [ %.1.lcssa.i.us, %.lr.ph34.i.us ], [ %76, %82 ] - %.025.lcssa.i.us = phi double [ 0.000000e+00, %.critedge.i.us ], [ %90, %.lr.ph34.i.us ], [ 0.000000e+00, %82 ] + %.025.lcssa.i.us = phi double [ 0.000000e+00, %.critedge.i.us ], [ %89, %.lr.ph34.i.us ], [ 0.000000e+00, %82 ] %92 = add nsw i32 %78, 1 %93 = sitofp i32 %92 to double %94 = fdiv double 1.000000e+00, %93 @@ -4155,12 +4158,12 @@ _ZNSt6vectorIiSaIiEED2Ev.exit: ; preds = %_ZNSt6vectorIS_IiSa br i1 %160, label %11, label %._crit_edge133, !llvm.loop !148 161: ; preds = %.loopexit, %.loopexit.split-lp, %103 - %.pn = phi { ptr, i32 } [ %104, %103 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ] + %.pn = phi { ptr, i32 } [ %104, %102 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ] %.not4.i.i.i.i54 = icmp eq ptr %.sroa.069.0, %.0.lcssa.i.i.i.i.i br i1 %.not4.i.i.i.i54, label %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit.i62, label %.lr.ph.i.i.i.i55 .lr.ph.i.i.i.i55: ; preds = %161, %_ZSt8_DestroyISt6vectorIiSaIiEEEvPT_.exit.i.i.i.i58 - %.05.i.i.i.i56 = phi ptr [ %169, %_ZSt8_DestroyISt6vectorIiSaIiEEEvPT_.exit.i.i.i.i58 ], [ %.sroa.069.0, %161 ] + %.05.i.i.i.i56 = phi ptr [ %169, %_ZSt8_DestroyISt6vectorIiSaIiEEEvPT_.exit.i.i.i.i58 ], [ %.sroa.069.0, %160 ] %162 = load ptr, ptr %.05.i.i.i.i56, align 8, !tbaa !139 %.not.i.i.i.i.i.i.i.i57 = icmp eq ptr %162, null br i1 %.not.i.i.i.i.i.i.i.i57, label %_ZSt8_DestroyISt6vectorIiSaIiEEEvPT_.exit.i.i.i.i58, label %163 @@ -4190,7 +4193,7 @@ _ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit.i62: ; preds = %_ZSt8_De br label %_ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev.exit64 _ZNSt6vectorIS_IiSaIiEESaIS1_EED2Ev.exit64: ; preds = %.loopexit82, %.loopexit.split-lp83, %170, %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit.i62 - %.pn.pn = phi { ptr, i32 } [ %.pn, %170 ], [ %.pn, %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit.i62 ], [ %lpad.loopexit84, %.loopexit82 ], [ %lpad.loopexit.split-lp85, %.loopexit.split-lp83 ] + %.pn.pn = phi { ptr, i32 } [ %.pn, %169 ], [ %.pn, %_ZSt8_DestroyIPSt6vectorIiSaIiEES2_EvT_S4_RSaIT0_E.exit.i62 ], [ %lpad.loopexit84, %.loopexit82 ], [ %lpad.loopexit.split-lp85, %.loopexit.split-lp83 ] %.not.i.i.i65 = icmp eq ptr %.sroa.077.0, null br i1 %.not.i.i.i65, label %_ZNSt6vectorIiSaIiEED2Ev.exit66, label %173 diff --git a/bench/ffmpeg/optimized/bmvvideo.ll b/bench/ffmpeg/optimized/bmvvideo.ll index a59fb147020..4a7734d742e 100644 --- a/bench/ffmpeg/optimized/bmvvideo.ll +++ b/bench/ffmpeg/optimized/bmvvideo.ll @@ -241,7 +241,8 @@ define internal i32 @decode_frame(ptr noundef %0, ptr noundef %1, ptr noundef wr %invariant.smax.i = zext nneg i32 %116 to i64 %117 = ptrtoint ptr %110 to i64 %118 = sext i32 %.068 to i64 - %invariant.op.i = add nsw i64 %invariant.smax.i, -640 + %invariant.op = sub i64 640, %115 + %invariant.op137 = sub i64 640, %115 br label %119 119: ; preds = %.loopexit.i, %108 @@ -274,7 +275,7 @@ define internal i32 @decode_frame(ptr noundef %0, ptr noundef %1, ptr noundef wr br i1 %.not204287.i, label %.preheader255.i.preheader, label %.thread.i .preheader255.i.preheader: ; preds = %.thread285.i, %124 - %.1172.i.ph = phi i32 [ %.0174.i, %124 ], [ %127, %.thread285.i ] + %.1172.i.ph = phi i32 [ %.0174.i, %124 ], [ %127, %.thread289.i ] br label %.preheader255.i .preheader255.i: ; preds = %.preheader255.i.preheader, %140 @@ -325,9 +326,9 @@ define internal i32 @decode_frame(ptr noundef %0, ptr noundef %1, ptr noundef wr br label %.thread.i .thread.i: ; preds = %.thread.loopexit.i, %.thread285.i - %.2229.i = phi i32 [ %150, %.thread.loopexit.i ], [ 4, %.thread285.i ] - %.3228.i = phi i32 [ %138, %.thread.loopexit.i ], [ %127, %.thread285.i ] - %.4189227.i = phi ptr [ %.3188.i, %.thread.loopexit.i ], [ %.1186.i, %.thread285.i ] + %.2229.i = phi i32 [ %150, %.thread.loopexit.i ], [ 4, %.thread289.i ] + %.3228.i = phi i32 [ %138, %.thread.loopexit.i ], [ %127, %.thread289.i ] + %.4189227.i = phi ptr [ %.3188.i, %.thread.loopexit.i ], [ %.1186.i, %.thread289.i ] %151 = lshr i32 %.3228.i, %.2229.i %notmask212.i = shl nsw i32 -1, %.2229.i %152 = xor i32 %notmask212.i, -1 @@ -379,8 +380,8 @@ define internal i32 @decode_frame(ptr noundef %0, ptr noundef %1, ptr noundef wr br i1 %106, label %171, label %182 171: ; preds = %170 - %172 = sub i64 %164, %115 - %or.cond218.i = icmp slt i64 %172, %invariant.op.i + %.reass268.reass.i.reass.reass = add i64 %164, %invariant.op137 + %or.cond218.i = icmp slt i64 %.reass268.reass.i.reass.reass, %invariant.smax.i br i1 %or.cond218.i, label %.loopexit, label %173 173: ; preds = %171 @@ -414,8 +415,8 @@ define internal i32 @decode_frame(ptr noundef %0, ptr noundef %1, ptr noundef wr %183 = sub nsw i64 0, %167 %184 = getelementptr inbounds i8, ptr %.1182.i, i64 %183 %185 = ptrtoint ptr %184 to i64 - %186 = sub i64 %185, %115 - %or.cond221.i = icmp slt i64 %186, %invariant.op.i + %.reass.reass.i.reass.reass = add i64 %185, %invariant.op + %or.cond221.i = icmp slt i64 %.reass.reass.i.reass.reass, %invariant.smax.i br i1 %or.cond221.i, label %.loopexit, label %187 187: ; preds = %182 @@ -490,8 +491,8 @@ default.unreachable.i: ; preds = %169 unreachable .loopexit.i: ; preds = %.lr.ph.i, %215, %213, %208, %202, %._crit_edge.i - %.6.i = phi ptr [ %.5240.i, %215 ], [ %.5240.i, %._crit_edge.i ], [ %.5240.i, %213 ], [ %204, %202 ], [ %211, %208 ], [ %.5240.i, %.lr.ph.i ] - %.3184.i = phi ptr [ %217, %215 ], [ %181, %._crit_edge.i ], [ %214, %213 ], [ %203, %202 ], [ %210, %208 ], [ %184, %.lr.ph.i ] + %.6.i = phi ptr [ %.5240.i, %213 ], [ %.5240.i, %._crit_edge.i ], [ %.5240.i, %211 ], [ %204, %200 ], [ %211, %206 ], [ %.5240.i, %.lr.ph.i ] + %.3184.i = phi ptr [ %217, %213 ], [ %181, %._crit_edge.i ], [ %214, %211 ], [ %203, %200 ], [ %210, %206 ], [ %184, %.lr.ph.i ] %.not254.i = icmp eq ptr %.3184.i, %.0180.i br i1 %.not254.i, label %decode_bmv_frame.exit, label %119 @@ -518,24 +519,24 @@ decode_bmv_frame.exit: ; preds = %.loopexit.i br label %228 228: ; preds = %.lr.ph, %228 - %229 = phi i32 [ %.pre, %.lr.ph ], [ %231, %228 ] - %.06995 = phi ptr [ %225, %.lr.ph ], [ %236, %228 ] - %.07094 = phi ptr [ %224, %.lr.ph ], [ %233, %228 ] - %.17293 = phi i32 [ 0, %.lr.ph ], [ %237, %228 ] + %229 = phi i32 [ %.pre, %.lr.ph ], [ %229, %226 ] + %.06995 = phi ptr [ %225, %.lr.ph ], [ %234, %226 ] + %.07094 = phi ptr [ %224, %.lr.ph ], [ %231, %226 ] + %.17293 = phi i32 [ 0, %.lr.ph ], [ %235, %226 ] + %228 = sext i32 %227 to i64 + tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.06996, ptr align 1 %.07095, i64 %228, i1 false) + %229 = load i32, ptr %224, align 8, !tbaa !31 %230 = sext i32 %229 to i64 - tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.06995, ptr align 1 %.07094, i64 %230, i1 false) - %231 = load i32, ptr %226, align 8, !tbaa !31 + %231 = getelementptr inbounds i8, ptr %.07094, i64 %230 + %231 = load i32, ptr %225, align 8, !tbaa !40 %232 = sext i32 %231 to i64 - %233 = getelementptr inbounds i8, ptr %.07094, i64 %232 - %234 = load i32, ptr %227, align 8, !tbaa !40 - %235 = sext i32 %234 to i64 - %236 = getelementptr inbounds i8, ptr %.06995, i64 %235 - %237 = add nuw nsw i32 %.17293, 1 - %238 = load i32, ptr %221, align 4, !tbaa !32 - %239 = icmp slt i32 %237, %238 - br i1 %239, label %228, label %._crit_edge, !llvm.loop !45 - -._crit_edge: ; preds = %228, %decode_bmv_frame.exit + %233 = getelementptr inbounds i8, ptr %.06996, i64 %232 + %235 = add nuw nsw i32 %.17294, 1 + %236 = load i32, ptr %219, align 4, !tbaa !32 + %237 = icmp slt i32 %235, %236 + br i1 %237, label %226, label %._crit_edge, !llvm.loop !45 + +._crit_edge:; preds = %226, %decode_bmv_frame.exit store i32 1, ptr %2, align 4, !tbaa !40 %240 = load i32, ptr %96, align 8, !tbaa !38 br label %241 diff --git a/bench/ffmpeg/optimized/hlsenc.ll b/bench/ffmpeg/optimized/hlsenc.ll index f54e1441dd7..84e8e967454 100644 --- a/bench/ffmpeg/optimized/hlsenc.ll +++ b/bench/ffmpeg/optimized/hlsenc.ll @@ -4105,10 +4105,14 @@ define internal fastcc void @write_codec_attr(ptr noundef readonly captures(none %70 = load i32, ptr %69, align 8, !tbaa !204 %71 = sext i32 %70 to i64 %72 = icmp sgt i32 %70, 19 - br i1 %72, label %.lr.ph149, label %.critedge + br i1 %72, label %.lr.ph149.preheader, label %.critedge -.lr.ph149: ; preds = %.lr.ph, %124 - %.0103137148 = phi ptr [ %74, %124 ], [ %63, %.lr.ph ] +.lr.ph149.preheader: ; preds = %.lr.ph + %invariant.op = sub i64 19, %68 + br label %.lr.ph149 + +.lr.ph149: ; preds = %.lr.ph149.preheader, %124 + %.0103137148 = phi ptr [ %74, %124 ], [ %63, %.lr.ph149.preheader ] %73 = load i8, ptr %.0103137148, align 1, !tbaa !102 %74 = getelementptr inbounds nuw i8, ptr %.0103137148, i64 1 %75 = load i8, ptr %74, align 1, !tbaa !102 @@ -4200,10 +4204,9 @@ define internal fastcc void @write_codec_attr(ptr noundef readonly captures(none 124: ; preds = %84, %80, %.lr.ph149 %125 = ptrtoint ptr %74 to i64 - %reass.sub = sub i64 %125, %68 - %126 = add i64 %reass.sub, 19 - %127 = icmp slt i64 %126, %71 - br i1 %127, label %.lr.ph149, label %.critedge + %.reass.reass = add i64 %125, %invariant.op + %126 = icmp slt i64 %.reass.reass, %71 + br i1 %126, label %.lr.ph149, label %.critedge .critedge: ; preds = %124, %.lr.ph, %61, %.thread123 %128 = phi i1 [ %123, %.thread123 ], [ false, %61 ], [ false, %.lr.ph ], [ false, %124 ] diff --git a/bench/fmt/optimized/format-impl-test.ll b/bench/fmt/optimized/format-impl-test.ll index d622507ee3b..93ddd2300b2 100644 --- a/bench/fmt/optimized/format-impl-test.ll +++ b/bench/fmt/optimized/format-impl-test.ll @@ -11015,6 +11015,7 @@ _ZN3fmt3v1119basic_memory_bufferIjLm32ENS0_6detail9allocatorIjEEE6resizeEm.exit: .lr.ph68: ; preds = %.preheader %58 = load ptr, ptr %2, align 8 %59 = and i64 %4, 2147483647 + %invariant.op = sub i32 1, %5 br label %90 60: ; preds = %51, %45 @@ -11091,10 +11092,9 @@ _ZN3fmt3v116detail11to_unsignedIiEENSt13make_unsignedIT_E4typeES4_.exit.i: ; pre %indvars.iv92 = phi i32 [ 1, %.lr.ph68 ], [ %indvars.iv.next93, %._crit_edge ] %.266 = phi i128 [ %.037.lcssa, %.lr.ph68 ], [ %97, %._crit_edge ] %91 = trunc nuw i64 %indvars.iv102 to i32 - %reass.sub = sub i32 %91, %5 - %92 = add i32 %reass.sub, 1 - %93 = icmp slt i32 %92, %5 - br i1 %93, label %.lr.ph.preheader, label %._crit_edge + %.reass.reass = add i32 %91, %invariant.op + %92 = icmp slt i32 %.reass.reass, %5 + br i1 %92, label %.lr.ph.preheader, label %._crit_edge .lr.ph.preheader: ; preds = %90 %94 = sext i32 %indvars.iv92 to i64 @@ -11157,7 +11157,7 @@ _ZN3fmt3v1119basic_memory_bufferIjLm32ENS0_6detail9allocatorIjEEED2Ev.exit: ; pr br label %.body .body: ; preds = %116, %60, %46 - %.pn = phi { ptr, i32 } [ %47, %46 ], [ %61, %60 ], [ %117, %116 ] + %.pn = phi { ptr, i32 } [ %47, %46 ], [ %61, %60 ], [ %117, %115 ] %118 = load ptr, ptr %2, align 8, !tbaa !23 %119 = getelementptr inbounds nuw i8, ptr %2, i64 32 %.not.i.i48 = icmp eq ptr %118, %119 diff --git a/bench/git/optimized/ref-cache.ll b/bench/git/optimized/ref-cache.ll index 446347ca893..77a1dc96e54 100644 --- a/bench/git/optimized/ref-cache.ll +++ b/bench/git/optimized/ref-cache.ll @@ -545,16 +545,16 @@ define internal fastcc ptr @find_containing_dir(ptr noundef captures(ret: addres .lr.ph: ; preds = %2 %4 = ptrtoint ptr %1 to i64 + %invariant.op = sub i64 1, %4 br label %5 5: ; preds = %.lr.ph, %search_for_subdir.exit %.01124 = phi ptr [ %0, %.lr.ph ], [ %39, %search_for_subdir.exit ] %.01223 = phi ptr [ %3, %.lr.ph ], [ %55, %search_for_subdir.exit ] %6 = ptrtoint ptr %.01223 to i64 - %7 = sub i64 %6, %4 - %8 = add nsw i64 %7, 1 - %9 = load i32, ptr %.01124, align 8, !tbaa !4 - %.not.i.i = icmp eq i32 %9, 0 + %.reass.reass.reass = add i64 %6, %invariant.op + %7 = load i32, ptr %.01124, align 8, !tbaa !4 + %.not.i.i = icmp eq i32 %7, 0 br i1 %.not.i.i, label %search_for_subdir.exit.thread, label %10 10: ; preds = %5 @@ -570,27 +570,27 @@ define internal fastcc ptr @find_containing_dir(ptr noundef captures(ret: addres br label %.lr.ph.i.i.i .lr.ph.i.i.i: ; preds = %31, %.lr.ph.i.preheader.i.i - %.01621.i.i.i = phi i64 [ %.1.i.i.i, %31 ], [ 0, %.lr.ph.i.preheader.i.i ] - %.01720.i.i.i = phi i64 [ %.118.i.i.i, %31 ], [ %14, %.lr.ph.i.preheader.i.i ] + %.01621.i.i.i = phi i64 [ %.1.i.i.i, %29 ], [ 0, %.lr.ph.i.preheader.i.i ] + %.01720.i.i.i = phi i64 [ %.118.i.i.i, %29 ], [ %14, %.lr.ph.i.preheader.i.i ] %15 = add i64 %.01720.i.i.i, %.01621.i.i.i %16 = lshr i64 %15, 1 %17 = shl i64 %16, 3 %18 = getelementptr inbounds nuw i8, ptr %12, i64 %17 %19 = load ptr, ptr %18, align 8, !tbaa !14 %20 = getelementptr inbounds nuw i8, ptr %19, i64 56 - %21 = tail call i32 @strncmp(ptr noundef nonnull readonly %1, ptr noundef nonnull %20, i64 noundef range(i64 -9223372036854775807, -9223372036854775808) %8) #13 + %21 = tail call i32 @strncmp(ptr noundef nonnull readonly %1, ptr noundef nonnull %110, i64 noundef range(i64 -9223372036854775807, -9223372036854775808) %.reass.reass.reass) #13 %.not.i13.i.i = icmp eq i32 %21, 0 br i1 %.not.i13.i.i, label %22, label %ref_entry_cmp_sslice.exit.i.i 22: ; preds = %.lr.ph.i.i.i - %23 = getelementptr inbounds nuw i8, ptr %20, i64 %8 + %23 = getelementptr inbounds nuw i8, ptr %110, i64 %.reass.reass.reass %24 = load i8, ptr %23, align 1, !tbaa !17 %25 = zext i8 %24 to i32 %26 = sub nsw i32 0, %25 br label %ref_entry_cmp_sslice.exit.i.i ref_entry_cmp_sslice.exit.i.i: ; preds = %22, %.lr.ph.i.i.i - %.0.i14.i.i = phi i32 [ %26, %22 ], [ %21, %.lr.ph.i.i.i ] + %.0.i14.i.i = phi i32 [ %26, %20 ], [ %21, %.lr.ph.i.i.i ] %27 = icmp slt i32 %.0.i14.i.i, 0 br i1 %27, label %31, label %28 @@ -603,8 +603,8 @@ ref_entry_cmp_sslice.exit.i.i: ; preds = %22, %.lr.ph.i.i.i br label %31 31: ; preds = %29, %ref_entry_cmp_sslice.exit.i.i - %.118.i.i.i = phi i64 [ %.01720.i.i.i, %29 ], [ %16, %ref_entry_cmp_sslice.exit.i.i ] - %.1.i.i.i = phi i64 [ %30, %29 ], [ %.01621.i.i.i, %ref_entry_cmp_sslice.exit.i.i ] + %.118.i.i.i = phi i64 [ %.01720.i.i.i, %27 ], [ %16, %ref_entry_cmp_sslice.exit.i.i ] + %.1.i.i.i = phi i64 [ %210, %27 ], [ %.01621.i.i.i, %ref_entry_cmp_sslice.exit.i.i ] %32 = icmp ult i64 %.1.i.i.i, %.118.i.i.i br i1 %32, label %.lr.ph.i.i.i, label %search_for_subdir.exit.thread, !llvm.loop !28 @@ -620,7 +620,7 @@ search_ref_dir.exit.i: ; preds = %28 %38 = load ptr, ptr %37, align 8, !tbaa !14 %39 = getelementptr inbounds nuw i8, ptr %38, i64 8 %40 = load i8, ptr %38, align 8, !tbaa !17 - %41 = and i8 %40, 32 + %41 = and i8 %310, 32 %.not.i8.i = icmp eq i8 %41, 0 br i1 %.not.i8.i, label %search_for_subdir.exit, label %42 @@ -640,7 +640,7 @@ search_ref_dir.exit.i: ; preds = %28 %49 = getelementptr inbounds nuw i8, ptr %44, i64 8 %50 = load ptr, ptr %49, align 8, !tbaa !22 %51 = getelementptr inbounds nuw i8, ptr %38, i64 56 - tail call void %46(ptr noundef %50, ptr noundef nonnull %39, ptr noundef nonnull %51) #12 + tail call void %44(ptr noundef %410, ptr noundef nonnull %39, ptr noundef nonnull %51) #12 %52 = load i8, ptr %38, align 8, !tbaa !17 %53 = and i8 %52, -33 store i8 %53, ptr %38, align 8, !tbaa !17 @@ -653,7 +653,7 @@ search_for_subdir.exit: ; preds = %48, %35 br i1 %.not, label %search_for_subdir.exit.thread, label %5, !llvm.loop !30 search_for_subdir.exit.thread: ; preds = %search_for_subdir.exit, %search_ref_dir.exit.i, %5, %10, %31, %2 - %.1 = phi ptr [ %0, %2 ], [ null, %31 ], [ null, %search_ref_dir.exit.i ], [ null, %5 ], [ %39, %search_for_subdir.exit ], [ null, %10 ] + %.1 = phi ptr [ %0, %2 ], [ null, %29 ], [ null, %search_ref_dir.exit.i ], [ null, %5 ], [ %39, %search_for_subdir.exit ], [ null, %8 ] ret ptr %.1 } diff --git a/bench/gromacs/optimized/mpiinfo.ll b/bench/gromacs/optimized/mpiinfo.ll index 21d6c029969..2a2cc2bd74a 100644 --- a/bench/gromacs/optimized/mpiinfo.ll +++ b/bench/gromacs/optimized/mpiinfo.ll @@ -977,11 +977,11 @@ _ZN3gmx23mpiLibraryVersionStringEv.exit: ; preds = %0, %3, %5 %10 = ptrtoint ptr %9 to i64 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %19, %.lr.ph.i.i - %.033.i.i = phi i64 [ %8, %.lr.ph.i.i ], [ %22, %19 ] - %.02132.i.i = phi ptr [ %7, %.lr.ph.i.i ], [ %20, %19 ] +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %.lr.ph.i.i, %18 + %.033.i.i = phi i64 [ %8, %.lr.ph.i.i ], [ %22, %18 ] + %.02132.i.i = phi ptr [ %7, %.lr.ph.i.i ], [ %20, %18 ] %11 = add i64 %.033.i.i, -19 - %12 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef 73, i64 noundef %11) #31 + %12 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef 73, i64 noundef %11) #31 %.not26.i.i = icmp eq ptr %12, null br i1 %.not26.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -1005,7 +1005,7 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsI br i1 %.not25.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !16 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %19, %_ZN3gmx23mpiLibraryVersionStringEv.exit, %14 - %.020.i.i = phi i1 [ %18, %14 ], [ false, %_ZN3gmx23mpiLibraryVersionStringEv.exit ], [ false, %19 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] + %.020.i.i = phi i1 [ %18, %13 ], [ false, %_ZN3gmx23mpiLibraryVersionStringEv.exit ], [ false, %18 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] ret i1 %.020.i.i } diff --git a/bench/grpc/optimized/http_filters_plugin.ll b/bench/grpc/optimized/http_filters_plugin.ll index ab29642d879..c6755d3578f 100644 --- a/bench/grpc/optimized/http_filters_plugin.ll +++ b/bench/grpc/optimized/http_filters_plugin.ll @@ -1208,11 +1208,11 @@ define internal noundef zeroext i1 @_ZN9grpc_core12_GLOBAL__N_127IsBuildingHttpL %11 = ptrtoint ptr %10 to i64 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %20, %.lr.ph.i.i.i - %.033.i.i.i = phi i64 [ %8, %.lr.ph.i.i.i ], [ %23, %20 ] - %.02132.i.i.i = phi ptr [ %9, %.lr.ph.i.i.i ], [ %21, %20 ] +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %.lr.ph.i.i.i, %19 + %.033.i.i.i = phi i64 [ %8, %.lr.ph.i.i.i ], [ %23, %19 ] + %.02132.i.i.i = phi ptr [ %9, %.lr.ph.i.i.i ], [ %21, %19 ] %12 = add i64 %.033.i.i.i, -3 - %13 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i.i, i32 noundef 104, i64 noundef %12) #27 + %13 = tail call ptr @memchr(ptr noundef %.02132.i.i.i, i32 noundef 104, i64 noundef %12) #27 %.not26.i.i.i = icmp eq ptr %13, null br i1 %.not26.i.i.i, label %_ZN4absl12lts_2024072211StrContainsESt17basic_string_viewIcSt11char_traitsIcEES4_.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i @@ -1236,7 +1236,7 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i: ; preds = %_ZNSt11char_traitsI br i1 %.not25.i.i.i, label %_ZN4absl12lts_2024072211StrContainsESt17basic_string_viewIcSt11char_traitsIcEES4_.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, !llvm.loop !27 _ZN4absl12lts_2024072211StrContainsESt17basic_string_viewIcSt11char_traitsIcEES4_.exit: ; preds = %20, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, %15, %3, %1 - %24 = phi i1 [ false, %1 ], [ %19, %15 ], [ false, %3 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ], [ false, %20 ] + %24 = phi i1 [ false, %1 ], [ %19, %14 ], [ false, %3 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ], [ false, %19 ] ret i1 %24 } diff --git a/bench/hdf5/optimized/H5HFdbg.ll b/bench/hdf5/optimized/H5HFdbg.ll index 249d40a9b97..8a8d7baff3f 100644 --- a/bench/hdf5/optimized/H5HFdbg.ll +++ b/bench/hdf5/optimized/H5HFdbg.ll @@ -557,6 +557,7 @@ define void @H5HF_iblock_print(ptr noundef readonly captures(none) %0, i1 nounde %113 = call i32 @llvm.smax.i32(i32 %4, i32 6) %114 = add nsw i32 %113, -6 %115 = getelementptr inbounds nuw i8, ptr %0, i64 344 + %invariant.op = sub i32 1, %108 br label %116 116: ; preds = %.lr.ph141, %._crit_edge138 @@ -655,17 +656,16 @@ define void @H5HF_iblock_print(ptr noundef readonly captures(none) %0, i1 nounde H5VM_log2_gen.exit: ; preds = %125, %130, %137, %142, %151, %156, %163, %168 %.0.i = phi i32 [ %160, %156 ], [ %134, %130 ], [ %146, %142 ], [ %129, %125 ], [ %141, %137 ], [ %155, %151 ], [ %167, %163 ], [ %171, %168 ] - %reass.sub = sub i32 %.0.i, %108 - %172 = add i32 %reass.sub, 1 - %173 = trunc nuw i64 %.1139 to i32 - %174 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 64, ptr noundef nonnull @.str.74, i32 noundef %173, i32 noundef %172) #9 - %175 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.69, i32 noundef %109, ptr noundef nonnull @.str.6, i32 noundef %111, ptr noundef nonnull %6) #9 - %176 = load i32, ptr %32, align 8, !tbaa !83 - %.not144 = icmp eq i32 %176, 0 + %.reass.reass = add i32 %.0.i, %invariant.op + %172 = trunc nuw i64 %.1139 to i32 + %173 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %6, i64 noundef 64, ptr noundef nonnull @.str.74, i32 noundef %172, i32 noundef %.reass.reass) #9 + %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.69, i32 noundef %109, ptr noundef nonnull @.str.6, i32 noundef %111, ptr noundef nonnull %6) #9 + %175 = load i32, ptr %32, align 8, !tbaa !83 + %.not144 = icmp eq i32 %175, 0 br i1 %.not144, label %._crit_edge138, label %.lr.ph137.preheader .lr.ph137.preheader: ; preds = %H5VM_log2_gen.exit - %177 = zext i32 %176 to i64 + %177 = zext i32 %175 to i64 br label %.lr.ph137 .lr.ph137: ; preds = %.lr.ph137.preheader, %.lr.ph137 diff --git a/bench/hyperscan/optimized/rose_build_convert.ll b/bench/hyperscan/optimized/rose_build_convert.ll index ce51c4a3bbb..8a6a2726355 100644 --- a/bench/hyperscan/optimized/rose_build_convert.ll +++ b/bench/hyperscan/optimized/rose_build_convert.ll @@ -321,6 +321,7 @@ _ZN3ue2L23findFloodProneSuffixLenERKNS_13RoseBuildImplE.exit: ; preds = %_ZNSt15 %30 = getelementptr inbounds nuw i8, ptr %0, i64 160 %31 = getelementptr inbounds nuw i8, ptr %0, i64 136 %32 = getelementptr inbounds nuw i8, ptr %0, i64 128 + %invariant.op = sub i64 1, %26 br label %33 33: ; preds = %.lr.ph, %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread @@ -492,17 +493,16 @@ _ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit: ; preds = %.lr.ph.i.split.i.i br i1 %141, label %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread, label %142 142: ; preds = %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit - %reass.sub = sub nuw i64 %140, %26 - %143 = add i64 %reass.sub, 1 - %144 = sub i64 %115, %143 - %145 = icmp ult i64 %144, 5 - br i1 %145, label %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread, label %146 - -146: ; preds = %142 - tail call fastcc void @_ZN3ue2L23convertFloodProneSuffixERNS_13RoseBuildImplENS_12graph_detail17vertex_descriptorINS_9ue2_graphINS_9RoseGraphENS_15RoseVertexPropsENS_13RoseEdgePropsEEEEEjRKNS_15rose_literal_idEm(ptr noundef nonnull align 8 dereferenceable(780) %0, ptr %.sroa.053.061, i64 %35, i32 noundef %51, ptr noundef nonnull align 8 dereferenceable(124) %storemerge.i.i.i.i.i.i, i64 noundef %143) + %.reass.reass = add i64 %140, %invariant.op + %143 = sub i64 %115, %.reass.reass + %144 = icmp ult i64 %143, 5 + br i1 %144, label %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread, label %145 + +145: ; preds = %142 + tail call fastcc void @_ZN3ue2L23convertFloodProneSuffixERNS_13RoseBuildImplENS_12graph_detail17vertex_descriptorINS_9ue2_graphINS_9RoseGraphENS_15RoseVertexPropsENS_13RoseEdgePropsEEEEEjRKNS_15rose_literal_idEm(ptr noundef nonnull align 8 dereferenceable(780) %0, ptr %.sroa.053.061, i64 %35, i32 noundef %51, ptr noundef nonnull align 8 dereferenceable(124) %storemerge.i.i.i.i.i.i, i64 noundef %.reass.reass) br label %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread -_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread: ; preds = %139, %102, %_ZNK3ue214RoseLiteralMap2atEj.exit, %105, %111, %113, %146, %142, %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit, %45, %42, %39, %33 +_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit.thread: ; preds = %139, %102, %_ZNK3ue214RoseLiteralMap2atEj.exit, %105, %111, %113, %145, %142, %_ZN3ue2L14suffixFloodLenERKNS_11ue2_literalE.exit, %45, %42, %39, %33 %.sroa.053.0 = load ptr, ptr %.sroa.053.061, align 8 %.not57 = icmp eq ptr %.sroa.053.0, %27 br i1 %.not57, label %.loopexit, label %33 diff --git a/bench/hyperscan/optimized/tamarama.ll b/bench/hyperscan/optimized/tamarama.ll index 968124b59b9..8c8c69aaae3 100644 --- a/bench/hyperscan/optimized/tamarama.ll +++ b/bench/hyperscan/optimized/tamarama.ll @@ -1499,7 +1499,11 @@ isMultiTopType.exit: ; preds = %23, %18, %18, %25 %32 = getelementptr inbounds nuw i8, ptr %2, i64 104 %33 = getelementptr inbounds nuw i8, ptr %3, i64 12 %34 = getelementptr inbounds nuw i8, ptr %3, i64 104 - br i1 %.not, label %.lr.ph.split.us, label %.lr.ph.split + br i1 %.not, label %.lr.ph.split.us, label %.lr.ph.split.preheader + +.lr.ph.split.preheader: ; preds = %.lr.ph + %invariant.op = sub i32 4, %9 + br label %.lr.ph.split .lr.ph.split.us: ; preds = %.lr.ph, %61 %35 = phi i32 [ %63, %61 ], [ %29, %.lr.ph ] @@ -1557,8 +1561,8 @@ isMultiTopType.exit: ; preds = %23, %18, %18, %25 %65 = icmp ult i32 %63, %64 br i1 %65, label %.lr.ph.split.us, label %.loopexit -.lr.ph.split: ; preds = %.lr.ph, %99 - %66 = phi i32 [ %101, %99 ], [ %29, %.lr.ph ] +.lr.ph.split: ; preds = %.lr.ph.split.preheader, %99 + %66 = phi i32 [ %101, %98 ], [ %29, %.lr.ph.split.preheader ] %67 = zext i32 %66 to i64 %68 = getelementptr inbounds nuw %struct.mq_item, ptr %32, i64 %67 %69 = load i32, ptr %68, align 8 @@ -1570,42 +1574,41 @@ isMultiTopType.exit: ; preds = %23, %18, %18, %25 br i1 %or.cond, label %73, label %.thread39 73: ; preds = %.lr.ph.split - %reass.sub = sub nuw i32 %69, %9 - %74 = add i32 %reass.sub, 4 - %75 = load i32, ptr %33, align 4, !alias.scope !11 - %.not.i36 = icmp eq i32 %75, 0 - br i1 %.not.i36, label %.thread, label %76 - -76: ; preds = %73 - %77 = add i32 %75, -1 - %78 = zext i32 %77 to i64 - %79 = getelementptr inbounds nuw %struct.mq_item, ptr %34, i64 %78 - %80 = load i32, ptr %79, align 8, !alias.scope !11 - %81 = icmp eq i32 %80, %74 - br i1 %81, label %82, label %.thread - -82: ; preds = %76 - %83 = getelementptr inbounds nuw i8, ptr %79, i64 8 - %84 = load i64, ptr %83, align 8, !alias.scope !11 - %85 = icmp eq i64 %84, %71 - br i1 %85, label %86, label %.thread - -86: ; preds = %82 - %87 = getelementptr inbounds nuw i8, ptr %79, i64 16 - store i64 0, ptr %87, align 8, !alias.scope !11 - br label %99 - -.thread: ; preds = %76, %82, %73 - %88 = zext i32 %75 to i64 - %89 = getelementptr inbounds nuw %struct.mq_item, ptr %34, i64 %88 - store i32 %74, ptr %89, align 8, !alias.scope !11 - %90 = getelementptr inbounds nuw i8, ptr %89, i64 8 - store i64 %71, ptr %90, align 8, !alias.scope !11 - %91 = getelementptr inbounds nuw i8, ptr %89, i64 16 - store i64 0, ptr %91, align 8, !alias.scope !11 - %92 = add i32 %75, 1 - store i32 %92, ptr %33, align 4, !alias.scope !11 - br label %99 + %.reass.reass = add i32 %69, %invariant.op + %74 = load i32, ptr %33, align 4, !alias.scope !11 + %.not.i36 = icmp eq i32 %74, 0 + br i1 %.not.i36, label %.thread, label %75 + +75: ; preds = %73 + %76 = add i32 %74, -1 + %77 = zext i32 %76 to i64 + %78 = getelementptr inbounds nuw %struct.mq_item, ptr %34, i64 %77 + %79 = load i32, ptr %78, align 8, !alias.scope !11 + %80 = icmp eq i32 %79, %.reass.reass + br i1 %80, label %81, label %.thread + +81: ; preds = %75 + %82 = getelementptr inbounds nuw i8, ptr %78, i64 8 + %83 = load i64, ptr %82, align 8, !alias.scope !11 + %84 = icmp eq i64 %83, %71 + br i1 %84, label %85, label %.thread + +85: ; preds = %81 + %86 = getelementptr inbounds nuw i8, ptr %78, i64 16 + store i64 0, ptr %86, align 8, !alias.scope !11 + br label %98 + +.thread: ; preds = %75, %81, %73 + %87 = zext i32 %74 to i64 + %88 = getelementptr inbounds nuw %struct.mq_item, ptr %34, i64 %87 + store i32 %.reass.reass, ptr %88, align 8, !alias.scope !11 + %89 = getelementptr inbounds nuw i8, ptr %88, i64 8 + store i64 %71, ptr %89, align 8, !alias.scope !11 + %90 = getelementptr inbounds nuw i8, ptr %88, i64 16 + store i64 0, ptr %90, align 8, !alias.scope !11 + %91 = add i32 %74, 1 + store i32 %91, ptr %33, align 4, !alias.scope !11 + br label %98 .thread39: ; preds = %.lr.ph.split, %.lr.ph.split.us %.us-phi = phi i64 [ %40, %.lr.ph.split.us ], [ %71, %.lr.ph.split ] @@ -1621,7 +1624,7 @@ isMultiTopType.exit: ; preds = %23, %18, %18, %25 store i32 %98, ptr %33, align 4, !alias.scope !14 br label %.loopexit -99: ; preds = %.thread, %86 +99: ; preds = %.thread, %85 %100 = load i32, ptr %27, align 8 %101 = add i32 %100, 1 store i32 %101, ptr %27, align 8 diff --git a/bench/influxdb-rs/optimized/1s5ibqekmzia6ibu.ll b/bench/influxdb-rs/optimized/1s5ibqekmzia6ibu.ll index 5dd24a850ee..795d35bed5e 100644 --- a/bench/influxdb-rs/optimized/1s5ibqekmzia6ibu.ll +++ b/bench/influxdb-rs/optimized/1s5ibqekmzia6ibu.ll @@ -9336,8 +9336,8 @@ _ZN4core3str11validations23next_code_point_reverse17hdbb7c3cdae54fa66E.exit.thre %105 = getelementptr inbounds nuw i8, ptr %1, i64 24 %106 = load i64, ptr %105, align 8, !alias.scope !1247, !noalias !1254 %.promoted63.i = load i64, ptr %104, align 8, !alias.scope !1247, !noalias !1254 + %invariant.op.i = sub i64 %10, %103 %107 = sub i64 %10, %106 - %.neg.i = sub i64 %10, %103 br label %108 108: ; preds = %.backedge.i, %.lr.ph.i @@ -9362,14 +9362,14 @@ _ZN4core3str11validations23next_code_point_reverse17hdbb7c3cdae54fa66E.exit.thre br i1 %90, label %.backedge.i, label %.backedge.sink.split.i .backedge.sink.split.i: ; preds = %.split51.us, %155, %120 - %.sink118.i = phi i64 [ %98, %120 ], [ %106, %155 ], [ %98, %.split51.us ] - %.ph117.i = phi i64 [ %110, %120 ], [ %107, %155 ], [ %135, %.split51.us ] + %.sink118.i = phi i64 [ %98, %120 ], [ %106, %154 ], [ %98, %.split51.us ] + %.ph117.i = phi i64 [ %110, %120 ], [ %107, %154 ], [ %135, %.split51.us ] store i64 %.sink118.i, ptr %104, align 8, !alias.scope !1247, !noalias !1254 br label %.backedge.i .backedge.i: ; preds = %.split51.us, %155, %.backedge.sink.split.i, %120 - %121 = phi i64 [ %109, %120 ], [ %109, %155 ], [ %109, %.split51.us ], [ %.sink118.i, %.backedge.sink.split.i ] - %122 = phi i64 [ %110, %120 ], [ %107, %155 ], [ %135, %.split51.us ], [ %.ph117.i, %.backedge.sink.split.i ] + %121 = phi i64 [ %109, %120 ], [ %109, %154 ], [ %109, %.split51.us ], [ %.sink118.i, %.backedge.sink.split.i ] + %122 = phi i64 [ %110, %120 ], [ %107, %154 ], [ %135, %.split51.us ], [ %.ph117.i, %.backedge.sink.split.i ] %123 = sub i64 %122, %98 %.not33.i = icmp ult i64 %123, %94 br i1 %.not33.i, label %108, label %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit.thread" @@ -9402,7 +9402,7 @@ _ZN4core3str11validations23next_code_point_reverse17hdbb7c3cdae54fa66E.exit.thre br i1 %.not25.i.us, label %.split.us, label %.split51.us .split51.us: ; preds = %130 - %135 = add i64 %.neg.i, %127 + %135 = add i64 %127, %invariant.op.i store i64 %135, ptr %9, align 8, !alias.scope !1247, !noalias !1254 br i1 %90, label %.backedge.i, label %.backedge.sink.split.i @@ -9419,7 +9419,7 @@ _ZN4core3str11validations23next_code_point_reverse17hdbb7c3cdae54fa66E.exit.thre unreachable 137: ; preds = %148, %.split47.us - %.sroa.09.0.i = phi i64 [ %103, %.split47.us ], [ %141, %148 ] + %.sroa.09.0.i = phi i64 [ %103, %.split47.us ], [ %141, %147 ] %138 = icmp ult i64 %.sroa.09.0.i, %.014.i br i1 %138, label %140, label %139 @@ -9481,7 +9481,7 @@ _ZN4core3str7pattern14TwoWaySearcher9next_back17hb22b869579dabd1dE.exit: ; preds br label %85 .lr.ph: ; preds = %.loopexit, %162 - %.01557 = phi i64 [ %163, %162 ], [ %111, %.loopexit ] + %.01557 = phi i64 [ %163, %161 ], [ %111, %.loopexit ] %.not.i19 = icmp ult i64 %.01557, %94 br i1 %.not.i19, label %157, label %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit" @@ -9501,7 +9501,7 @@ _ZN4core3str7pattern14TwoWaySearcher9next_back17hb22b869579dabd1dE.exit: ; preds br i1 %164, label %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit.thread.loopexit", label %.lr.ph "_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit.thread.loopexit": ; preds = %162, %157, %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit" - %.015.lcssa.ph = phi i64 [ %94, %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit" ], [ %.01557, %157 ], [ 0, %162 ] + %.015.lcssa.ph = phi i64 [ %94, %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit" ], [ %.01557, %156 ], [ 0, %161 ] %165 = tail call i64 @llvm.umin.i64(i64 %.015.lcssa.ph, i64 %111) br label %"_ZN4core3str21_$LT$impl$u20$str$GT$16is_char_boundary17h3e064cc84751aba6E.exit.thread" diff --git a/bench/just-rs/optimized/4mdvpwvrpdu4jonv.ll b/bench/just-rs/optimized/4mdvpwvrpdu4jonv.ll index b11c14aeb16..28a018933a4 100644 --- a/bench/just-rs/optimized/4mdvpwvrpdu4jonv.ll +++ b/bench/just-rs/optimized/4mdvpwvrpdu4jonv.ll @@ -2020,6 +2020,7 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: %191 = getelementptr inbounds nuw i8, ptr %7, i64 24 %192 = load i64, ptr %191, align 8, !alias.scope !278, !noalias !285 %193 = sub i64 %183, %192 + %invariant.op = sub i64 1, %190 br label %194 194: ; preds = %.sink.split.i, %.lr.ph.i47 @@ -2045,7 +2046,7 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: .sink.split.i: ; preds = %238, %225, %205 %.sink.i = phi i64 [ 0, %238 ], [ %193, %225 ], [ 0, %205 ] - %.ph87.i = phi i64 [ %240, %238 ], [ %226, %225 ], [ %206, %205 ] + %.ph87.i = phi i64 [ %239, %238 ], [ %226, %225 ], [ %206, %205 ] %208 = add i64 %.ph87.i, %185 %.not34.i53 = icmp ult i64 %208, %179 br i1 %.not34.i53, label %194, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit" @@ -2111,9 +2112,8 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: unreachable 238: ; preds = %230 - %reass.sub = sub i64 %195, %190 - %239 = add i64 %reass.sub, 1 - %240 = add i64 %239, %.sroa.04.0.i50 + %.reass.reass = add i64 %195, %invariant.op + %239 = add i64 %.reass.reass, %.sroa.04.0.i50 br label %.sink.split.i 241: ; preds = %172 @@ -2133,37 +2133,38 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: %247 = load i64, ptr %246, align 8, !alias.scope !291, !noalias !298 %248 = add i64 %245, -1 %.first_iter = icmp ult i64 %248, %183 - br label %249 - -249: ; preds = %261, %.lr.ph.i41 - %250 = phi i64 [ %.promoted.i38, %.lr.ph.i41 ], [ %262, %261 ] - %251 = phi i64 [ %242, %.lr.ph.i41 ], [ %263, %261 ] - %252 = getelementptr inbounds i8, ptr %177, i64 %251 - %253 = load i8, ptr %252, align 1, !alias.scope !294, !noalias !300, !noundef !13 - %254 = and i8 %253, 63 - %255 = zext nneg i8 %254 to i64 - %256 = shl nuw i64 1, %255 - %257 = and i64 %256, %244 - %258 = icmp eq i64 %257, 0 - br i1 %258, label %259, label %.preheader61 - -259: ; preds = %249 - %260 = add i64 %250, %183 - br label %261 - -261: ; preds = %290, %277, %259 - %262 = phi i64 [ %278, %277 ], [ %260, %259 ], [ %292, %290 ] - %263 = add i64 %262, %185 - %.not34.i = icmp ult i64 %263, %179 - br i1 %.not34.i, label %249, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit" - -.preheader61: ; preds = %249, %282 - %.sroa.04.0.i = phi i64 [ %283, %282 ], [ %245, %249 ] - %264 = icmp ult i64 %.sroa.04.0.i, %183 - br i1 %264, label %279, label %.preheader - -.preheader: ; preds = %.preheader61, %271 - %.sroa.5.0.i = phi i64 [ %266, %271 ], [ %245, %.preheader61 ] + %invariant.op401 = sub i64 1, %244 + br label %248 + +248:; preds = %260, %.lr.ph.i41 + %251 = phi i64 [ %.promoted.i38, %.lr.ph.i41 ], [ %261, %260 ] + %250 = phi i64 [ %241, %.lr.ph.i41 ], [ %262, %260 ] + %251 = getelementptr inbounds i8, ptr %177, i64 %250 + %252 = load i8, ptr %251, align 1, !alias.scope !294, !noalias !300, !noundef !13 + %253 = and i8 %252, 63 + %254 = zext nneg i8 %253 to i64 + %255 = shl nuw i64 1, %254 + %256 = and i64 %255, %243 + %257 = icmp eq i64 %256, 0 + br i1 %257, label %258, label %.preheader61 + +258:; preds = %248 + %259 = add i64 %249, %183 + br label %260 + +260:; preds = %289, %276, %258 + %261 = phi i64 [ %277, %276 ], [ %259, %258 ], [ %290, %289 ] + %262 = add i64 %261, %185 + %.not34.i = icmp ult i64 %262, %179 + br i1 %.not34.i, label %248, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit" + +.preheader61:; preds = %248, %282 + %.sroa.04.0.i = phi i64 [ %282, %281 ], [ %244, %248 ] + %263 = icmp ult i64 %.sroa.04.0.i, %183 + br i1 %263, label %278, label %.preheader + +.preheader: ; preds = %.preheader61, %270 + %.sroa.5.0.i = phi i64 [ %265, %270 ], [ %244, %.preheader61 ] %.not = icmp eq i64 %.sroa.5.0.i, 0 br i1 %.not, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit", label %265 @@ -2172,7 +2173,7 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: br i1 %.first_iter, label %267, label %270, !prof !288 267: ; preds = %265 - %268 = add i64 %266, %250 + %268 = add i64 %266, %251 %269 = icmp ult i64 %268, %179 br i1 %269, label %271, label %276, !prof !288 @@ -2193,11 +2194,11 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: unreachable 277: ; preds = %271 - %278 = add i64 %250, %247 - br label %261 + %278 = add i64 %251, %247 + br label %260 279: ; preds = %.preheader61 - %280 = add i64 %.sroa.04.0.i, %250 + %280 = add i64 %.sroa.04.0.i, %251 %281 = icmp ult i64 %280, %179 br i1 %281, label %282, label %288, !prof !288 @@ -2211,19 +2212,18 @@ _ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i: br i1 %.not.i42, label %.preheader61, label %290 288: ; preds = %279 - %289 = add i64 %250, %245 + %289 = add i64 %251, %245 %umax.i = tail call i64 @llvm.umax.i64(i64 %179, i64 %289) tail call void @_ZN4core9panicking18panic_bounds_check17h5aa5e8a957e001f9E(i64 noundef %umax.i, i64 noundef %179, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.7dbcd5d78972d10e75f23ce35f923e43.33) #27, !noalias !301 unreachable 290: ; preds = %282 - %reass.sub129 = sub i64 %250, %245 - %291 = add i64 %reass.sub129, 1 - %292 = add i64 %291, %.sroa.04.0.i - br label %261 + %.reass271.reass = add i64 %251, %invariant.op401 + %291 = add i64 %.reass271.reass, %.sroa.04.0.i + br label %260 -"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit": ; preds = %_ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i, %.sink.split.i, %.preheader62, %261, %.preheader, %241, %186, %.preheader.i36, %.thread20.i.i, %.thread.i.i - %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %.thread.i.i ], [ 0, %.preheader.i36 ], [ 0, %.thread20.i.i ], [ 1, %.preheader62 ], [ 0, %186 ], [ 0, %241 ], [ 0, %.sink.split.i ], [ 0, %261 ], [ 1, %_ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i ] +"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h81357aafb99f3895E.exit": ; preds = %_ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i, %.sink.split.i, %.preheader62, %260, %.preheader, %241, %186, %.preheader.i36, %.thread20.i.i, %.thread.i.i + %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %.thread.i.i ], [ 0, %.preheader.i36 ], [ 0, %.thread20.i.i ], [ 1, %.preheader62 ], [ 0, %186 ], [ 0, %240 ], [ 0, %.sink.split.i ], [ 0, %260 ], [ 1, %_ZN4core3str11validations15next_code_point17h56de14856462d818E.exit.thread.i.i ] call void @llvm.lifetime.end.p0(ptr nonnull %7) br label %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h03a4955529edbd10E.exit" } diff --git a/bench/libcxx/optimized/nodebug_on_aliases.ll b/bench/libcxx/optimized/nodebug_on_aliases.ll index e4b7d557b65..b00277f3c5d 100644 --- a/bench/libcxx/optimized/nodebug_on_aliases.ll +++ b/bench/libcxx/optimized/nodebug_on_aliases.ll @@ -4374,10 +4374,10 @@ _ZNK5clang9NamedDecl7getNameEv.exit: ; preds = %4 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %34, %.lr.ph.i.i.i - %.033.i.i.i = phi i64 [ %15, %.lr.ph.i.i.i ], [ %37, %34 ] - %.02132.i.i.i = phi ptr [ %13, %.lr.ph.i.i.i ], [ %35, %34 ] + %.033.i.i.i = phi i64 [ %15, %.lr.ph.i.i.i ], [ %37, %33 ] + %.02132.i.i.i = phi ptr [ %13, %.lr.ph.i.i.i ], [ %35, %33 ] %26 = add i64 %.033.i.i.i, -1 - %27 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i.i, i32 noundef 95, i64 noundef %26) #22 + %27 = tail call ptr @memchr(ptr noundef nonnull %.02132.i.i.i, i32 noundef 95, i64 noundef %26) #22 %.not26.i.i.i = icmp eq ptr %27, null br i1 %.not26.i.i.i, label %_Z12is_ugly_nameSt17basic_string_viewIcSt11char_traitsIcEE.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i @@ -4401,7 +4401,7 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i: ; preds = %_ZNSt11char_traitsI br i1 %.not25.i.i.i, label %_Z12is_ugly_nameSt17basic_string_viewIcSt11char_traitsIcEE.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, !llvm.loop !244 _Z12is_ugly_nameSt17basic_string_viewIcSt11char_traitsIcEE.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, %34, %4, %_ZNK5clang9NamedDecl7getNameEv.exit, %20, %29 - %.0.i = phi i1 [ false, %20 ], [ true, %_ZNK5clang9NamedDecl7getNameEv.exit ], [ %33, %29 ], [ true, %4 ], [ true, %34 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ] + %.0.i = phi i1 [ false, %20 ], [ true, %_ZNK5clang9NamedDecl7getNameEv.exit ], [ %33, %28 ], [ true, %4 ], [ true, %33 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ] ret i1 %.0.i } @@ -4649,10 +4649,10 @@ _ZNK5clang9NamedDecl7getNameEv.exit: ; preds = %4 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %34, %.lr.ph.i.i.i - %.033.i.i.i = phi i64 [ %15, %.lr.ph.i.i.i ], [ %37, %34 ] - %.02132.i.i.i = phi ptr [ %13, %.lr.ph.i.i.i ], [ %35, %34 ] + %.033.i.i.i = phi i64 [ %15, %.lr.ph.i.i.i ], [ %37, %33 ] + %.02132.i.i.i = phi ptr [ %13, %.lr.ph.i.i.i ], [ %35, %33 ] %26 = add i64 %.033.i.i.i, -1 - %27 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i.i, i32 noundef 95, i64 noundef %26) #22 + %27 = tail call ptr @memchr(ptr noundef nonnull %.02132.i.i.i, i32 noundef 95, i64 noundef %26) #22 %.not26.i.i.i = icmp eq ptr %27, null br i1 %.not26.i.i.i, label %_Z12is_ugly_nameSt17basic_string_viewIcSt11char_traitsIcEE.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i @@ -4676,7 +4676,7 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i: ; preds = %_ZNSt11char_traitsI br i1 %.not25.i.i.i, label %_Z12is_ugly_nameSt17basic_string_viewIcSt11char_traitsIcEE.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, !llvm.loop !244 _Z12is_ugly_nameSt17basic_string_viewIcSt11char_traitsIcEE.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, %34, %4, %_ZNK5clang9NamedDecl7getNameEv.exit, %20, %29 - %.0.i = phi i1 [ true, %20 ], [ false, %_ZNK5clang9NamedDecl7getNameEv.exit ], [ %33, %29 ], [ false, %4 ], [ false, %34 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ] + %.0.i = phi i1 [ true, %20 ], [ false, %_ZNK5clang9NamedDecl7getNameEv.exit ], [ %33, %28 ], [ false, %4 ], [ false, %33 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ] ret i1 %.0.i } diff --git a/bench/libcxx/optimized/string.ll b/bench/libcxx/optimized/string.ll index 2ffd756e06f..4e4156fac99 100644 --- a/bench/libcxx/optimized/string.ll +++ b/bench/libcxx/optimized/string.ll @@ -2285,37 +2285,37 @@ define weak_odr dso_local noundef i64 @_ZNKSt3__112basic_stringIcNS_11char_trait %23 = getelementptr inbounds nuw i8, ptr %10, i64 %2 %24 = load i8, ptr %1, align 1, !tbaa !4 %25 = sext i8 %24 to i32 + %invariant.op = sub i64 1, %3 br label %26 26: ; preds = %33, %.lr.ph.i.i %27 = phi i64 [ %gepdiff.i, %.lr.ph.i.i ], [ %36, %33 ] %.02529.i.i = phi ptr [ %23, %.lr.ph.i.i ], [ %34, %33 ] - %reass.sub = sub i64 %27, %3 - %28 = add i64 %reass.sub, 1 - %29 = tail call noundef ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02529.i.i, i32 noundef %25, i64 noundef %28) #28 - %30 = icmp eq ptr %29, null - br i1 %30, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %31 - -31: ; preds = %26 - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %29, ptr nonnull %1, i64 %3) - %32 = icmp eq i32 %bcmp.i.i, 0 - br i1 %32, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i, label %33 - -33: ; preds = %31 - %34 = getelementptr inbounds nuw i8, ptr %29, i64 1 - %35 = ptrtoint ptr %34 to i64 - %36 = sub i64 %21, %35 - %37 = icmp slt i64 %36, %3 - br i1 %37, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %26, !llvm.loop !9 + %.reass.i.reass.i.reass.reass = add i64 %27, %invariant.op + %28 = tail call noundef ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02529.i.i, i32 noundef %25, i64 noundef %.reass.i.reass.i.reass.reass) #28 + %29 = icmp eq ptr %28, null + br i1 %29, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %30 -_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i: ; preds = %31 - %.pre20.i = ptrtoint ptr %29 to i64 - %38 = icmp eq ptr %29, %20 - %39 = ptrtoint ptr %10 to i64 - %40 = sub i64 %.pre20.i, %39 - br i1 %38, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %_ZNSt3__110__str_findB8ne210000IcmNS_11char_traitsIcEETnT0_Lm18446744073709551615EEES3_PKT_S3_S6_S3_S3_.exit +30: ; preds = %26 + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %28, ptr nonnull %1, i64 %3) + %31 = icmp eq i32 %bcmp.i.i, 0 + br i1 %32, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i, label %32 -_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i: ; preds = %33, %26, %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i, %19 +32: ; preds = %30 + %33 = getelementptr inbounds nuw i8, ptr %28, i64 1 + %34 = ptrtoint ptr %33 to i64 + %35 = sub i64 %21, %34 + %36 = icmp slt i64 %35, %3 + br i1 %36, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %26, !llvm.loop !9 + +_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i: ; preds = %30 + %.pre20.i = ptrtoint ptr %28 to i64 + %37 = icmp eq ptr %28, %20 + %38 = ptrtoint ptr %10 to i64 + %39 = sub i64 %.pre20.i, %38 + br i1 %37, label %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %_ZNSt3__110__str_findB8ne210000IcmNS_11char_traitsIcEETnT0_Lm18446744073709551615EEES3_PKT_S3_S6_S3_S3_.exit + +_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i: ; preds = %32, %26, %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i, %19 br label %_ZNSt3__110__str_findB8ne210000IcmNS_11char_traitsIcEETnT0_Lm18446744073709551615EEES3_PKT_S3_S6_S3_S3_.exit _ZNSt3__110__str_findB8ne210000IcmNS_11char_traitsIcEETnT0_Lm18446744073709551615EEES3_PKT_S3_S6_S3_S3_.exit: ; preds = %4, %17, %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.i, %_ZNSt3__118__search_substringB8ne210000IcNS_11char_traitsIcEEEEPKT_S5_S5_S5_S5_.exit.thread.i @@ -5236,24 +5236,24 @@ define weak_odr dso_local noundef i64 @_ZNKSt3__112basic_stringIwNS_11char_trait %23 = getelementptr inbounds nuw i8, ptr %10, i64 %.idx22.i %24 = load i32, ptr %1, align 4, !tbaa !7 %25 = ashr exact i64 %gepdiff.i, 2 + %invariant.op = sub i64 1, %3 br label %.lr.ph.i.i .lr.ph.i.i: ; preds = %32, %.lr.ph.preheader.i.i - %26 = phi i64 [ %36, %32 ], [ %25, %.lr.ph.preheader.i.i ] - %.02530.i.i = phi ptr [ %33, %32 ], [ %23, %.lr.ph.preheader.i.i ] - %reass.sub = sub i64 %26, %3 - %27 = add i64 %reass.sub, 1 - %28 = tail call noundef ptr @wmemchr(ptr noundef %.02530.i.i, i32 noundef signext %24, i64 noundef %27) #28 - %29 = icmp eq ptr %28, null - br i1 %29, label %_ZNSt3__118__search_substringB8ne210000IwNS_11char_traitsIwEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %_ZNSt3__111char_traitsIwE7compareB8ne210000EPKwS3_m.exit.i.i + %26 = phi i64 [ %36, %31 ], [ %25, %.lr.ph.preheader.i.i ] + %.02530.i.i = phi ptr [ %33, %31 ], [ %23, %.lr.ph.preheader.i.i ] + %.reass.i.reass.i.reass.reass = add i64 %26, %invariant.op + %27 = tail call noundef ptr @wmemchr(ptr noundef %.02530.i.i, i32 noundef signext %24, i64 noundef %.reass.i.reass.i.reass.reass) #28 + %28 = icmp eq ptr %27, null + br i1 %28, label %_ZNSt3__118__search_substringB8ne210000IwNS_11char_traitsIwEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %_ZNSt3__111char_traitsIwE7compareB8ne210000EPKwS3_m.exit.i.i _ZNSt3__111char_traitsIwE7compareB8ne210000EPKwS3_m.exit.i.i: ; preds = %.lr.ph.i.i - %30 = tail call noundef i32 @wmemcmp(ptr noundef nonnull %28, ptr noundef nonnull %1, i64 noundef %3) #28 + %30 = tail call noundef i32 @wmemcmp(ptr noundef nonnull %27, ptr noundef nonnull %1, i64 noundef %3) #28 %31 = icmp eq i32 %30, 0 br i1 %31, label %_ZNSt3__118__search_substringB8ne210000IwNS_11char_traitsIwEEEEPKT_S5_S5_S5_S5_.exit.i, label %32 32: ; preds = %_ZNSt3__111char_traitsIwE7compareB8ne210000EPKwS3_m.exit.i.i - %33 = getelementptr inbounds nuw i8, ptr %28, i64 4 + %33 = getelementptr inbounds nuw i8, ptr %27, i64 4 %34 = ptrtoint ptr %33 to i64 %35 = sub i64 %21, %34 %36 = ashr exact i64 %35, 2 @@ -5261,8 +5261,8 @@ _ZNSt3__111char_traitsIwE7compareB8ne210000EPKwS3_m.exit.i.i: ; preds = %.lr.ph. br i1 %37, label %_ZNSt3__118__search_substringB8ne210000IwNS_11char_traitsIwEEEEPKT_S5_S5_S5_S5_.exit.thread.i, label %.lr.ph.i.i, !llvm.loop !22 _ZNSt3__118__search_substringB8ne210000IwNS_11char_traitsIwEEEEPKT_S5_S5_S5_S5_.exit.i: ; preds = %_ZNSt3__111char_traitsIwE7compareB8ne210000EPKwS3_m.exit.i.i - %.pre23.i = ptrtoint ptr %28 to i64 - %38 = icmp eq ptr %28, %20 + %.pre23.i = ptrtoint ptr %27 to i64 + %38 = icmp eq ptr %27, %20 %39 = ptrtoint ptr %10 to i64 %40 = sub i64 %.pre23.i, %39 %41 = ashr exact i64 %40, 2 diff --git a/bench/libquic/optimized/ssl_test.ll b/bench/libquic/optimized/ssl_test.ll index 693b9e58437..9e18020dbcc 100644 --- a/bench/libquic/optimized/ssl_test.ll +++ b/bench/libquic/optimized/ssl_test.ll @@ -1458,15 +1458,19 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit19: ; preds = %.cr define internal fastcc noundef zeroext i1 @_ZL20TestPaddingExtensionv() unnamed_addr #3 { %1 = tail call fastcc noundef i64 @_ZL17GetClientHelloLenm(i64 noundef 1) %2 = icmp eq i64 %1, 0 - br i1 %2, label %.loopexit, label %.preheader + br i1 %2, label %.loopexit, label %.preheader.preheader + +.preheader.preheader: ; preds = %0 + %invariant.op = sub i64 1, %1 + br label %.preheader 3: ; preds = %.critedge29 %.022.add = add nuw nsw i64 %.022.idx33, 16 %.not = icmp eq i64 %.022.add, 176 br i1 %.not, label %.loopexit, label %.preheader -.preheader: ; preds = %0, %3 - %.022.idx33 = phi i64 [ %.022.add, %3 ], [ 0, %0 ] +.preheader: ; preds = %.preheader.preheader, %3 + %.022.idx33 = phi i64 [ %.022.add, %3 ], [ 0, %.preheader.preheader ] %.022.ptr34 = getelementptr inbounds nuw i8, ptr @_ZL13kPaddingTests, i64 %.022.idx33 %4 = load i64, ptr %.022.ptr34, align 16, !tbaa !71 %5 = icmp ugt i64 %1, %4 @@ -1478,24 +1482,23 @@ define internal fastcc noundef zeroext i1 @_ZL20TestPaddingExtensionv() unnamed_ br label %.loopexit .critedge29: ; preds = %.preheader - %reass.sub = sub nuw i64 %4, %1 - %8 = add nuw i64 %reass.sub, 1 - %9 = tail call fastcc noundef i64 @_ZL17GetClientHelloLenm(i64 noundef %8) - %10 = getelementptr inbounds nuw i8, ptr %.022.ptr34, i64 8 - %11 = load i64, ptr %10, align 8, !tbaa !73 - %.not27 = icmp eq i64 %9, %11 - br i1 %.not27, label %3, label %12 - -12: ; preds = %.critedge29 - %13 = load ptr, ptr @stderr, align 8, !tbaa !20 - %14 = trunc i64 %4 to i32 - %15 = trunc i64 %9 to i32 - %16 = trunc i64 %11 to i32 - %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.91, i32 noundef %14, i32 noundef %15, i32 noundef %16) #26 + %.reass.reass = add i64 %4, %invariant.op + %8 = tail call fastcc noundef i64 @_ZL17GetClientHelloLenm(i64 noundef %.reass.reass) + %9 = getelementptr inbounds nuw i8, ptr %.022.ptr34, i64 8 + %10 = load i64, ptr %9, align 8, !tbaa !73 + %.not27 = icmp eq i64 %8, %10 + br i1 %.not27, label %3, label %11 + +11: ; preds = %.critedge29 + %12 = load ptr, ptr @stderr, align 8, !tbaa !20 + %13 = trunc i64 %4 to i32 + %14 = trunc i64 %8 to i32 + %15 = trunc i64 %10 to i32 + %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str.91, i32 noundef %13, i32 noundef %14, i32 noundef %15) #26 br label %.loopexit -.loopexit: ; preds = %3, %.critedge, %12, %0 - %.0 = phi i1 [ false, %0 ], [ false, %12 ], [ false, %.critedge ], [ true, %3 ] +.loopexit: ; preds = %3, %.critedge, %11, %0 + %.0 = phi i1 [ false, %0 ], [ false, %11 ], [ false, %.critedge ], [ true, %3 ] ret i1 %.0 } diff --git a/bench/libquic/optimized/string16.ll b/bench/libquic/optimized/string16.ll index 5cf13678e45..4cc964c2b10 100644 --- a/bench/libquic/optimized/string16.ll +++ b/bench/libquic/optimized/string16.ll @@ -5634,32 +5634,33 @@ define weak_odr noundef i64 @_ZNKSt7__cxx1112basic_stringItN4base20string16_char %15 = getelementptr inbounds nuw i16, ptr %13, i64 %6 %16 = getelementptr inbounds nuw i16, ptr %13, i64 %2 %17 = ptrtoint ptr %15 to i64 - br label %.lr.ph.i.i.preheader - -.lr.ph.i.i.preheader: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit, %.lr.ph - %.046 = phi i64 [ %14, %.lr.ph ], [ %38, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit ] - %.02845 = phi ptr [ %16, %.lr.ph ], [ %35, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit ] - %18 = sub nuw i64 %.046, %3 - %19 = add nuw i64 %18, 1 - br label %.lr.ph.i.i + %invariant.op = sub i64 1, %3 + br label %18 -.lr.ph.i.i: ; preds = %.lr.ph.i.i.preheader, %22 - %.in.i.i = phi i64 [ %23, %22 ], [ %19, %.lr.ph.i.i.preheader ] - %.068.i.i = phi ptr [ %24, %22 ], [ %.02845, %.lr.ph.i.i.preheader ] - %20 = load i16, ptr %.068.i.i, align 2, !tbaa !3 - %21 = icmp eq i16 %20, %12 - br i1 %21, label %.lr.ph.i.i36, label %22 - -22: ; preds = %.lr.ph.i.i - %23 = add i64 %.in.i.i, -1 - %24 = getelementptr inbounds nuw i8, ptr %.068.i.i, i64 2 - %.not.i.i = icmp eq i64 %23, 0 +.lr.ph.i.i: ; preds = %.lr.ph, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit + %.in.i.i = phi i64 [ %14, %.lr.ph ], [ %37, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit ] + %.068.i.i = phi ptr [ %16, %.lr.ph ], [ %34, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit ] + %.reass.reass.reass = add i64 %.046, %invariant.op + %21 = icmp eq i64 %.reass.reass.reass, 0 + br i1 %21, label %_ZN4base20string16_char_traits4findEPKtmRS1_.exit.thread, label %22 + +22: ; preds = %.lr.ph.i.i, %21 + %.in.i.i = phi i64 [ %22, %21 ], [ %.reass.reass.reass, %18 ] + %.068.i.i = phi ptr [ %23, %21 ], [ %.068.i.i, %18 ] + %19 = load i16, ptr %.068.i.i, align 2, !tbaa !3 + %20 = icmp eq i16 %19, %12 + br i1 %20, label %.lr.ph.i.i36, label %21 + +21: ; preds = %.lr.ph.i.i + %22 = add i64 %.in.i.i, -1 + %23 = getelementptr inbounds nuw i8, ptr %.068.i.i, i64 2 + %.not.i.i = icmp eq i64 %22, 0 br i1 %.not.i.i, label %_ZN4base20string16_char_traits4findEPKtmRS1_.exit.thread, label %.lr.ph.i.i, !llvm.loop !10 .lr.ph.i.i36: ; preds = %.lr.ph.i.i, %27 - %.in.i.i37 = phi i64 [ %28, %27 ], [ %3, %.lr.ph.i.i ] - %.0716.i.i = phi ptr [ %30, %27 ], [ %1, %.lr.ph.i.i ] - %.0815.i.i = phi ptr [ %29, %27 ], [ %.068.i.i, %.lr.ph.i.i ] + %.in.i.i37 = phi i64 [ %28, %26 ], [ %3, %.lr.ph.i.i ] + %.0716.i.i = phi ptr [ %30, %26 ], [ %1, %.lr.ph.i.i ] + %.0815.i.i = phi ptr [ %29, %26 ], [ %.068.i.i, %.lr.ph.i.i ] %25 = load i16, ptr %.0815.i.i, align 2, !tbaa !3 %26 = load i16, ptr %.0716.i.i, align 2, !tbaa !3 %.not12.i.i = icmp eq i16 %25, %26 @@ -5685,10 +5686,10 @@ _ZN4base20string16_char_traits7compareEPKtS2_m.exit: ; preds = %.lr.ph.i.i36 %37 = sub i64 %17, %36 %38 = ashr exact i64 %37, 1 %.not33 = icmp ult i64 %38, %3 - br i1 %.not33, label %_ZN4base20string16_char_traits4findEPKtmRS1_.exit.thread, label %.lr.ph.i.i.preheader, !llvm.loop !29 + br i1 %.not33, label %_ZN4base20string16_char_traits4findEPKtmRS1_.exit.thread, label %.lr.ph.i.i, !llvm.loop !29 -_ZN4base20string16_char_traits4findEPKtmRS1_.exit.thread: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit, %22, %11, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread, %10, %8 - %.027 = phi i64 [ %9, %8 ], [ -1, %10 ], [ %34, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread ], [ -1, %11 ], [ -1, %22 ], [ -1, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit ] +_ZN4base20string16_char_traits4findEPKtmRS1_.exit.thread: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit, %18, %21, %11, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread, %10, %8 + %.027 = phi i64 [ %9, %8 ], [ -1, %10 ], [ %34, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread ], [ -1, %11 ], [ -1, %21 ], [ -1, %18 ], [ -1, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit ] ret i64 %.027 } @@ -5722,18 +5723,19 @@ define weak_odr noundef i64 @_ZNKSt7__cxx1112basic_stringItN4base20string16_char %17 = getelementptr inbounds nuw i16, ptr %15, i64 %8 %18 = getelementptr inbounds nuw i16, ptr %15, i64 %2 %19 = ptrtoint ptr %17 to i64 - br label %.lr.ph.i.i.preheader.i + %invariant.op = sub i64 1, %6 + br label %20 .lr.ph.i.i.preheader.i: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i, %.lr.ph.i %.046.i = phi i64 [ %16, %.lr.ph.i ], [ %39, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ] %.02845.i = phi ptr [ %18, %.lr.ph.i ], [ %36, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ] - %reass.sub = sub i64 %.046.i, %6 - %20 = add i64 %reass.sub, 1 - br label %.lr.ph.i.i.i + %.reass.reass.i.reass.reass.reass = add i64 %.046.i, %invariant.op + %.not7.i.i.i = icmp eq i64 %.reass.reass.i.reass.reass.reass, 0 + br i1 %.not7.i.i.i, label %_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit, label %.lr.ph.i.i.i -.lr.ph.i.i.i: ; preds = %23, %.lr.ph.i.i.preheader.i - %.in.i.i.i = phi i64 [ %24, %23 ], [ %20, %.lr.ph.i.i.preheader.i ] - %.068.i.i.i = phi ptr [ %25, %23 ], [ %.02845.i, %.lr.ph.i.i.preheader.i ] +.lr.ph.i.i.i: ; preds = %.lr.ph.i.i.preheader.i, %23 + %.in.i.i.i = phi i64 [ %24, %23 ], [ %.reass.reass.i.reass.reass.reass, %20 ] + %.068.i.i.i = phi ptr [ %25, %23 ], [ %.02845.i, %20 ] %21 = load i16, ptr %.068.i.i.i, align 2, !tbaa !3 %22 = icmp eq i16 %21, %14 br i1 %22, label %.lr.ph.i.i36.i, label %23 @@ -5775,8 +5777,8 @@ _ZN4base20string16_char_traits7compareEPKtS2_m.exit.i: ; preds = %.lr.ph.i.i36.i %.not33.i = icmp ult i64 %39, %6 br i1 %.not33.i, label %_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit, label %.lr.ph.i.i.preheader.i, !llvm.loop !29 -_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i, %23, %10, %12, %13, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i - %.027.i = phi i64 [ %11, %10 ], [ -1, %12 ], [ %35, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i ], [ -1, %13 ], [ -1, %23 ], [ -1, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ] +_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit: ; preds = %20, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i, %23, %10, %12, %13, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i + %.027.i = phi i64 [ %11, %10 ], [ -1, %12 ], [ %35, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i ], [ -1, %13 ], [ -1, %23 ], [ -1, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ], [ -1, %20 ] ret i64 %.027.i } @@ -5821,18 +5823,19 @@ _ZN4base20string16_char_traits6lengthEPKt.exit: ; preds = %4 %21 = getelementptr inbounds nuw i16, ptr %19, i64 %12 %22 = getelementptr inbounds nuw i16, ptr %19, i64 %2 %23 = ptrtoint ptr %21 to i64 - br label %.lr.ph.i.i.preheader.i + %invariant.op = sub i64 1, %10 + br label %24 .lr.ph.i.i.preheader.i: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i, %.lr.ph.i %.046.i = phi i64 [ %20, %.lr.ph.i ], [ %43, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ] %.02845.i = phi ptr [ %22, %.lr.ph.i ], [ %40, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ] - %reass.sub = sub i64 %.046.i, %10 - %24 = add i64 %reass.sub, 1 - br label %.lr.ph.i.i.i + %.reass.reass.i.reass.reass.reass = add i64 %.046.i, %invariant.op + %.not7.i.i.i = icmp eq i64 %.reass.reass.i.reass.reass.reass, 0 + br i1 %.not7.i.i.i, label %_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit, label %.lr.ph.i.i.i -.lr.ph.i.i.i: ; preds = %27, %.lr.ph.i.i.preheader.i - %.in.i.i.i = phi i64 [ %28, %27 ], [ %24, %.lr.ph.i.i.preheader.i ] - %.068.i.i.i = phi ptr [ %29, %27 ], [ %.02845.i, %.lr.ph.i.i.preheader.i ] +.lr.ph.i.i.i: ; preds = %.lr.ph.i.i.preheader.i, %27 + %.in.i.i.i = phi i64 [ %28, %27 ], [ %.reass.reass.i.reass.reass.reass, %24 ] + %.068.i.i.i = phi ptr [ %29, %27 ], [ %.02845.i, %24 ] %25 = load i16, ptr %.068.i.i.i, align 2, !tbaa !3 %26 = icmp eq i16 %25, %18 br i1 %26, label %.lr.ph.i.i36.i, label %27 @@ -5874,8 +5877,8 @@ _ZN4base20string16_char_traits7compareEPKtS2_m.exit.i: ; preds = %.lr.ph.i.i36.i %.not33.i = icmp ult i64 %43, %10 br i1 %.not33.i, label %_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit, label %.lr.ph.i.i.preheader.i, !llvm.loop !29 -_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit: ; preds = %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i, %27, %14, %16, %17, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i - %.027.i = phi i64 [ %15, %14 ], [ -1, %16 ], [ %39, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i ], [ -1, %17 ], [ -1, %27 ], [ -1, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ] +_ZNKSt7__cxx1112basic_stringItN4base20string16_char_traitsESaItEE4findEPKtmm.exit: ; preds = %24, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i, %27, %14, %16, %17, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i + %.027.i = phi i64 [ %15, %14 ], [ -1, %16 ], [ %39, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.thread.i ], [ -1, %17 ], [ -1, %27 ], [ -1, %_ZN4base20string16_char_traits7compareEPKtS2_m.exit.i ], [ -1, %24 ] ret i64 %.027.i } diff --git a/bench/lief/optimized/AArch64PAuth.ll b/bench/lief/optimized/AArch64PAuth.ll index 9460162d436..86bf467e41a 100644 --- a/bench/lief/optimized/AArch64PAuth.ll +++ b/bench/lief/optimized/AArch64PAuth.ll @@ -16905,6 +16905,7 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %_ZN3fmt3 %52 = load ptr, ptr %7, align 8 %sext = shl i64 %4, 32 %53 = ashr exact i64 %sext, 32 + %invariant.op = sub i32 1, %5 br label %92 54: ; preds = %58 @@ -16998,10 +16999,9 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEED2Ev.exit: ; preds = %_ZN3fmt3v106d %indvars.iv70 = phi i32 [ 1, %.lr.ph50 ], [ %indvars.iv.next71, %._crit_edge ] %.03149 = phi i32 [ %5, %.lr.ph50 ], [ %100, %._crit_edge ] %.248 = phi i128 [ %.035.lcssa, %.lr.ph50 ], [ %99, %._crit_edge ] - %reass.sub = sub i32 %.03149, %5 - %93 = add i32 %reass.sub, 1 - %94 = icmp slt i32 %93, %5 - br i1 %94, label %.lr.ph.preheader, label %._crit_edge + %.reass.reass = add i32 %.03149, %invariant.op + %93 = icmp slt i32 %.reass.reass, %5 + br i1 %93, label %.lr.ph.preheader, label %._crit_edge .lr.ph.preheader: ; preds = %92 %95 = sext i32 %indvars.iv70 to i64 diff --git a/bench/linux/optimized/dmi_scan.ll b/bench/linux/optimized/dmi_scan.ll index 679a346dbf6..dd499325205 100644 --- a/bench/linux/optimized/dmi_scan.ll +++ b/bench/linux/optimized/dmi_scan.ll @@ -792,10 +792,14 @@ define dso_local noundef range(i32 -12, 1) i32 @dmi_walk(ptr noundef readonly ca %14 = icmp ult i32 %13, 4 br i1 %14, label %.loopexit6, label %.preheader5 -.preheader5: ; preds = %11, %51 - %15 = phi i32 [ %54, %51 ], [ %13, %11 ] - %16 = phi ptr [ %41, %51 ], [ %9, %11 ] - %17 = phi i32 [ %42, %51 ], [ 0, %11 ] +.preheader5: ; preds = %11 + %invariant.op = sub i64 4, %12 + br label %.preheader5 + +.preheader5: ; preds = %.preheader5.preheader, %51 + %15 = phi i32 [ %53, %51 ], [ %13, %.preheader5.preheader ] + %16 = phi ptr [ %41, %51 ], [ %9, %.preheader5.preheader ] + %17 = phi i32 [ %42, %51 ], [ 0, %.preheader5.preheader ] %18 = getelementptr inbounds nuw i8, ptr %16, i64 1 %19 = load i8, ptr %18, align 1 %20 = zext i8 %19 to i64 @@ -850,12 +854,11 @@ define dso_local noundef range(i32 -12, 1) i32 @dmi_walk(ptr noundef readonly ca 51: ; preds = %48, %45 %52 = ptrtoint ptr %41 to i64 - %reass.sub10 = sub i64 %52, %12 - %53 = add i64 %reass.sub10, 4 - %54 = load i32, ptr @dmi_len, align 4 - %55 = zext i32 %54 to i64 - %56 = icmp ugt i64 %53, %55 - br i1 %56, label %.loopexit6.loopexit, label %.preheader5 + %.reass.reass = add i64 %52, %invariant.op + %53 = load i32, ptr @dmi_len, align 4 + %54 = zext i32 %53 to i64 + %55 = icmp ugt i64 %.reass.reass, %54 + br i1 %55, label %.loopexit6.loopexit, label %.preheader5 .loopexit6.loopexit: ; preds = %45, %48, %51 %.pre = load i32, ptr @dmi_len, align 4 @@ -880,7 +883,7 @@ define dso_local noundef range(i32 -12, 1) i32 @dmi_walk(ptr noundef readonly ca br label %64 64: ; preds = %63, %5, %2 - %65 = phi i32 [ 0, %63 ], [ -6, %2 ], [ -12, %5 ] + %65 = phi i32 [ 0, %62 ], [ -6, %2 ], [ -12, %5 ] ret i32 %65 } @@ -1313,12 +1316,16 @@ define internal fastcc noundef range(i32 -12, 1) i32 @dmi_walk_early(ptr noundef %8 = ptrtoint ptr %5 to i64 %9 = load i32, ptr @dmi_len, align 4 %10 = icmp ult i32 %9, 4 - br i1 %10, label %._crit_edge.i, label %.lr.ph.i + br i1 %10, label %._crit_edge.i, label %.lr.ph.i.preheader -.lr.ph.i: ; preds = %7, %.backedge.i - %11 = phi i32 [ %46, %.backedge.i ], [ %9, %7 ] - %12 = phi ptr [ %37, %.backedge.i ], [ %5, %7 ] - %13 = phi i32 [ %38, %.backedge.i ], [ 0, %7 ] +.lr.ph.i.preheader: ; preds = %7 + %invariant.op = sub i64 4, %8 + br label %.lr.ph.i + +.lr.ph.i: ; preds = %.lr.ph.i.preheader, %.backedge.i + %11 = phi i32 [ %45, %.backedge.i ], [ %9, %.lr.ph.i.preheader ] + %12 = phi ptr [ %37, %.backedge.i ], [ %5, %.lr.ph.i.preheader ] + %13 = phi i32 [ %38, %.backedge.i ], [ 0, %.lr.ph.i.preheader ] %14 = getelementptr inbounds nuw i8, ptr %12, i64 1 %15 = load i8, ptr %14, align 1 %16 = zext i8 %15 to i64 @@ -1373,12 +1380,11 @@ define internal fastcc noundef range(i32 -12, 1) i32 @dmi_walk_early(ptr noundef .backedge.i: ; preds = %43, %41 %44 = ptrtoint ptr %37 to i64 - %reass.sub = sub i64 %44, %8 - %45 = add i64 %reass.sub, 4 - %46 = load i32, ptr @dmi_len, align 4 - %47 = zext i32 %46 to i64 - %48 = icmp ugt i64 %45, %47 - br i1 %48, label %._crit_edge.loopexit.i, label %.lr.ph.i + %.reass.i.reass.reass = add i64 %44, %invariant.op + %45 = load i32, ptr @dmi_len, align 4 + %46 = zext i32 %45 to i64 + %47 = icmp ugt i64 %.reass.i.reass.reass, %46 + br i1 %47, label %._crit_edge.loopexit.i, label %.lr.ph.i ._crit_edge.loopexit.i: ; preds = %.backedge.i, %43, %41 %.pre.i = load i32, ptr @dmi_len, align 4 @@ -1400,7 +1406,7 @@ define internal fastcc noundef range(i32 -12, 1) i32 @dmi_walk_early(ptr noundef br label %dmi_decode_table.exit dmi_decode_table.exit: ; preds = %._crit_edge.i, %51 - %.pre-phi = phi i64 [ %.pre-phi.i, %._crit_edge.i ], [ %.pre, %51 ] + %.pre-phi = phi i64 [ %.pre-phi.i, %._crit_edge.i ], [ %.pre, %50 ] tail call void @add_device_randomness(ptr noundef nonnull %5, i64 noundef %.pre-phi) #21 tail call void @early_memunmap(ptr noundef nonnull %5, i64 noundef %4) #21 br label %53 diff --git a/bench/linux/optimized/extents.ll b/bench/linux/optimized/extents.ll index ee81eaea665..5416ee70b80 100644 --- a/bench/linux/optimized/extents.ll +++ b/bench/linux/optimized/extents.ll @@ -11833,7 +11833,11 @@ define internal fastcc noundef range(i32 0, 2) i32 @ext4_ext_try_to_merge_right( %37 = add i32 %36, %35 %38 = load i32, ptr %17, align 4 %39 = icmp eq i32 %37, %38 - br i1 %39, label %.lr.ph16, label %.critedge + br i1 %39, label %.lr.ph16.preheader, label %.critedge + +.lr.ph16.preheader: ; preds = %.lr.ph + %invariant.op = sub i64 4294967284, %30 + br label %.lr.ph16 40: ; preds = %3 tail call void asm sideeffect "2064: nop\0A\09.pushsection .discard.instr_begin\0A\09.long 2064b - .\0A\09.popsection\0A\09", "i,~{dirflag},~{fpsr},~{flags}"(i32 2064) #16, !srcloc !191 @@ -11860,15 +11864,15 @@ define internal fastcc noundef range(i32 0, 2) i32 @ext4_ext_try_to_merge_right( %56 = icmp eq i32 %54, %55 br i1 %56, label %.lr.ph16, label %.critedge, !llvm.loop !193 -.lr.ph16: ; preds = %.lr.ph, %47 - %.in = phi i64 [ %51, %47 ], [ %34, %.lr.ph ] - %57 = phi i32 [ %52, %47 ], [ %35, %.lr.ph ] - %58 = phi i1 [ %49, %47 ], [ %32, %.lr.ph ] - %59 = phi i32 [ 1, %47 ], [ 0, %.lr.ph ] - %60 = phi i16 [ %42, %47 ], [ %25, %.lr.ph ] - %61 = phi i1 [ %43, %47 ], [ %26, %.lr.ph ] - %62 = phi i16 [ %44, %47 ], [ %27, %.lr.ph ] - %63 = phi i1 [ %45, %47 ], [ %28, %.lr.ph ] +.lr.ph16: ; preds = %.lr.ph16.preheader, %47 + %.in = phi i64 [ %51, %47 ], [ %34, %.lr.ph16.preheader ] + %57 = phi i32 [ %52, %47 ], [ %35, %.lr.ph16.preheader ] + %58 = phi i1 [ %49, %47 ], [ %32, %.lr.ph16.preheader ] + %59 = phi i32 [ 1, %47 ], [ 0, %.lr.ph16.preheader ] + %60 = phi i16 [ %42, %47 ], [ %25, %.lr.ph16.preheader ] + %61 = phi i1 [ %43, %47 ], [ %26, %.lr.ph16.preheader ] + %62 = phi i16 [ %44, %47 ], [ %27, %.lr.ph16.preheader ] + %63 = phi i1 [ %45, %47 ], [ %28, %.lr.ph16.preheader ] %64 = zext i16 %62 to i32 %65 = add nsw i32 %64, -32768 %66 = select i1 %63, i32 %64, i32 %65 @@ -11930,10 +11934,9 @@ define internal fastcc noundef range(i32 0, 2) i32 @ext4_ext_try_to_merge_right( 104: ; preds = %99 %105 = ptrtoint ptr %102 to i64 - %reass.sub = sub i64 %105, %30 - %106 = add i64 %reass.sub, 4294967284 - %107 = and i64 %106, 4294967295 - tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %17, ptr align 4 %24, i64 %107, i1 false) + %.reass.reass = add i64 %105, %invariant.op + %106 = and i64 %.reass.reass, 4294967295 + tail call void @llvm.memmove.p0.p0.i64(ptr align 4 %17, ptr align 4 %24, i64 %106, i1 false) %.pre = load i16, ptr %11, align 2 br label %108 @@ -11958,7 +11961,7 @@ define internal fastcc noundef range(i32 0, 2) i32 @ext4_ext_try_to_merge_right( br label %.thread .thread: ; preds = %108, %114, %112 - %115 = phi i16 [ %110, %108 ], [ %.pre11, %114 ], [ %.pr, %112 ] + %115 = phi i16 [ %110, %107 ], [ %.pre11, %113 ], [ %.pr, %111 ] %116 = zext i16 %115 to i64 %117 = getelementptr %struct.ext4_extent, ptr %8, i64 %116 %118 = icmp ugt ptr %117, %2 diff --git a/bench/linux/optimized/ohci-hcd.ll b/bench/linux/optimized/ohci-hcd.ll index 048e6dbee07..dae78947a87 100644 --- a/bench/linux/optimized/ohci-hcd.ll +++ b/bench/linux/optimized/ohci-hcd.ll @@ -824,10 +824,11 @@ define internal fastcc noundef range(i32 -108, 1) i32 @root_port_reset(ptr nound %8 = getelementptr inbounds nuw i8, ptr %4, i64 60 %9 = tail call i32 asm sideeffect "movl $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) %8) #14, !srcloc !5 %10 = trunc i32 %9 to i16 + %invariant.op = sub i16 -50, %10 br label %11 11: ; preds = %29, %2 - %12 = phi i32 [ 5, %2 ], [ %36, %29 ] + %12 = phi i32 [ 5, %2 ], [ %35, %29 ] br label %13 13: ; preds = %20, %11 @@ -868,13 +869,12 @@ define internal fastcc noundef range(i32 -108, 1) i32 @root_port_reset(ptr nound %31 = getelementptr inbounds nuw i8, ptr %30, i64 60 %32 = tail call i32 asm sideeffect "movl $1,$0", "=r,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull elementtype(i32) %31) #14, !srcloc !5 %33 = trunc i32 %32 to i16 - %reass.sub = sub i16 %33, %10 - %34 = add i16 %reass.sub, -50 - %35 = icmp slt i16 %34, 0 - %36 = add nsw i32 %12, -1 - %37 = icmp ne i32 %12, 0 - %38 = select i1 %35, i1 %37, i1 false - br i1 %38, label %11, label %.thread2, !llvm.loop !18 + %.reass.reass = add i16 %33, %invariant.op + %34 = icmp slt i16 %.reass.reass, 0 + %35 = add nsw i32 %12, -1 + %36 = icmp ne i32 %12, 0 + %37 = select i1 %34, i1 %36, i1 false + br i1 %37, label %11, label %.thread2, !llvm.loop !18 .thread2: ; preds = %22, %29, %20, %13 %39 = phi i32 [ -108, %13 ], [ 0, %20 ], [ 0, %29 ], [ 0, %22 ] diff --git a/bench/llama.cpp/optimized/ggml-opt.ll b/bench/llama.cpp/optimized/ggml-opt.ll index 9f2c963dab3..b1d5ff0407e 100644 --- a/bench/llama.cpp/optimized/ggml-opt.ll +++ b/bench/llama.cpp/optimized/ggml-opt.ll @@ -2498,7 +2498,11 @@ ggml_opt_forward_backward.exit: ; preds = %61, %73 %77 = getelementptr inbounds nuw i8, ptr %0, i64 5120 %.not = icmp eq ptr %6, null %78 = sub nsw i64 %26, %33 - br i1 %.not, label %.lr.ph62.split.us, label %.lr.ph62.split + br i1 %.not, label %.lr.ph62.split.us, label %.lr.ph62.split.preheader + +.lr.ph62.split.preheader: ; preds = %.lr.ph62 + %invariant.op = sub i64 1, %33 + br label %.lr.ph62.split .lr.ph62.split.us: ; preds = %.lr.ph62, %.lr.ph62.split.us %.160.us = phi i64 [ %80, %.lr.ph62.split.us ], [ %.0.lcssa, %.lr.ph62 ] @@ -2509,16 +2513,15 @@ ggml_opt_forward_backward.exit: ; preds = %61, %73 %exitcond69.not = icmp eq i64 %80, %26 br i1 %exitcond69.not, label %._crit_edge63, label %.lr.ph62.split.us, !llvm.loop !159 -.lr.ph62.split: ; preds = %.lr.ph62, %.lr.ph62.split - %.160 = phi i64 [ %83, %.lr.ph62.split ], [ %.0.lcssa, %.lr.ph62 ] +.lr.ph62.split: ; preds = %.lr.ph62.split.preheader, %.lr.ph62.split + %.160 = phi i64 [ %82, %.lr.ph62.split ], [ %.0.lcssa, %.lr.ph62.split.preheader ] tail call void @ggml_opt_dataset_get_batch(ptr noundef %1, ptr noundef %9, ptr noundef %11, i64 noundef %.160) %81 = load ptr, ptr %77, align 8, !tbaa !81 tail call fastcc void @_ZL19ggml_opt_eval_graphP16ggml_opt_contextP11ggml_cgraphP15ggml_opt_result(ptr noundef nonnull %0, ptr noundef %81, ptr noundef %3) - %reass.sub = sub i64 %.160, %33 - %82 = add i64 %reass.sub, 1 - tail call void %6(i1 noundef zeroext false, ptr noundef nonnull %0, ptr noundef %1, ptr noundef %3, i64 noundef %82, i64 noundef %78, i64 noundef %75) - %83 = add i64 %.160, 1 - %exitcond68.not = icmp eq i64 %83, %26 + %.reass.reass = add i64 %.160, %invariant.op + tail call void %6(i1 noundef zeroext false, ptr noundef nonnull %0, ptr noundef %1, ptr noundef %3, i64 noundef %.reass.reass, i64 noundef %78, i64 noundef %75) + %82 = add i64 %.160, 1 + %exitcond68.not = icmp eq i64 %82, %26 br i1 %exitcond68.not, label %._crit_edge63, label %.lr.ph62.split, !llvm.loop !159 ._crit_edge63: ; preds = %.lr.ph62.split, %.lr.ph62.split.us, %._crit_edge diff --git a/bench/llvm/optimized/BitcastBuffer.ll b/bench/llvm/optimized/BitcastBuffer.ll index 74c57949475..b24ed4c5c73 100644 --- a/bench/llvm/optimized/BitcastBuffer.ll +++ b/bench/llvm/optimized/BitcastBuffer.ll @@ -239,10 +239,14 @@ define dso_local noundef zeroext i1 @_ZNK5clang6interp13BitcastBuffer16rangeInit %.not51 = icmp eq i32 %11, 0 br i1 %.not51, label %.loopexit, label %.lr.ph -.lr.ph: ; preds = %5, %24 - %.02254 = phi i1 [ %.1, %24 ], [ false, %5 ] - %.02353 = phi ptr [ %30, %24 ], [ %9, %5 ] - %.sroa.035.052 = phi i64 [ %.sroa.035.3, %24 ], [ 0, %5 ] +.lr.ph: ; preds = %5 + %invariant.op = sub i64 1, %1 + br label %.lr.ph + +.lr.ph: ; preds = %.lr.ph.preheader, %24 + %.02254 = phi i1 [ %.1, %24 ], [ false, %.lr.ph.preheader ] + %.02353 = phi ptr [ %29, %24 ], [ %9, %.lr.ph.preheader ] + %.sroa.035.052 = phi i64 [ %.sroa.035.3, %24 ], [ 0, %.lr.ph.preheader ] %.sroa.030.0.copyload = load i64, ptr %.02353, align 8, !tbaa !14 %.sroa.8.0..023.sroa_idx = getelementptr inbounds nuw i8, ptr %.02353, i64 8 %.sroa.8.0.copyload = load i64, ptr %.sroa.8.0..023.sroa_idx, align 8, !tbaa !14 @@ -271,10 +275,9 @@ define dso_local noundef zeroext i1 @_ZNK5clang6interp13BitcastBuffer16rangeInit %25 = icmp ule i64 %.sroa.030.0.copyload, %1 %26 = icmp uge i64 %.sroa.8.0.copyload, %1 %27 = select i1 %25, i1 %26, i1 false - %reass.sub = sub i64 %.sroa.8.0.copyload, %1 - %28 = add i64 %reass.sub, 1 - %29 = select i1 %27, i64 %28, i64 0 - %.sroa.035.3 = add i64 %.sroa.035.2, %29 + %.reass.reass = add i64 %.sroa.8.0.copyload, %invariant.op + %28 = select i1 %27, i64 %.reass.reass, i64 0 + %.sroa.035.3 = add i64 %.sroa.035.2, %28 %.1 = or i1 %27, %.02254 %30 = getelementptr inbounds nuw i8, ptr %.02353, i64 16 %.not = icmp eq ptr %30, %13 diff --git a/bench/meilisearch-rs/optimized/2bqmf34tdvo23w8l.ll b/bench/meilisearch-rs/optimized/2bqmf34tdvo23w8l.ll index 262ef9f95a5..4260ae954e5 100644 --- a/bench/meilisearch-rs/optimized/2bqmf34tdvo23w8l.ll +++ b/bench/meilisearch-rs/optimized/2bqmf34tdvo23w8l.ll @@ -42716,6 +42716,7 @@ _ZN4core3str7pattern13simd_contains17hf720a9f11bbf911cE.exit: ; preds = %39, %18 %216 = getelementptr inbounds nuw i8, ptr %7, i64 24 %217 = load i64, ptr %216, align 8, !alias.scope !8135, !noalias !8142 %218 = sub i64 %208, %217 + %invariant.op = sub i64 1, %215 br label %219 219: ; preds = %.sink.split.i, %.lr.ph.i45 @@ -42741,7 +42742,7 @@ _ZN4core3str7pattern13simd_contains17hf720a9f11bbf911cE.exit: ; preds = %39, %18 .sink.split.i: ; preds = %263, %253, %230 %.sink.i = phi i64 [ 0, %263 ], [ %218, %253 ], [ 0, %230 ] - %.ph82.i = phi i64 [ %265, %263 ], [ %254, %253 ], [ %231, %230 ] + %.ph82.i = phi i64 [ %264, %263 ], [ %254, %253 ], [ %231, %230 ] %233 = add i64 %.ph82.i, %210 %.not29.i51 = icmp ult i64 %233, %204 br i1 %.not29.i51, label %219, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17hd20f2a596ae1877dE.exit" @@ -42807,9 +42808,8 @@ _ZN4core3str7pattern13simd_contains17hf720a9f11bbf911cE.exit: ; preds = %39, %18 unreachable 263: ; preds = %255 - %reass.sub = sub i64 %220, %215 - %264 = add i64 %reass.sub, 1 - %265 = add i64 %264, %.sroa.06.0.i48 + %.reass.reass = add i64 %220, %invariant.op + %264 = add i64 %.reass.reass, %.sroa.06.0.i48 br label %.sink.split.i 266: ; preds = %197 @@ -42829,42 +42829,43 @@ _ZN4core3str7pattern13simd_contains17hf720a9f11bbf911cE.exit: ; preds = %39, %18 %272 = load i64, ptr %271, align 8, !alias.scope !8147, !noalias !8154 %273 = add i64 %270, -1 %.first_iter = icmp ult i64 %273, %208 - br label %274 - -274: ; preds = %286, %.lr.ph.i39 - %275 = phi i64 [ %.promoted.i36, %.lr.ph.i39 ], [ %287, %286 ] - %276 = phi i64 [ %267, %.lr.ph.i39 ], [ %288, %286 ] - %277 = getelementptr inbounds i8, ptr %202, i64 %276 - %278 = load i8, ptr %277, align 1, !alias.scope !8150, !noalias !8156, !noundef !9 - %279 = and i8 %278, 63 - %280 = zext nneg i8 %279 to i64 - %281 = shl nuw i64 1, %280 - %282 = and i64 %281, %269 - %283 = icmp eq i64 %282, 0 - br i1 %283, label %284, label %.preheader60 - -284: ; preds = %274 - %285 = add i64 %275, %208 - br label %286 - -286: ; preds = %315, %305, %284 - %287 = phi i64 [ %306, %305 ], [ %285, %284 ], [ %317, %315 ] - %288 = add i64 %287, %210 - %.not29.i = icmp ult i64 %288, %204 - br i1 %.not29.i, label %274, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17hd20f2a596ae1877dE.exit" - -.preheader60: ; preds = %274, %307 - %.sroa.06.0.i = phi i64 [ %308, %307 ], [ %270, %274 ] - %289 = icmp ult i64 %.sroa.06.0.i, %208 - br i1 %289, label %290, label %.preheader - -290: ; preds = %.preheader60 - %291 = add i64 %.sroa.06.0.i, %275 - %292 = icmp ult i64 %291, %204 - br i1 %292, label %307, label %313, !prof !1841 - -.preheader: ; preds = %.preheader60, %299 - %.sroa.5.0.i = phi i64 [ %294, %299 ], [ %270, %.preheader60 ] + %invariant.op398 = sub i64 1, %270 + br label %273 + +273:; preds = %285, %.lr.ph.i39 + %276 = phi i64 [ %.promoted.i36, %.lr.ph.i39 ], [ %286, %285 ] + %275 = phi i64 [ %266, %.lr.ph.i39 ], [ %287, %285 ] + %276 = getelementptr inbounds i8, ptr %202, i64 %275 + %277 = load i8, ptr %276, align 1, !alias.scope !8150, !noalias !8156, !noundef !9 + %278 = and i8 %277, 63 + %279 = zext nneg i8 %278 to i64 + %280 = shl nuw i64 1, %279 + %281 = and i64 %280, %268 + %282 = icmp eq i64 %281, 0 + br i1 %282, label %283, label %.preheader60 + +283:; preds = %273 + %284 = add i64 %274, %208 + br label %285 + +285:; preds = %314, %305, %283 + %286 = phi i64 [ %305, %304 ], [ %284, %283 ], [ %315, %314 ] + %287 = add i64 %286, %210 + %.not29.i = icmp ult i64 %287, %204 + br i1 %.not29.i, label %273, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17hd20f2a596ae1877dE.exit" + +.preheader60:; preds = %273, %307 + %.sroa.06.0.i = phi i64 [ %307, %306 ], [ %269, %273 ] + %288 = icmp ult i64 %.sroa.06.0.i, %208 + br i1 %288, label %289, label %.preheader + +289:; preds = %.preheader60 + %290 = add i64 %.sroa.06.0.i, %274 + %291 = icmp ult i64 %290, %204 + br i1 %291, label %306, label %312, !prof !1841 + +.preheader: ; preds = %.preheader60, %298 + %.sroa.5.0.i = phi i64 [ %293, %298 ], [ %269, %.preheader60 ] %.not = icmp eq i64 %.sroa.5.0.i, 0 br i1 %.not, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17hd20f2a596ae1877dE.exit", label %293 @@ -42873,7 +42874,7 @@ _ZN4core3str7pattern13simd_contains17hf720a9f11bbf911cE.exit: ; preds = %39, %18 br i1 %.first_iter, label %295, label %298, !prof !1841 295: ; preds = %293 - %296 = add i64 %294, %275 + %296 = add i64 %294, %274 %297 = icmp ult i64 %296, %204 br i1 %297, label %299, label %304, !prof !1841 @@ -42894,32 +42895,31 @@ _ZN4core3str7pattern13simd_contains17hf720a9f11bbf911cE.exit: ; preds = %39, %18 unreachable 305: ; preds = %299 - %306 = add i64 %275, %272 - br label %286 + %306 = add i64 %274, %272 + br label %285 -307: ; preds = %290 +307: ; preds = %289 %308 = add nuw i64 %.sroa.06.0.i, 1 %309 = getelementptr inbounds i8, ptr %206, i64 %.sroa.06.0.i %310 = load i8, ptr %309, align 1, !alias.scope !8152, !noalias !8158, !noundef !9 - %311 = getelementptr inbounds i8, ptr %202, i64 %291 + %311 = getelementptr inbounds i8, ptr %202, i64 %290 %312 = load i8, ptr %311, align 1, !alias.scope !8150, !noalias !8156, !noundef !9 %.not24.i = icmp eq i8 %310, %312 br i1 %.not24.i, label %.preheader60, label %315 -313: ; preds = %290 - %314 = add i64 %275, %270 +313: ; preds = %289 + %314 = add i64 %274, %270 %umax.i = tail call i64 @llvm.umax.i64(i64 %204, i64 %314) tail call void @_ZN4core9panicking18panic_bounds_check17hd7e618b1b39cc1c3E(i64 noundef %umax.i, i64 noundef %204, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.4274f88979834c3c083b31457f2e0a9e.146) #57, !noalias !8157 unreachable 315: ; preds = %307 - %reass.sub124 = sub i64 %275, %270 - %316 = add i64 %reass.sub124, 1 - %317 = add i64 %316, %.sroa.06.0.i - br label %286 + %.reass267.reass = add i64 %274, %invariant.op398 + %316 = add i64 %.reass267.reass, %.sroa.06.0.i + br label %285 -"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17hd20f2a596ae1877dE.exit": ; preds = %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.i.i", %.sink.split.i, %.preheader61, %286, %.preheader, %266, %211, %.preheader.i34, %.thread.i.i, %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.thread.i.i" - %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.thread.i.i" ], [ 0, %.preheader.i34 ], [ 0, %.thread.i.i ], [ 1, %.preheader61 ], [ 0, %211 ], [ 0, %266 ], [ 0, %.sink.split.i ], [ 0, %286 ], [ 1, %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.i.i" ] +"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17hd20f2a596ae1877dE.exit": ; preds = %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.i.i", %.sink.split.i, %.preheader61, %285, %.preheader, %266, %211, %.preheader.i34, %.thread.i.i, %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.thread.i.i" + %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.thread.i.i" ], [ 0, %.preheader.i34 ], [ 0, %.thread.i.i ], [ 1, %.preheader61 ], [ 0, %211 ], [ 0, %265 ], [ 0, %.sink.split.i ], [ 0, %285 ], [ 1, %"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h917887c7fa076885E.exit.i.i" ] call void @llvm.lifetime.end.p0(ptr nonnull %7) br label %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h4dd919777ea29ee7E.exit" } diff --git a/bench/meshlab/optimized/arap.ll b/bench/meshlab/optimized/arap.ll index d998f55c85a..6eeaf139740 100644 --- a/bench/meshlab/optimized/arap.ll +++ b/bench/meshlab/optimized/arap.ll @@ -17677,7 +17677,7 @@ define linkonce_odr void @_ZN5Eigen8internal12SparseLUImplIdiE7countnzElRlS3_RNS br label %19 .loopexit: ; preds = %35, %19 - %18 = phi ptr [ %20, %19 ], [ %43, %35 ] + %18 = phi ptr [ %20, %19 ], [ %42, %35 ] %exitcond.not = icmp eq i64 %.02732, %16 br i1 %exitcond.not, label %.loopexit28, label %19, !llvm.loop !309 @@ -17701,27 +17701,27 @@ define linkonce_odr void @_ZN5Eigen8internal12SparseLUImplIdiE7countnzElRlS3_RNS %32 = load i32, ptr %29, align 4 %33 = sub nsw i32 %31, %32 %34 = sext i32 %33 to i64 + %invariant.op = sub i64 1, %27 br label %35 35: ; preds = %.lr.ph, %35 - %.030 = phi i64 [ %34, %.lr.ph ], [ %41, %35 ] - %.02629 = phi i64 [ %27, %.lr.ph ], [ %42, %35 ] + %.030 = phi i64 [ %34, %.lr.ph ], [ %40, %35 ] + %.02629 = phi i64 [ %27, %.lr.ph ], [ %41, %35 ] %36 = load i64, ptr %2, align 8 %37 = add nsw i64 %36, %.030 store i64 %37, ptr %2, align 8 %38 = load i64, ptr %3, align 8 - %reass.sub = sub nsw i64 %.02629, %27 - %39 = add nuw nsw i64 %reass.sub, 1 - %40 = add nsw i64 %39, %38 - store i64 %40, ptr %3, align 8 - %41 = add nsw i64 %.030, -1 - %42 = add nsw i64 %.02629, 1 - %43 = load ptr, ptr %4, align 8 - %44 = getelementptr inbounds nuw i32, ptr %43, i64 %23 - %45 = load i32, ptr %44, align 4 - %46 = sext i32 %45 to i64 - %47 = icmp slt i64 %42, %46 - br i1 %47, label %35, label %.loopexit, !llvm.loop !310 + %.reass.reass = add i64 %.02629, %invariant.op + %39 = add nsw i64 %.reass.reass, %38 + store i64 %39, ptr %3, align 8 + %40 = add nsw i64 %.030, -1 + %41 = add nsw i64 %.02629, 1 + %42 = load ptr, ptr %4, align 8 + %43 = getelementptr inbounds nuw i32, ptr %42, i64 %23 + %44 = load i32, ptr %43, align 4 + %45 = sext i32 %44 to i64 + %46 = icmp slt i64 %41, %45 + br i1 %46, label %35, label %.loopexit, !llvm.loop !310 .loopexit28: ; preds = %.loopexit, %5 ret void diff --git a/bench/meshoptimizer/optimized/vertexfilter.ll b/bench/meshoptimizer/optimized/vertexfilter.ll index f40dcf9314d..8c427edf22b 100644 --- a/bench/meshoptimizer/optimized/vertexfilter.ll +++ b/bench/meshoptimizer/optimized/vertexfilter.ll @@ -875,6 +875,7 @@ define dso_local void @meshopt_encodeFilterExp(ptr noundef writeonly captures(no .lr.ph113: ; preds = %._crit_edge.us, %.loopexit95 %27 = icmp eq i32 %5, 1 %.not118 = icmp eq i64 %8, 0 + %invariant.op = sub i32 1, %3 br label %28 ._crit_edge114: ; preds = %._crit_edge, %.preheader94.thread, %.loopexit95 @@ -965,7 +966,7 @@ define dso_local void @meshopt_encodeFilterExp(ptr noundef writeonly captures(no br i1 %exitcond131.not, label %._crit_edge114, label %28, !llvm.loop !28 .lr.ph110: ; preds = %.lr.ph110.preheader, %68 - %.078109 = phi i64 [ %84, %68 ], [ 0, %.lr.ph110.preheader ] + %.078109 = phi i64 [ %83, %68 ], [ 0, %.lr.ph110.preheader ] br i1 %27, label %68, label %65 65: ; preds = %.lr.ph110 @@ -975,24 +976,23 @@ define dso_local void @meshopt_encodeFilterExp(ptr noundef writeonly captures(no 68: ; preds = %.lr.ph110, %65 %69 = phi i32 [ %67, %65 ], [ %.1147, %.lr.ph110 ] - %reass.sub = sub i32 %69, %3 - %70 = add i32 %reass.sub, 1 - %71 = getelementptr inbounds nuw float, ptr %30, i64 %.078109 - %72 = load float, ptr %71, align 4, !tbaa !14 - %73 = shl i32 %70, 23 - %74 = sub i32 1065353216, %73 - %75 = bitcast i32 %74 to float - %76 = fcmp oge float %72, 0.000000e+00 - %77 = select i1 %76, float 5.000000e-01, float -5.000000e-01 - %78 = tail call float @llvm.fmuladd.f32(float %72, float %75, float %77) - %79 = fptosi float %78 to i32 - %80 = and i32 %79, 16777215 - %81 = shl i32 %70, 24 - %82 = or disjoint i32 %80, %81 - %83 = getelementptr inbounds nuw i32, ptr %31, i64 %.078109 - store i32 %82, ptr %83, align 4, !tbaa !20 - %84 = add nuw nsw i64 %.078109, 1 - %exitcond130.not = icmp eq i64 %84, %8 + %.reass.reass = add i32 %69, %invariant.op + %70 = getelementptr inbounds nuw float, ptr %30, i64 %.078109 + %71 = load float, ptr %70, align 4, !tbaa !14 + %72 = shl i32 %.reass.reass, 23 + %73 = sub i32 1065353216, %72 + %74 = bitcast i32 %73 to float + %75 = fcmp oge float %71, 0.000000e+00 + %76 = select i1 %75, float 5.000000e-01, float -5.000000e-01 + %77 = tail call float @llvm.fmuladd.f32(float %71, float %74, float %76) + %78 = fptosi float %77 to i32 + %79 = and i32 %78, 16777215 + %80 = shl i32 %.reass.reass, 24 + %81 = or disjoint i32 %79, %80 + %82 = getelementptr inbounds nuw i32, ptr %31, i64 %.078109 + store i32 %81, ptr %82, align 4, !tbaa !20 + %83 = add nuw nsw i64 %.078109, 1 + %exitcond130.not = icmp eq i64 %83, %8 br i1 %exitcond130.not, label %._crit_edge, label %.lr.ph110, !llvm.loop !29 } diff --git a/bench/minetest/optimized/dungeongen.ll b/bench/minetest/optimized/dungeongen.ll index fd739f315d0..bbe2e96f0a4 100644 --- a/bench/minetest/optimized/dungeongen.ll +++ b/bench/minetest/optimized/dungeongen.ll @@ -3242,6 +3242,8 @@ entry: %sub85 = add nsw i32 %conv38, -1 %cmp86351 = icmp slt i16 %roomsize.sroa.0.0.extract.trunc, 3 %brmerge = select i1 %cmp78358, i1 true, i1 %cmp86351 + %invariant.op = sub i16 1, %roomsize.sroa.6.0.extract.trunc + %invariant.op13 = sub i16 1, %roomsize.sroa.0.0.extract.trunc br label %for.body for.body: ; preds = %for.inc122, %entry @@ -3296,8 +3298,7 @@ if.then14: ; preds = %land.lhs.true.i159 %call26 = tail call noundef i32 @_ZN12PseudoRandom5rangeEii(ptr noundef nonnull align 4 dereferenceable(4) %random36, i32 noundef %add25, i32 noundef -2) %conv27 = trunc i32 %call26 to i16 %9 = load i16, ptr %doorplace, align 2, !tbaa !24 - %reass.sub4 = sub i16 %9, %roomsize.sroa.0.0.extract.trunc - %add.i170 = add i16 %reass.sub4, 1 + %add.i170.reass.reass = add i16 %9, %invariant.op13 %10 = load i16, ptr %Y.i, align 2, !tbaa !25 %add8.i173 = add i16 %10, -1 %11 = load i16, ptr %Z.i, align 2, !tbaa !26 @@ -3334,14 +3335,13 @@ if.then48: ; preds = %_ZNK3irr4core8vecto %18 = load i16, ptr %Y.i, align 2, !tbaa !25 %add8.i229 = add i16 %18, -1 %19 = load i16, ptr %Z.i, align 2, !tbaa !26 - %reass.sub3 = sub i16 %19, %roomsize.sroa.6.0.extract.trunc - %add13.i232 = add i16 %reass.sub3, 1 + %add13.i232.reass.reass = add i16 %19, %invariant.op br label %if.end65 if.end65: ; preds = %if.then48, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit223.thread, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit195, %land.lhs.true.i187, %if.then14, %land.lhs.true.i159, %if.then3, %land.lhs.true.i, %if.end - %roomplace.sroa.0.3 = phi i16 [ %add.i226, %if.then48 ], [ %add.i170, %if.then14 ], [ 0, %land.lhs.true.i159 ], [ 0, %land.lhs.true.i ], [ %4, %if.then3 ], [ 0, %land.lhs.true.i187 ], [ 0, %if.end ], [ %add.i198, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit223.thread ], [ 0, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit195 ] + %roomplace.sroa.0.3 = phi i16 [ %add.i226, %if.then48 ], [ %add.i170.reass.reass, %if.then14 ], [ 0, %land.lhs.true.i159 ], [ 0, %land.lhs.true.i ], [ %4, %if.then3 ], [ 0, %land.lhs.true.i187 ], [ 0, %if.end ], [ %add.i198, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit223.thread ], [ 0, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit195 ] %roomplace.sroa.9.3 = phi i16 [ %add8.i229, %if.then48 ], [ %add8.i173, %if.then14 ], [ 0, %land.lhs.true.i159 ], [ 0, %land.lhs.true.i ], [ %add8.i, %if.then3 ], [ 0, %land.lhs.true.i187 ], [ 0, %if.end ], [ %add8.i201, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit223.thread ], [ 0, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit195 ] - %roomplace.sroa.11.3 = phi i16 [ %add13.i232, %if.then48 ], [ %add13.i176, %if.then14 ], [ 0, %land.lhs.true.i159 ], [ 0, %land.lhs.true.i ], [ %add13.i, %if.then3 ], [ 0, %land.lhs.true.i187 ], [ 0, %if.end ], [ %14, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit223.thread ], [ 0, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit195 ] + %roomplace.sroa.11.3 = phi i16 [ %add13.i232.reass.reass, %if.then48 ], [ %add13.i176, %if.then14 ], [ 0, %land.lhs.true.i159 ], [ 0, %land.lhs.true.i ], [ %add13.i, %if.then3 ], [ 0, %land.lhs.true.i187 ], [ 0, %if.end ], [ %14, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit223.thread ], [ 0, %_ZNK3irr4core8vector3dIsEeqERKS2_.exit195 ] br i1 %cmp71361, label %for.cond74.preheader.lr.ph, label %cleanup118 for.cond74.preheader.lr.ph: ; preds = %if.end65 diff --git a/bench/mold/optimized/glob.ll b/bench/mold/optimized/glob.ll index 9b30fa8d8cb..5cf7ea03ffe 100644 --- a/bench/mold/optimized/glob.ll +++ b/bench/mold/optimized/glob.ll @@ -635,14 +635,14 @@ define dso_local noundef zeroext i1 @_ZN4mold4Glob8do_matchESt17basic_string_vie br i1 %5, label %._crit_edge, label %.lr.ph .lr.ph: ; preds = %4, %81 - %.sroa.17.0140 = phi ptr [ %.sroa.17.1, %81 ], [ %1, %4 ] - %.sroa.077.0139 = phi i64 [ %.sroa.077.1, %81 ], [ %0, %4 ] - %.sroa.067.0138 = phi ptr [ %7, %81 ], [ %2, %4 ] - %.sroa.9.0137 = phi i64 [ %6, %81 ], [ %3, %4 ] + %.sroa.17.0140 = phi ptr [ %.sroa.17.1, %82 ], [ %1, %4 ] + %.sroa.077.0139 = phi i64 [ %.sroa.077.1, %82 ], [ %0, %4 ] + %.sroa.067.0138 = phi ptr [ %7, %82 ], [ %2, %4 ] + %.sroa.9.0137 = phi i64 [ %6, %82 ], [ %3, %4 ] %6 = add i64 %.sroa.9.0137, -1 %7 = getelementptr inbounds nuw i8, ptr %.sroa.067.0138, i64 72 %8 = load i32, ptr %.sroa.067.0138, align 8, !tbaa !18 - switch i32 %8, label %81 [ + switch i32 %8, label %82 [ i32 0, label %9 i32 1, label %19 i32 2, label %64 @@ -693,8 +693,8 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit: ; preds = %14, %_ br label %28 28: ; preds = %.preheader, %57 - %.sroa.077.2 = phi i64 [ %58, %57 ], [ %.sroa.077.0139, %.preheader ] - %.sroa.17.2 = phi ptr [ %59, %57 ], [ %.sroa.17.0140, %.preheader ] + %.sroa.077.2 = phi i64 [ %58, %58 ], [ %.sroa.077.0139, %.preheader ] + %.sroa.17.2 = phi ptr [ %59, %58 ], [ %.sroa.17.0140, %.preheader ] %29 = load ptr, ptr %24, align 8, !tbaa !37 %30 = load i64, ptr %25, align 8, !tbaa !27 %31 = icmp eq i64 %30, 0 @@ -709,31 +709,35 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit: ; preds = %14, %_ %34 = load i8, ptr %29, align 1, !tbaa !11 %35 = sext i8 %34 to i32 %36 = ptrtoint ptr %33 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %40, %.lr.ph.i.i - %.033.i.i = phi i64 [ %.sroa.077.2, %.lr.ph.i.i ], [ %43, %40 ] - %.02132.i.i = phi ptr [ %.sroa.17.2, %.lr.ph.i.i ], [ %41, %40 ] - %reass.sub = sub i64 %.033.i.i, %30 - %37 = add i64 %reass.sub, 1 - %38 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %35, i64 noundef %37) #17 - %.not26.i.i = icmp eq ptr %38, null + %invariant.op = sub i64 1, %30 + br label %37 + +37:; preds = %40, %.lr.ph.i.i + %.02132.i.i = phi i64 [ %.sroa.077.2, %.lr.ph.i.i ], [ %44, %41 ] + %.02132.i.i = phi ptr [ %.sroa.17.2, %.lr.ph.i.i ], [ %42, %41 ] + %37 = add i64 %.033.i.i, %invariant.op + %38 = icmp eq i64 %37, 0 + br i1 %38, label %.thread107, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %37 + %39 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %35, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #17 + %.not26.i.i = icmp eq ptr %39, null br i1 %.not26.i.i, label %.thread107, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i49 = tail call i32 @bcmp(ptr nonnull %38, ptr nonnull %29, i64 %30) + %bcmp.i.i49 = tail call i32 @bcmp(ptr nonnull %39, ptr nonnull %29, i64 %30) %39 = icmp eq i32 %bcmp.i.i49, 0 br i1 %39, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %40 40: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %41 = getelementptr inbounds nuw i8, ptr %38, i64 1 + %41 = getelementptr inbounds nuw i8, ptr %39, i64 1 %42 = ptrtoint ptr %41 to i64 %43 = sub i64 %36, %42 %.not25.i.i = icmp ult i64 %43, %30 - br i1 %.not25.i.i, label %.thread107, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !41 + br i1 %.not25.i.i, label %.thread107, label %37, !llvm.loop !41 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %44 = ptrtoint ptr %38 to i64 + %44 = ptrtoint ptr %39 to i64 %45 = ptrtoint ptr %.sroa.17.2 to i64 %46 = sub i64 %44, %45 %47 = icmp eq i64 %46, -1 @@ -817,12 +821,12 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit66: ; preds = %.cri br i1 %82, label %._crit_edge, label %.lr.ph ._crit_edge: ; preds = %81, %4 - %.sroa.077.0.lcssa = phi i64 [ %0, %4 ], [ %.sroa.077.1, %81 ] + %.sroa.077.0.lcssa = phi i64 [ %0, %4 ], [ %.sroa.077.1, %82 ] %83 = icmp eq i64 %.sroa.077.0.lcssa, 0 br label %.thread107 -.thread107: ; preds = %68, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i, %9, %64, %.critedge, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit60, %32, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit52, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %40, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %.preheader115, %19, %._crit_edge - %.5 = phi i1 [ %83, %._crit_edge ], [ %62, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit60 ], [ false, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ true, %19 ], [ false, %40 ], [ false, %.preheader115 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ false, %32 ], [ true, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit52 ], [ false, %.critedge ], [ false, %64 ], [ false, %9 ], [ false, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i ], [ false, %68 ] +.thread107: ; preds = %68, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i, %9, %64, %.critedge, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit60, %32, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit52, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %41, %37, %.preheader115, %19, %._crit_edge + %.5 = phi i1 [ %83, %._crit_edge ], [ false, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ false, %.preheader115 ], [ true, %19 ], [ %63, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit60 ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ false, %37 ], [ false, %41 ], [ false, %32 ], [ true, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit52 ], [ false, %.critedge ], [ false, %65 ], [ false, %9 ], [ false, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i ], [ false, %69 ] ret i1 %.5 } diff --git a/bench/nix/optimized/remote-store.ll b/bench/nix/optimized/remote-store.ll index 4ce460db2ac..8723d84e1ea 100644 --- a/bench/nix/optimized/remote-store.ll +++ b/bench/nix/optimized/remote-store.ll @@ -5229,37 +5229,41 @@ define linkonce_odr noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIc %16 = load i8, ptr %1, align 1 %17 = sext i8 %16 to i32 %18 = ptrtoint ptr %14 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i + %invariant.op = sub i64 1, %4 + br label %19 + +19: ; preds = %27, %.lr.ph.i + %.041.i = phi i64 [ %13, %.lr.ph.i ], [ %30, %27 ] + %.02840.i = phi ptr [ %15, %.lr.ph.i ], [ %28, %27 ] + %.reass.reass.i.reass.reass.reass = add i64 %.041.i, %invariant.op + %20 = icmp eq i64 %.reass.reass.i.reass.reass.reass, 0 + br i1 %20, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i: ; preds = %26, %.lr.ph.i - %.041.i = phi i64 [ %13, %.lr.ph.i ], [ %29, %26 ] - %.02840.i = phi ptr [ %15, %.lr.ph.i ], [ %27, %26 ] - %reass.sub = sub i64 %.041.i, %4 - %19 = add i64 %reass.sub, 1 - %20 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i, i32 noundef %17, i64 noundef %19) #31 - %.not34.i = icmp eq ptr %20, null +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i: ; preds = %19 + %21 = tail call ptr @memchr(ptr noundef %.02840.i, i32 noundef %17, i64 noundef %.reass.reass.i.reass.reass.reass) #31 + %.not34.i = icmp eq ptr %21, null br i1 %.not34.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i - %bcmp.i = tail call i32 @bcmp(ptr nonnull %20, ptr nonnull %1, i64 %4) + %bcmp.i = tail call i32 @bcmp(ptr nonnull %21, ptr nonnull %1, i64 %4) %21 = icmp eq i32 %bcmp.i, 0 br i1 %21, label %22, label %26 22: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i - %23 = ptrtoint ptr %20 to i64 + %23 = ptrtoint ptr %21 to i64 %24 = ptrtoint ptr %12 to i64 %25 = sub i64 %23, %24 br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit 26: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i - %27 = getelementptr inbounds nuw i8, ptr %20, i64 1 + %27 = getelementptr inbounds nuw i8, ptr %21, i64 1 %28 = ptrtoint ptr %27 to i64 %29 = sub i64 %18, %28 %.not33.i = icmp ult i64 %29, %4 - br i1 %.not33.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i, !llvm.loop !27 + br i1 %.not33.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit, label %19, !llvm.loop !27 -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i, %26, %8, %10, %11, %22 - %.027.i = phi i64 [ %9, %8 ], [ -1, %10 ], [ %25, %22 ], [ -1, %11 ], [ -1, %26 ], [ -1, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i ] +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findEPKcmm.exit: ; preds = %19, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i, %26, %8, %10, %11, %22 + %.027.i = phi i64 [ %9, %8 ], [ -1, %10 ], [ %25, %23 ], [ -1, %11 ], [ -1, %27 ], [ -1, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i ], [ -1, %19 ] ret i64 %.027.i } diff --git a/bench/nlohmann_json/optimized/unit-json_pointer.ll b/bench/nlohmann_json/optimized/unit-json_pointer.ll index c3e856840e7..172ea551a14 100644 --- a/bench/nlohmann_json/optimized/unit-json_pointer.ll +++ b/bench/nlohmann_json/optimized/unit-json_pointer.ll @@ -58155,31 +58155,35 @@ define linkonce_odr dso_local void @_ZN8nlohmann16json_abi_v3_11_36detail17repla %14 = load i8, ptr %4, align 1, !tbaa !22 %15 = sext i8 %14 to i32 %16 = ptrtoint ptr %13 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %20, %.lr.ph.i.i - %.041.i.i = phi i64 [ %8, %.lr.ph.i.i ], [ %23, %20 ] - %.02840.i.i = phi ptr [ %12, %.lr.ph.i.i ], [ %21, %20 ] - %reass.sub = sub i64 %.041.i.i, %6 - %17 = add i64 %reass.sub, 1 - %18 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i, i32 noundef %15, i64 noundef %17) #29 - %.not34.i.i = icmp eq ptr %18, null + %invariant.op = sub i64 1, %6 + br label %17 + +17:; preds = %21, %.lr.ph.i.i + %.02840.i.i = phi i64 [ %8, %.lr.ph.i.i ], [ %24, %21 ] + %.02840.i.i = phi ptr [ %12, %.lr.ph.i.i ], [ %22, %21 ] + %17 = add i64 %.041.i.i, %invariant.op + %18 = icmp eq i64 %17, 0 + br i1 %18, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %17 + %19 = tail call ptr @memchr(ptr noundef %.02840.i.i, i32 noundef %15, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #29 + %.not34.i.i = icmp eq ptr %19, null br i1 %.not34.i.i, label %._crit_edge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %18, ptr nonnull %4, i64 %6) + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %19, ptr nonnull %4, i64 %6) %19 = icmp eq i32 %bcmp.i.i, 0 br i1 %19, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %20 20: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %21 = getelementptr inbounds nuw i8, ptr %18, i64 1 + %21 = getelementptr inbounds nuw i8, ptr %19, i64 1 %22 = ptrtoint ptr %21 to i64 %23 = sub i64 %16, %22 %.not33.i.i = icmp ult i64 %23, %6 - br i1 %.not33.i.i, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !550 + br i1 %.not33.i.i, label %._crit_edge, label %17, !llvm.loop !550 _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %24 = ptrtoint ptr %18 to i64 + %24 = ptrtoint ptr %19 to i64 %25 = ptrtoint ptr %12 to i64 %26 = sub i64 %24, %25 %.not28 = icmp eq i64 %26, -1 @@ -58190,13 +58194,13 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds %27 = getelementptr inbounds nuw i8, ptr %2, i64 8 br label %28 -._crit_edge: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %43, %45, %44, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14, %60, %11, %10, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit +._crit_edge: ; preds = %17, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %44, %46, %45, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23, %54, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18, %62, %11, %10, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit ret void -28: ; preds = %.lr.ph, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 - %29 = phi i64 [ %6, %.lr.ph ], [ %40, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 ] - %30 = phi i64 [ %8, %.lr.ph ], [ %41, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 ] - %.029 = phi i64 [ %.027.i.i51, %.lr.ph ], [ %.027.i.i11, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 ] +28: ; preds = %.lr.ph, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 + %29 = phi i64 [ %6, %.lr.ph ], [ %41, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 ] + %30 = phi i64 [ %8, %.lr.ph ], [ %42, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 ] + %.029 = phi i64 [ %.027.i.i51, %.lr.ph ], [ %.027.i.i11, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 ] %31 = icmp ugt i64 %.029, %30 br i1 %31, label %32, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit @@ -58204,71 +58208,75 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds tail call void (ptr, ...) @_ZSt24__throw_out_of_range_fmtPKcz(ptr noundef nonnull @.str.337, ptr noundef nonnull @.str.340, i64 noundef %.029, i64 noundef %30) #33 unreachable -_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit: ; preds = %28 - %33 = load i64, ptr %27, align 8, !tbaa !19 - %34 = load ptr, ptr %2, align 8, !tbaa !27 - %35 = sub nuw i64 %30, %.029 - %spec.select.i.i.i = tail call noundef i64 @llvm.umin.i64(i64 %29, i64 %35) - %36 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %.029, i64 noundef %spec.select.i.i.i, ptr noundef %34, i64 noundef %33) - %37 = load i64, ptr %27, align 8, !tbaa !19 - %38 = add i64 %37, %.029 - %39 = load ptr, ptr %1, align 8, !tbaa !27 - %40 = load i64, ptr %5, align 8, !tbaa !19 - %41 = load i64, ptr %7, align 8, !tbaa !19 - %42 = icmp eq i64 %40, 0 - br i1 %42, label %43, label %44 - -43: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit - %.not35.i.i = icmp ugt i64 %38, %41 - br i1 %.not35.i.i, label %._crit_edge, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 +_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit:; preds = %29 + %34 = load i64, ptr %28, align 8, !tbaa !19 + %35 = load ptr, ptr %2, align 8, !tbaa !27 + %36 = sub nuw i64 %31, %.029 + %spec.select.i.i.i = tail call noundef i64 @llvm.umin.i64(i64 %30, i64 %36) + %37 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE10_M_replaceEmmPKcm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %.029, i64 noundef %spec.select.i.i.i, ptr noundef %35, i64 noundef %34) + %38 = load i64, ptr %28, align 8, !tbaa !19 + %39 = add i64 %38, %.029 + %40 = load ptr, ptr %1, align 8, !tbaa !27 + %41 = load i64, ptr %5, align 8, !tbaa !19 + %42 = load i64, ptr %7, align 8, !tbaa !19 + %43 = icmp eq i64 %41, 0 + br i1 %43, label %44, label %45 44: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit - %.not.i.i10 = icmp ult i64 %38, %41 - br i1 %.not.i.i10, label %45, label %._crit_edge + %.not.i.i10 = icmp ugt i64 %39, %42 + br i1 %.not.i.i10, label %._crit_edge, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 + +45: ; preds = %43 + %.not.i.i10 = icmp ult i64 %39, %42 + br i1 %.not.i.i10, label %46, label %._crit_edge -45: ; preds = %44 - %46 = load ptr, ptr %0, align 8, !tbaa !27 - %47 = sub nuw i64 %41, %38 - %.not3339.i.i12 = icmp ult i64 %47, %40 +46: ; preds = %45 + %47 = load ptr, ptr %0, align 8, !tbaa !27 + %48 = sub nuw i64 %42, %39 + %.not3339.i.i12 = icmp ult i64 %48, %41 br i1 %.not3339.i.i12, label %._crit_edge, label %.lr.ph.i.i13 -.lr.ph.i.i13: ; preds = %45 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 %41 - %49 = getelementptr inbounds nuw i8, ptr %46, i64 %38 - %50 = load i8, ptr %39, align 1, !tbaa !22 +.lr.ph.i.i13: ; preds = %46 + %48 = getelementptr inbounds nuw i8, ptr %47, i64 %42 + %49 = getelementptr inbounds nuw i8, ptr %47, i64 %39 + %50 = load i8, ptr %40, align 1, !tbaa !22 %51 = sext i8 %50 to i32 %52 = ptrtoint ptr %48 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14 - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14: ; preds = %60, %.lr.ph.i.i13 - %.041.i.i15 = phi i64 [ %47, %.lr.ph.i.i13 ], [ %63, %60 ] - %.02840.i.i16 = phi ptr [ %49, %.lr.ph.i.i13 ], [ %61, %60 ] - %reass.sub30 = sub i64 %.041.i.i15, %40 - %53 = add i64 %reass.sub30, 1 - %54 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i16, i32 noundef %51, i64 noundef %53) #29 - %.not34.i.i18 = icmp eq ptr %54, null - br i1 %.not34.i.i18, label %._crit_edge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19 - -_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14 - %bcmp.i.i20 = tail call i32 @bcmp(ptr nonnull %54, ptr nonnull %39, i64 %40) - %55 = icmp eq i32 %bcmp.i.i20, 0 - br i1 %55, label %56, label %60 - -56: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19 - %57 = ptrtoint ptr %54 to i64 - %58 = ptrtoint ptr %46 to i64 - %59 = sub i64 %57, %58 - br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 - -60: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19 - %61 = getelementptr inbounds nuw i8, ptr %54, i64 1 - %62 = ptrtoint ptr %61 to i64 - %63 = sub i64 %52, %62 - %.not33.i.i21 = icmp ult i64 %63, %40 - br i1 %.not33.i.i21, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14, !llvm.loop !550 - -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22: ; preds = %43, %56 - %.027.i.i11 = phi i64 [ %38, %43 ], [ %59, %56 ] + %invariant.op85 = sub i64 1, %41 + br label %54 + +54:; preds = %62, %.lr.ph.i.i13 + %.02840.i.i16 = phi i64 [ %48, %.lr.ph.i.i13 ], [ %65, %62 ] + %.02840.i.i15 = phi ptr [ %50, %.lr.ph.i.i13 ], [ %63, %62 ] + %53 = add i64 %.041.i.i14, %invariant.op85 + %55 = icmp eq i64 %53, 0 + br i1 %55, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18 + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18: ; preds = %54 + %56 = tail call ptr @memchr(ptr noundef %.02840.i.i15, i32 noundef %52, i64 noundef %53) #29 + %.not34.i.i19 = icmp eq ptr %56, null + br i1 %.not34.i.i19, label %._crit_edge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20 + +_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18 + %bcmp.i.i21 = tail call i32 @bcmp(ptr nonnull %56, ptr nonnull %40, i64 %41) + %57 = icmp eq i32 %bcmp.i.i21, 0 + br i1 %57, label %58, label %62 + +58:; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20 + %59 = ptrtoint ptr %56 to i64 + %60 = ptrtoint ptr %47 to i64 + %61 = sub i64 %59, %60 + br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 + +62:; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20 + %63 = getelementptr inbounds nuw i8, ptr %56, i64 1 + %64 = ptrtoint ptr %63 to i64 + %65 = sub i64 %53, %64 + %.not33.i.i22 = icmp ult i64 %65, %41 + br i1 %.not33.i.i22, label %._crit_edge, label %54, !llvm.loop !550 + +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23: ; preds = %44, %58 + %.027.i.i11 = phi i64 [ %39, %44 ], [ %61, %58 ] %.not = icmp eq i64 %.027.i.i11, -1 br i1 %.not, label %._crit_edge, label %28, !llvm.loop !551 } diff --git a/bench/nlohmann_json/optimized/unit-regression2.ll b/bench/nlohmann_json/optimized/unit-regression2.ll index bcaa54fea12..211b2a7d9ec 100644 --- a/bench/nlohmann_json/optimized/unit-regression2.ll +++ b/bench/nlohmann_json/optimized/unit-regression2.ll @@ -113780,31 +113780,35 @@ define linkonce_odr dso_local void @_ZN8nlohmann16json_abi_v3_11_36detail17repla %14 = load i8, ptr %4, align 1, !tbaa !14 %15 = sext i8 %14 to i32 %16 = ptrtoint ptr %13 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %20, %.lr.ph.i.i - %.041.i.i = phi i64 [ %8, %.lr.ph.i.i ], [ %23, %20 ] - %.02840.i.i = phi ptr [ %12, %.lr.ph.i.i ], [ %21, %20 ] - %reass.sub = sub i64 %.041.i.i, %6 - %17 = add i64 %reass.sub, 1 - %18 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i, i32 noundef %15, i64 noundef %17) #36 - %.not34.i.i = icmp eq ptr %18, null + %invariant.op = sub i64 1, %6 + br label %17 + +17:; preds = %21, %.lr.ph.i.i + %.02840.i.i = phi i64 [ %8, %.lr.ph.i.i ], [ %24, %21 ] + %.02840.i.i = phi ptr [ %12, %.lr.ph.i.i ], [ %22, %21 ] + %17 = add i64 %.041.i.i, %invariant.op + %18 = icmp eq i64 %17, 0 + br i1 %18, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %17 + %19 = tail call ptr @memchr(ptr noundef %.02840.i.i, i32 noundef %15, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #36 + %.not34.i.i = icmp eq ptr %19, null br i1 %.not34.i.i, label %._crit_edge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %18, ptr nonnull %4, i64 %6) + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %19, ptr nonnull %4, i64 %6) %19 = icmp eq i32 %bcmp.i.i, 0 br i1 %19, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %20 20: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %21 = getelementptr inbounds nuw i8, ptr %18, i64 1 + %21 = getelementptr inbounds nuw i8, ptr %19, i64 1 %22 = ptrtoint ptr %21 to i64 %23 = sub i64 %16, %22 %.not33.i.i = icmp ult i64 %23, %6 - br i1 %.not33.i.i, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !1927 + br i1 %.not33.i.i, label %._crit_edge, label %17, !llvm.loop !1927 _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %24 = ptrtoint ptr %18 to i64 + %24 = ptrtoint ptr %19 to i64 %25 = ptrtoint ptr %12 to i64 %26 = sub i64 %24, %25 %.not28 = icmp eq i64 %26, -1 @@ -113815,13 +113819,13 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds %27 = getelementptr inbounds nuw i8, ptr %2, i64 8 br label %28 -._crit_edge: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %43, %45, %44, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14, %60, %11, %10, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit +._crit_edge: ; preds = %17, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %44, %46, %45, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22, %54, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18, %62, %11, %10, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit ret void 28: ; preds = %.lr.ph, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 - %29 = phi i64 [ %6, %.lr.ph ], [ %40, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 ] - %30 = phi i64 [ %8, %.lr.ph ], [ %41, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 ] - %.029 = phi i64 [ %.027.i.i51, %.lr.ph ], [ %.027.i.i11, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 ] + %29 = phi i64 [ %6, %.lr.ph ], [ %40, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 ] + %30 = phi i64 [ %8, %.lr.ph ], [ %41, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 ] + %.029 = phi i64 [ %.027.i.i51, %.lr.ph ], [ %.027.i.i11, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 ] %31 = icmp ugt i64 %.029, %30 br i1 %31, label %32, label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit @@ -113841,59 +113845,63 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit: ; pr %40 = load i64, ptr %5, align 8, !tbaa !15 %41 = load i64, ptr %7, align 8, !tbaa !15 %42 = icmp eq i64 %40, 0 - br i1 %42, label %43, label %44 - -43: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit - %.not35.i.i = icmp ugt i64 %38, %41 - br i1 %.not35.i.i, label %._crit_edge, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 + br i1 %42, label %44, label %45 44: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit + %.not.i.i10 = icmp ugt i64 %38, %41 + br i1 %.not.i.i10, label %._crit_edge, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 + +45: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit %.not.i.i10 = icmp ult i64 %38, %41 - br i1 %.not.i.i10, label %45, label %._crit_edge + br i1 %.not.i.i10, label %46, label %._crit_edge -45: ; preds = %44 - %46 = load ptr, ptr %0, align 8, !tbaa !11 - %47 = sub nuw i64 %41, %38 - %.not3339.i.i12 = icmp ult i64 %47, %40 +46: ; preds = %45 + %47 = load ptr, ptr %0, align 8, !tbaa !11 + %48 = sub nuw i64 %42, %39 + %.not3339.i.i12 = icmp ult i64 %48, %41 br i1 %.not3339.i.i12, label %._crit_edge, label %.lr.ph.i.i13 -.lr.ph.i.i13: ; preds = %45 - %48 = getelementptr inbounds nuw i8, ptr %46, i64 %41 - %49 = getelementptr inbounds nuw i8, ptr %46, i64 %38 +.lr.ph.i.i13: ; preds = %46 + %48 = getelementptr inbounds nuw i8, ptr %47, i64 %41 + %49 = getelementptr inbounds nuw i8, ptr %47, i64 %38 %50 = load i8, ptr %39, align 1, !tbaa !14 %51 = sext i8 %50 to i32 %52 = ptrtoint ptr %48 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14 - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14: ; preds = %60, %.lr.ph.i.i13 - %.041.i.i15 = phi i64 [ %47, %.lr.ph.i.i13 ], [ %63, %60 ] - %.02840.i.i16 = phi ptr [ %49, %.lr.ph.i.i13 ], [ %61, %60 ] - %reass.sub30 = sub i64 %.041.i.i15, %40 - %53 = add i64 %reass.sub30, 1 - %54 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i16, i32 noundef %51, i64 noundef %53) #36 - %.not34.i.i18 = icmp eq ptr %54, null - br i1 %.not34.i.i18, label %._crit_edge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19 - -_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14 - %bcmp.i.i20 = tail call i32 @bcmp(ptr nonnull %54, ptr nonnull %39, i64 %40) - %55 = icmp eq i32 %bcmp.i.i20, 0 - br i1 %55, label %56, label %60 - -56: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19 - %57 = ptrtoint ptr %54 to i64 - %58 = ptrtoint ptr %46 to i64 - %59 = sub i64 %57, %58 - br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22 + %invariant.op85 = sub i64 1, %41 + br label %54 -60: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i19 - %61 = getelementptr inbounds nuw i8, ptr %54, i64 1 - %62 = ptrtoint ptr %61 to i64 - %63 = sub i64 %52, %62 - %.not33.i.i21 = icmp ult i64 %63, %40 - br i1 %.not33.i.i21, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i14, !llvm.loop !1927 +60: ; preds = %62, %.lr.ph.i.i13 + %.041.i.i14 = phi i64 [ %48, %.lr.ph.i.i13 ], [ %65, %62 ] + %.02840.i.i15 = phi ptr [ %50, %.lr.ph.i.i13 ], [ %63, %62 ] + %.reass.reass.i.reass.reass.i17.reass.reass.reass = add i64 %.041.i.i14, %invariant.op85 + %.not33.i.i21 = icmp eq i64 %.reass.reass.i.reass.reass.i17.reass.reass.reass, 0 + br i1 %.not33.i.i21, label %._crit_edge, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18 + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18: ; preds = %54 + %56 = tail call ptr @memchr(ptr noundef %.02840.i.i15, i32 noundef %52, i64 noundef %.reass.reass.i.reass.reass.i17.reass.reass.reass) #36 + %.not34.i.i19 = icmp eq ptr %56, null + br i1 %.not34.i.i19, label %._crit_edge, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20 + +_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i18 + %bcmp.i.i21 = tail call i32 @bcmp(ptr nonnull %56, ptr nonnull %40, i64 %41) + %57 = icmp eq i32 %bcmp.i.i21, 0 + br i1 %57, label %58, label %62 + +58: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20 + %59 = ptrtoint ptr %56 to i64 + %60 = ptrtoint ptr %47 to i64 + %61 = sub i64 %59, %60 + br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit23 + +62: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i20 + %63 = getelementptr inbounds nuw i8, ptr %56, i64 1 + %64 = ptrtoint ptr %63 to i64 + %65 = sub i64 %53, %64 + %.not33.i.i22 = icmp ult i64 %65, %41 + br i1 %.not33.i.i22, label %._crit_edge, label %54, !llvm.loop !1927 -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22: ; preds = %43, %56 - %.027.i.i11 = phi i64 [ %38, %43 ], [ %59, %56 ] +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit22: ; preds = %44, %58 + %.027.i.i11 = phi i64 [ %38, %44 ], [ %61, %58 ] %.not = icmp eq i64 %.027.i.i11, -1 br i1 %.not, label %._crit_edge, label %28, !llvm.loop !1928 } diff --git a/bench/node/optimized/libnode.node_contextify.ll b/bench/node/optimized/libnode.node_contextify.ll index 4942f215100..7a07097112c 100644 --- a/bench/node/optimized/libnode.node_contextify.ll +++ b/bench/node/optimized/libnode.node_contextify.ll @@ -4992,14 +4992,18 @@ if.end.i.i65: ; preds = %for.body while.body.lr.ph.i.i: ; preds = %if.end.i.i65 %79 = load i8, ptr %agg.tmp276.sroa.2.0.copyload, align 1 %conv.i.i.i = sext i8 %79 to i32 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + %invariant.op = sub i64 1, %agg.tmp276.sroa.0.0.copyload + br label %while.body.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %if.end19.i.i, %while.body.lr.ph.i.i %__len.022.i.i = phi i64 [ %78, %while.body.lr.ph.i.i ], [ %sub.ptr.sub22.i.i, %if.end19.i.i ] %__first.021.i.i = phi ptr [ %77, %while.body.lr.ph.i.i ], [ %incdec.ptr.i.i, %if.end19.i.i ] - %reass.sub = sub i64 %__len.022.i.i, %agg.tmp276.sroa.0.0.copyload - %add.i.i = add i64 %reass.sub, 1 - %call.i.i.i = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.021.i.i, i32 noundef %conv.i.i.i, i64 noundef %add.i.i) #22 + %add.reass.reass.i.reass.reass.i.reass.reass.reass = add i64 %__len.022.i.i, %invariant.op + %cmp.i.i.i68 = icmp eq i64 %add.reass.reass.i.reass.reass.i.reass.reass.reass, 0 + br i1 %cmp.i.i.i68, label %for.inc, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %while.body.i.i + %call.i.i.i = call ptr @memchr(ptr noundef %__first.021.i.i, i32 noundef %conv.i.i.i, i64 noundef %add.reass.reass.i.reass.reass.i.reass.reass.reass) #22 %tobool.not.i.i = icmp eq ptr %call.i.i.i, null br i1 %tobool.not.i.i, label %for.inc, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -5021,7 +5025,7 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt1 %cmp278.not = icmp eq i64 %sub.ptr.sub.i.i, -1 br i1 %cmp278.not, label %for.inc, label %for.end -for.inc: ; preds = %if.end19.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end.i.i65, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit +for.inc: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end19.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end.i.i65, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit %__begin3.0.add = add nuw nsw i64 %__begin3.0.idx103, 16 %cmp275.not.not = icmp eq i64 %__begin3.0.add, 48 br i1 %cmp275.not.not, label %for.end.thread, label %for.body @@ -5046,7 +5050,7 @@ _ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit78.sink.split: ; preds = br label %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit78 _ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit78: ; preds = %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit78.sink.split, %for.end, %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit, %land.lhs.true, %for.end.thread - %add.i.i823 = phi i64 [ 640, %land.lhs.true ], [ 632, %for.end ], [ 640, %for.end.thread ], [ 640, %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit ], [ %add.i.i823.ph, %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit78.sink.split ] + %add.i.i823 = phi i64 [ 640, %land.lhs.true ], [ 632, %for.end ], [ 640, %for.end.thread ], [ 640, %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit ], [ %add.i.i823.ph, %_ZNSt6vectorIN2v85LocalINS0_6StringEEESaIS3_EED2Ev.exit79.sink.split ] %82 = load ptr, ptr %args, align 8 %arrayidx.i100121 = getelementptr inbounds nuw i8, ptr %82, i64 24 %arrayidx.i827 = getelementptr inbounds nuw i8, ptr %82, i64 8 diff --git a/bench/open3d/optimized/AdvancedIndexing.ll b/bench/open3d/optimized/AdvancedIndexing.ll index da43a6e9d74..b01e56583e7 100644 --- a/bench/open3d/optimized/AdvancedIndexing.ll +++ b/bench/open3d/optimized/AdvancedIndexing.ll @@ -22837,6 +22837,7 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %_ZN3fmt3 %55 = load ptr, ptr %7, align 8 %sext = shl i64 %4, 32 %56 = ashr exact i64 %sext, 32 + %invariant.op = sub i32 1, %5 br label %88 57: ; preds = %48 @@ -22915,10 +22916,9 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %_ZN3fmt3 %indvars.iv81 = phi i32 [ 1, %.lr.ph61 ], [ %indvars.iv.next82, %._crit_edge ] %.03360 = phi i32 [ %5, %.lr.ph61 ], [ %105, %._crit_edge ] %.259 = phi i128 [ %.037.lcssa, %.lr.ph61 ], [ %104, %._crit_edge ] - %reass.sub = sub i32 %.03360, %5 - %89 = add i32 %reass.sub, 1 - %90 = icmp slt i32 %89, %5 - br i1 %90, label %.lr.ph.preheader, label %._crit_edge + %.reass.reass = add i32 %.03360, %invariant.op + %89 = icmp slt i32 %.reass.reass, %5 + br i1 %89, label %.lr.ph.preheader, label %._crit_edge .lr.ph.preheader: ; preds = %88 %91 = sext i32 %indvars.iv81 to i64 @@ -22984,7 +22984,7 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEED2Ev.exit: ; preds = %106, %113 br label %118 118: ; preds = %116, %57 - %.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %117, %116 ] + %.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %117, %115 ] %119 = load ptr, ptr %7, align 8, !tbaa !365 %120 = getelementptr inbounds nuw i8, ptr %2, i64 32 %.not.i.i47 = icmp eq ptr %119, %120 diff --git a/bench/open3d/optimized/FileGLTF.ll b/bench/open3d/optimized/FileGLTF.ll index 0dff2ebc16e..8f4d040574a 100644 --- a/bench/open3d/optimized/FileGLTF.ll +++ b/bench/open3d/optimized/FileGLTF.ll @@ -178752,6 +178752,7 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %_ZN3fmt3 %55 = load ptr, ptr %7, align 8 %sext = shl i64 %4, 32 %56 = ashr exact i64 %sext, 32 + %invariant.op = sub i32 1, %5 br label %88 57: ; preds = %48 @@ -178830,10 +178831,9 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %_ZN3fmt3 %indvars.iv81 = phi i32 [ 1, %.lr.ph61 ], [ %indvars.iv.next82, %._crit_edge ] %.03360 = phi i32 [ %5, %.lr.ph61 ], [ %105, %._crit_edge ] %.259 = phi i128 [ %.037.lcssa, %.lr.ph61 ], [ %104, %._crit_edge ] - %reass.sub = sub i32 %.03360, %5 - %89 = add i32 %reass.sub, 1 - %90 = icmp slt i32 %89, %5 - br i1 %90, label %.lr.ph.preheader, label %._crit_edge + %.reass.reass = add i32 %.03360, %invariant.op + %89 = icmp slt i32 %.reass.reass, %5 + br i1 %89, label %.lr.ph.preheader, label %._crit_edge .lr.ph.preheader: ; preds = %88 %91 = sext i32 %indvars.iv81 to i64 @@ -178899,7 +178899,7 @@ _ZN3fmt3v1019basic_memory_bufferIjLm32ESaIjEED2Ev.exit: ; preds = %106, %113 br label %118 118: ; preds = %116, %57 - %.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %117, %116 ] + %.pn.pn = phi { ptr, i32 } [ %58, %57 ], [ %117, %115 ] %119 = load ptr, ptr %7, align 8, !tbaa !4255 %120 = getelementptr inbounds nuw i8, ptr %2, i64 32 %.not.i.i47 = icmp eq ptr %119, %120 diff --git a/bench/opencv/optimized/tldEnsembleClassifier.ll b/bench/opencv/optimized/tldEnsembleClassifier.ll index 1698ed2835c..5a7150682e1 100644 --- a/bench/opencv/optimized/tldEnsembleClassifier.ll +++ b/bench/opencv/optimized/tldEnsembleClassifier.ll @@ -182,12 +182,12 @@ define hidden void @_ZN2cv8tracking4impl3tld21TLDEnsembleClassifier12stepPrefSuf %30 = add i8 %29, 1 br label %31 -._crit_edge: ; preds = %55, %4 +._crit_edge: ; preds = %54, %4 ret void -31: ; preds = %.lr.ph, %55 - %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %55 ] - %32 = phi ptr [ %14, %.lr.ph ], [ %57, %55 ] +31: ; preds = %.lr.ph, %54 + %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %54 ] + %32 = phi ptr [ %14, %.lr.ph ], [ %57, %54 ] %33 = getelementptr inbounds nuw %"class.cv::Vec", ptr %32, i64 %indvars.iv %34 = getelementptr inbounds i8, ptr %33, i64 %23 %35 = load i8, ptr %34, align 1, !tbaa !28 @@ -197,7 +197,7 @@ define hidden void @_ZN2cv8tracking4impl3tld21TLDEnsembleClassifier12stepPrefSuf 38: ; preds = %31 %39 = mul i8 %35, %30 - br label %55 + br label %54 40: ; preds = %31 %41 = icmp sgt i32 %24, %36 @@ -209,34 +209,33 @@ define hidden void @_ZN2cv8tracking4impl3tld21TLDEnsembleClassifier12stepPrefSuf %45 = add nsw i32 %44, %28 %46 = trunc i32 %45 to i8 %47 = add i8 %35, %46 - br label %55 + br label %54 48: ; preds = %40 %49 = icmp sgt i32 %6, %36 - br i1 %49, label %50, label %55 + br i1 %49, label %50, label %54 50: ; preds = %48 - %51 = sub nsw i32 %36, %24 - %reass.add = add i32 %51, %10 - %reass.mul = mul i32 %reass.add, %9 - %52 = add i32 %reass.mul, %27 - %53 = trunc i32 %52 to i8 - %54 = add i8 %35, %53 - br label %55 - -55: ; preds = %48, %50, %42, %38 - %.sink = phi i8 [ %39, %38 ], [ %54, %50 ], [ %47, %42 ], [ %26, %48 ] + %51 = sub i32 %36, %22 + %reass.mul = mul i32 %51, %9 + %51 = add i32 %reass.mul, %27 + %52 = trunc i32 %51 to i8 + %53 = add i8 %35, %52 + br label %54 + +54: ; preds = %48, %50, %42, %38 + %.sink = phi i8 [ %39, %38 ], [ %53, %50 ], [ %47, %42 ], [ %26, %48 ] store i8 %.sink, ptr %34, align 1, !tbaa !28 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %56 = load ptr, ptr %12, align 8, !tbaa !27 %57 = load ptr, ptr %0, align 8, !tbaa !26 + %57 = ptrtoint ptr %55 to i64 %58 = ptrtoint ptr %56 to i64 - %59 = ptrtoint ptr %57 to i64 - %60 = sub i64 %58, %59 - %sext = shl i64 %60, 30 - %61 = ashr i64 %sext, 32 - %62 = icmp slt i64 %indvars.iv.next, %61 - br i1 %62, label %31, label %._crit_edge, !llvm.loop !29 + %59 = sub i64 %57, %58 + %sext = shl i64 %59, 30 + %60 = ashr i64 %sext, 32 + %61 = icmp slt i64 %indvars.iv.next, %60 + br i1 %61, label %31, label %._crit_edge, !llvm.loop !29 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none, target_mem0: none, target_mem1: none) uwtable @@ -1048,7 +1047,7 @@ _ZNSt6vectorIN2cv3VecIhLi4EEESaIS2_EED2Ev.exit: ; preds = %._crit_edge72, %208 ret i32 %213 214: ; preds = %.lr.ph71, %_ZN2cv8tracking4impl3tld21TLDEnsembleClassifierD2Ev.exit - %.02070 = phi i32 [ 0, %.lr.ph71 ], [ %216, %_ZN2cv8tracking4impl3tld21TLDEnsembleClassifierD2Ev.exit ] + %.02070 = phi i32 [ 0, %.lr.ph68 ], [ %216, %_ZN2cv8tracking4impl3tld21TLDEnsembleClassifierD2Ev.exit ] call void @llvm.lifetime.start.p0(ptr nonnull %7) %215 = mul nsw i32 %.02070, %1 %216 = add nuw nsw i32 %.02070, 1 diff --git a/bench/openexr/optimized/parse_header.ll b/bench/openexr/optimized/parse_header.ll index 297b9317a61..790764cfebf 100644 --- a/bench/openexr/optimized/parse_header.ll +++ b/bench/openexr/optimized/parse_header.ll @@ -3639,10 +3639,11 @@ check_bad_attrsz.exit: ; preds = %32, %33, %38, %40 %51 = getelementptr i8, ptr %50, i64 -1 %52 = getelementptr inbounds nuw i8, ptr %1, i64 48 %zext = zext nneg i32 %48 to i64 + %invariant.op = sub i32 -2, %15 br label %.lr.ph.i .lr.ph.i: ; preds = %.lr.ph.i.lr.ph, %99 - %.04077 = phi i32 [ %5, %.lr.ph.i.lr.ph ], [ %94, %99 ] + %.04077 = phi i32 [ %5, %.lr.ph.i.lr.ph ], [ %94, %98 ] call void @llvm.lifetime.start.p0(ptr nonnull %7) br label %53 @@ -3680,9 +3681,8 @@ read_text.exit: ; preds = %60 br i1 %.not, label %.thread, label %.loopexit .thread: ; preds = %read_text.exit - %reass.sub96 = sub nsw i32 %.04077, %15 - %66 = add nsw i32 %reass.sub96, -2 - br label %71 + %.reass.reass = add i32 %.04077, %invariant.op + br label %70 67: ; preds = %56 %68 = trunc nsw i64 %indvars.iv.i to i32 @@ -3693,41 +3693,41 @@ read_text.exit: ; preds = %60 br i1 %70, label %.loopexit, label %71 71: ; preds = %.thread, %67 - %72 = phi i32 [ %66, %.thread ], [ %69, %67 ] - %.0566067 = phi i32 [ %48, %.thread ], [ %68, %67 ] + %72 = phi i32 [ %.reass.reass, %.thread ], [ %69, %66 ] + %.0566067 = phi i32 [ %48, %.thread ], [ %68, %66 ] %73 = icmp slt i32 %72, 16 br i1 %73, label %74, label %81 74: ; preds = %71 %75 = getelementptr inbounds nuw i8, ptr %1, i64 40 %76 = load ptr, ptr %75, align 8, !tbaa !74 - %77 = call i32 %76(ptr noundef nonnull %1, i32 noundef %72) #9 + %77 = call i32 %75(ptr noundef nonnull %1, i32 noundef %72) #9 %78 = getelementptr inbounds nuw i8, ptr %0, i64 72 %79 = load ptr, ptr %78, align 8, !tbaa !40 - %80 = call i32 (ptr, i32, ptr, ...) %79(ptr noundef %0, i32 noundef 17, ptr noundef nonnull @.str.89, ptr noundef %3, ptr noundef nonnull %8) #9 + %80 = call i32 (ptr, i32, ptr, ...) %78(ptr noundef %0, i32 noundef 17, ptr noundef nonnull @.str.89, ptr noundef %3, ptr noundef nonnull %8) #9 br label %110 81: ; preds = %71 %82 = load ptr, ptr %47, align 8, !tbaa !73 - %83 = call i32 %82(ptr noundef nonnull %1, ptr noundef nonnull %9, i64 noundef 4) #9 + %83 = call i32 %81(ptr noundef nonnull %1, ptr noundef nonnull %9, i64 noundef 4) #9 %.not50 = icmp eq i32 %83, 0 br i1 %.not50, label %84, label %.loopexit 84: ; preds = %81 %85 = load ptr, ptr %47, align 8, !tbaa !73 - %86 = call i32 %85(ptr noundef nonnull %1, ptr noundef nonnull %12, i64 noundef 4) #9 + %86 = call i32 %84(ptr noundef nonnull %1, ptr noundef nonnull %12, i64 noundef 4) #9 %.not51 = icmp eq i32 %86, 0 br i1 %.not51, label %87, label %.loopexit 87: ; preds = %84 %88 = load ptr, ptr %47, align 8, !tbaa !73 - %89 = call i32 %88(ptr noundef nonnull %1, ptr noundef nonnull %10, i64 noundef 4) #9 + %89 = call i32 %87(ptr noundef nonnull %1, ptr noundef nonnull %10, i64 noundef 4) #9 %.not52 = icmp eq i32 %89, 0 br i1 %.not52, label %90, label %.loopexit 90: ; preds = %87 %91 = load ptr, ptr %47, align 8, !tbaa !73 - %92 = call i32 %91(ptr noundef nonnull %1, ptr noundef nonnull %11, i64 noundef 4) #9 + %92 = call i32 %90(ptr noundef nonnull %1, ptr noundef nonnull %11, i64 noundef 4) #9 %.not53 = icmp eq i32 %92, 0 br i1 %.not53, label %93, label %.loopexit @@ -3744,7 +3744,7 @@ read_text.exit: ; preds = %60 br label %99 99: ; preds = %93, %98 - %100 = phi i32 [ %95, %93 ], [ 3, %98 ] + %100 = phi i32 [ %95, %92 ], [ 3, %97 ] %101 = load i8, ptr %12, align 1, !tbaa !29 %102 = zext i8 %101 to i32 %103 = call i32 @exr_attr_chlist_add_with_length(ptr noundef %0, ptr noundef %2, ptr noundef nonnull %8, i32 noundef %.0566067, i32 noundef %100, i32 noundef %102, i32 noundef %96, i32 noundef %97) #9 @@ -3754,15 +3754,15 @@ read_text.exit: ; preds = %60 br i1 %106, label %.lr.ph.i, label %.loopexit, !llvm.loop !112 .loopexit: ; preds = %99, %read_text.exit, %67, %81, %84, %87, %90, %check_bad_attrsz.exit.thread, %check_bad_attrsz.exit, %read_text.exit.thread61 - %.141 = phi i32 [ %.04077, %read_text.exit.thread61 ], [ %5, %check_bad_attrsz.exit ], [ %5, %check_bad_attrsz.exit.thread ], [ %72, %87 ], [ %72, %84 ], [ %72, %81 ], [ %69, %67 ], [ %.04077, %read_text.exit ], [ %94, %99 ], [ %72, %90 ] - %.1 = phi i32 [ %55, %read_text.exit.thread61 ], [ %.0.i, %check_bad_attrsz.exit ], [ %21, %check_bad_attrsz.exit.thread ], [ %89, %87 ], [ %86, %84 ], [ %83, %81 ], [ 0, %67 ], [ %65, %read_text.exit ], [ %103, %99 ], [ %92, %90 ] + %.141 = phi i32 [ %.04077, %read_text.exit.thread61 ], [ %5, %check_bad_attrsz.exit ], [ %5, %check_bad_attrsz.exit.thread ], [ %72, %86 ], [ %71, %83 ], [ %71, %80 ], [ %68, %66 ], [ %.04077, %read_text.exit ], [ %93, %98 ], [ %71, %89 ] + %.1 = phi i32 [ %55, %read_text.exit.thread61 ], [ %.0.i, %check_bad_attrsz.exit ], [ %21, %check_bad_attrsz.exit.thread ], [ %89, %86 ], [ %87, %83 ], [ %84, %80 ], [ 0, %66 ], [ %65, %read_text.exit ], [ %102, %98 ], [ %91, %89 ] %107 = getelementptr inbounds nuw i8, ptr %1, i64 40 %108 = load ptr, ptr %107, align 8, !tbaa !74 - %109 = call i32 %108(ptr noundef nonnull %1, i32 noundef %.141) #9 + %109 = call i32 %107(ptr noundef nonnull %1, i32 noundef %.141) #9 br label %110 110: ; preds = %.loopexit, %74 - %.039 = phi i32 [ %.1, %.loopexit ], [ %80, %74 ] + %.039 = phi i32 [ %.1, %.loopexit ], [ %80, %73 ] call void @llvm.lifetime.end.p0(ptr nonnull %12) call void @llvm.lifetime.end.p0(ptr nonnull %11) call void @llvm.lifetime.end.p0(ptr nonnull %10) diff --git a/bench/openjdk/optimized/hb-ot-shaper-khmer.ll b/bench/openjdk/optimized/hb-ot-shaper-khmer.ll index 7e4c3b6230f..77d6d4fa5ca 100644 --- a/bench/openjdk/optimized/hb-ot-shaper-khmer.ll +++ b/bench/openjdk/optimized/hb-ot-shaper-khmer.ll @@ -639,7 +639,7 @@ _ZL22reorder_syllable_khmerPK18hb_ot_shape_plan_tP9hb_face_tP11hb_buffer_tjj.exi br label %114 114: ; preds = %115, %_ZL22reorder_syllable_khmerPK18hb_ot_shape_plan_tP9hb_face_tP11hb_buffer_tjj.exit - %.0.i26 = phi i32 [ %.030, %_ZL22reorder_syllable_khmerPK18hb_ot_shape_plan_tP9hb_face_tP11hb_buffer_tjj.exit ], [ %116, %115 ] + %.0.i26 = phi i32 [ %.030, %_ZL22reorder_syllable_khmerPK18hb_ot_shape_plan_tP9hb_face_tP11hb_buffer_tjj.exit ], [ %116, %114 ] %exitcond33.not = icmp eq i32 %.0.i26, %113 br i1 %exitcond33.not, label %_ZL17_hb_next_syllableP11hb_buffer_tj.exit28, label %115 @@ -653,7 +653,7 @@ _ZL22reorder_syllable_khmerPK18hb_ot_shape_plan_tP9hb_face_tP11hb_buffer_tjj.exi br i1 %121, label %114, label %_ZL17_hb_next_syllableP11hb_buffer_tj.exit28, !llvm.loop !12 _ZL17_hb_next_syllableP11hb_buffer_tj.exit28: ; preds = %114, %115 - %.lcssa.i27 = phi i32 [ %umax.i25, %114 ], [ %116, %115 ] + %.lcssa.i27 = phi i32 [ %umax.i25, %113 ], [ %116, %114 ] %122 = icmp ult i32 %.030, %11 br i1 %122, label %27, label %._crit_edge, !llvm.loop !17 diff --git a/bench/openspiel/optimized/tiny_bridge.ll b/bench/openspiel/optimized/tiny_bridge.ll index 591ac0e765d..f9794115a04 100644 --- a/bench/openspiel/optimized/tiny_bridge.ll +++ b/bench/openspiel/optimized/tiny_bridge.ll @@ -8139,7 +8139,11 @@ _ZNK4absl7debian24SpanIfE2atEm.exit49: ; preds = %_ZN10open_spiel11ti %99 = sub i64 %97, %98 %100 = ashr exact i64 %99, 2 %101 = icmp ugt i64 %100, %94 - br i1 %101, label %.lr.ph, label %.loopexit + br i1 %101, label %.lr.ph.preheader, label %.loopexit + +.lr.ph.preheader: ; preds = %.preheader76 + %invariant.op = sub i32 4, %1 + br label %.lr.ph .preheader: ; preds = %91 %102 = load ptr, ptr %47, align 8 @@ -8183,21 +8187,20 @@ _ZNK4absl7debian24SpanIfE2atEm.exit51: ; preds = %.lr.ph81 %128 = icmp ugt i64 %127, %indvars.iv.next85 br i1 %128, label %.lr.ph81, label %.loopexit, !llvm.loop !81 -.lr.ph: ; preds = %.preheader76, %167 - %indvars.iv = phi i64 [ %indvars.iv.next, %167 ], [ %94, %.preheader76 ] - %129 = phi ptr [ %169, %167 ], [ %96, %.preheader76 ] - %.03978 = phi i32 [ %.1, %167 ], [ 0, %.preheader76 ] +.lr.ph: ; preds = %.lr.ph.preheader, %167 + %indvars.iv = phi i64 [ %indvars.iv.next, %166 ], [ %94, %.lr.ph.preheader ] + %129 = phi ptr [ %169, %166 ], [ %96, %.lr.ph.preheader ] + %.03978 = phi i32 [ %.1, %166 ], [ 0, %.lr.ph.preheader ] %130 = load i32, ptr %23, align 4 %131 = trunc nsw i64 %indvars.iv to i32 %132 = srem i32 %131, %130 - %reass.sub = sub i32 %132, %1 - %133 = add i32 %reass.sub, 4 - %134 = srem i32 %133, 4 - %135 = getelementptr inbounds i32, ptr %129, i64 %indvars.iv - %136 = load i32, ptr %135, align 4 - switch i32 %136, label %158 [ - i32 0, label %137 - i32 7, label %141 + %.reass.reass = add i32 %132, %invariant.op + %133 = srem i32 %.reass.reass, 4 + %134 = getelementptr inbounds i32, ptr %129, i64 %indvars.iv + %135 = load i32, ptr %134, align 4 + switch i32 %135, label %157 [ + i32 0, label %136 + i32 7, label %140 i32 8, label %151 ] @@ -8206,7 +8209,7 @@ _ZNK4absl7debian24SpanIfE2atEm.exit51: ; preds = %.lr.ph81 br i1 %138, label %_ZNK4absl7debian24SpanIfE2atEm.exit52, label %167 _ZNK4absl7debian24SpanIfE2atEm.exit52: ; preds = %137 - %139 = add nsw i32 %134, %34 + %139 = add nsw i32 %133, %34 %140 = zext nneg i32 %139 to i64 br label %.sink.split102 @@ -8216,7 +8219,7 @@ _ZNK4absl7debian24SpanIfE2atEm.exit52: ; preds = %137 %144 = add i32 %143, -3 %145 = mul i32 %144, %130 %146 = add nsw i32 %142, %145 - %147 = add nsw i32 %146, %134 + %147 = add nsw i32 %146, %133 %148 = sext i32 %147 to i64 %149 = icmp ugt i64 %3, %148 br i1 %149, label %.sink.split102, label %150 @@ -8229,7 +8232,7 @@ _ZNK4absl7debian24SpanIfE2atEm.exit52: ; preds = %137 %152 = mul i32 %.03978, 3 %reass.add = add i32 %152, -1 %reass.mul = mul i32 %reass.add, %130 - %153 = add nsw i32 %134, %34 + %153 = add nsw i32 %133, %34 %154 = add i32 %153, %reass.mul %155 = sext i32 %154 to i64 %156 = icmp ugt i64 %3, %155 @@ -8240,10 +8243,10 @@ _ZNK4absl7debian24SpanIfE2atEm.exit52: ; preds = %137 unreachable 158: ; preds = %.lr.ph - %159 = mul i32 %136, 3 + %159 = mul i32 %135, 3 %reass.add74 = add i32 %159, -1 %reass.mul75 = mul i32 %reass.add74, %130 - %160 = add nsw i32 %134, %34 + %160 = add nsw i32 %133, %34 %161 = add i32 %160, %130 %162 = add i32 %161, %reass.mul75 %163 = sext i32 %162 to i64 @@ -8255,23 +8258,23 @@ _ZNK4absl7debian24SpanIfE2atEm.exit52: ; preds = %137 unreachable .sink.split102: ; preds = %158, %151, %141, %_ZNK4absl7debian24SpanIfE2atEm.exit52 - %.sink103 = phi i64 [ %140, %_ZNK4absl7debian24SpanIfE2atEm.exit52 ], [ %148, %141 ], [ %155, %151 ], [ %163, %158 ] - %.1.ph = phi i32 [ 0, %_ZNK4absl7debian24SpanIfE2atEm.exit52 ], [ %.03978, %141 ], [ %.03978, %151 ], [ %136, %158 ] + %.sink103 = phi i64 [ %140, %_ZNK4absl7debian24SpanIfE2atEm.exit52 ], [ %148, %140 ], [ %155, %150 ], [ %163, %157 ] + %.1.ph = phi i32 [ 0, %_ZNK4absl7debian24SpanIfE2atEm.exit52 ], [ %.03978, %140 ], [ %.03978, %150 ], [ %135, %157 ] %166 = getelementptr inbounds nuw float, ptr %2, i64 %.sink103 store float 1.000000e+00, ptr %166, align 4 br label %167 167: ; preds = %.sink.split102, %137 - %.1 = phi i32 [ %.03978, %137 ], [ %.1.ph, %.sink.split102 ] + %.1 = phi i32 [ %.03978, %136 ], [ %.1.ph, %.sink.split102 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %168 = load ptr, ptr %47, align 8 %169 = load ptr, ptr %46, align 8 + %169 = ptrtoint ptr %167 to i64 %170 = ptrtoint ptr %168 to i64 - %171 = ptrtoint ptr %169 to i64 - %172 = sub i64 %170, %171 - %173 = ashr exact i64 %172, 2 - %174 = icmp ugt i64 %173, %indvars.iv.next - br i1 %174, label %.lr.ph, label %.loopexit, !llvm.loop !82 + %171 = sub i64 %169, %170 + %172 = ashr exact i64 %171, 2 + %173 = icmp ugt i64 %172, %indvars.iv.next + br i1 %173, label %.lr.ph, label %.loopexit, !llvm.loop !82 .loopexit: ; preds = %167, %_ZNK4absl7debian24SpanIfE2atEm.exit51, %.preheader76, %.preheader ret void diff --git a/bench/openssl/optimized/bn_lib.ll b/bench/openssl/optimized/bn_lib.ll index 400b03cb6a6..4362604a233 100644 --- a/bench/openssl/optimized/bn_lib.ll +++ b/bench/openssl/optimized/bn_lib.ll @@ -1180,12 +1180,13 @@ bn_correct_top.exit: ; preds = %39, %42 %.055 = select i1 %.not68, ptr %62, ptr %1 %63 = shl nsw i32 %50, 3 %64 = sext i32 %63 to i64 + %invariant.op = sub i64 1, %64 br label %65 65: ; preds = %.lr.ph, %65 %.15674 = phi ptr [ %.055, %.lr.ph ], [ %83, %65 ] - %.06073 = phi i64 [ 0, %.lr.ph ], [ %87, %65 ] - %.06172 = phi i64 [ 0, %.lr.ph ], [ %86, %65 ] + %.06073 = phi i64 [ 0, %.lr.ph ], [ %86, %65 ] + %.06172 = phi i64 [ 0, %.lr.ph ], [ %85, %65 ] %.16471 = phi i32 [ %.063, %.lr.ph ], [ %82, %65 ] %66 = load ptr, ptr %0, align 8, !tbaa !13 %67 = lshr i64 %.06172, 3 @@ -1207,12 +1208,11 @@ bn_correct_top.exit: ; preds = %39, %42 %81 = icmp samesign ugt i32 %77, %80 %82 = zext i1 %81 to i32 %83 = getelementptr inbounds i8, ptr %.15674, i64 %.059 - %reass.sub = sub i64 %.06172, %64 - %84 = add i64 %reass.sub, 1 - %85 = lshr i64 %84, 63 - %86 = add i64 %85, %.06172 - %87 = add nuw i64 %.06073, 1 - %exitcond.not = icmp eq i64 %87, %56 + %.reass.reass = add i64 %.06172, %invariant.op + %84 = lshr i64 %.reass.reass, 63 + %85 = add i64 %84, %.06172 + %86 = add nuw i64 %.06073, 1 + %exitcond.not = icmp eq i64 %86, %56 br i1 %exitcond.not, label %.loopexit, label %65, !llvm.loop !26 .loopexit: ; preds = %65, %55, %52, %53, %bn_correct_top.exit @@ -1268,12 +1268,13 @@ define range(i32 -268435455, 268435456) i32 @BN_bn2bin(ptr noundef readonly capt %18 = getelementptr i8, ptr %1, i64 %13 %19 = shl nsw i32 %7, 3 %20 = sext i32 %19 to i64 + %invariant.op = sub i64 1, %20 br label %21 21: ; preds = %21, %.lr.ph.i %.pn = phi ptr [ %18, %.lr.ph.i ], [ %.15674.i, %21 ] - %.06073.i = phi i64 [ 0, %.lr.ph.i ], [ %41, %21 ] - %.06172.i = phi i64 [ 0, %.lr.ph.i ], [ %40, %21 ] + %.06073.i = phi i64 [ 0, %.lr.ph.i ], [ %40, %21 ] + %.06172.i = phi i64 [ 0, %.lr.ph.i ], [ %39, %21 ] %.16471.i = phi i32 [ 0, %.lr.ph.i ], [ %37, %21 ] %.15674.i = getelementptr i8, ptr %.pn, i64 -1 %22 = load ptr, ptr %0, align 8, !tbaa !13 @@ -1294,12 +1295,11 @@ define range(i32 -268435455, 268435456) i32 @BN_bn2bin(ptr noundef readonly capt %35 = and i32 %33, 255 %36 = icmp samesign ugt i32 %32, %35 %37 = zext i1 %36 to i32 - %reass.sub = sub i64 %.06172.i, %20 - %38 = add i64 %reass.sub, 1 - %39 = lshr i64 %38, 63 - %40 = add i64 %39, %.06172.i - %41 = add nuw i64 %.06073.i, 1 - %exitcond.not.i = icmp eq i64 %41, %13 + %.reass.i.reass.reass = add i64 %.06172.i, %invariant.op + %38 = lshr i64 %.reass.i.reass.reass, 63 + %39 = add i64 %38, %.06172.i + %40 = add nuw i64 %.06073.i, 1 + %exitcond.not.i = icmp eq i64 %40, %13 br i1 %exitcond.not.i, label %bn2binpad.exit, label %21, !llvm.loop !26 bn2binpad.exit: ; preds = %21, %9, %10, %12 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 eca16a3a1ff..646b3d5d65c 100644 --- a/bench/openssl/optimized/cipher_aes_cbc_hmac_sha1_hw.ll +++ b/bench/openssl/optimized/cipher_aes_cbc_hmac_sha1_hw.ll @@ -1760,12 +1760,13 @@ define internal i32 @aesni_cbc_hmac_sha1_tls1_multiblock_encrypt(ptr noundef %0, %219 = getelementptr inbounds nuw i8, ptr %0, i64 732 %220 = getelementptr inbounds nuw i8, ptr %0, i64 733 %221 = getelementptr inbounds nuw i8, ptr %0, i64 734 + %invariant.op = sub i32 36, %.0307.i br label %222 222: ; preds = %222, %.lr.ph351.i %indvars.iv391.i = phi i64 [ 0, %.lr.ph351.i ], [ %indvars.iv.next392.i, %222 ] %.0300349.i = phi ptr [ %8, %.lr.ph351.i ], [ %scevgep390.i, %222 ] - %.0309347.i = phi i64 [ 0, %.lr.ph351.i ], [ %281, %222 ] + %.0309347.i = phi i64 [ 0, %.lr.ph351.i ], [ %280, %222 ] %223 = icmp eq i64 %indvars.iv391.i, %156 %224 = select i1 %223, i32 %.0303.i, i32 %.0302.i %225 = getelementptr inbounds nuw %struct.CIPH_DESC, ptr %5, i64 %indvars.iv391.i @@ -1818,36 +1819,35 @@ define internal i32 @aesni_cbc_hmac_sha1_tls1_multiblock_encrypt(ptr noundef %0, %263 = getelementptr i8, ptr %scevgep.i, i64 %233 %scevgep390.i = getelementptr i8, ptr %263, i64 %261 %264 = sub i32 %224, %256 - %reass.sub = sub i32 %264, %.0307.i - %265 = add i32 %reass.sub, 36 - %266 = lshr i32 %265, 4 - %267 = getelementptr inbounds nuw i8, ptr %225, i64 16 - store i32 %266, ptr %267, align 8, !tbaa !66 - %268 = add i32 %264, 52 - %269 = load i8, ptr %219, align 4, !tbaa !8 - store i8 %269, ptr %.0300349.i, align 1, !tbaa !8 - %270 = load i8, ptr %220, align 1, !tbaa !8 - %271 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 1 - store i8 %270, ptr %271, align 1, !tbaa !8 - %272 = load i8, ptr %221, align 2, !tbaa !8 - %273 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 2 - store i8 %272, ptr %273, align 1, !tbaa !8 - %274 = lshr i32 %268, 8 - %275 = trunc i32 %274 to i8 - %276 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 3 - store i8 %275, ptr %276, align 1, !tbaa !8 - %277 = trunc i32 %268 to i8 - %278 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 4 - store i8 %277, ptr %278, align 1, !tbaa !8 - %279 = add i32 %264, 57 - %280 = zext i32 %279 to i64 - %281 = add i64 %.0309347.i, %280 + %.reass.i.reass.reass = add i32 %264, %invariant.op + %265 = lshr i32 %.reass.i.reass.reass, 4 + %266 = getelementptr inbounds nuw i8, ptr %225, i64 16 + store i32 %265, ptr %266, align 8, !tbaa !66 + %267 = add i32 %264, 52 + %268 = load i8, ptr %219, align 4, !tbaa !8 + store i8 %268, ptr %.0300349.i, align 1, !tbaa !8 + %269 = load i8, ptr %220, align 1, !tbaa !8 + %270 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 1 + store i8 %269, ptr %270, align 1, !tbaa !8 + %271 = load i8, ptr %221, align 2, !tbaa !8 + %272 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 2 + store i8 %271, ptr %272, align 1, !tbaa !8 + %273 = lshr i32 %267, 8 + %274 = trunc i32 %273 to i8 + %275 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 3 + store i8 %274, ptr %275, align 1, !tbaa !8 + %276 = trunc i32 %267 to i8 + %277 = getelementptr inbounds nuw i8, ptr %.0300349.i, i64 4 + store i8 %276, ptr %277, align 1, !tbaa !8 + %278 = add i32 %264, 57 + %279 = zext i32 %278 to i64 + %280 = add i64 %.0309347.i, %279 %indvars.iv.next392.i = add nuw nsw i64 %indvars.iv391.i, 1 %exitcond395.not.i = icmp eq i64 %indvars.iv.next392.i, %wide.trip.count383.i br i1 %exitcond395.not.i, label %._crit_edge352.i, label %222, !llvm.loop !88 ._crit_edge352.i: ; preds = %222, %._crit_edge340.thread.i - %.0309.lcssa.i = phi i64 [ 0, %._crit_edge340.thread.i ], [ %281, %222 ] + %.0309.lcssa.i = phi i64 [ 0, %._crit_edge340.thread.i ], [ %280, %222 ] %282 = getelementptr inbounds nuw i8, ptr %0, i64 192 call void @aesni_multi_cbc_encrypt(ptr noundef nonnull %5, ptr noundef nonnull %282, i32 noundef range(i32 0, 1073741824) %15) #9 call void @OPENSSL_cleanse(ptr noundef nonnull %7, i64 noundef 1024) #9 diff --git a/bench/openusd/optimized/aom_scale.ll b/bench/openusd/optimized/aom_scale.ll index 9f4f60988cc..d1ebbaea3ba 100644 --- a/bench/openusd/optimized/aom_scale.ll +++ b/bench/openusd/optimized/aom_scale.ll @@ -405,10 +405,11 @@ Scale2D.exit: ; preds = %117, %93, %71, %._c .lr.ph: ; preds = %Scale2D.exit %190 = sext i32 %42 to i64 + %invariant.op = sub i32 1, %42 br label %191 191: ; preds = %.lr.ph, %191 - %.07788 = phi i32 [ 0, %.lr.ph ], [ %207, %191 ] + %.07788 = phi i32 [ 0, %.lr.ph ], [ %206, %191 ] %192 = load ptr, ptr %53, align 8 %193 = load i32, ptr %55, align 4 %194 = mul nsw i32 %193, %.07788 @@ -422,12 +423,11 @@ Scale2D.exit: ; preds = %117, %93, %71, %._c %202 = getelementptr i8, ptr %201, i64 -2 %203 = load i8, ptr %202, align 1 %204 = load i32, ptr %186, align 4 - %reass.sub = sub i32 %204, %42 - %205 = add i32 %reass.sub, 1 - %206 = sext i32 %205 to i64 - tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %198, i8 %203, i64 %206, i1 false) - %207 = add nuw nsw i32 %.07788, 1 - %exitcond.not = icmp eq i32 %207, %43 + %.reass.reass = add i32 %204, %invariant.op + %205 = sext i32 %.reass.reass to i64 + tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %198, i8 %203, i64 %205, i1 false) + %206 = add nuw nsw i32 %.07788, 1 + %exitcond.not = icmp eq i32 %206, %43 br i1 %exitcond.not, label %.loopexit81, label %191, !llvm.loop !16 .loopexit81: ; preds = %191, %Scale2D.exit.thread, %Scale2D.exit @@ -443,7 +443,7 @@ Scale2D.exit: ; preds = %117, %93, %71, %._c br label %214 214: ; preds = %.lr.ph90, %214 - %.089 = phi i32 [ %212, %.lr.ph90 ], [ %226, %214 ] + %.089 = phi i32 [ %212, %.lr.ph90 ], [ %226, %213 ] %215 = load ptr, ptr %53, align 8 %216 = load i32, ptr %55, align 4 %217 = mul nsw i32 %216, %.089 diff --git a/bench/openusd/optimized/openexr-c.ll b/bench/openusd/optimized/openexr-c.ll index 24c9e67484a..a44cb396a1f 100644 --- a/bench/openusd/optimized/openexr-c.ll +++ b/bench/openusd/optimized/openexr-c.ll @@ -18318,10 +18318,11 @@ check_bad_attrsz.exit: ; preds = %20, %25, %29, %scra %45 = getelementptr i8, ptr %44, i64 -1 %46 = getelementptr inbounds nuw i8, ptr %0, i64 72 %zext = zext nneg i32 %42 to i64 + %invariant.op = sub i32 -2, %15 br label %.lr.ph.i .lr.ph.i: ; preds = %.lr.ph.i.lr.ph, %81 - %.03567 = phi i32 [ %5, %.lr.ph.i.lr.ph ], [ %82, %81 ] + %.03567 = phi i32 [ %5, %.lr.ph.i.lr.ph ], [ %82, %80 ] call void @llvm.lifetime.start.p0(ptr nonnull %7) br label %47 @@ -18357,9 +18358,8 @@ read_text.exit: ; preds = %54 br i1 %.not, label %.thread, label %.loopexit .thread: ; preds = %read_text.exit - %reass.sub79 = sub nsw i32 %.03567, %15 - %58 = add nsw i32 %reass.sub79, -2 - br label %63 + %.reass.reass = add i32 %.03567, %invariant.op + br label %62 59: ; preds = %50 %60 = trunc nsw i64 %indvars.iv.i to i32 @@ -18370,37 +18370,37 @@ read_text.exit: ; preds = %54 br i1 %62, label %.loopexit, label %63 63: ; preds = %.thread, %59 - %64 = phi i32 [ %58, %.thread ], [ %61, %59 ] - %.0495360 = phi i32 [ %42, %.thread ], [ %60, %59 ] + %64 = phi i32 [ %.reass.reass, %.thread ], [ %61, %58 ] + %.0495360 = phi i32 [ %42, %.thread ], [ %60, %58 ] %65 = icmp slt i32 %64, 16 br i1 %65, label %66, label %69 66: ; preds = %63 %67 = load ptr, ptr %46, align 8 - %68 = call i32 (ptr, i32, ptr, ...) %67(ptr noundef %0, i32 noundef 17, ptr noundef nonnull @.str.260, ptr noundef %3, ptr noundef nonnull %8) #53 + %68 = call i32 (ptr, i32, ptr, ...) %66(ptr noundef %0, i32 noundef 17, ptr noundef nonnull @.str.260, ptr noundef %3, ptr noundef nonnull %8) #53 br label %.loopexit 69: ; preds = %63 %70 = load ptr, ptr %41, align 8 - %71 = call i32 %70(ptr noundef nonnull %1, ptr noundef nonnull %9, i64 noundef 4) #53 + %71 = call i32 %69(ptr noundef nonnull %1, ptr noundef nonnull %9, i64 noundef 4) #53 %.not43 = icmp eq i32 %71, 0 br i1 %.not43, label %72, label %.loopexit 72: ; preds = %69 %73 = load ptr, ptr %41, align 8 - %74 = call i32 %73(ptr noundef nonnull %1, ptr noundef nonnull %12, i64 noundef 4) #53 + %74 = call i32 %72(ptr noundef nonnull %1, ptr noundef nonnull %12, i64 noundef 4) #53 %.not44 = icmp eq i32 %74, 0 br i1 %.not44, label %75, label %.loopexit 75: ; preds = %72 %76 = load ptr, ptr %41, align 8 - %77 = call i32 %76(ptr noundef nonnull %1, ptr noundef nonnull %10, i64 noundef 4) #53 + %77 = call i32 %75(ptr noundef nonnull %1, ptr noundef nonnull %10, i64 noundef 4) #53 %.not45 = icmp eq i32 %77, 0 br i1 %.not45, label %78, label %.loopexit 78: ; preds = %75 %79 = load ptr, ptr %41, align 8 - %80 = call i32 %79(ptr noundef nonnull %1, ptr noundef nonnull %11, i64 noundef 4) #53 + %80 = call i32 %78(ptr noundef nonnull %1, ptr noundef nonnull %11, i64 noundef 4) #53 %.not46 = icmp eq i32 %80, 0 br i1 %.not46, label %81, label %.loopexit @@ -18418,7 +18418,7 @@ read_text.exit: ; preds = %54 br i1 %91, label %.lr.ph.i, label %.loopexit, !llvm.loop !87 .loopexit: ; preds = %78, %75, %72, %69, %59, %read_text.exit, %81, %check_bad_attrsz.exit.thread, %check_bad_attrsz.exit, %read_text.exit.thread54, %66 - %.034 = phi i32 [ %68, %66 ], [ %49, %read_text.exit.thread54 ], [ %.0.i, %check_bad_attrsz.exit ], [ %19, %check_bad_attrsz.exit.thread ], [ %57, %read_text.exit ], [ %80, %78 ], [ %77, %75 ], [ %74, %72 ], [ %71, %69 ], [ 0, %59 ], [ %88, %81 ] + %.034 = phi i32 [ %68, %65 ], [ %49, %read_text.exit.thread54 ], [ %.0.i, %check_bad_attrsz.exit ], [ %19, %check_bad_attrsz.exit.thread ], [ %57, %read_text.exit ], [ %80, %77 ], [ %76, %74 ], [ %73, %71 ], [ %71, %68 ], [ 0, %58 ], [ %87, %80 ] ret i32 %.034 } diff --git a/bench/php/optimized/shared_alloc_mmap.ll b/bench/php/optimized/shared_alloc_mmap.ll index f11caa579b2..159f840e2a0 100644 --- a/bench/php/optimized/shared_alloc_mmap.ll +++ b/bench/php/optimized/shared_alloc_mmap.ll @@ -43,16 +43,20 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef .preheader.i: ; preds = %15 %17 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef nonnull %16) %.not5164.i = icmp eq ptr %17, null - br i1 %.not5164.i, label %.thread92, label %.lr.ph.i + br i1 %.not5164.i, label %.thread92, label %.lr.ph.i.preheader + +.lr.ph.i.preheader: ; preds = %.preheader.i + %invariant.op = sub i64 2097151, %0 + br label %.lr.ph.i .thread92: ; preds = %.preheader.i %18 = call i32 @fclose(ptr noundef nonnull %16) br label %.thread.sink.split -.lr.ph.i: ; preds = %.preheader.i, %52 - %.03767.i = phi i64 [ %.3.i, %52 ], [ 2097152, %.preheader.i ] - %.04066.i = phi i64 [ %.242.i, %52 ], [ -1, %.preheader.i ] - %.04565.i = phi i64 [ %.146.i, %52 ], [ 0, %.preheader.i ] +.lr.ph.i: ; preds = %.lr.ph.i.preheader, %52 + %.03767.i = phi i64 [ %.3.i, %51 ], [ 2097152, %.lr.ph.i.preheader ] + %.04066.i = phi i64 [ %.242.i, %51 ], [ -1, %.lr.ph.i.preheader ] + %.04565.i = phi i64 [ %.146.i, %51 ], [ 0, %.lr.ph.i.preheader ] %19 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %7, ptr noundef nonnull @.str.4, ptr noundef nonnull %5, ptr noundef nonnull %6) #8 %20 = icmp eq i32 %19, 2 br i1 %20, label %21, label %55 @@ -83,25 +87,24 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef 30: ; preds = %29 %.not56.i = icmp ugt i64 %.pre-phi, %.pre.i - br i1 %.not56.i, label %37, label %31 + br i1 %.not56.i, label %36, label %31 31: ; preds = %30 - %reass.sub = sub i64 %.pre.i, %0 - %32 = add i64 %reass.sub, 2097151 - %33 = and i64 %32, -2097152 - %34 = add i64 %33, %0 - %35 = icmp ugt i64 %34, %.pre.i - %36 = add i64 %33, -2097152 - %spec.select.i = select i1 %35, i64 %36, i64 %33 - br label %37 - -37: ; preds = %31, %30 + %.reass.i.reass.reass = add i64 %.pre.i, %invariant.op + %32 = and i64 %.reass.i.reass.reass, -2097152 + %33 = add i64 %32, %0 + %34 = icmp ugt i64 %33, %.pre.i + %35 = add i64 %32, -2097152 + %spec.select.i = select i1 %34, i64 %35, i64 %32 + br label %36 + +36: ; preds = %31, %30 %.343.i = phi i64 [ %.04066.i, %30 ], [ %spec.select.i, %31 ] %38 = load i64, ptr %6, align 8, !tbaa !19 %39 = icmp ugt i64 %38, ptrtoint (ptr @execute_ex to i64) br i1 %39, label %40, label %47 -40: ; preds = %37 +40: ; preds = %36 %.not57.i = icmp ne i64 %.343.i, -1 %41 = sub i64 %38, %.343.i %42 = icmp ult i64 %41, 4294967295 @@ -121,10 +124,10 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef %.pre76.i = load i64, ptr %6, align 8, !tbaa !19 br label %47 -47: ; preds = %._crit_edge.i, %40, %37 - %48 = phi i64 [ %.pre76.i, %._crit_edge.i ], [ %38, %37 ], [ %38, %40 ] - %.247.i = phi i64 [ %.04565.i, %._crit_edge.i ], [ %.04565.i, %37 ], [ %.pre.i, %40 ] - %.5.i = phi i64 [ %.04066.i, %._crit_edge.i ], [ %.343.i, %37 ], [ -1, %40 ] +47: ; preds = %._crit_edge.i, %40, %36 + %48 = phi i64 [ %.pre76.i, %._crit_edge.i ], [ %38, %36 ], [ %38, %39 ] + %.247.i = phi i64 [ %.04565.i, %._crit_edge.i ], [ %.04565.i, %36 ], [ %.pre.i, %39 ] + %.5.i = phi i64 [ %.04066.i, %._crit_edge.i ], [ %.343.i, %36 ], [ -1, %39 ] %49 = add i64 %48, 2097151 %50 = and i64 %49, -2097152 %51 = add i64 %50, 2097152 @@ -132,15 +135,15 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef br label %52 52: ; preds = %47, %23 - %.146.i = phi i64 [ %.04565.i, %23 ], [ %.247.i, %47 ] - %.242.i = phi i64 [ %.04066.i, %23 ], [ %.5.i, %47 ] - %.3.i = phi i64 [ %28, %23 ], [ %spec.select58.i, %47 ] + %.146.i = phi i64 [ %.04565.i, %23 ], [ %.247.i, %46 ] + %.242.i = phi i64 [ %.04066.i, %23 ], [ %.5.i, %46 ] + %.3.i = phi i64 [ %28, %23 ], [ %spec.select58.i, %46 ] %53 = call ptr @fgets(ptr noundef nonnull %7, i32 noundef 4096, ptr noundef nonnull %16) %.not51.i = icmp eq ptr %53, null br i1 %.not51.i, label %55, label %.lr.ph.i .thread113: ; preds = %40, %46 - %.141.i.ph = phi i64 [ %.03767.i, %46 ], [ %.343.i, %40 ] + %.141.i.ph = phi i64 [ %.03767.i, %45 ], [ %.343.i, %39 ] %54 = call i32 @fclose(ptr noundef nonnull %16) call void @llvm.lifetime.end.p0(ptr nonnull %7) call void @llvm.lifetime.end.p0(ptr nonnull %6) @@ -148,7 +151,7 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef br label %57 55: ; preds = %.lr.ph.i, %43, %52 - %.141.i = phi i64 [ %.04066.i, %.lr.ph.i ], [ %.04066.i, %43 ], [ %.242.i, %52 ] + %.141.i = phi i64 [ %.04066.i, %.lr.ph.i ], [ %.04066.i, %42 ], [ %.242.i, %51 ] %56 = call i32 @fclose(ptr noundef nonnull %16) call void @llvm.lifetime.end.p0(ptr nonnull %7) call void @llvm.lifetime.end.p0(ptr nonnull %6) @@ -157,7 +160,7 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef br i1 %.not, label %.thread, label %57 57: ; preds = %.thread113, %55 - %.in = phi i64 [ %.141.i.ph, %.thread113 ], [ %.141.i, %55 ] + %.in = phi i64 [ %.141.i.ph, %.thread113 ], [ %.141.i, %54 ] %58 = inttoptr i64 %.in to ptr %59 = icmp ugt i64 %0, 2097151 %60 = and i64 %0, 2097151 @@ -223,7 +226,7 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef br label %92 .thread96: ; preds = %64, %62, %82, %80, %78, %71 - %.1 = phi ptr [ %77, %71 ], [ %79, %78 ], [ %81, %80 ], [ %83, %82 ], [ %65, %64 ], [ %63, %62 ] + %.1 = phi ptr [ %77, %70 ], [ %79, %77 ], [ %81, %79 ], [ %83, %81 ], [ %65, %63 ], [ %63, %61 ] store i32 1, ptr %2, align 4, !tbaa !21 %86 = call noalias dereferenceable_or_null(40) ptr @calloc(i64 noundef 1, i64 noundef 40) #10 store ptr %86, ptr %1, align 8, !tbaa !22 @@ -244,7 +247,7 @@ define internal range(i32 0, 2) i32 @create_segments(i64 noundef %0, ptr noundef br label %92 92: ; preds = %89, %87, %85 - %.0 = phi i32 [ 0, %85 ], [ 1, %89 ], [ 0, %87 ] + %.0 = phi i32 [ 0, %84 ], [ 1, %88 ], [ 0, %86 ] ret i32 %.0 } diff --git a/bench/php/optimized/zend_opcode.ll b/bench/php/optimized/zend_opcode.ll index 3e51edc6fa0..2d79293f448 100644 --- a/bench/php/optimized/zend_opcode.ll +++ b/bench/php/optimized/zend_opcode.ll @@ -3134,9 +3134,15 @@ define internal fastcc void @zend_calc_live_ranges(ptr noundef %0, ptr noundef r %.not131143 = icmp eq i32 %4, 0 br i1 %.not131143, label %._crit_edge, label %.lr.ph -.lr.ph: ; preds = %20, %86 - %.0123145 = phi i32 [ %26, %86 ], [ %4, %20 ] - %.0124144 = phi ptr [ %27, %86 ], [ %8, %20 ] +.lr.ph: ; preds = %20 + %invariant.op = sub i32 -5, %10 + %invariant.op177 = sub i32 -5, %10 + %invariant.op178 = sub i32 -5, %10 + br label %.lr.ph + +.lr.ph: ; preds = %.lr.ph.preheader, %83 + %.0123145 = phi i32 [ %26, %83 ], [ %4, %.lr.ph.preheader ] + %.0124144 = phi ptr [ %27, %83 ], [ %8, %.lr.ph.preheader ] %26 = add i32 %.0123145, -1 %27 = getelementptr inbounds i8, ptr %.0124144, i64 -32 %28 = getelementptr inbounds i8, ptr %.0124144, i64 -1 @@ -3158,29 +3164,28 @@ is_fake_def.exit: ; preds = %31 %33 = getelementptr inbounds i8, ptr %.0124144, i64 -16 %34 = load i32, ptr %33, align 8, !tbaa !23 %35 = lshr i32 %34, 4 - %reass.sub = sub i32 %35, %10 - %36 = add i32 %reass.sub, -5 - %37 = zext i32 %36 to i64 - %38 = getelementptr inbounds nuw i32, ptr %21, i64 %37 - %39 = load i32, ptr %38, align 4, !tbaa !25 - %.not133 = icmp eq i32 %39, -1 - br i1 %.not133, label %is_fake_def.exit.thread, label %40, !prof !98 - -40: ; preds = %is_fake_def.exit - %.not134 = icmp eq i32 %.0123145, %39 - br i1 %.not134, label %43, label %41 - -41: ; preds = %40 - %42 = icmp ne i8 %.val, -119 - tail call void @llvm.assume(i1 %42) - tail call fastcc void @emit_live_range(ptr noundef %0, i32 noundef %36, i32 noundef %26, i32 noundef %39, ptr noundef %1) - br label %43 - -43: ; preds = %41, %40 - store i32 -1, ptr %38, align 4, !tbaa !25 + %.reass.reass = add i32 %35, %invariant.op + %36 = zext i32 %.reass.reass to i64 + %37 = getelementptr inbounds nuw i32, ptr %21, i64 %36 + %38 = load i32, ptr %37, align 4, !tbaa !25 + %.not133 = icmp eq i32 %38, -1 + br i1 %.not133, label %is_fake_def.exit.thread, label %39, !prof !98 + +39: ; preds = %is_fake_def.exit + %.not134 = icmp eq i32 %.0123145, %38 + br i1 %.not134, label %42, label %40 + +40: ; preds = %39 + %41 = icmp ne i8 %.val, -119 + tail call void @llvm.assume(i1 %41) + tail call fastcc void @emit_live_range(ptr noundef %0, i32 noundef %.reass.reass, i32 noundef %26, i32 noundef %38, ptr noundef %1) + br label %42 + +42: ; preds = %40, %39 + store i32 -1, ptr %37, align 4, !tbaa !25 br label %is_fake_def.exit.thread -is_fake_def.exit.thread: ; preds = %31, %31, %31, %is_fake_def.exit, %43, %.lr.ph +is_fake_def.exit.thread: ; preds = %31, %31, %31, %is_fake_def.exit, %42, %.lr.ph %44 = getelementptr inbounds i8, ptr %.0124144, i64 -3 %45 = load i8, ptr %44, align 1, !tbaa !164 %46 = and i8 %45, 6 @@ -3191,18 +3196,17 @@ is_fake_def.exit.thread: ; preds = %31, %31, %31, %is_f %48 = getelementptr inbounds i8, ptr %.0124144, i64 -24 %49 = load i32, ptr %48, align 8, !tbaa !23 %50 = lshr i32 %49, 4 - %reass.sub156 = sub i32 %50, %10 - %51 = add i32 %reass.sub156, -5 - %52 = zext i32 %51 to i64 - %53 = getelementptr inbounds nuw i32, ptr %21, i64 %52 - %54 = load i32, ptr %53, align 4, !tbaa !25 - %55 = icmp eq i32 %54, -1 - br i1 %55, label %56, label %keeps_op1_alive.exit.thread, !prof !106 - -56: ; preds = %47 - %57 = getelementptr i8, ptr %.0124144, i64 -4 - %.val139 = load i8, ptr %57, align 4, !tbaa !163 - switch i8 %.val139, label %58 [ + %.reass169.reass = add i32 %50, %invariant.op180 + %50 = zext i32 %.reass169.reass to i64 + %51 = getelementptr inbounds nuw i32, ptr %21, i64 %50 + %52 = load i32, ptr %51, align 4, !tbaa !25 + %53 = icmp eq i32 %52, -1 + br i1 %53, label %54, label %keeps_op1_alive.exit.thread, !prof !106 + +54: ; preds = %46 + %55 = getelementptr i8, ptr %.0124144, i64 -4 + %.val139 = load i8, ptr %55, align 4, !tbaa !163 + switch i8 %.val139, label %56 [ i8 48, label %keeps_op1_alive.exit.thread i8 -60, label %keeps_op1_alive.exit.thread i8 -69, label %keeps_op1_alive.exit.thread @@ -3214,24 +3218,24 @@ is_fake_def.exit.thread: ; preds = %31, %31, %31, %is_f i8 -89, label %keeps_op1_alive.exit.thread ] -58: ; preds = %56 +58: ; preds = %54 %59 = icmp ne i8 %.val139, 78 + tail call void @llvm.assume(i1 %57) + %58 = icmp ne i8 %.val139, 126 + tail call void @llvm.assume(i1 %58) + %59 = icmp ne i8 %.val139, 124 tail call void @llvm.assume(i1 %59) - %60 = icmp ne i8 %.val139, 126 + %60 = icmp ne i8 %.val139, -74 tail call void @llvm.assume(i1 %60) - %61 = icmp ne i8 %.val139, 124 + %61 = icmp ne i8 %.val139, 55 tail call void @llvm.assume(i1 %61) - %62 = icmp ne i8 %.val139, -74 - tail call void @llvm.assume(i1 %62) - %63 = icmp ne i8 %.val139, 55 - tail call void @llvm.assume(i1 %63) - %64 = icmp eq i8 %.val139, -119 - %.neg = sext i1 %64 to i32 - %65 = add i32 %26, %.neg - store i32 %65, ptr %53, align 4, !tbaa !25 + %62 = icmp eq i8 %.val139, -119 + %.neg = sext i1 %62 to i32 + %63 = add i32 %26, %.neg + store i32 %63, ptr %51, align 4, !tbaa !25 br label %keeps_op1_alive.exit.thread -keeps_op1_alive.exit.thread: ; preds = %56, %56, %56, %56, %56, %56, %56, %56, %56, %47, %58, %is_fake_def.exit.thread +keeps_op1_alive.exit.thread: ; preds = %54, %54, %54, %54, %54, %54, %54, %54, %54, %47, %58, %is_fake_def.exit.thread %66 = getelementptr inbounds i8, ptr %.0124144, i64 -2 %67 = load i8, ptr %66, align 2, !tbaa !165 %68 = and i8 %67, 6 @@ -3242,41 +3246,40 @@ keeps_op1_alive.exit.thread: ; preds = %56, %56, %56, %56, %70 = getelementptr inbounds i8, ptr %.0124144, i64 -20 %71 = load i32, ptr %70, align 4, !tbaa !23 %72 = lshr i32 %71, 4 - %reass.sub157 = sub i32 %72, %10 - %73 = add i32 %reass.sub157, -5 - %74 = getelementptr inbounds i8, ptr %.0124144, i64 -4 - %75 = load i8, ptr %74, align 4, !tbaa !163 - %76 = zext i32 %73 to i64 - %77 = getelementptr inbounds nuw i32, ptr %21, i64 %76 - %78 = load i32, ptr %77, align 4, !tbaa !25 - %79 = icmp eq i32 %78, -1 - switch i8 %75, label %83 [ - i8 126, label %80 - i8 78, label %80 + %.reass171.reass = add i32 %72, %invariant.op178 + %71 = getelementptr inbounds i8, ptr %.0124144, i64 -4 + %72 = load i8, ptr %71, align 4, !tbaa !163 + %73 = zext i32 %.reass171.reass to i64 + %74 = getelementptr inbounds nuw i32, ptr %21, i64 %73 + %75 = load i32, ptr %74, align 4, !tbaa !25 + %76 = icmp eq i32 %75, -1 + switch i8 %72, label %80 [ + i8 126, label %83 + i8 81, label %80 ], !prof !166 80: ; preds = %69, %69 - br i1 %79, label %86, label %81 + br i1 %76, label %86, label %81 81: ; preds = %80 - %.not138 = icmp eq i32 %.0123145, %78 + %.not138 = icmp eq i32 %.0123145, %75 br i1 %.not138, label %.sink.split, label %82 82: ; preds = %81 - tail call fastcc void @emit_live_range(ptr noundef %0, i32 noundef %73, i32 noundef %26, i32 noundef %78, ptr noundef %1) + tail call fastcc void @emit_live_range(ptr noundef %0, i32 noundef %.reass171.reass, i32 noundef %26, i32 noundef %75, ptr noundef %1) br label %.sink.split 83: ; preds = %69 - br i1 %79, label %84, label %86, !prof !106 + br i1 %76, label %84, label %86, !prof !106 84: ; preds = %83 - %85 = icmp ne i8 %75, -119 + %85 = icmp ne i8 %72, -119 tail call void @llvm.assume(i1 %85) br label %.sink.split .sink.split: ; preds = %81, %82, %84 - %.sink = phi i32 [ %26, %84 ], [ -1, %82 ], [ -1, %81 ] - store i32 %.sink, ptr %77, align 4, !tbaa !25 + %.sink = phi i32 [ %26, %81 ], [ -1, %79 ], [ -1, %78 ] + store i32 %.sink, ptr %74, align 4, !tbaa !25 br label %86 86: ; preds = %.sink.split, %80, %83, %keeps_op1_alive.exit.thread @@ -3323,7 +3326,7 @@ keeps_op1_alive.exit.thread: ; preds = %56, %56, %56, %56, br i1 %104, label %.lr.ph151, label %.lr.ph155 .lr.ph155: ; preds = %.lr.ph151, %116 - %.1153 = phi ptr [ %117, %116 ], [ %90, %.lr.ph151 ] + %.1153 = phi ptr [ %117, %113 ], [ %90, %.lr.ph151 ] %105 = getelementptr inbounds nuw i8, ptr %.1153, i64 4 %106 = load i32, ptr %105, align 4, !tbaa !169 %107 = getelementptr inbounds nuw i8, ptr %.1153, i64 16 diff --git a/bench/pocketpy/optimized/io.ll b/bench/pocketpy/optimized/io.ll index 1f013537405..fc85345f796 100644 --- a/bench/pocketpy/optimized/io.ll +++ b/bench/pocketpy/optimized/io.ll @@ -940,22 +940,26 @@ define void @_ZN4pkpy6FileIOC2EPNS_2VMERKNS_3StrES5_(ptr noundef nonnull writeon %9 = sext i32 %8 to i64 %10 = getelementptr inbounds i8, ptr %7, i64 %9 %11 = ptrtoint ptr %10 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + br label %12 + +12: ; preds = %22, %.lr.ph.i.i + %.033.i.i = phi i64 [ %9, %.lr.ph.i.i ], [ %25, %22 ] + %.02132.i.i = phi ptr [ %7, %.lr.ph.i.i ], [ %23, %22 ] + %13 = icmp eq i64 %.033.i.i, 0 + br i1 %13, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %20, %.lr.ph.i.i - %.033.i.i = phi i64 [ %9, %.lr.ph.i.i ], [ %23, %20 ] - %.02132.i.i = phi ptr [ %7, %.lr.ph.i.i ], [ %21, %20 ] - %12 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef 98, i64 noundef %.033.i.i) #27 - %.not26.i.i = icmp eq ptr %12, null +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %12 + %14 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef 98, i64 noundef %.033.i.i) #27 + %.not26.i.i = icmp eq ptr %14, null br i1 %.not26.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %lhsc = load i8, ptr %12, align 1 + %lhsc = load i8, ptr %14, align 1 %13 = icmp eq i8 %lhsc, 98 br i1 %13, label %14, label %20 14: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %15 = ptrtoint ptr %12 to i64 + %15 = ptrtoint ptr %14 to i64 %16 = ptrtoint ptr %7 to i64 %17 = sub i64 %15, %16 %18 = icmp eq i64 %17, -1 @@ -963,14 +967,14 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsI br label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit 20: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %21 = getelementptr inbounds nuw i8, ptr %12, i64 1 + %21 = getelementptr inbounds nuw i8, ptr %14, i64 1 %22 = ptrtoint ptr %21 to i64 %23 = sub i64 %11, %22 %.not25.i.i = icmp eq i64 %23, 0 - br i1 %.not25.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !4 + br i1 %.not25.i.i, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit, label %12, !llvm.loop !4 -_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %4, %14 - %.020.i.i = phi i8 [ %19, %14 ], [ 1, %4 ], [ 1, %20 ], [ 1, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findEPKcm.exit: ; preds = %12, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %20, %4, %14 + %.020.i.i = phi i8 [ %19, %16 ], [ 1, %4 ], [ 1, %22 ], [ 1, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ 1, %12 ] %24 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i8 %.020.i.i, ptr %24, align 8 %25 = getelementptr inbounds nuw i8, ptr %2, i64 8 diff --git a/bench/postgres/optimized/inv_api.ll b/bench/postgres/optimized/inv_api.ll index 1f9c9e4c1b5..5677d75831c 100644 --- a/bench/postgres/optimized/inv_api.ll +++ b/bench/postgres/optimized/inv_api.ll @@ -782,14 +782,15 @@ define dso_local range(i32 0, -2147483648) i32 @inv_write(ptr noundef captures(n %69 = add i64 %6, 8 %70 = add i64 %6, 4 %71 = add nuw i64 %6, 12 + %invariant.op = sub i64 -5, %6 br label %72 72: ; preds = %.lr.ph168, %189 - %.0115167 = phi i32 [ 0, %.lr.ph168 ], [ %.1, %189 ] - %.0116166 = phi i32 [ %13, %.lr.ph168 ], [ %190, %189 ] - %.0118165 = phi ptr [ null, %.lr.ph168 ], [ %.2, %189 ] - %.0120164 = phi ptr [ null, %.lr.ph168 ], [ %.3, %189 ] - %.0123163 = phi i1 [ true, %.lr.ph168 ], [ %.2125, %189 ] + %.0115167 = phi i32 [ 0, %.lr.ph168 ], [ %.1, %188 ] + %.0116166 = phi i32 [ %13, %.lr.ph168 ], [ %190, %188 ] + %.0118165 = phi ptr [ null, %.lr.ph168 ], [ %.2, %188 ] + %.0120164 = phi ptr [ null, %.lr.ph168 ], [ %.3, %188 ] + %.0123163 = phi i1 [ true, %.lr.ph168 ], [ %.2125, %188 ] br i1 %.0123163, label %73, label %86 73: ; preds = %72 @@ -970,14 +971,13 @@ getdatafield.exit: ; preds = %97 .lr.ph161.preheader: ; preds = %165 %166 = add i64 %70, %.pre174 %umax171 = call i64 @llvm.umax.i64(i64 %166, i64 %71) - %reass.sub = sub i64 %umax171, %6 - %167 = add i64 %reass.sub, -5 - %168 = and i64 %167, -8 - %169 = add i64 %168, 8 + %.reass.reass = add i64 %umax171, %invariant.op + %167 = and i64 %.reass.reass, -8 + %168 = add i64 %167, 8 br label %.loopexit.sink.split .loopexit.sink.split: ; preds = %160, %161, %.lr.ph161.preheader - %.sink184 = phi i64 [ %169, %.lr.ph161.preheader ], [ %.pre174, %161 ], [ %.pre174, %160 ] + %.sink184 = phi i64 [ %168, %.lr.ph161.preheader ], [ %.pre174, %161 ], [ %.pre174, %160 ] call void @llvm.memset.p0.i64(ptr nonnull align 4 %14, i8 0, i64 %.sink184, i1 false) br label %.loopexit diff --git a/bench/postgres/optimized/parse_relation.ll b/bench/postgres/optimized/parse_relation.ll index 95035116aa8..e5f5f2d979e 100644 --- a/bench/postgres/optimized/parse_relation.ll +++ b/bench/postgres/optimized/parse_relation.ll @@ -1013,7 +1013,11 @@ define internal fastcc i32 @scanRTEForColumn(ptr noundef %0, ptr noundef %1, ptr br i1 %.not42, label %.lr.ph.split.us.split, label %.lr.ph.split.preheader .lr.ph.split.preheader: ; preds = %.lr.ph - br i1 %14, label %.lr.ph47, label %.critedge + br i1 %14, label %.lr.ph47.preheader, label %.critedge + +.lr.ph47.preheader: ; preds = %.lr.ph.split.preheader + %invariant.op = sub i32 1, %4 + br label %.lr.ph47 .lr.ph.split.us.split: ; preds = %.lr.ph br i1 %14, label %.lr.ph15, label %.critedge.thread @@ -1045,9 +1049,9 @@ updateFuzzyAttrMatchState.exit.us: ; preds = %23, %16 %exitcond.not = icmp eq i64 %indvars.iv.next23, %wide.trip.count br i1 %exitcond.not, label %.critedge, label %16 -.lr.ph47: ; preds = %.lr.ph.split.preheader, %updateFuzzyAttrMatchState.exit - %.031646 = phi i32 [ %.1, %updateFuzzyAttrMatchState.exit ], [ 0, %.lr.ph.split.preheader ] - %indvars.iv45 = phi i64 [ %indvars.iv.next, %updateFuzzyAttrMatchState.exit ], [ 0, %.lr.ph.split.preheader ] +.lr.ph47: ; preds = %.lr.ph47.preheader, %updateFuzzyAttrMatchState.exit + %.031646 = phi i32 [ %.1, %updateFuzzyAttrMatchState.exit ], [ 0, %.lr.ph47.preheader ] + %indvars.iv45 = phi i64 [ %indvars.iv.next, %updateFuzzyAttrMatchState.exit ], [ 0, %.lr.ph47.preheader ] %24 = load ptr, ptr %8, align 8 %25 = getelementptr inbounds nuw %union.ListCell, ptr %24, i64 %indvars.iv45 %26 = load ptr, ptr %25, align 8 @@ -1092,29 +1096,28 @@ updateFuzzyAttrMatchState.exit.us: ; preds = %23, %16 %44 = trunc i64 %43 to i32 %45 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %28) #11 %46 = trunc i64 %45 to i32 - %reass.sub = sub i32 %37, %4 - %47 = add i32 %reass.sub, 1 - %48 = tail call i32 @varstr_levenshtein_less_equal(ptr noundef nonnull %28, i32 noundef %46, ptr noundef nonnull %2, i32 noundef %44, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef %47, i1 noundef zeroext true) #10 - %49 = sdiv i32 %44, 2 - %50 = icmp sgt i32 %48, %49 - br i1 %50, label %updateFuzzyAttrMatchState.exit, label %51 - -51: ; preds = %42 - %52 = add i32 %48, %4 - %53 = load i32, ptr %5, align 8 - %54 = icmp slt i32 %52, %53 - br i1 %54, label %55, label %57 - -55: ; preds = %51 - store i32 %52, ptr %5, align 8 + %.reass.reass = add i32 %37, %invariant.op + %47 = tail call i32 @varstr_levenshtein_less_equal(ptr noundef nonnull %28, i32 noundef %46, ptr noundef nonnull %2, i32 noundef %44, i32 noundef 1, i32 noundef 1, i32 noundef 1, i32 noundef %.reass.reass, i1 noundef zeroext true) #10 + %48 = sdiv i32 %44, 2 + %49 = icmp sgt i32 %47, %48 + br i1 %49, label %updateFuzzyAttrMatchState.exit, label %50 + +50: ; preds = %42 + %51 = add i32 %47, %4 + %52 = load i32, ptr %5, align 8 + %53 = icmp slt i32 %51, %52 + br i1 %53, label %54, label %56 + +54: ; preds = %50 + store i32 %51, ptr %5, align 8 store ptr %1, ptr %10, align 8 %56 = trunc i64 %indvars.iv.next to i16 store i16 %56, ptr %12, align 8 store ptr null, ptr %9, align 8 br label %updateFuzzyAttrMatchState.exit -57: ; preds = %51 - %58 = icmp eq i32 %52, %53 +57: ; preds = %50 + %58 = icmp eq i32 %51, %52 br i1 %58, label %59, label %updateFuzzyAttrMatchState.exit 59: ; preds = %57 @@ -1138,7 +1141,7 @@ updateFuzzyAttrMatchState.exit.us: ; preds = %23, %16 store i16 %65, ptr %11, align 8 br label %updateFuzzyAttrMatchState.exit -updateFuzzyAttrMatchState.exit: ; preds = %64, %62, %61, %57, %55, %42, %39, %36 +updateFuzzyAttrMatchState.exit: ; preds = %64, %62, %61, %57, %54, %42, %39, %36 %66 = load i32, ptr %7, align 4 %67 = sext i32 %66 to i64 %68 = icmp slt i64 %indvars.iv.next, %67 @@ -1178,7 +1181,7 @@ specialAttNum.exit: ; preds = %75 br label %specialAttNum.exit.thread specialAttNum.exit.thread: ; preds = %75, %79, %.critedge.thread, %72, %specialAttNum.exit, %.critedge - %.0 = phi i32 [ %.031.lcssa, %.critedge ], [ 0, %.critedge.thread ], [ %spec.select, %79 ], [ 0, %specialAttNum.exit ], [ 0, %72 ], [ 0, %75 ] + %.0 = phi i32 [ %.031.lcssa, %.critedge ], [ 0, %.critedge.thread ], [ %spec.select, %78 ], [ 0, %specialAttNum.exit ], [ 0, %71 ], [ 0, %74 ] ret i32 %.0 } diff --git a/bench/protobuf/optimized/importer.ll b/bench/protobuf/optimized/importer.ll index d635bbe108f..59285f74e11 100644 --- a/bench/protobuf/optimized/importer.ll +++ b/bench/protobuf/optimized/importer.ll @@ -2097,11 +2097,11 @@ while.body.lr.ph.i.i.i: ; preds = %if.end.i.i.i %sub.ptr.lhs.cast20.i.i.i = ptrtoint ptr %add.ptr9.i.i.i to i64 br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %if.end19.i.i.i, %while.body.lr.ph.i.i.i +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %while.body.lr.ph.i.i.i, %if.end19.i.i.i %__len.022.i.i.i = phi i64 [ %path.coerce0, %while.body.lr.ph.i.i.i ], [ %sub.ptr.sub22.i.i.i, %if.end19.i.i.i ] %__first.021.i.i.i = phi ptr [ %path.coerce1, %while.body.lr.ph.i.i.i ], [ %incdec.ptr.i.i.i, %if.end19.i.i.i ] %add.i.i.i = add i64 %__len.022.i.i.i, -3 - %call.i.i.i.i = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.021.i.i.i, i32 noundef 47, i64 noundef %add.i.i.i) #27 + %call.i.i.i.i = tail call ptr @memchr(ptr noundef nonnull %__first.021.i.i.i, i32 noundef 47, i64 noundef %add.i.i.i) #27 %tobool.not.i.i.i = icmp eq ptr %call.i.i.i.i, null br i1 %tobool.not.i.i.i, label %lor.end, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i @@ -2125,7 +2125,7 @@ if.end19.i.i.i: ; preds = %_ZNSt11char_traitsI br i1 %cmp11.not.i.i.i, label %lor.end, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, !llvm.loop !36 lor.end: ; preds = %if.end19.i.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, %if.end.i.i.i.thread, %if.then17.i.i.i, %if.end.i.i.i, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i, %_ZN4absl12lts_202308028EndsWithESt17basic_string_viewIcSt11char_traitsIcEES4_.exit, %_ZN4absl12lts_2023080210StartsWithESt17basic_string_viewIcSt11char_traitsIcEES4_.exit - %2 = phi i1 [ true, %_ZN4absl12lts_202308028EndsWithESt17basic_string_viewIcSt11char_traitsIcEES4_.exit ], [ true, %_ZN4absl12lts_2023080210StartsWithESt17basic_string_viewIcSt11char_traitsIcEES4_.exit ], [ %1, %if.then17.i.i.i ], [ false, %if.end.i.i.i ], [ true, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i ], [ false, %if.end.i.i.i.thread ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ], [ false, %if.end19.i.i.i ] + %2 = phi i1 [ true, %_ZN4absl12lts_202308028EndsWithESt17basic_string_viewIcSt11char_traitsIcEES4_.exit ], [ true, %_ZN4absl12lts_2023080210StartsWithESt17basic_string_viewIcSt11char_traitsIcEES4_.exit ], [ false, %if.end.i.i.i ], [ %1, %if.then17.i.i.i ], [ true, %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i ], [ false, %if.end.i.i.i.thread ], [ false, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i ], [ false, %if.end19.i.i.i ] ret i1 %2 } diff --git a/bench/protobuf/optimized/php_generator.ll b/bench/protobuf/optimized/php_generator.ll index 51b798507b8..7cb581b29fd 100644 --- a/bench/protobuf/optimized/php_generator.ll +++ b/bench/protobuf/optimized/php_generator.ll @@ -19639,7 +19639,7 @@ _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %if.end19.i.i, %whil %__len.022.i.i = phi i64 [ %0, %while.body.lr.ph.i.i ], [ %sub.ptr.sub22.i.i, %if.end19.i.i ] %__first.021.i.i = phi ptr [ %1, %while.body.lr.ph.i.i ], [ %incdec.ptr.i.i, %if.end19.i.i ] %add.i.i = add i64 %__len.022.i.i, -14 - %call.i.i.i = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.021.i.i, i32 noundef 103, i64 noundef %add.i.i) #27 + %call.i.i.i = tail call ptr @memchr(ptr noundef %__first.021.i.i, i32 noundef 103, i64 noundef %add.i.i) #27 %tobool.not.i.i = icmp eq ptr %call.i.i.i, null br i1 %tobool.not.i.i, label %if.end11, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -19687,7 +19687,7 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit: ; preds = %if.the call void @_ZN4absl12lts_202308026StrCatB5cxx11ERKNS0_8AlphaNumES3_S3_(ptr nonnull sret(%"class.std::__cxx11::basic_string") align 8 %agg.result, ptr noundef nonnull align 8 dereferenceable(48) %ref.tmp, ptr noundef nonnull align 8 dereferenceable(48) %ref.tmp6, ptr noundef nonnull align 8 dereferenceable(48) %ref.tmp7) br label %return -if.end11: ; preds = %if.end19.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %entry +if.end11: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end19.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %entry call void @_ZNSaIcEC1Ev(ptr noundef nonnull align 1 dereferenceable(1) %ref.tmp12) #27 call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i) %call.i = call { i64, ptr } @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17_S_to_string_viewESt17basic_string_viewIcS2_E(i64 %0, ptr %1) #27 @@ -20560,7 +20560,7 @@ _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %if.end19.i.i, %whil %__len.022.i.i = phi i64 [ %0, %while.body.lr.ph.i.i ], [ %sub.ptr.sub22.i.i, %if.end19.i.i ] %__first.021.i.i = phi ptr [ %1, %while.body.lr.ph.i.i ], [ %incdec.ptr.i.i, %if.end19.i.i ] %add.i.i = add i64 %__len.022.i.i, -14 - %call.i.i.i = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.021.i.i, i32 noundef 103, i64 noundef %add.i.i) #27 + %call.i.i.i = tail call ptr @memchr(ptr noundef %__first.021.i.i, i32 noundef 103, i64 noundef %add.i.i) #27 %tobool.not.i.i = icmp eq ptr %call.i.i.i, null br i1 %tobool.not.i.i, label %if.end11, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -20608,7 +20608,7 @@ _ZNKSt17basic_string_viewIcSt11char_traitsIcEE6substrEmm.exit: ; preds = %if.the call void @_ZN4absl12lts_202308026StrCatB5cxx11ERKNS0_8AlphaNumES3_S3_(ptr nonnull sret(%"class.std::__cxx11::basic_string") align 8 %agg.result, ptr noundef nonnull align 8 dereferenceable(48) %ref.tmp, ptr noundef nonnull align 8 dereferenceable(48) %ref.tmp6, ptr noundef nonnull align 8 dereferenceable(48) %ref.tmp7) br label %return -if.end11: ; preds = %if.end19.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %entry +if.end11: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end19.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %entry call void @_ZNSaIcEC1Ev(ptr noundef nonnull align 1 dereferenceable(1) %ref.tmp12) #27 call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i) %call.i = call { i64, ptr } @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE17_S_to_string_viewESt17basic_string_viewIcS2_E(i64 %0, ptr %1) #27 diff --git a/bench/redis/optimized/t_hash.ll b/bench/redis/optimized/t_hash.ll index 4b918984e65..f6cc3301426 100644 --- a/bench/redis/optimized/t_hash.ll +++ b/bench/redis/optimized/t_hash.ll @@ -10599,7 +10599,7 @@ define internal fastcc void @httlGenericCommand(ptr noundef %0, i64 noundef %1, %40 = load i32, ptr %12, align 8 %41 = lshr i32 %40, 4 %42 = and i32 %41, 15 - switch i32 %42, label %187 [ + switch i32 %42, label %185 [ i32 11, label %43 i32 12, label %83 i32 2, label %147 @@ -10883,7 +10883,7 @@ hfieldGetExpireTime.exit: ; preds = %169 br label %hfieldGetExpireTime.exit.thread hfieldGetExpireTime.exit.thread: ; preds = %181, %hfieldGetExpireTime.exit, %hfieldIsExpireAttached.exit.i, %169, %162, %153, %182 - %.sink42 = phi i64 [ -2, %153 ], [ -1, %hfieldIsExpireAttached.exit.i ], [ -2, %hfieldGetExpireTime.exit ], [ %184, %182 ], [ -1, %162 ], [ -1, %169 ], [ %reass.sub, %181 ] + %.sink42 = phi i64 [ -2, %152 ], [ -1, %hfieldIsExpireAttached.exit.i ], [ -2, %hfieldGetExpireTime.exit ], [ %184, %181 ], [ -1, %161 ], [ -1, %168 ], [ %reass.sub, %180 ] call void @addReplyLongLong(ptr noundef nonnull %0, i64 noundef %.sink42) #17 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %185 = load i64, ptr %4, align 8, !tbaa !28 diff --git a/bench/ruff-rs/optimized/8rgebevtg1rphkf0xv4zhooko.ll b/bench/ruff-rs/optimized/8rgebevtg1rphkf0xv4zhooko.ll index 792f69e4b6f..46c6714480a 100644 --- a/bench/ruff-rs/optimized/8rgebevtg1rphkf0xv4zhooko.ll +++ b/bench/ruff-rs/optimized/8rgebevtg1rphkf0xv4zhooko.ll @@ -4417,8 +4417,8 @@ define hidden { ptr, i64 } @"_ZN4core3str21_$LT$impl$u20$str$GT$16trim_end_match br i1 %25, label %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h2e2fd07e955ff12bE.exit21.i.i.i", label %40 26: ; preds = %40, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h2e2fd07e955ff12bE.exit17.i.i.i" - %.sroa.5.0.i.i = phi ptr [ %.sroa.5.1.i.i, %40 ], [ %13, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h2e2fd07e955ff12bE.exit17.i.i.i" ] - %.sroa.04.0.i.i.i = phi i32 [ %44, %40 ], [ %16, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h2e2fd07e955ff12bE.exit17.i.i.i" ] + %.sroa.5.0.i.i = phi ptr [ %.sroa.5.1.i.i, %39 ], [ %13, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h2e2fd07e955ff12bE.exit17.i.i.i" ] + %.sroa.04.0.i.i.i = phi i32 [ %44, %39 ], [ %16, %"_ZN106_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..double_ended..DoubleEndedIterator$GT$9next_back17h2e2fd07e955ff12bE.exit17.i.i.i" ] %27 = shl nuw nsw i32 %.sroa.04.0.i.i.i, 6 %28 = and i8 %10, 63 %29 = zext nneg i8 %28 to i32 @@ -4448,12 +4448,12 @@ define hidden { ptr, i64 } @"_ZN4core3str21_$LT$impl$u20$str$GT$16trim_end_match br label %26 "_ZN88_$LT$core..str..pattern..CharSearcher$u20$as$u20$core..str..pattern..ReverseSearcher$GT$9next_back17h0aa1e611b4d6b7fdE.exit.i": ; preds = %26, %18 - %.sroa.5.2.ph.i.i = phi ptr [ %.sroa.5.0.i.i, %26 ], [ %9, %18 ] - %.sroa.4.1.i.ph.i.i = phi i32 [ %30, %26 ], [ %19, %18 ] + %.sroa.5.2.ph.i.i = phi ptr [ %.sroa.5.0.i.i, %25 ], [ %9, %17 ] + %.sroa.4.1.i.ph.i.i = phi i32 [ %30, %25 ], [ %19, %17 ] %45 = icmp samesign ult i32 %.sroa.4.1.i.ph.i.i, 1114112 tail call void @llvm.assume(i1 %45) %46 = ptrtoint ptr %.sroa.5.2.ph.i.i to i64 - %47 = sub nuw i64 %46, %3 + %47 = sub i64 %46, %3 %.not.i = icmp eq i32 %.sroa.4.1.i.ph.i.i, %2 br i1 %.not.i, label %4, label %_ZN4core3str7pattern15ReverseSearcher16next_reject_back17h31fc8d5c55a0b172E.exit diff --git a/bench/rust-analyzer-rs/optimized/36cskjvhktchzlnh.ll b/bench/rust-analyzer-rs/optimized/36cskjvhktchzlnh.ll index b7df6cb4733..93dc7c68ea1 100644 --- a/bench/rust-analyzer-rs/optimized/36cskjvhktchzlnh.ll +++ b/bench/rust-analyzer-rs/optimized/36cskjvhktchzlnh.ll @@ -599,9 +599,9 @@ switch.lookup: br label %7 7: ; preds = %.lr.ph, %58 - %.sroa.613.052 = phi i32 [ undef, %.lr.ph ], [ %.sroa.613.1, %58 ] - %.sroa.411.051 = phi i8 [ undef, %.lr.ph ], [ %.sroa.411.1, %58 ] - %.sroa.0.050 = phi ptr [ %0, %.lr.ph ], [ %.sroa.0.1.ph3544, %58 ] + %.sroa.613.052 = phi i32 [ undef, %.lr.ph ], [ %.sroa.613.1, %57 ] + %.sroa.411.051 = phi i8 [ undef, %.lr.ph ], [ %.sroa.411.1, %57 ] + %.sroa.0.050 = phi ptr [ %0, %.lr.ph ], [ %.sroa.0.1.ph3544, %57 ] %8 = getelementptr inbounds nuw i8, ptr %.sroa.0.050, i64 1 %9 = load i8, ptr %.sroa.0.050, align 1, !noalias !284, !noundef !4 %10 = icmp sgt i8 %9, -1 @@ -660,10 +660,9 @@ switch.lookup: %.sroa.4.0.i.ph36 = phi i32 [ %44, %34 ], [ %19, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit13.i" ], [ %32, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit15.i" ] %.sroa.0.1.ph35 = phi ptr [ %36, %34 ], [ %14, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit13.i" ], [ %25, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit15.i" ] %45 = ptrtoint ptr %.sroa.0.1.ph35 to i64 - %.neg = sub i64 %45, %6 - %46 = add i64 %.neg, %1 - %47 = icmp samesign ult i32 %.sroa.4.0.i.ph36, 128 - br i1 %47, label %51, label %.thread38 + %.reass = add i64 %.neg47, %45 + %46 = icmp samesign ult i32 %.sroa.4.0.i.ph36, 128 + br i1 %46, label %51, label %.thread38 .thread: ; preds = %34, %58, %switch.lookup ret void @@ -673,11 +672,11 @@ switch.lookup: %49 = icmp samesign ult i32 %.sroa.4.0.i.ph36, 65536 %. = select i1 %49, i64 -3, i64 -4 %.018.neg.ph = select i1 %48, i64 -2, i64 %. - %50 = add i64 %46, %.018.neg.ph + %50 = add i64 %.reass, %.018.neg.ph br label %55 51: ; preds = %.thread31.thread, %.thread31 - %52 = phi i64 [ %46, %.thread31 ], [ %23, %.thread31.thread ] + %52 = phi i64 [ %.reass, %.thread31 ], [ %23, %.thread31.thread ] %.sroa.0.1.ph3546 = phi ptr [ %.sroa.0.1.ph35, %.thread31 ], [ %8, %.thread31.thread ] %.sroa.4.0.i.ph3643 = phi i32 [ %.sroa.4.0.i.ph36, %.thread31 ], [ %21, %.thread31.thread ] %53 = add i64 %52, -1 @@ -685,23 +684,23 @@ switch.lookup: br i1 %54, label %58, label %55 55: ; preds = %.thread38, %51 - %.not48 = phi i1 [ %switch.masked, %.thread38 ], [ false, %51 ] - %56 = phi i64 [ %46, %.thread38 ], [ %52, %51 ] - %.sroa.0.1.ph3545 = phi ptr [ %.sroa.0.1.ph35, %.thread38 ], [ %.sroa.0.1.ph3546, %51 ] - %.sroa.4.0.i.ph3642 = phi i32 [ %.sroa.4.0.i.ph36, %.thread38 ], [ %.sroa.4.0.i.ph3643, %51 ] - %57 = phi i64 [ %50, %.thread38 ], [ %53, %51 ] + %.not48 = phi i1 [ %switch.masked, %.thread38 ], [ false, %50 ] + %56 = phi i64 [ %.reass, %.thread38 ], [ %52, %50 ] + %.sroa.0.1.ph3545 = phi ptr [ %.sroa.0.1.ph35, %.thread38 ], [ %.sroa.0.1.ph3546, %50 ] + %.sroa.4.0.i.ph3642 = phi i32 [ %.sroa.4.0.i.ph36, %.thread38 ], [ %.sroa.4.0.i.ph3643, %50 ] + %57 = phi i64 [ %50, %.thread38 ], [ %53, %50 ] %.20 = zext i1 %.not48 to i64 %.sroa.411.0. = select i1 %.not48, i8 19, i8 %.sroa.411.051 %.0..sroa.613.0 = select i1 %.not48, i32 %.sroa.613.052, i32 %.sroa.4.0.i.ph3642 br label %58 58: ; preds = %51, %55 - %59 = phi i64 [ %56, %55 ], [ %52, %51 ] - %.sroa.0.1.ph3544 = phi ptr [ %.sroa.0.1.ph3545, %55 ], [ %.sroa.0.1.ph3546, %51 ] - %60 = phi i64 [ %57, %55 ], [ %53, %51 ] - %.sroa.010.0 = phi i64 [ %.20, %55 ], [ 1, %51 ] - %.sroa.411.1 = phi i8 [ %.sroa.411.0., %55 ], [ 5, %51 ] - %.sroa.613.1 = phi i32 [ %.0..sroa.613.0, %55 ], [ %.sroa.613.052, %51 ] + %59 = phi i64 [ %56, %54 ], [ %52, %50 ] + %.sroa.0.1.ph3544 = phi ptr [ %.sroa.0.1.ph3545, %54 ], [ %.sroa.0.1.ph3546, %50 ] + %60 = phi i64 [ %57, %54 ], [ %53, %50 ] + %.sroa.010.0 = phi i64 [ %.20, %54 ], [ 1, %50 ] + %.sroa.411.1 = phi i8 [ %.sroa.411.0., %54 ], [ 5, %50 ] + %.sroa.613.1 = phi i32 [ %.0..sroa.613.0, %54 ], [ %.sroa.613.052, %50 ] %.sroa.613.0.insert.ext = zext i32 %.sroa.613.1 to i64 %.sroa.613.0.insert.shift = shl nuw i64 %.sroa.613.0.insert.ext, 32 %.sroa.411.0.insert.ext = zext i8 %.sroa.411.1 to i64 @@ -731,9 +730,9 @@ switch.lookup: br label %7 7: ; preds = %.lr.ph, %58 - %.sroa.613.052 = phi i32 [ undef, %.lr.ph ], [ %.sroa.613.1, %58 ] - %.sroa.411.051 = phi i8 [ undef, %.lr.ph ], [ %.sroa.411.1, %58 ] - %.sroa.0.050 = phi ptr [ %0, %.lr.ph ], [ %.sroa.0.1.ph3544, %58 ] + %.sroa.613.052 = phi i32 [ undef, %.lr.ph ], [ %.sroa.613.1, %57 ] + %.sroa.411.051 = phi i8 [ undef, %.lr.ph ], [ %.sroa.411.1, %57 ] + %.sroa.0.050 = phi ptr [ %0, %.lr.ph ], [ %.sroa.0.1.ph3544, %57 ] %8 = getelementptr inbounds nuw i8, ptr %.sroa.0.050, i64 1 %9 = load i8, ptr %.sroa.0.050, align 1, !noalias !287, !noundef !4 %10 = icmp sgt i8 %9, -1 @@ -792,10 +791,9 @@ switch.lookup: %.sroa.4.0.i.ph36 = phi i32 [ %44, %34 ], [ %19, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit13.i" ], [ %32, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit15.i" ] %.sroa.0.1.ph35 = phi ptr [ %36, %34 ], [ %14, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit13.i" ], [ %25, %"_ZN91_$LT$core..slice..iter..Iter$LT$T$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hb431706d4e78e158E.exit15.i" ] %45 = ptrtoint ptr %.sroa.0.1.ph35 to i64 - %.neg = sub i64 %45, %6 - %46 = add i64 %.neg, %1 - %47 = icmp samesign ult i32 %.sroa.4.0.i.ph36, 128 - br i1 %47, label %51, label %.thread38 + %.reass = add i64 %.neg47, %45 + %46 = icmp samesign ult i32 %.sroa.4.0.i.ph36, 128 + br i1 %46, label %51, label %.thread38 .thread: ; preds = %34, %58, %switch.lookup ret void @@ -805,11 +803,11 @@ switch.lookup: %49 = icmp samesign ult i32 %.sroa.4.0.i.ph36, 65536 %. = select i1 %49, i64 -3, i64 -4 %.018.neg.ph = select i1 %48, i64 -2, i64 %. - %50 = add i64 %46, %.018.neg.ph + %50 = add i64 %.reass, %.018.neg.ph br label %55 51: ; preds = %.thread31.thread, %.thread31 - %52 = phi i64 [ %46, %.thread31 ], [ %23, %.thread31.thread ] + %52 = phi i64 [ %.reass, %.thread31 ], [ %23, %.thread31.thread ] %.sroa.0.1.ph3546 = phi ptr [ %.sroa.0.1.ph35, %.thread31 ], [ %8, %.thread31.thread ] %.sroa.4.0.i.ph3643 = phi i32 [ %.sroa.4.0.i.ph36, %.thread31 ], [ %21, %.thread31.thread ] %53 = add i64 %52, -1 @@ -817,23 +815,23 @@ switch.lookup: br i1 %54, label %58, label %55 55: ; preds = %.thread38, %51 - %.not48 = phi i1 [ %switch.masked, %.thread38 ], [ false, %51 ] - %56 = phi i64 [ %46, %.thread38 ], [ %52, %51 ] - %.sroa.0.1.ph3545 = phi ptr [ %.sroa.0.1.ph35, %.thread38 ], [ %.sroa.0.1.ph3546, %51 ] - %.sroa.4.0.i.ph3642 = phi i32 [ %.sroa.4.0.i.ph36, %.thread38 ], [ %.sroa.4.0.i.ph3643, %51 ] - %57 = phi i64 [ %50, %.thread38 ], [ %53, %51 ] + %.not48 = phi i1 [ %switch.masked, %.thread38 ], [ false, %50 ] + %56 = phi i64 [ %.reass, %.thread38 ], [ %52, %50 ] + %.sroa.0.1.ph3545 = phi ptr [ %.sroa.0.1.ph35, %.thread38 ], [ %.sroa.0.1.ph3546, %50 ] + %.sroa.4.0.i.ph3642 = phi i32 [ %.sroa.4.0.i.ph36, %.thread38 ], [ %.sroa.4.0.i.ph3643, %50 ] + %57 = phi i64 [ %50, %.thread38 ], [ %53, %50 ] %.20 = zext i1 %.not48 to i64 %.sroa.411.0. = select i1 %.not48, i8 19, i8 %.sroa.411.051 %.0..sroa.613.0 = select i1 %.not48, i32 %.sroa.613.052, i32 %.sroa.4.0.i.ph3642 br label %58 58: ; preds = %51, %55 - %59 = phi i64 [ %56, %55 ], [ %52, %51 ] - %.sroa.0.1.ph3544 = phi ptr [ %.sroa.0.1.ph3545, %55 ], [ %.sroa.0.1.ph3546, %51 ] - %60 = phi i64 [ %57, %55 ], [ %53, %51 ] - %.sroa.010.0 = phi i64 [ %.20, %55 ], [ 1, %51 ] - %.sroa.411.1 = phi i8 [ %.sroa.411.0., %55 ], [ 5, %51 ] - %.sroa.613.1 = phi i32 [ %.0..sroa.613.0, %55 ], [ %.sroa.613.052, %51 ] + %59 = phi i64 [ %56, %54 ], [ %52, %50 ] + %.sroa.0.1.ph3544 = phi ptr [ %.sroa.0.1.ph3545, %54 ], [ %.sroa.0.1.ph3546, %50 ] + %60 = phi i64 [ %57, %54 ], [ %53, %50 ] + %.sroa.010.0 = phi i64 [ %.20, %54 ], [ 1, %50 ] + %.sroa.411.1 = phi i8 [ %.sroa.411.0., %54 ], [ 5, %50 ] + %.sroa.613.1 = phi i32 [ %.0..sroa.613.0, %54 ], [ %.sroa.613.052, %50 ] %.sroa.613.0.insert.ext = zext i32 %.sroa.613.1 to i64 %.sroa.613.0.insert.shift = shl nuw i64 %.sroa.613.0.insert.ext, 32 %.sroa.411.0.insert.ext = zext i8 %.sroa.411.1 to i64 diff --git a/bench/rustfmt-rs/optimized/3xcdaapyewyrfogi.ll b/bench/rustfmt-rs/optimized/3xcdaapyewyrfogi.ll index 358312aee7d..e8b50ff75e9 100644 --- a/bench/rustfmt-rs/optimized/3xcdaapyewyrfogi.ll +++ b/bench/rustfmt-rs/optimized/3xcdaapyewyrfogi.ll @@ -5107,6 +5107,7 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: %218 = getelementptr inbounds nuw i8, ptr %7, i64 24 %219 = load i64, ptr %218, align 8, !alias.scope !863, !noalias !870 %220 = sub i64 %210, %219 + %invariant.op = sub i64 1, %217 br label %221 221: ; preds = %.backedge.sink.split.i, %.lr.ph.i56 @@ -5128,7 +5129,7 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: .backedge.sink.split.i: ; preds = %265, %252, %232 %.sink.i = phi i64 [ %220, %252 ], [ 0, %232 ], [ 0, %265 ] - %.ph88.i = phi i64 [ %253, %252 ], [ %233, %232 ], [ %267, %265 ] + %.ph88.i = phi i64 [ %253, %252 ], [ %233, %232 ], [ %266, %265 ] %234 = add i64 %.ph88.i, %212 %.not35.i63 = icmp ult i64 %234, %206 br i1 %.not35.i63, label %221, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17he7c268187cb709a7E.exit" @@ -5198,9 +5199,8 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: unreachable 265: ; preds = %257 - %reass.sub = sub i64 %222, %217 - %266 = add i64 %reass.sub, 1 - %267 = add i64 %266, %.sroa.04.0.i59 + %.reass.reass = add i64 %222, %invariant.op + %266 = add i64 %.reass.reass, %.sroa.04.0.i59 br label %.backedge.sink.split.i 268: ; preds = %199 @@ -5220,37 +5220,38 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: %274 = load i64, ptr %273, align 8, !alias.scope !875, !noalias !882 %275 = add i64 %272, -1 %.first_iter = icmp ult i64 %275, %210 - br label %276 - -276: ; preds = %.backedge.i, %.lr.ph.i50 - %277 = phi i64 [ %.promoted.i47, %.lr.ph.i50 ], [ %288, %.backedge.i ] - %278 = phi i64 [ %269, %.lr.ph.i50 ], [ %289, %.backedge.i ] - %279 = getelementptr inbounds i8, ptr %204, i64 %278 - %280 = load i8, ptr %279, align 1, !alias.scope !878, !noalias !884, !noundef !10 - %281 = and i8 %280, 63 - %282 = zext nneg i8 %281 to i64 - %283 = shl nuw i64 1, %282 - %284 = and i64 %283, %271 - %285 = icmp eq i64 %284, 0 - br i1 %285, label %286, label %.preheader71 - -286: ; preds = %276 - %287 = add i64 %277, %210 + %invariant.op424 = sub i64 1, %271 + br label %275 + +275: ; preds = %.backedge.i, %.lr.ph.i50 + %278 = phi i64 [ %.promoted.i47, %.lr.ph.i50 ], [ %287, %.backedge.i ] + %277 = phi i64 [ %268, %.lr.ph.i50 ], [ %288, %.backedge.i ] + %278 = getelementptr inbounds i8, ptr %204, i64 %277 + %279 = load i8, ptr %278, align 1, !alias.scope !878, !noalias !884, !noundef !10 + %280 = and i8 %279, 63 + %281 = zext nneg i8 %280 to i64 + %282 = shl nuw i64 1, %281 + %283 = and i64 %282, %270 + %284 = icmp eq i64 %283, 0 + br i1 %284, label %285, label %.preheader71 + +285:; preds = %275 + %286 = add i64 %276, %210 br label %.backedge.i -.backedge.i: ; preds = %316, %303, %286 - %288 = phi i64 [ %287, %286 ], [ %318, %316 ], [ %304, %303 ] +.backedge.i: ; preds = %316, %303, %285 + %288 = phi i64 [ %286, %285 ], [ %316, %315 ], [ %304, %302 ] %289 = add i64 %288, %212 %.not35.i = icmp ult i64 %289, %206 - br i1 %.not35.i, label %276, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17he7c268187cb709a7E.exit" + br i1 %.not35.i, label %275, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17he7c268187cb709a7E.exit" -.preheader71: ; preds = %276, %308 - %.sroa.04.0.i = phi i64 [ %309, %308 ], [ %272, %276 ] +.preheader71: ; preds = %275, %308 + %.sroa.04.0.i = phi i64 [ %309, %307 ], [ %272, %275 ] %290 = icmp ult i64 %.sroa.04.0.i, %210 br i1 %290, label %305, label %.preheader .preheader: ; preds = %.preheader71, %297 - %.sroa.5.0.i = phi i64 [ %292, %297 ], [ %272, %.preheader71 ] + %.sroa.5.0.i = phi i64 [ %292, %296 ], [ %272, %.preheader71 ] %.not = icmp eq i64 %.sroa.5.0.i, 0 br i1 %.not, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17he7c268187cb709a7E.exit", label %291 @@ -5259,7 +5260,7 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: br i1 %.first_iter, label %293, label %296, !prof !815 293: ; preds = %291 - %294 = add i64 %292, %277 + %294 = add i64 %292, %276 %295 = icmp ult i64 %294, %206 br i1 %295, label %297, label %302, !prof !815 @@ -5280,11 +5281,11 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: unreachable 303: ; preds = %297 - %304 = add i64 %277, %274 + %304 = add i64 %276, %274 br label %.backedge.i 305: ; preds = %.preheader71 - %306 = add i64 %.sroa.04.0.i, %277 + %306 = add i64 %.sroa.04.0.i, %276 %307 = icmp ult i64 %306, %206 br i1 %307, label %308, label %314, !prof !815 @@ -5298,19 +5299,18 @@ _ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i: br i1 %.not.i51, label %.preheader71, label %316 314: ; preds = %305 - %315 = add i64 %277, %272 + %315 = add i64 %276, %272 %umax.i = tail call i64 @llvm.umax.i64(i64 %206, i64 %315) tail call void @_ZN4core9panicking18panic_bounds_check17h87898f2af235819bE(i64 noundef %umax.i, i64 noundef %206, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.87cf9f699931e7f72e5feaf785e04e8d.48) #52, !noalias !885 unreachable 316: ; preds = %308 - %reass.sub140 = sub i64 %277, %272 - %317 = add i64 %reass.sub140, 1 - %318 = add i64 %317, %.sroa.04.0.i + %.reass287.reass = add i64 %276, %invariant.op424 + %317 = add i64 %.reass287.reass, %.sroa.04.0.i br label %.backedge.i "_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17he7c268187cb709a7E.exit": ; preds = %_ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i, %.backedge.sink.split.i, %.preheader72, %.backedge.i, %.preheader, %268, %213, %.preheader.i45, %.thread23.i.i, %.thread.i.i - %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %.thread.i.i ], [ 0, %.preheader.i45 ], [ 0, %.thread23.i.i ], [ 1, %.preheader72 ], [ 0, %213 ], [ 0, %268 ], [ 0, %.backedge.sink.split.i ], [ 0, %.backedge.i ], [ 1, %_ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i ] + %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %.thread.i.i ], [ 0, %.preheader.i45 ], [ 0, %.thread23.i.i ], [ 1, %.preheader72 ], [ 0, %213 ], [ 0, %267 ], [ 0, %.backedge.sink.split.i ], [ 0, %.backedge.i ], [ 1, %_ZN4core3str11validations15next_code_point17h875c6555aba9a391E.exit.thread.i.i ] call void @llvm.lifetime.end.p0(ptr nonnull %7) br label %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h884929514755f779E.exit" } diff --git a/bench/sentencepiece/optimized/bpe_model_trainer.ll b/bench/sentencepiece/optimized/bpe_model_trainer.ll index fd016bb6871..55b8c5164ac 100644 --- a/bench/sentencepiece/optimized/bpe_model_trainer.ll +++ b/bench/sentencepiece/optimized/bpe_model_trainer.ll @@ -5829,7 +5829,7 @@ define linkonce_odr void @_ZN4absl13StringReplaceESt17basic_string_viewIcSt11cha br i1 %.not.i.i.us44.not, label %.thread, label %.lr.ph .lr.ph: ; preds = %.preheader.split.us, %37 - %.013.us45 = phi i64 [ %39, %37 ], [ 0, %.preheader.split.us ] + %.013.us45 = phi i64 [ %39, %38 ], [ 0, %.preheader.split.us ] %14 = sub nuw i64 %0, %.013.us45 %.not2531.i.i.us = icmp ult i64 %14, %2 br i1 %.not2531.i.i.us, label %.thread, label %.lr.ph.i.i.us @@ -5841,27 +5841,31 @@ define linkonce_odr void @_ZN4absl13StringReplaceESt17basic_string_viewIcSt11cha br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us: ; preds = %21, %.lr.ph.i.i.us - %.033.i.i.us = phi i64 [ %14, %.lr.ph.i.i.us ], [ %24, %21 ] - %.02132.i.i.us = phi ptr [ %15, %.lr.ph.i.i.us ], [ %22, %21 ] - %18 = add i64 %reass.sub.i, %.033.i.i.us - %19 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i.us, i32 noundef %17, i64 noundef %18) #24 - %.not26.i.i.us = icmp eq ptr %19, null + %.033.i.i.us = phi i64 [ %14, %.lr.ph.i.i.us ], [ %24, %22 ] + %.02132.i.i.us = phi ptr [ %15, %.lr.ph.i.i.us ], [ %22, %22 ] + %18 = add i64 %.033.i.i.us, %reass.sub.i + %19 = icmp eq i64 %18, 0 + br i1 %19, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us: ; preds = %18 + %20 = tail call ptr @memchr(ptr noundef %.02132.i.i.us, i32 noundef %17, i64 noundef %.reass.reass.i.reass.reass.i.reass.us) #24 + %.not26.i.i.us = icmp eq ptr %20, null br i1 %.not26.i.i.us, label %.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us - %bcmp.i.i.us = tail call i32 @bcmp(ptr nonnull %19, ptr nonnull %3, i64 %2) + %bcmp.i.i.us = tail call i32 @bcmp(ptr nonnull %20, ptr nonnull %3, i64 %2) %20 = icmp eq i32 %bcmp.i.i.us, 0 br i1 %20, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, label %21 21: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us - %22 = getelementptr inbounds nuw i8, ptr %19, i64 1 + %22 = getelementptr inbounds nuw i8, ptr %20, i64 1 %23 = ptrtoint ptr %22 to i64 %24 = sub i64 %11, %23 %.not25.i.i.us = icmp ult i64 %24, %2 br i1 %.not25.i.i.us, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us, !llvm.loop !253 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us - %25 = ptrtoint ptr %19 to i64 + %25 = ptrtoint ptr %20 to i64 %26 = sub i64 %25, %12 %27 = icmp eq i64 %26, -1 br i1 %27, label %.thread, label %28 @@ -5911,27 +5915,31 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.exit: ; preds br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %52, %.lr.ph.i.i - %.033.i.i = phi i64 [ %0, %.lr.ph.i.i ], [ %55, %52 ] - %.02132.i.i = phi ptr [ %1, %.lr.ph.i.i ], [ %53, %52 ] - %49 = add i64 %reass.sub.i, %.033.i.i - %50 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %48, i64 noundef %49) #24 - %.not26.i.i = icmp eq ptr %50, null + %.033.i.i = phi i64 [ %0, %.lr.ph.i.i ], [ %55, %54 ] + %.02132.i.i = phi ptr [ %1, %.lr.ph.i.i ], [ %53, %54 ] + %49 = add i64 %.033.i.i, %reass.sub.i + %51 = icmp eq i64 %49, 0 + br i1 %51, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %50 + %52 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %49, i64 noundef %.reass.reass.i.reass.reass.i.reass) #24 + %.not26.i.i = icmp eq ptr %52, null br i1 %.not26.i.i, label %.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %50, ptr nonnull %3, i64 %2) + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %52, ptr nonnull %3, i64 %2) %51 = icmp eq i32 %bcmp.i.i, 0 br i1 %51, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %52 52: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %53 = getelementptr inbounds nuw i8, ptr %50, i64 1 + %53 = getelementptr inbounds nuw i8, ptr %52, i64 1 %54 = ptrtoint ptr %53 to i64 %55 = sub i64 %11, %54 %.not25.i.i = icmp ult i64 %55, %2 br i1 %.not25.i.i, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !253 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %56 = ptrtoint ptr %50 to i64 + %56 = ptrtoint ptr %52 to i64 %57 = sub i64 %56, %12 %58 = icmp eq i64 %57, -1 br i1 %58, label %.thread, label %59 @@ -5962,8 +5970,8 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.exit16: ; pred %69 = add i64 %57, %2 br label %.thread -.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %52, %37, %.lr.ph, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, %21, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us, %.preheader.split.us, %67, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %.preheader.split - %.135 = phi i64 [ 0, %.preheader.split.us ], [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ %69, %67 ], [ %.013.us45, %21 ], [ 0, %.preheader.split ], [ %39, %37 ], [ %.013.us45, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us ], [ %.013.us45, %.lr.ph ], [ %.013.us45, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us ], [ 0, %52 ], [ 0, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +.thread: ; preds = %50, %54, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %37, %.lr.ph, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, %21, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us, %18, %.preheader.split.us, %67, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %.preheader.split + %.135 = phi i64 [ 0, %.preheader.split ], [ %40, %38 ], [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ %71, %69 ], [ 0, %.preheader.split.us ], [ %.013.us44, %22 ], [ %.013.us44, %18 ], [ %.013.us45, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us ], [ %.013.us45, %.lr.ph ], [ %.013.us45, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us ], [ 0, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ 0, %54 ], [ 0, %50 ] %70 = sub i64 %0, %.135 %71 = load i64, ptr %13, align 8, !tbaa !160 %72 = sub i64 4611686018427387903, %71 diff --git a/bench/sentencepiece/optimized/builder.ll b/bench/sentencepiece/optimized/builder.ll index ede63d6790a..1a092f33f32 100644 --- a/bench/sentencepiece/optimized/builder.ll +++ b/bench/sentencepiece/optimized/builder.ll @@ -18060,7 +18060,7 @@ define linkonce_odr void @_ZN4absl13StringReplaceESt17basic_string_viewIcSt11cha br i1 %.not.i.i.us44.not, label %.thread, label %.lr.ph .lr.ph: ; preds = %.preheader.split.us, %37 - %.013.us45 = phi i64 [ %39, %37 ], [ 0, %.preheader.split.us ] + %.013.us45 = phi i64 [ %39, %38 ], [ 0, %.preheader.split.us ] %14 = sub nuw i64 %0, %.013.us45 %.not2531.i.i.us = icmp ult i64 %14, %2 br i1 %.not2531.i.i.us, label %.thread, label %.lr.ph.i.i.us @@ -18072,27 +18072,31 @@ define linkonce_odr void @_ZN4absl13StringReplaceESt17basic_string_viewIcSt11cha br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us: ; preds = %21, %.lr.ph.i.i.us - %.033.i.i.us = phi i64 [ %14, %.lr.ph.i.i.us ], [ %24, %21 ] - %.02132.i.i.us = phi ptr [ %15, %.lr.ph.i.i.us ], [ %22, %21 ] - %18 = add i64 %reass.sub.i, %.033.i.i.us - %19 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i.us, i32 noundef %17, i64 noundef %18) #26 - %.not26.i.i.us = icmp eq ptr %19, null + %.033.i.i.us = phi i64 [ %14, %.lr.ph.i.i.us ], [ %24, %22 ] + %.02132.i.i.us = phi ptr [ %15, %.lr.ph.i.i.us ], [ %22, %22 ] + %18 = add i64 %.033.i.i.us, %reass.sub.i + %19 = icmp eq i64 %18, 0 + br i1 %19, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us: ; preds = %18 + %20 = tail call ptr @memchr(ptr noundef %.02132.i.i.us, i32 noundef %17, i64 noundef %.reass.reass.i.reass.reass.i.reass.us) #26 + %.not26.i.i.us = icmp eq ptr %20, null br i1 %.not26.i.i.us, label %.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us - %bcmp.i.i.us = tail call i32 @bcmp(ptr nonnull %19, ptr nonnull %3, i64 %2) + %bcmp.i.i.us = tail call i32 @bcmp(ptr nonnull %20, ptr nonnull %3, i64 %2) %20 = icmp eq i32 %bcmp.i.i.us, 0 br i1 %20, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, label %21 21: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us - %22 = getelementptr inbounds nuw i8, ptr %19, i64 1 + %22 = getelementptr inbounds nuw i8, ptr %20, i64 1 %23 = ptrtoint ptr %22 to i64 %24 = sub i64 %11, %23 %.not25.i.i.us = icmp ult i64 %24, %2 br i1 %.not25.i.i.us, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us, !llvm.loop !395 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.us - %25 = ptrtoint ptr %19 to i64 + %25 = ptrtoint ptr %20 to i64 %26 = sub i64 %25, %12 %27 = icmp eq i64 %26, -1 br i1 %27, label %.thread, label %28 @@ -18142,27 +18146,31 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.exit: ; preds br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %52, %.lr.ph.i.i - %.033.i.i = phi i64 [ %0, %.lr.ph.i.i ], [ %55, %52 ] - %.02132.i.i = phi ptr [ %1, %.lr.ph.i.i ], [ %53, %52 ] - %49 = add i64 %reass.sub.i, %.033.i.i - %50 = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02132.i.i, i32 noundef %48, i64 noundef %49) #26 - %.not26.i.i = icmp eq ptr %50, null + %.033.i.i = phi i64 [ %0, %.lr.ph.i.i ], [ %55, %54 ] + %.02132.i.i = phi ptr [ %1, %.lr.ph.i.i ], [ %53, %54 ] + %49 = add i64 %.033.i.i, %reass.sub.i + %51 = icmp eq i64 %49, 0 + br i1 %51, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %50 + %52 = tail call ptr @memchr(ptr noundef %.02132.i.i, i32 noundef %49, i64 noundef %.reass.reass.i.reass.reass.i.reass) #26 + %.not26.i.i = icmp eq ptr %52, null br i1 %.not26.i.i, label %.thread, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %50, ptr nonnull %3, i64 %2) + %bcmp.i.i = tail call i32 @bcmp(ptr nonnull %52, ptr nonnull %3, i64 %2) %51 = icmp eq i32 %bcmp.i.i, 0 br i1 %51, label %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, label %52 52: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %53 = getelementptr inbounds nuw i8, ptr %50, i64 1 + %53 = getelementptr inbounds nuw i8, ptr %52, i64 1 %54 = ptrtoint ptr %53 to i64 %55 = sub i64 %11, %54 %.not25.i.i = icmp ult i64 %55, %2 br i1 %.not25.i.i, label %.thread, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !395 _ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %56 = ptrtoint ptr %50 to i64 + %56 = ptrtoint ptr %52 to i64 %57 = sub i64 %56, %12 %58 = icmp eq i64 %57, -1 br i1 %58, label %.thread, label %59 @@ -18193,8 +18201,8 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6appendEPKcm.exit16: ; pred %69 = add i64 %57, %2 br label %.thread -.thread: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %52, %37, %.lr.ph, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, %21, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us, %.preheader.split.us, %67, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %.preheader.split - %.135 = phi i64 [ 0, %.preheader.split.us ], [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ %69, %67 ], [ %.013.us45, %21 ], [ 0, %.preheader.split ], [ %39, %37 ], [ %.013.us45, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us ], [ %.013.us45, %.lr.ph ], [ %.013.us45, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us ], [ 0, %52 ], [ 0, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +.thread: ; preds = %50, %54, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %37, %.lr.ph, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us, %21, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us, %18, %.preheader.split.us, %67, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit, %.preheader.split + %.135 = phi i64 [ 0, %.preheader.split ], [ %40, %38 ], [ 0, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit ], [ %71, %69 ], [ 0, %.preheader.split.us ], [ %.013.us44, %22 ], [ %.013.us44, %18 ], [ %.013.us45, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.us ], [ %.013.us45, %.lr.ph ], [ %.013.us45, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.us ], [ 0, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ 0, %54 ], [ 0, %50 ] %70 = sub i64 %0, %.135 %71 = load i64, ptr %13, align 8, !tbaa !37 %72 = sub i64 4611686018427387903, %71 diff --git a/bench/slurm/optimized/gres_sock_list.ll b/bench/slurm/optimized/gres_sock_list.ll index e2de87d8f8c..9246538b7ad 100644 --- a/bench/slurm/optimized/gres_sock_list.ll +++ b/bench/slurm/optimized/gres_sock_list.ll @@ -1853,10 +1853,11 @@ define internal noundef i32 @_foreach_restricted_gpu(ptr noundef readonly captur %68 = mul nuw nsw i64 %indvars.iv.next99.i, %52 %69 = mul nuw nsw i64 %indvars.iv98.i, %52 %70 = trunc nuw nsw i64 %69 to i32 + %invariant.op = sub i32 1, %70 br label %71 71: ; preds = %95, %.lr.ph.us.us.us.us.us.i - %.04757.us.us.us.us.us.i = phi i32 [ 0, %.lr.ph.us.us.us.us.us.i ], [ %96, %95 ] + %.04757.us.us.us.us.us.i = phi i32 [ 0, %.lr.ph.us.us.us.us.us.i ], [ %.reass.i.reass.reass.reass, %95 ] %72 = add nsw i32 %.04757.us.us.us.us.us.i, %70 %73 = load ptr, ptr %43, align 8 %74 = getelementptr inbounds nuw ptr, ptr %73, i64 %indvars.iv104.i @@ -1918,29 +1919,28 @@ _pick_core_group.exit.us60.us.us.us.us.i: ; preds = %_pick_core_group.ex 93: ; preds = %_pick_core_group.exit.us60.us.us.us.us.i %94 = load i32, ptr %53, align 4 - br label %98 - -95: ; preds = %98 - %reass.sub88.i = sub i32 %94, %70 - %96 = add i32 %reass.sub88.i, 1 - %97 = icmp slt i32 %96, %47 - br i1 %97, label %71, label %.critedge.us.us.us.us.us.i, !llvm.loop !32 - -98: ; preds = %98, %93 - %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %98 ], [ 0, %93 ] - %99 = getelementptr inbounds nuw i32, ptr %27, i64 %indvars.iv.i - %100 = load i32, ptr %99, align 4 - %101 = sext i32 %100 to i64 - tail call void @slurm_bit_set(ptr noundef %15, i64 noundef %101) #5 - %102 = load ptr, ptr %28, align 8 - %103 = getelementptr inbounds nuw ptr, ptr %102, i64 %39 - %104 = load ptr, ptr %103, align 8 - %105 = load i32, ptr %99, align 4 - %106 = sext i32 %105 to i64 - tail call void @slurm_bit_set(ptr noundef %104, i64 noundef %106) #5 + br label %97 + +95: ; preds = %97 + %.reass.i.reass.reass.reass = add i32 %94, %invariant.op + %96 = icmp slt i32 %.reass.i.reass.reass.reass, %47 + br i1 %96, label %71, label %.critedge.us.us.us.us.us.i, !llvm.loop !32 + +97: ; preds = %97, %93 + %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %97 ], [ 0, %93 ] + %98 = getelementptr inbounds nuw i32, ptr %27, i64 %indvars.iv.i + %99 = load i32, ptr %98, align 4 + %100 = sext i32 %99 to i64 + tail call void @slurm_bit_set(ptr noundef %15, i64 noundef %100) #5 + %101 = load ptr, ptr %28, align 8 + %102 = getelementptr inbounds nuw ptr, ptr %101, i64 %39 + %103 = load ptr, ptr %102, align 8 + %104 = load i32, ptr %98, align 4 + %105 = sext i32 %104 to i64 + tail call void @slurm_bit_set(ptr noundef %103, i64 noundef %105) #5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %26 - br i1 %exitcond.not.i, label %95, label %98, !llvm.loop !33 + br i1 %exitcond.not.i, label %95, label %97, !llvm.loop !33 .lr.ph.split.us.split.us.split.split.us.i: ; preds = %.lr.ph.split.us.split.us.i %107 = getelementptr inbounds nuw i32, ptr %27, i64 %51 @@ -1976,7 +1976,7 @@ _pick_core_group.exit.us60.us.us.us.us.i: ; preds = %_pick_core_group.ex br label %..loopexit_crit_edge.split.us.split.split.us.us.us.us.i ..loopexit_crit_edge.split.us.split.split.us.us.us.us.i: ; preds = %..loopexit_crit_edge.split.us.split.split.us.us.us.us.loopexit.i, %115, %108 - %120 = phi i16 [ %.pre127.i, %..loopexit_crit_edge.split.us.split.split.us.us.us.us.loopexit.i ], [ %109, %115 ], [ %109, %108 ] + %120 = phi i16 [ %.pre127.i, %..loopexit_crit_edge.split.us.split.split.us.us.us.us.loopexit.i ], [ %109, %114 ], [ %109, %107 ] %indvars.iv.next120.i = add nuw nsw i64 %indvars.iv119.i, 1 %121 = zext i16 %120 to i64 %122 = icmp samesign ult i64 %indvars.iv.next120.i, %121 @@ -1985,33 +1985,33 @@ _pick_core_group.exit.us60.us.us.us.us.i: ; preds = %_pick_core_group.ex .lr.ph.us.us65.us.us.us.i: ; preds = %.lr.ph.us.us65.us.us.us.i.preheader, %..critedge_crit_edge.split.us.us.us.us.us.us.i %.04958.us.us66.us.us.us.i = phi i32 [ %137, %..critedge_crit_edge.split.us.us.us.us.us.us.i ], [ 0, %.lr.ph.us.us65.us.us.us.i.preheader ] %123 = mul nuw i32 %.04958.us.us66.us.us.us.i, %47 + %invariant.op40 = sub i32 1, %122 br label %_pick_core_group.exit.us.us.us.us.us.us.i _pick_core_group.exit.us.us.us.us.us.us.i: ; preds = %125, %.lr.ph.us.us65.us.us.us.i %124 = load i32, ptr %107, align 4 - br label %128 - -125: ; preds = %128 - %reass.sub = sub i32 %124, %123 - %126 = add i32 %reass.sub, 1 - %127 = icmp slt i32 %126, %47 - br i1 %127, label %_pick_core_group.exit.us.us.us.us.us.us.i, label %..critedge_crit_edge.split.us.us.us.us.us.us.i, !llvm.loop !32 - -128: ; preds = %128, %_pick_core_group.exit.us.us.us.us.us.us.i - %indvars.iv112.i = phi i64 [ %indvars.iv.next113.i, %128 ], [ 0, %_pick_core_group.exit.us.us.us.us.us.us.i ] - %129 = getelementptr inbounds nuw i32, ptr %27, i64 %indvars.iv112.i - %130 = load i32, ptr %129, align 4 - %131 = sext i32 %130 to i64 - tail call void @slurm_bit_set(ptr noundef %15, i64 noundef %131) #5 - %132 = load ptr, ptr %28, align 8 - %133 = getelementptr inbounds nuw ptr, ptr %132, i64 %39 - %134 = load ptr, ptr %133, align 8 - %135 = load i32, ptr %129, align 4 - %136 = sext i32 %135 to i64 - tail call void @slurm_bit_set(ptr noundef %134, i64 noundef %136) #5 + br label %126 + +125: ; preds = %126 + %.reass136.i.reass.reass = add i32 %124, %invariant.op40 + %125 = icmp slt i32 %.reass136.i.reass.reass, %47 + br i1 %125, label %_pick_core_group.exit.us.us.us.us.us.us.i, label %..critedge_crit_edge.split.us.us.us.us.us.us.i, !llvm.loop !32 + +126: ; preds = %126, %_pick_core_group.exit.us.us.us.us.us.us.i + %indvars.iv112.i = phi i64 [ %indvars.iv.next113.i, %126 ], [ 0, %_pick_core_group.exit.us.us.us.us.us.us.i ] + %127 = getelementptr inbounds nuw i32, ptr %27, i64 %indvars.iv112.i + %128 = load i32, ptr %127, align 4 + %129 = sext i32 %128 to i64 + tail call void @slurm_bit_set(ptr noundef %15, i64 noundef %129) #5 + %130 = load ptr, ptr %28, align 8 + %131 = getelementptr inbounds nuw ptr, ptr %130, i64 %39 + %132 = load ptr, ptr %131, align 8 + %134 = load i32, ptr %127, align 4 + %134 = sext i32 %133 to i64 + tail call void @slurm_bit_set(ptr noundef %132, i64 noundef %134) #5 %indvars.iv.next113.i = add nuw nsw i64 %indvars.iv112.i, 1 %exitcond117.not.i = icmp eq i64 %indvars.iv.next113.i, %26 - br i1 %exitcond117.not.i, label %125, label %128, !llvm.loop !33 + br i1 %exitcond117.not.i, label %125, label %126, !llvm.loop !33 ..critedge_crit_edge.split.us.us.us.us.us.us.i: ; preds = %125 %137 = add nuw nsw i32 %.04958.us.us66.us.us.us.i, 1 diff --git a/bench/stockfish/optimized/thread.ll b/bench/stockfish/optimized/thread.ll index 7c1da7c164f..23d9d044f4c 100644 --- a/bench/stockfish/optimized/thread.ll +++ b/bench/stockfish/optimized/thread.ll @@ -1775,8 +1775,12 @@ _ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairI %.not = icmp eq ptr %50, %43 br i1 %.not, label %.lr.ph96, label %.lr.ph -.lr.ph96: ; preds = %.lr.ph, %.lr.ph96 - %.sroa.070.095 = phi ptr [ %63, %.lr.ph96 ], [ %42, %.lr.ph ] +.lr.ph96: ; preds = %.lr.ph + %invariant.op = sub i32 14, %.sroa.speculated84 + br label %.lr.ph96 + +.lr.ph96: ; preds = %.lr.ph96.preheader, %.lr.ph96 + %.sroa.070.095 = phi ptr [ %62, %.lr.ph96 ], [ %42, %.lr.ph96.preheader ] %51 = load ptr, ptr %.sroa.070.095, align 8 %52 = getelementptr i8, ptr %51, i64 8 %.val56 = load ptr, ptr %52, align 8 @@ -1785,18 +1789,17 @@ _ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairI %54 = getelementptr i8, ptr %.val56, i64 9582684 %.val56.val62 = load i32, ptr %54, align 4 %.val56.val.val = load i32, ptr %.val56.val, align 8 - %reass.sub = sub i32 %.val56.val.val, %.sroa.speculated84 - %55 = add i32 %reass.sub, 14 - %56 = mul nsw i32 %55, %.val56.val62 - %57 = sext i32 %56 to i64 - %58 = getelementptr inbounds nuw i8, ptr %.val56.val, i64 32 - %59 = load ptr, ptr %58, align 8 - %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail9_Map_baseIN9Stockfish4MoveESt4pairIKS2_lESaIS5_ENS_10_Select1stESt8equal_toIS2_ENS2_8MoveHashENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb1ELb0ELb1EEELb1EEixERS4_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 2 dereferenceable(2) %59) - %61 = load i64, ptr %60, align 8 - %62 = add nsw i64 %61, %57 - store i64 %62, ptr %60, align 8 - %63 = getelementptr inbounds nuw i8, ptr %.sroa.070.095, i64 8 - %.not89 = icmp eq ptr %63, %43 + %.reass.reass = add i32 %.val56.val.val, %invariant.op + %55 = mul nsw i32 %.reass.reass, %.val56.val62 + %56 = sext i32 %55 to i64 + %57 = getelementptr inbounds nuw i8, ptr %.val56.val, i64 32 + %58 = load ptr, ptr %57, align 8 + %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail9_Map_baseIN9Stockfish4MoveESt4pairIKS2_lESaIS5_ENS_10_Select1stESt8equal_toIS2_ENS2_8MoveHashENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb1ELb0ELb1EEELb1EEixERS4_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 2 dereferenceable(2) %58) + %60 = load i64, ptr %59, align 8 + %61 = add nsw i64 %60, %56 + store i64 %61, ptr %59, align 8 + %62 = getelementptr inbounds nuw i8, ptr %.sroa.070.095, i64 8 + %.not89 = icmp eq ptr %62, %43 br i1 %.not89, label %._crit_edge, label %.lr.ph96 ._crit_edge: ; preds = %.lr.ph96 @@ -1805,113 +1808,116 @@ _ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairI %.not9097 = icmp eq ptr %.pre, %.pre106 br i1 %.not9097, label %._crit_edge102, label %.lr.ph101 -.lr.ph101: ; preds = %._crit_edge, %128 - %.099 = phi ptr [ %.1, %128 ], [ %5, %._crit_edge ] - %.sroa.066.098 = phi ptr [ %129, %128 ], [ %.pre, %._crit_edge ] - %64 = load ptr, ptr %.sroa.066.098, align 8 - %65 = getelementptr inbounds nuw i8, ptr %.099, i64 8 - %66 = load ptr, ptr %65, align 8 - %67 = getelementptr inbounds nuw i8, ptr %66, i64 9582656 - %68 = load ptr, ptr %67, align 8 - %69 = load i32, ptr %68, align 8 - %70 = getelementptr inbounds nuw i8, ptr %64, i64 8 +.lr.ph101: ; preds = %._crit_edge + %invariant.op129 = sub i32 14, %.sroa.speculated84 + %invariant.op130 = sub i32 14, %.sroa.speculated84 + br label %.lr.ph101 + +.lr.ph101:; preds = %.lr.ph101.preheader, %125 + %.099 = phi ptr [ %.1, %125 ], [ %5, %.lr.ph101.preheader ] + %.sroa.066.098 = phi ptr [ %126, %125 ], [ %.pre, %.lr.ph101.preheader ] + %69 = load ptr, ptr %.sroa.066.098, align 8 + %70 = getelementptr inbounds nuw i8, ptr %.099, i64 8 %71 = load ptr, ptr %70, align 8 %72 = getelementptr inbounds nuw i8, ptr %71, i64 9582656 %73 = load ptr, ptr %72, align 8 %74 = load i32, ptr %73, align 8 - %75 = getelementptr inbounds nuw i8, ptr %68, i64 32 - %76 = getelementptr inbounds nuw i8, ptr %73, i64 32 - %77 = load ptr, ptr %75, align 8 - %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail9_Map_baseIN9Stockfish4MoveESt4pairIKS2_lESaIS5_ENS_10_Select1stESt8equal_toIS2_ENS2_8MoveHashENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb1ELb0ELb1EEELb1EEixERS4_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 2 dereferenceable(2) %77) - %79 = load i64, ptr %78, align 8 - %80 = load ptr, ptr %76, align 8 - %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail9_Map_baseIN9Stockfish4MoveESt4pairIKS2_lESaIS5_ENS_10_Select1stESt8equal_toIS2_ENS2_8MoveHashENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb1ELb0ELb1EEELb1EEixERS4_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 2 dereferenceable(2) %80) - %82 = load i64, ptr %81, align 8 - %83 = icmp sgt i32 %69, 31506 - %84 = icmp sgt i32 %74, 31506 - %85 = icmp ne i32 %74, -32001 - %86 = icmp slt i32 %74, -31506 - %87 = and i1 %85, %86 - %.val58 = load ptr, ptr %70, align 8 - %88 = getelementptr i8, ptr %.val58, i64 9582656 - %.val58.val = load ptr, ptr %88, align 8 - %89 = getelementptr i8, ptr %.val58, i64 9582684 - %.val58.val61 = load i32, ptr %89, align 4 + %75 = getelementptr inbounds nuw i8, ptr %63, i64 8 + %70 = load ptr, ptr %75, align 8 + %71 = getelementptr inbounds nuw i8, ptr %70, i64 9582656 + %72 = load ptr, ptr %71, align 8 + %79 = load i32, ptr %72, align 8 + %74 = getelementptr inbounds nuw i8, ptr %67, i64 32 + %75 = getelementptr inbounds nuw i8, ptr %72, i64 32 + %82 = load ptr, ptr %74, align 8 + %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail9_Map_baseIN9Stockfish4MoveESt4pairIKS2_lESaIS5_ENS_10_Select1stESt8equal_toIS2_ENS2_8MoveHashENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb1ELb0ELb1EEELb1EEixERS4_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 2 dereferenceable(2) %76) + %78 = load i64, ptr %77, align 8 + %79 = load ptr, ptr %75, align 8 + %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail9_Map_baseIN9Stockfish4MoveESt4pairIKS2_lESaIS5_ENS_10_Select1stESt8equal_toIS2_ENS2_8MoveHashENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb1ELb0ELb1EEELb1EEixERS4_(ptr noundef nonnull align 8 dereferenceable(56) %2, ptr noundef nonnull align 2 dereferenceable(2) %79) + %81 = load i64, ptr %80, align 8 + %82 = icmp sgt i32 %74, 31506 + %83 = icmp sgt i32 %73, 31506 + %84 = icmp ne i32 %73, -32001 + %85 = icmp slt i32 %73, -31506 + %86 = and i1 %84, %85 + %.val58 = load ptr, ptr %69, align 8 + %87 = getelementptr i8, ptr %.val58, i64 9582656 + %.val58.val = load ptr, ptr %87, align 8 + %88 = getelementptr i8, ptr %.val58, i64 9582684 + %.val58.val61 = load i32, ptr %88, align 4 %.val58.val.val = load i32, ptr %.val58.val, align 8 - %reass.sub104 = sub i32 %.val58.val.val, %.sroa.speculated84 - %90 = add i32 %reass.sub104, 14 - %91 = mul nsw i32 %90, %.val58.val61 - %92 = getelementptr inbounds nuw i8, ptr %73, i64 40 - %93 = load ptr, ptr %92, align 8 - %94 = load ptr, ptr %76, align 8 + %.reass124.reass = add i32 %.val58.val.val, %invariant.op129 + %89 = mul nsw i32 %.reass124.reass, %.val58.val61 + %90 = getelementptr inbounds nuw i8, ptr %72, i64 40 + %91 = load ptr, ptr %90, align 8 + %93 = load ptr, ptr %75, align 8 + %93 = ptrtoint ptr %91 to i64 %95 = ptrtoint ptr %93 to i64 - %96 = ptrtoint ptr %94 to i64 - %97 = sub i64 %95, %96 - %98 = icmp ugt i64 %97, 4 - %99 = select i1 %98, i32 %91, i32 0 - %.0.val = load ptr, ptr %65, align 8 - %100 = getelementptr i8, ptr %.0.val, i64 9582656 - %.0.val.val = load ptr, ptr %100, align 8 - %101 = getelementptr i8, ptr %.0.val, i64 9582684 - %.0.val.val60 = load i32, ptr %101, align 4 + %95 = sub i64 %93, %94 + %96 = icmp ugt i64 %95, 4 + %97 = select i1 %96, i32 %89, i32 0 + %.0.val = load ptr, ptr %64, align 8 + %98 = getelementptr i8, ptr %.0.val, i64 9582656 + %.0.val.val = load ptr, ptr %98, align 8 + %99 = getelementptr i8, ptr %.0.val, i64 9582684 + %.0.val.val60 = load i32, ptr %99, align 4 %.0.val.val.val = load i32, ptr %.0.val.val, align 8 - %reass.sub105 = sub i32 %.0.val.val.val, %.sroa.speculated84 - %102 = add i32 %reass.sub105, 14 - %103 = mul nsw i32 %102, %.0.val.val60 - %104 = getelementptr inbounds nuw i8, ptr %68, i64 40 - %105 = load ptr, ptr %104, align 8 - %106 = load ptr, ptr %75, align 8 + %.reass126.reass = add i32 %.0.val.val.val, %invariant.op130 + %100 = mul nsw i32 %.reass126.reass, %.0.val.val60 + %101 = getelementptr inbounds nuw i8, ptr %67, i64 40 + %102 = load ptr, ptr %101, align 8 + %105 = load ptr, ptr %74, align 8 + %104 = ptrtoint ptr %102 to i64 %107 = ptrtoint ptr %105 to i64 - %108 = ptrtoint ptr %106 to i64 - %109 = sub i64 %107, %108 - %110 = icmp ugt i64 %109, 4 - %111 = select i1 %110, i32 %103, i32 0 - %112 = icmp sgt i32 %99, %111 - br i1 %83, label %113, label %115 - -113: ; preds = %.lr.ph101 - %114 = icmp sgt i32 %74, %69 - %spec.select = select i1 %114, ptr %64, ptr %.099 - br label %128 - -115: ; preds = %.lr.ph101 - %116 = icmp ne i32 %69, -32001 - %117 = icmp slt i32 %69, -31506 - %118 = and i1 %116, %117 - br i1 %118, label %119, label %121 - -119: ; preds = %115 - %120 = icmp slt i32 %74, %69 - %or.cond53 = select i1 %87, i1 %120, i1 false - %spec.select55 = select i1 %or.cond53, ptr %64, ptr %.099 - br label %128 - -121: ; preds = %115 - %or.cond = or i1 %84, %87 - br i1 %or.cond, label %127, label %122 - -122: ; preds = %121 - %123 = icmp sgt i32 %74, -31507 - br i1 %123, label %124, label %128 - -124: ; preds = %122 - %125 = icmp sgt i64 %82, %79 - %126 = icmp eq i64 %82, %79 - %or.cond3 = and i1 %126, %112 - %or.cond54 = or i1 %125, %or.cond3 - br i1 %or.cond54, label %127, label %128 - -127: ; preds = %124, %121 - br label %128 - -128: ; preds = %119, %113, %124, %122, %127 - %.1 = phi ptr [ %.099, %122 ], [ %.099, %124 ], [ %64, %127 ], [ %spec.select, %113 ], [ %spec.select55, %119 ] - %129 = getelementptr inbounds nuw i8, ptr %.sroa.066.098, i64 8 - %.not90 = icmp eq ptr %129, %.pre106 + %106 = sub i64 %104, %105 + %107 = icmp ugt i64 %106, 4 + %108 = select i1 %107, i32 %100, i32 0 + %109 = icmp sgt i32 %97, %108 + br i1 %82, label %110, label %112 + +110: ; preds = %.lr.ph101 + %111 = icmp sgt i32 %73, %68 + %spec.select = select i1 %111, ptr %63, ptr %.099 + br label %125 + +112: ; preds = %.lr.ph101 + %113 = icmp ne i32 %68, -32001 + %116 = icmp slt i32 %68, -31506 + %115 = and i1 %113, %116 + br i1 %115, label %116, label %118 + +116: ; preds = %112 + %117 = icmp slt i32 %73, %68 + %or.cond53 = select i1 %86, i1 %117, i1 false + %or.cond53 = select i1 %or.cond53, ptr %63, ptr %.099 + br label %125 + +118: ; preds = %112 + %or.cond = or i1 %83, %86 + br i1 %or.cond, label %124, label %119 + +119: ; preds = %118 + %120 = icmp sgt i32 %73, -31507 + br i1 %120, label %121, label %125 + +121: ; preds = %119 + %122 = icmp sgt i64 %81, %78 + %125 = icmp eq i64 %81, %78 + %or.cond3 = and i1 %123, %109 + %or.cond54 = or i1 %122, %or.cond3 + br i1 %or.cond54, label %124, label %125 + +124: ; preds = %121, %118 + br label %125 + +125: ; preds = %116, %110, %121, %119, %124 + %.1 = phi ptr [ %.099, %119 ], [ %.099, %121 ], [ %63, %124 ], [ %spec.select, %110 ], [ %or.cond53, %116 ] + %126 = getelementptr inbounds nuw i8, ptr %.sroa.066.098, i64 8 + %.not90 = icmp eq ptr %126, %.pre106 br i1 %.not90, label %._crit_edge102, label %.lr.ph101 -._crit_edge102: ; preds = %128, %_ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairIKS1_lEEEC2EmRKS2_RKS4_RKS8_.exit, %._crit_edge - %.0.lcssa = phi ptr [ %5, %._crit_edge ], [ %5, %_ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairIKS1_lEEEC2EmRKS2_RKS4_RKS8_.exit ], [ %.1, %128 ] +._crit_edge102: ; preds = %125, %_ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairIKS1_lEEEC2EmRKS2_RKS4_RKS8_.exit, %._crit_edge + %.0.lcssa = phi ptr [ %5, %._crit_edge ], [ %5, %_ZNSt13unordered_mapIN9Stockfish4MoveElNS1_8MoveHashESt8equal_toIS1_ESaISt4pairIKS1_lEEEC2EmRKS2_RKS4_RKS8_.exit ], [ %.1, %125 ] %130 = load ptr, ptr %25, align 8 %.not5.i.i.i.i = icmp eq ptr %130, null br i1 %.not5.i.i.i.i, label %_ZNSt10_HashtableIN9Stockfish4MoveESt4pairIKS1_lESaIS4_ENSt8__detail10_Select1stESt8equal_toIS1_ENS1_8MoveHashENS6_18_Mod_range_hashingENS6_20_Default_ranged_hashENS6_20_Prime_rehash_policyENS6_17_Hashtable_traitsILb1ELb0ELb1EEEE5clearEv.exit.i.i, label %.lr.ph.i.i.i.i diff --git a/bench/tev/optimized/Image.ll b/bench/tev/optimized/Image.ll index f82058860f3..d4e43f223b6 100644 --- a/bench/tev/optimized/Image.ll +++ b/bench/tev/optimized/Image.ll @@ -50043,6 +50043,7 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEE6resizeEm.exit: ; pr .lr.ph54: ; preds = %.preheader %sext = shl i64 %4, 32 %51 = ashr exact i64 %sext, 32 + %invariant.op = sub i32 1, %5 br label %72 52: ; preds = %.preheader42, %52 @@ -50093,10 +50094,9 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEED2Ev.exit: ; preds = %indvars.iv74 = phi i32 [ 1, %.lr.ph54 ], [ %indvars.iv.next75, %._crit_edge ] %.03353 = phi i32 [ %5, %.lr.ph54 ], [ %92, %._crit_edge ] %.252 = phi i128 [ %.037.lcssa, %.lr.ph54 ], [ %91, %._crit_edge ] - %reass.sub = sub i32 %.03353, %5 - %73 = add i32 %reass.sub, 1 - %74 = icmp slt i32 %73, %5 - br i1 %74, label %.lr.ph, label %._crit_edge + %.reass.reass = add i32 %.03353, %invariant.op + %73 = icmp slt i32 %.reass.reass, %5 + br i1 %73, label %.lr.ph, label %._crit_edge .lr.ph: ; preds = %72 %75 = sext i32 %indvars.iv74 to i64 @@ -50104,9 +50104,9 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEED2Ev.exit: ; preds = br label %77 77: ; preds = %.lr.ph, %77 - %indvars.iv78.in = phi i64 [ %51, %.lr.ph ], [ %indvars.iv78, %77 ] - %indvars.iv76 = phi i64 [ %75, %.lr.ph ], [ %indvars.iv.next77, %77 ] - %.348 = phi i128 [ %.252, %.lr.ph ], [ %86, %77 ] + %indvars.iv78.in = phi i64 [ %51, %.lr.ph ], [ %indvars.iv78, %76 ] + %indvars.iv76 = phi i64 [ %75, %.lr.ph ], [ %indvars.iv.next77, %76 ] + %.348 = phi i128 [ %.252, %.lr.ph ], [ %86, %76 ] %indvars.iv78 = add nsw i64 %indvars.iv78.in, -1 %indvars.iv.next77 = add nsw i64 %indvars.iv76, 1 %78 = getelementptr inbounds i32, ptr %76, i64 %indvars.iv76 @@ -50123,7 +50123,7 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEED2Ev.exit: ; preds = br i1 %exitcond, label %._crit_edge, label %77, !llvm.loop !949 ._crit_edge: ; preds = %77, %72 - %.3.lcssa = phi i128 [ %.252, %72 ], [ %86, %77 ] + %.3.lcssa = phi i128 [ %.252, %72 ], [ %86, %76 ] %87 = load ptr, ptr %9, align 8 %88 = zext i32 %.03353 to i64 %89 = getelementptr inbounds nuw i32, ptr %87, i64 %88 @@ -50144,7 +50144,7 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEED2Ev.exit: ; preds = br label %97 97: ; preds = %100, %._crit_edge55 - %indvars.iv.i = phi i64 [ %101, %100 ], [ %96, %._crit_edge55 ] + %indvars.iv.i = phi i64 [ %101, %99 ], [ %96, %._crit_edge55 ] %98 = trunc nuw i64 %indvars.iv.i to i32 %99 = icmp sgt i32 %98, 1 br i1 %99, label %100, label %.critedge.i @@ -50157,7 +50157,7 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEED2Ev.exit: ; preds = br i1 %104, label %97, label %.critedge.i, !llvm.loop !944 .critedge.i: ; preds = %100, %97 - %.0.in.lcssa.i = phi i32 [ %smin.i, %97 ], [ %98, %100 ] + %.0.in.lcssa.i = phi i32 [ %smin.i, %96 ], [ %98, %99 ] %105 = zext i32 %.0.in.lcssa.i to i64 %106 = load i64, ptr %11, align 8 %107 = icmp ult i64 %106, %105 @@ -50166,7 +50166,7 @@ _ZN3fmt2v919basic_memory_bufferIjLm32ENSt3__19allocatorIjEEED2Ev.exit: ; preds = 108: ; preds = %.critedge.i %109 = load ptr, ptr %0, align 8 %110 = load ptr, ptr %109, align 8 - invoke void %110(ptr noundef nonnull align 8 dereferenceable(172) %0, i64 noundef %105) + invoke void %109(ptr noundef nonnull align 8 dereferenceable(172) %0, i64 noundef %105) to label %.noexc39 unwind label %62 .noexc39: ; preds = %108 diff --git a/bench/typst-rs/optimized/5z4no3nnr5v1s13.ll b/bench/typst-rs/optimized/5z4no3nnr5v1s13.ll index 533ad2ef2c1..53f0829d76e 100644 --- a/bench/typst-rs/optimized/5z4no3nnr5v1s13.ll +++ b/bench/typst-rs/optimized/5z4no3nnr5v1s13.ll @@ -34547,6 +34547,7 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: %218 = getelementptr inbounds nuw i8, ptr %7, i64 24 %219 = load i64, ptr %218, align 8, !alias.scope !6866, !noalias !6873 %220 = sub i64 %210, %219 + %invariant.op = sub i64 1, %217 br label %221 221: ; preds = %.sink.split.i, %.lr.ph.i50 @@ -34572,7 +34573,7 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: .sink.split.i: ; preds = %265, %252, %232 %.sink.i = phi i64 [ 0, %265 ], [ %220, %252 ], [ 0, %232 ] - %.ph87.i = phi i64 [ %267, %265 ], [ %253, %252 ], [ %233, %232 ] + %.ph87.i = phi i64 [ %266, %265 ], [ %253, %252 ], [ %233, %232 ] %235 = add i64 %.ph87.i, %212 %.not34.i56 = icmp ult i64 %235, %206 br i1 %.not34.i56, label %221, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h39dd9c4a3b4b9ae9E.exit" @@ -34638,9 +34639,8 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: unreachable 265: ; preds = %257 - %reass.sub = sub i64 %222, %217 - %266 = add i64 %reass.sub, 1 - %267 = add i64 %266, %.sroa.04.0.i53 + %.reass.reass = add i64 %222, %invariant.op + %266 = add i64 %.reass.reass, %.sroa.04.0.i53 br label %.sink.split.i 268: ; preds = %199 @@ -34660,37 +34660,38 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: %274 = load i64, ptr %273, align 8, !alias.scope !6878, !noalias !6885 %275 = add i64 %272, -1 %.first_iter = icmp ult i64 %275, %210 - br label %276 - -276: ; preds = %288, %.lr.ph.i44 - %277 = phi i64 [ %.promoted.i41, %.lr.ph.i44 ], [ %289, %288 ] - %278 = phi i64 [ %269, %.lr.ph.i44 ], [ %290, %288 ] - %279 = getelementptr inbounds i8, ptr %204, i64 %278 - %280 = load i8, ptr %279, align 1, !alias.scope !6881, !noalias !6887, !noundef !14 - %281 = and i8 %280, 63 - %282 = zext nneg i8 %281 to i64 - %283 = shl nuw i64 1, %282 - %284 = and i64 %283, %271 - %285 = icmp eq i64 %284, 0 - br i1 %285, label %286, label %.preheader64 - -286: ; preds = %276 - %287 = add i64 %277, %210 - br label %288 - -288: ; preds = %317, %304, %286 - %289 = phi i64 [ %305, %304 ], [ %287, %286 ], [ %319, %317 ] - %290 = add i64 %289, %212 - %.not34.i = icmp ult i64 %290, %206 - br i1 %.not34.i, label %276, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h39dd9c4a3b4b9ae9E.exit" - -.preheader64: ; preds = %276, %309 - %.sroa.04.0.i = phi i64 [ %310, %309 ], [ %272, %276 ] - %291 = icmp ult i64 %.sroa.04.0.i, %210 - br i1 %291, label %306, label %.preheader - -.preheader: ; preds = %.preheader64, %298 - %.sroa.5.0.i = phi i64 [ %293, %298 ], [ %272, %.preheader64 ] + %invariant.op417 = sub i64 1, %271 + br label %275 + +275:; preds = %287, %.lr.ph.i44 + %278 = phi i64 [ %.promoted.i41, %.lr.ph.i44 ], [ %288, %287 ] + %277 = phi i64 [ %268, %.lr.ph.i44 ], [ %289, %287 ] + %278 = getelementptr inbounds i8, ptr %204, i64 %277 + %279 = load i8, ptr %278, align 1, !alias.scope !6881, !noalias !6887, !noundef !14 + %280 = and i8 %279, 63 + %281 = zext nneg i8 %280 to i64 + %282 = shl nuw i64 1, %281 + %283 = and i64 %282, %270 + %284 = icmp eq i64 %283, 0 + br i1 %284, label %285, label %.preheader64 + +285:; preds = %275 + %286 = add i64 %278, %210 + br label %287 + +287:; preds = %316, %304, %285 + %288 = phi i64 [ %304, %303 ], [ %286, %285 ], [ %317, %316 ] + %289 = add i64 %288, %212 + %.not34.i = icmp ult i64 %289, %206 + br i1 %.not34.i, label %275, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h39dd9c4a3b4b9ae9E.exit" + +.preheader64:; preds = %275, %309 + %.sroa.04.0.i = phi i64 [ %309, %308 ], [ %271, %275 ] + %290 = icmp ult i64 %.sroa.04.0.i, %210 + br i1 %290, label %305, label %.preheader + +.preheader: ; preds = %.preheader64, %297 + %.sroa.5.0.i = phi i64 [ %292, %297 ], [ %271, %.preheader64 ] %.not = icmp eq i64 %.sroa.5.0.i, 0 br i1 %.not, label %"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h39dd9c4a3b4b9ae9E.exit", label %292 @@ -34699,7 +34700,7 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: br i1 %.first_iter, label %294, label %297, !prof !29 294: ; preds = %292 - %295 = add i64 %293, %277 + %295 = add i64 %293, %276 %296 = icmp ult i64 %295, %206 br i1 %296, label %298, label %303, !prof !29 @@ -34720,11 +34721,11 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: unreachable 304: ; preds = %298 - %305 = add i64 %277, %274 - br label %288 + %305 = add i64 %276, %274 + br label %287 306: ; preds = %.preheader64 - %307 = add i64 %.sroa.04.0.i, %277 + %307 = add i64 %.sroa.04.0.i, %276 %308 = icmp ult i64 %307, %206 br i1 %308, label %309, label %315, !prof !29 @@ -34738,19 +34739,18 @@ _ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i: br i1 %.not.i45, label %.preheader64, label %317 315: ; preds = %306 - %316 = add i64 %277, %272 + %316 = add i64 %276, %272 %umax.i = tail call i64 @llvm.umax.i64(i64 %206, i64 %316) tail call void @_ZN4core9panicking18panic_bounds_check17he5254f424ac3a4c4E(i64 noundef %umax.i, i64 noundef %206, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.53fe85e3a453dfbf0ab1e8743506e67c.233) #66, !noalias !6888 unreachable 317: ; preds = %309 - %reass.sub133 = sub i64 %277, %272 - %318 = add i64 %reass.sub133, 1 - %319 = add i64 %318, %.sroa.04.0.i - br label %288 + %.reass280.reass = add i64 %276, %invariant.op417 + %318 = add i64 %.reass280.reass, %.sroa.04.0.i + br label %287 -"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h39dd9c4a3b4b9ae9E.exit": ; preds = %_ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i, %.sink.split.i, %.preheader65, %288, %.preheader, %268, %213, %.preheader.i39, %.thread20.i.i, %.thread.i.i - %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %.thread.i.i ], [ 0, %.preheader.i39 ], [ 0, %.thread20.i.i ], [ 1, %.preheader65 ], [ 0, %213 ], [ 0, %268 ], [ 0, %.sink.split.i ], [ 0, %288 ], [ 1, %_ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i ] +"_ZN80_$LT$core..str..pattern..StrSearcher$u20$as$u20$core..str..pattern..Searcher$GT$10next_match17h39dd9c4a3b4b9ae9E.exit": ; preds = %_ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i, %.sink.split.i, %.preheader65, %287, %.preheader, %268, %213, %.preheader.i39, %.thread20.i.i, %.thread.i.i + %.sroa.0.0 = phi i8 [ 1, %.preheader ], [ 1, %.thread.i.i ], [ 0, %.preheader.i39 ], [ 0, %.thread20.i.i ], [ 1, %.preheader65 ], [ 0, %213 ], [ 0, %267 ], [ 0, %.sink.split.i ], [ 0, %287 ], [ 1, %_ZN4core3str11validations15next_code_point17h34adc5e17767eaceE.exit.thread.i.i ] call void @llvm.lifetime.end.p0(ptr nonnull %7) br label %"_ZN73_$LT$$u5b$A$u5d$$u20$as$u20$core..slice..cmp..SlicePartialEq$LT$B$GT$$GT$5equal17h45ed752b1ddb1024E.exit" } diff --git a/bench/vcpkg/optimized/format.ll b/bench/vcpkg/optimized/format.ll index ad153deedbf..dfe7f80d47e 100644 --- a/bench/vcpkg/optimized/format.ll +++ b/bench/vcpkg/optimized/format.ll @@ -17187,6 +17187,7 @@ _ZN3fmt3v1119basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %.noexc.i %54 = load ptr, ptr %2, align 8 %sext = shl i64 %4, 32 %55 = ashr exact i64 %sext, 32 + %invariant.op = sub i32 1, %5 br label %87 56: ; preds = %47 @@ -17265,10 +17266,9 @@ _ZN3fmt3v1119basic_memory_bufferIjLm32ESaIjEE6resizeEm.exit: ; preds = %.noexc.i %indvars.iv81 = phi i32 [ 1, %.lr.ph61 ], [ %indvars.iv.next82, %._crit_edge ] %.03360 = phi i32 [ %5, %.lr.ph61 ], [ %104, %._crit_edge ] %.259 = phi i128 [ %.037.lcssa, %.lr.ph61 ], [ %103, %._crit_edge ] - %reass.sub = sub i32 %.03360, %5 - %88 = add i32 %reass.sub, 1 - %89 = icmp slt i32 %88, %5 - br i1 %89, label %.lr.ph.preheader, label %._crit_edge + %.reass.reass = add i32 %.03360, %invariant.op + %88 = icmp slt i32 %.reass.reass, %5 + br i1 %88, label %.lr.ph.preheader, label %._crit_edge .lr.ph.preheader: ; preds = %87 %90 = sext i32 %indvars.iv81 to i64 @@ -17334,7 +17334,7 @@ _ZN3fmt3v1119basic_memory_bufferIjLm32ESaIjEED2Ev.exit: ; preds = %105, %112 br label %117 117: ; preds = %115, %56 - %.pn.pn = phi { ptr, i32 } [ %57, %56 ], [ %116, %115 ] + %.pn.pn = phi { ptr, i32 } [ %57, %56 ], [ %116, %114 ] %118 = load ptr, ptr %2, align 8, !tbaa !314 %119 = getelementptr inbounds nuw i8, ptr %2, i64 32 %.not.i.i47 = icmp eq ptr %118, %119 diff --git a/bench/velox/optimized/DateTimeFormatter.ll b/bench/velox/optimized/DateTimeFormatter.ll index 388139fd995..2d2f7ad5f04 100644 --- a/bench/velox/optimized/DateTimeFormatter.ll +++ b/bench/velox/optimized/DateTimeFormatter.ll @@ -4297,14 +4297,18 @@ while.body.lr.ph.i.i.i: ; preds = %if.end6.i.i.i %6 = load i8, ptr %3, align 1 %conv.i.i.i.i = sext i8 %6 to i32 %sub.ptr.lhs.cast20.i.i.i = ptrtoint ptr %add.ptr9.i.i.i to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i + %invariant.op = sub i64 1, %2 + br label %while.body.i.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %if.end19.i.i.i, %while.body.lr.ph.i.i.i %__len.022.i.i.i = phi i64 [ %sub.i.i.i, %while.body.lr.ph.i.i.i ], [ %sub.ptr.sub22.i.i.i, %if.end19.i.i.i ] %__first.021.i.i.i = phi ptr [ %add.ptr.i.i.i, %while.body.lr.ph.i.i.i ], [ %incdec.ptr.i.i.i, %if.end19.i.i.i ] - %reass.sub = sub i64 %__len.022.i.i.i, %2 - %add.i.i.i = add i64 %reass.sub, 1 - %call.i.i.i.i = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.021.i.i.i, i32 noundef %conv.i.i.i.i, i64 noundef %add.i.i.i) #2 + %add.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass = add i64 %__len.022.i.i.i, %invariant.op + %cmp.i.i.i.i = icmp eq i64 %add.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass, 0 + br i1 %cmp.i.i.i.i, label %_ZN8facebook5velox9functions12_GLOBAL__N_114countOccurenceERKSt17basic_string_viewIcSt11char_traitsIcEERKNSt7__cxx1112basic_stringIcS5_SaIcEEE.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i: ; preds = %while.body.i.i.i + %call.i.i.i.i = call ptr @memchr(ptr noundef %__first.021.i.i.i, i32 noundef %conv.i.i.i.i, i64 noundef %add.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass) #2 %tobool.not.i.i.i = icmp eq ptr %call.i.i.i.i, null br i1 %tobool.not.i.i.i, label %_ZN8facebook5velox9functions12_GLOBAL__N_114countOccurenceERKSt17basic_string_viewIcSt11char_traitsIcEERKNSt7__cxx1112basic_stringIcS5_SaIcEEE.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i @@ -4337,7 +4341,7 @@ while.body.i: ; preds = %_ZNKSt17basic_strin %add.i = add i64 %call2.i, %retval.0.i.i.i br label %while.cond.i, !llvm.loop !20 -_ZN8facebook5velox9functions12_GLOBAL__N_114countOccurenceERKSt17basic_string_viewIcSt11char_traitsIcEERKNSt7__cxx1112basic_stringIcS5_SaIcEEE.exit: ; preds = %if.then.i.i.i, %if.end.i.i.i, %if.end6.i.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, %if.end19.i.i.i +_ZN8facebook5velox9functions12_GLOBAL__N_114countOccurenceERKSt17basic_string_viewIcSt11char_traitsIcEERKNSt7__cxx1112basic_stringIcS5_SaIcEEE.exit: ; preds = %if.then.i.i.i, %if.end.i.i.i, %if.end6.i.i.i, %_ZNKSt17basic_string_viewIcSt11char_traitsIcEE4findES2_m.exit.i, %while.body.i.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i, %if.end19.i.i.i %conv.i = zext nneg i32 %occurrences.0.i to i64 %add = add i64 %0, %conv.i invoke void @_ZN8facebook5velox9functions24DateTimeFormatterBuilderC1Em(ptr noundef nonnull align 8 dereferenceable(44) %builder, i64 noundef %add) diff --git a/bench/velox/optimized/FirstLastValue.ll b/bench/velox/optimized/FirstLastValue.ll index 944e6b3b54d..364fb2b0378 100644 --- a/bench/velox/optimized/FirstLastValue.ll +++ b/bench/velox/optimized/FirstLastValue.ll @@ -4534,6 +4534,7 @@ if.then.i11.i: ; preds = %_ZNK8facebook5velox for.body.lr.ph.i.i: ; preds = %if.then.i11.i %48 = sext i32 %46 to i64 + %invariant.op185 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %for.body.i12.i for.body.i12.i: ; preds = %for.body.i12.i, %for.body.lr.ph.i.i @@ -4543,9 +4544,8 @@ for.body.i12.i: ; preds = %for.body.i12.i, %fo %arrayidx3.i.i.i = getelementptr inbounds i32, ptr %32, i64 %indvars.iv.i13.i %50 = load i32, ptr %arrayidx3.i.i.i, align 4 %sub.i.i.i = sub nsw i32 %49, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub127 = sub i32 %50, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i.i = add i32 %reass.sub127, 1 - %call.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i.i, i32 noundef %add.i.i.i) + %add.i.i.reass.i.reass.reass = add i32 %50, %invariant.op185 + %call.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i.i, i32 noundef %add.i.i.reass.i.reass.reass) %51 = load ptr, ptr %rowNumbers_, align 8 %add.ptr.i.i.i.i = getelementptr inbounds i32, ptr %51, i64 %indvars.iv.i13.i store i32 %call.i.i.i, ptr %add.ptr.i.i.i.i, align 4 @@ -4591,8 +4591,12 @@ if.then3.i.i.i.i.i: ; preds = %if.end.i.i.i4.i.i %tobool4.not.i.i.i.i.i.i = icmp eq i64 %and.i.i.i.i.i.i, 0 br i1 %tobool4.not.i.i.i.i.i.i, label %if.end6, label %while.body.i.i.i.i.i.i -while.body.i.i.i.i.i.i: ; preds = %if.then3.i.i.i.i.i, %while.body.i.i.i.i.i.i - %word.0.i.i.i.i.i.i = phi i64 [ %and6.i.i.i.i.i.i, %while.body.i.i.i.i.i.i ], [ %and.i.i.i.i.i.i, %if.then3.i.i.i.i.i ] +while.body.i.i.i.i.i.i: ; preds = %if.then3.i.i.i.i.i + %invariant.op184 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i + br label %while.body.i.i.i.i.i.i + +while.body.i.i.i.i.i.i: ; preds = %while.body.i.i.i.i.i.i.preheader, %while.body.i.i.i.i.i.i + %word.0.i.i.i.i.i.i = phi i64 [ %and6.i.i.i.i.i.i, %while.body.i.i.i.i.i.i ], [ %and.i.i.i.i.i.i, %while.body.i.i.i.i.i.i.preheader ] %60 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %word.0.i.i.i.i.i.i, i1 true) %cast.i.i.i.i.i.i = trunc nuw nsw i64 %60 to i32 %add.i26.i.i.i.i.i = or disjoint i32 %58, %cast.i.i.i.i.i.i @@ -4602,9 +4606,8 @@ while.body.i.i.i.i.i.i: ; preds = %if.then3.i.i.i.i.i, %arrayidx3.i.i.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i.i.i.i.i.i %62 = load i32, ptr %arrayidx3.i.i.i.i.i.i.i, align 4 %sub.i.i27.i.i.i.i.i = sub nsw i32 %61, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub126 = sub i32 %62, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i.i.i.i.i.i = add i32 %reass.sub126, 1 - %call.i.i.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i27.i.i.i.i.i, i32 noundef %add.i.i.i.i.i.i.i) + %add.i.i.i.i.i.i.reass.i.reass.reass = add i32 %62, %invariant.op184 + %call.i.i.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i27.i.i.i.i.i, i32 noundef %add.i.i.i.i.i.i.reass.i.reass.reass) %63 = load ptr, ptr %rowNumbers_, align 8 %add.ptr.i.i.i.i.i.i.i.i = getelementptr inbounds i32, ptr %63, i64 %idxprom.i.i.i.i.i.i.i store i32 %call.i.i.i.i.i.i.i, ptr %add.ptr.i.i.i.i.i.i.i.i, align 4 @@ -4635,6 +4638,7 @@ if.then10.i.i.i.i.i: ; preds = %if.end8.i.i.i.i.i while.body.preheader.i41.i.i.i.i.i: ; preds = %if.then10.i.i.i.i.i %mul.i42.i.i.i.i.i = shl nsw i32 %div11.i.i.i.i.i, 6 + %invariant.op = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %while.body.i43.i.i.i.i.i while.body.i43.i.i.i.i.i: ; preds = %while.body.i43.i.i.i.i.i, %while.body.preheader.i41.i.i.i.i.i @@ -4648,9 +4652,8 @@ while.body.i43.i.i.i.i.i: ; preds = %while.body.i43.i.i. %arrayidx3.i.i49.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i47.i.i.i.i.i %67 = load i32, ptr %arrayidx3.i.i49.i.i.i.i.i, align 4 %sub.i.i50.i.i.i.i.i = sub nsw i32 %66, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub = sub i32 %67, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i52.i.i.i.i.i = add i32 %reass.sub, 1 - %call.i.i53.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i50.i.i.i.i.i, i32 noundef %add.i.i52.i.i.i.i.i) + %add.i.i52.i.i.i.i.reass.i.reass.reass = add i32 %67, %invariant.op + %call.i.i53.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i50.i.i.i.i.i, i32 noundef %add.i.i52.i.i.i.i.reass.i.reass.reass) %68 = load ptr, ptr %rowNumbers_, align 8 %add.ptr.i.i.i55.i.i.i.i.i = getelementptr inbounds i32, ptr %68, i64 %idxprom.i.i47.i.i.i.i.i store i32 %call.i.i53.i.i.i.i.i, ptr %add.ptr.i.i.i55.i.i.i.i.i, align 4 @@ -4664,9 +4667,14 @@ if.end14.i.i.i.i.i: ; preds = %while.body.i43.i.i. %cmp15.not115.i.i.i.i.i = icmp sgt i32 %add114.i.i.i.i.i, %58 br i1 %cmp15.not115.i.i.i.i.i, label %for.end.i.i.i6.i.i, label %for.body.i.i.i5.i.i -for.body.i.i.i5.i.i: ; preds = %if.end14.i.i.i.i.i, %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE0EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i - %add117.i.i.i.i.i = phi i32 [ %add.i.i.i.i.i, %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE0EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i ], [ %add114.i.i.i.i.i, %if.end14.i.i.i.i.i ] - %i.0116.i.i.i.i.i = phi i32 [ %add117.i.i.i.i.i, %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE0EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i ], [ %mul.i.i.i.i.i.i, %if.end14.i.i.i.i.i ] +for.body.i.i.i5.i.i: ; preds = %if.end14.i.i.i.i.i + %invariant.op181 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i + %invariant.op182 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i + br label %for.body.i.i.i5.i.i + +for.body.i.i.i5.i.i: ; preds = %for.body.i.i.i5.i.i.preheader, %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE0EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i + %add117.i.i.i.i.i = phi i32 [ %add.i.i.i.i.i, %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE0EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i ], [ %add114.i.i.i.i.i, %for.body.i.i.i5.i.i.preheader ] + %i.0116.i.i.i.i.i = phi i32 [ %add117.i.i.i.i.i, %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE0EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i ], [ %mul.i.i.i.i.i.i, %for.body.i.i.i5.i.i.preheader ] %div16.i.i.i.i.i = sdiv i32 %i.0116.i.i.i.i.i, 64 %idxprom.i60.i.i.i.i.i = sext i32 %div16.i.i.i.i.i to i64 %arrayidx.i61.i.i.i.i.i = getelementptr inbounds i64, ptr %54, i64 %idxprom.i60.i.i.i.i.i @@ -4699,9 +4707,8 @@ for.body.i.i.i.i.i.i: ; preds = %for.body.i.i.i.i.i. %arrayidx2.i.i.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %row.022.i.i.i.i.i.i %71 = load i32, ptr %arrayidx2.i.i.i.i.i.i.i, align 4 %sub.i.i66.i.i.i.i.i = sub nsw i32 %70, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub124 = sub i32 %71, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i67.i.i.i.i.i = add i32 %reass.sub124, 1 - %call.i.i68.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i66.i.i.i.i.i, i32 noundef %add.i.i67.i.i.i.i.i) + %add.i.i67.i.i.i.i.reass.i.reass.reass = add i32 %71, %invariant.op181 + %call.i.i68.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i66.i.i.i.i.i, i32 noundef %add.i.i67.i.i.i.i.reass.i.reass.reass) %72 = load ptr, ptr %rowNumbers_, align 8 %add.ptr.i.i.i70.i.i.i.i.i = getelementptr inbounds i32, ptr %72, i64 %row.022.i.i.i.i.i.i store i32 %call.i.i68.i.i.i.i.i, ptr %add.ptr.i.i.i70.i.i.i.i.i, align 4 @@ -4720,22 +4727,21 @@ while.body.i71.i.i.i.i.i: ; preds = %_ZN8facebook5velox4 %arrayidx3.i.i74.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i73.i.i.i.i.i %75 = load i32, ptr %arrayidx3.i.i74.i.i.i.i.i, align 4 %sub.i12.i.i.i.i.i.i = sub nsw i32 %74, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub40.i = sub i32 %75, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i13.i.i.i.i.i.i = add i32 %reass.sub40.i, 1 - %cmp.not.i.i.i.i.i.i.i = icmp slt i32 %sub.i12.i.i.i.i.i.i, %add.i13.i.i.i.i.i.i + %add.i13.i.i.i.i.i.reass.i.reass.reass.reass = add i32 %75, %invariant.op182 + %cmp.not.i.i.i.i.i.i.i = icmp slt i32 %sub.i12.i.i.i.i.i.i, %add.i13.i.i.i.i.i.reass.i.reass.reass.reass br i1 %cmp.not.i.i.i.i.i.i.i, label %if.end.i.i.i.i.i.i.i, label %_ZN8facebook5velox4bits12findFirstBitEPKmii.exit.i.i.i.i.i if.end.i.i.i.i.i.i.i: ; preds = %while.body.i71.i.i.i.i.i %add.i.i.i.i.i.i.i.i = add i32 %sub.i12.i.i.i.i.i.i, 63 %76 = srem i32 %add.i.i.i.i.i.i.i.i, 64 %mul.i.i.i.i.i.i.i.i = sub nsw i32 %add.i.i.i.i.i.i.i.i, %76 - %77 = and i32 %add.i13.i.i.i.i.i.i, -64 + %77 = and i32 %add.i13.i.i.i.i.i.reass.i.reass.reass.reass, -64 %cmp2.i.i.i.i.i.i.i = icmp slt i32 %77, %mul.i.i.i.i.i.i.i.i br i1 %cmp2.i.i.i.i.i.i.i, label %if.then3.i.i.i.i.i.i.i, label %if.end9.i.i.i.i.i.i.i if.then3.i.i.i.i.i.i.i: ; preds = %if.end.i.i.i.i.i.i.i - %div.i.i.i.i.i.i.i = ashr i32 %add.i13.i.i.i.i.i.i, 6 - %sub.i.i107.i.i.i.i.i = and i32 %add.i13.i.i.i.i.i.i, 63 + %div.i.i.i.i.i.i.i = ashr i32 %add.i13.i.i.i.i.i.reass.i.reass.reass.reass, 6 + %sub.i.i107.i.i.i.i.i = and i32 %add.i13.i.i.i.i.i.reass.i.reass.reass.reass, 63 %sh_prom.i.i.i.i.i.i.i.i = zext nneg i32 %sub.i.i107.i.i.i.i.i to i64 %notmask.i.i.i.i.i.i.i.i = shl nsw i64 -1, %sh_prom.i.i.i.i.i.i.i.i %sub.i22.i.i.i.i.i.i.i = xor i64 %notmask.i.i.i.i.i.i.i.i, -1 @@ -4800,12 +4806,12 @@ _ZZN8facebook5velox4bits12findFirstBitEPKmiiENKUliE_clEi.exit.thread.i.i.i.i.i.i br label %return.sink.split.i.i.i.i.i.i.i for.end.i.i.i.i.i.i.i: ; preds = %for.cond.i.i.i.i.i.i.i - %cmp25.not.i.i.i.i.i.i.i = icmp eq i32 %add.i13.i.i.i.i.i.i, %77 + %cmp25.not.i.i.i.i.i.i.i = icmp eq i32 %add.i13.i.i.i.i.i.reass.i.reass.reass.reass, %77 br i1 %cmp25.not.i.i.i.i.i.i.i, label %_ZN8facebook5velox4bits12findFirstBitEPKmii.exit.i.i.i.i.i, label %if.then26.i.i.i.i.i.i.i if.then26.i.i.i.i.i.i.i: ; preds = %for.end.i.i.i.i.i.i.i - %div27.i.i.i.i.i.i.i = ashr i32 %add.i13.i.i.i.i.i.i, 6 - %sub28.i.i.i.i.i.i.i = and i32 %add.i13.i.i.i.i.i.i, 63 + %div27.i.i.i.i.i.i.i = ashr i32 %add.i13.i.i.i.i.i.reass.i.reass.reass.reass, 6 + %sub28.i.i.i.i.i.i.i = and i32 %add.i13.i.i.i.i.i.reass.i.reass.reass.reass, 63 %sh_prom.i49.i.i.i.i.i.i.i = zext nneg i32 %sub28.i.i.i.i.i.i.i to i64 %notmask.i50.i.i.i.i.i.i.i = shl nsw i64 -1, %sh_prom.i49.i.i.i.i.i.i.i %sub.i51.i.i.i.i.i.i.i = xor i64 %notmask.i50.i.i.i.i.i.i.i, -1 @@ -4854,10 +4860,14 @@ if.then19.i.i.i.i.i: ; preds = %for.end.i.i.i6.i.i %84 = load i64, ptr %arrayidx.i82.i.i.i.i.i, align 8 %and.i85.i.i.i.i.i = and i64 %84, %sub.i80.i.i.i.i.i %tobool4.not.i86.i.i.i.i.i = icmp eq i64 %and.i85.i.i.i.i.i, 0 - br i1 %tobool4.not.i86.i.i.i.i.i, label %if.end6, label %while.body.i89.i.i.i.i.i + br i1 %tobool4.not.i86.i.i.i.i.i, label %if.end6, label %while.body.i89.i.i.i.i.i.preheader + +while.body.i89.i.i.i.i.i.preheader: ; preds = %if.then19.i.i.i.i.i + %invariant.op183 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i + br label %while.body.i89.i.i.i.i.i -while.body.i89.i.i.i.i.i: ; preds = %if.then19.i.i.i.i.i, %while.body.i89.i.i.i.i.i - %word.0.i90.i.i.i.i.i = phi i64 [ %and6.i103.i.i.i.i.i, %while.body.i89.i.i.i.i.i ], [ %and.i85.i.i.i.i.i, %if.then19.i.i.i.i.i ] +while.body.i89.i.i.i.i.i: ; preds = %while.body.i89.i.i.i.i.i.preheader, %while.body.i89.i.i.i.i.i + %word.0.i90.i.i.i.i.i = phi i64 [ %and6.i103.i.i.i.i.i, %while.body.i89.i.i.i.i.i ], [ %and.i85.i.i.i.i.i, %while.body.i89.i.i.i.i.i.preheader ] %85 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %word.0.i90.i.i.i.i.i, i1 true) %cast.i91.i.i.i.i.i = trunc nuw nsw i64 %85 to i32 %add.i92.i.i.i.i.i = or disjoint i32 %58, %cast.i91.i.i.i.i.i @@ -4867,9 +4877,8 @@ while.body.i89.i.i.i.i.i: ; preds = %if.then19.i.i.i.i.i %arrayidx3.i.i95.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i93.i.i.i.i.i %87 = load i32, ptr %arrayidx3.i.i95.i.i.i.i.i, align 4 %sub.i.i96.i.i.i.i.i = sub nsw i32 %86, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub125 = sub i32 %87, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i98.i.i.i.i.i = add i32 %reass.sub125, 1 - %call.i.i99.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i96.i.i.i.i.i, i32 noundef %add.i.i98.i.i.i.i.i) + %add.i.i98.i.i.i.i.reass.i.reass.reass = add i32 %87, %invariant.op183 + %call.i.i99.i.i.i.i.i = tail call noundef i32 @_ZN8facebook5velox4bits12findFirstBitEPKmii(ptr noundef %28, i32 noundef %sub.i.i96.i.i.i.i.i, i32 noundef %add.i.i98.i.i.i.i.reass.i.reass.reass) %88 = load ptr, ptr %rowNumbers_, align 8 %add.ptr.i.i.i101.i.i.i.i.i = getelementptr inbounds i32, ptr %88, i64 %idxprom.i.i93.i.i.i.i.i store i32 %call.i.i99.i.i.i.i.i, ptr %add.ptr.i.i.i101.i.i.i.i.i, align 4 @@ -7306,6 +7315,7 @@ for.body.lr.ph.i.i: ; preds = %if.then.i11.i %50 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i.i, i64 8 %51 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i.i, i64 16 %52 = sext i32 %46 to i64 + %invariant.op191 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %for.body.i12.i for.body.i12.i: ; preds = %for.body.i12.i, %for.body.lr.ph.i.i @@ -7315,8 +7325,7 @@ for.body.i12.i: ; preds = %for.body.i12.i, %fo %arrayidx3.i.i.i = getelementptr inbounds i32, ptr %32, i64 %indvars.iv.i13.i %54 = load i32, ptr %arrayidx3.i.i.i, align 4 %sub.i.i.i = sub nsw i32 %53, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub129 = sub i32 %54, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i.i = add i32 %reass.sub129, 1 + %add.i.i.reass.i.reass.reass = add i32 %54, %invariant.op191 call void @llvm.lifetime.start.p0(ptr nonnull %found.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp2.i.i.i.i) @@ -7327,7 +7336,7 @@ for.body.i12.i: ; preds = %for.body.i12.i, %fo store ptr %28, ptr %agg.tmp2.i.i.i.i, align 8 store ptr %found.i.i.i.i, ptr %50, align 8 store i8 1, ptr %51, align 8 - %call.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i.i, i32 noundef %add.i.i.i, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i.i) + %call.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i.i, i32 noundef %add.i.i.reass.i.reass.reass, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i.i) %55 = load i32, ptr %found.i.i.i.i, align 4 call void @llvm.lifetime.end.p0(ptr nonnull %found.i.i.i.i) call void @llvm.lifetime.end.p0(ptr nonnull %agg.tmp.i.i.i.i) @@ -7382,6 +7391,7 @@ while.body.preheader.i.i.i.i.i.i: ; preds = %if.then3.i.i.i.i.i %66 = getelementptr inbounds nuw i8, ptr %agg.tmp.i.i.i.i.i.i.i.i, i64 16 %67 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i.i.i.i.i.i, i64 8 %68 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i.i.i.i.i.i, i64 16 + %invariant.op190 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %while.body.i.i.i.i.i.i while.body.i.i.i.i.i.i: ; preds = %while.body.i.i.i.i.i.i, %while.body.preheader.i.i.i.i.i.i @@ -7395,8 +7405,7 @@ while.body.i.i.i.i.i.i: ; preds = %while.body.i.i.i.i. %arrayidx3.i.i.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i.i.i.i.i.i %71 = load i32, ptr %arrayidx3.i.i.i.i.i.i.i, align 4 %sub.i.i27.i.i.i.i.i = sub nsw i32 %70, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub128 = sub i32 %71, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i.i.i.i.i.i = add i32 %reass.sub128, 1 + %add.i.i.i.i.i.i.reass.i.reass.reass = add i32 %71, %invariant.op190 call void @llvm.lifetime.start.p0(ptr nonnull %found.i.i.i.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i.i.i.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp2.i.i.i.i.i.i.i.i) @@ -7407,7 +7416,7 @@ while.body.i.i.i.i.i.i: ; preds = %while.body.i.i.i.i. store ptr %28, ptr %agg.tmp2.i.i.i.i.i.i.i.i, align 8 store ptr %found.i.i.i.i.i.i.i.i, ptr %67, align 8 store i8 1, ptr %68, align 8 - %call.i.i.i.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i27.i.i.i.i.i, i32 noundef %add.i.i.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i.i.i.i.i.i) + %call.i.i.i.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i27.i.i.i.i.i, i32 noundef %add.i.i.i.i.i.i.reass.i.reass.reass, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i.i.i.i.i.i) %72 = load i32, ptr %found.i.i.i.i.i.i.i.i, align 4 call void @llvm.lifetime.end.p0(ptr nonnull %found.i.i.i.i.i.i.i.i) call void @llvm.lifetime.end.p0(ptr nonnull %agg.tmp.i.i.i.i.i.i.i.i) @@ -7446,6 +7455,7 @@ while.body.preheader.i44.i.i.i.i.i: ; preds = %if.then10.i.i.i.i.i %76 = getelementptr inbounds nuw i8, ptr %agg.tmp.i.i.i36.i.i.i.i.i, i64 16 %77 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i37.i.i.i.i.i, i64 8 %78 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i37.i.i.i.i.i, i64 16 + %invariant.op = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %while.body.i46.i.i.i.i.i while.body.i46.i.i.i.i.i: ; preds = %while.body.i46.i.i.i.i.i, %while.body.preheader.i44.i.i.i.i.i @@ -7459,8 +7469,7 @@ while.body.i46.i.i.i.i.i: ; preds = %while.body.i46.i.i. %arrayidx3.i.i52.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i50.i.i.i.i.i %81 = load i32, ptr %arrayidx3.i.i52.i.i.i.i.i, align 4 %sub.i.i53.i.i.i.i.i = sub nsw i32 %80, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub = sub i32 %81, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i55.i.i.i.i.i = add i32 %reass.sub, 1 + %add.i.i55.i.i.i.i.reass.i.reass.reass = add i32 %81, %invariant.op call void @llvm.lifetime.start.p0(ptr nonnull %found.i.i.i35.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i.i.i36.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp2.i.i.i37.i.i.i.i.i) @@ -7471,7 +7480,7 @@ while.body.i46.i.i.i.i.i: ; preds = %while.body.i46.i.i. store ptr %28, ptr %agg.tmp2.i.i.i37.i.i.i.i.i, align 8 store ptr %found.i.i.i35.i.i.i.i.i, ptr %77, align 8 store i8 1, ptr %78, align 8 - %call.i.i.i56.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i53.i.i.i.i.i, i32 noundef %add.i.i55.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i36.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i37.i.i.i.i.i) + %call.i.i.i56.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i53.i.i.i.i.i, i32 noundef %add.i.i55.i.i.i.i.reass.i.reass.reass, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i36.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i37.i.i.i.i.i) %82 = load i32, ptr %found.i.i.i35.i.i.i.i.i, align 4 call void @llvm.lifetime.end.p0(ptr nonnull %found.i.i.i35.i.i.i.i.i) call void @llvm.lifetime.end.p0(ptr nonnull %agg.tmp.i.i.i36.i.i.i.i.i) @@ -7494,6 +7503,8 @@ for.body.lr.ph.i.i.i.i.i: ; preds = %if.end14.i.i.i.i.i %85 = getelementptr inbounds nuw i8, ptr %agg.tmp.i.i.i64.i.i.i.i.i, i64 16 %86 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i65.i.i.i.i.i, i64 8 %87 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i65.i.i.i.i.i, i64 16 + %invariant.op187 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i + %invariant.op188 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %for.body.i.i.i5.i.i for.body.i.i.i5.i.i: ; preds = %_ZZN8facebook5velox4bits10forEachBitIZNS0_6window9prestosql12_GLOBAL__N_122FirstLastValueFunctionILNS5_9ValueTypeE1EE24setRowNumbersIgnoreNullsERKNS0_17SelectivityVectorERKN5boost13intrusive_ptrINS0_6BufferEEESH_EUlT_E_EEvPKmiibSI_ENKUliE_clEi.exit.i.i.i.i.i, %for.body.lr.ph.i.i.i.i.i @@ -7531,8 +7542,7 @@ for.body.i.i.i.i.i.i: ; preds = %for.body.i.i.i.i.i. %arrayidx2.i.i.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %row.025.i.i.i.i.i.i %90 = load i32, ptr %arrayidx2.i.i.i.i.i.i.i, align 4 %sub.i.i72.i.i.i.i.i = sub nsw i32 %89, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub126 = sub i32 %90, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i73.i.i.i.i.i = add i32 %reass.sub126, 1 + %add.i.i73.i.i.i.i.reass.i.reass.reass = add i32 %90, %invariant.op187 call void @llvm.lifetime.start.p0(ptr nonnull %found.i.i.i63.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i.i.i64.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp2.i.i.i65.i.i.i.i.i) @@ -7543,7 +7553,7 @@ for.body.i.i.i.i.i.i: ; preds = %for.body.i.i.i.i.i. store ptr %28, ptr %agg.tmp2.i.i.i65.i.i.i.i.i, align 8 store ptr %found.i.i.i63.i.i.i.i.i, ptr %86, align 8 store i8 1, ptr %87, align 8 - %call.i.i.i74.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i72.i.i.i.i.i, i32 noundef %add.i.i73.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i64.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i65.i.i.i.i.i) + %call.i.i.i74.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i72.i.i.i.i.i, i32 noundef %add.i.i73.i.i.i.i.reass.i.reass.reass, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i64.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i65.i.i.i.i.i) %91 = load i32, ptr %found.i.i.i63.i.i.i.i.i, align 4 call void @llvm.lifetime.end.p0(ptr nonnull %found.i.i.i63.i.i.i.i.i) call void @llvm.lifetime.end.p0(ptr nonnull %agg.tmp.i.i.i64.i.i.i.i.i) @@ -7566,22 +7576,21 @@ while.body.i77.i.i.i.i.i: ; preds = %_ZN8facebook5velox4 %arrayidx3.i.i80.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i79.i.i.i.i.i %95 = load i32, ptr %arrayidx3.i.i80.i.i.i.i.i, align 4 %sub.i15.i.i.i.i.i.i = sub nsw i32 %94, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub41.i = sub i32 %95, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i16.i.i.i.i.i.i = add i32 %reass.sub41.i, 1 - %cmp.not.i.i.i.i.i.i = icmp slt i32 %sub.i15.i.i.i.i.i.i, %add.i16.i.i.i.i.i.i + %add.i16.i.i.i.i.i.reass.i.reass.reass.reass = add i32 %95, %invariant.op188 + %cmp.not.i.i.i.i.i.i = icmp slt i32 %sub.i15.i.i.i.i.i.i, %add.i16.i.i.i.i.i.reass.i.reass.reass.reass br i1 %cmp.not.i.i.i.i.i.i, label %if.end.i.i.i.i.i.i, label %_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_.exit.i.i.i.i.i if.end.i.i.i.i.i.i: ; preds = %while.body.i77.i.i.i.i.i %add.i.i117.i.i.i.i.i = add i32 %sub.i15.i.i.i.i.i.i, 63 %96 = srem i32 %add.i.i117.i.i.i.i.i, 64 %mul.i.i.i.i.i.i.i = sub nsw i32 %add.i.i117.i.i.i.i.i, %96 - %97 = and i32 %add.i16.i.i.i.i.i.i, -64 + %97 = and i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, -64 %cmp2.i.i.i.i.i.i = icmp slt i32 %97, %mul.i.i.i.i.i.i.i br i1 %cmp2.i.i.i.i.i.i, label %if.then3.i.i.i.i.i.i, label %if.end9.i.i.i.i.i.i if.then3.i.i.i.i.i.i: ; preds = %if.end.i.i.i.i.i.i - %div.i.i.i.i.i.i = ashr i32 %add.i16.i.i.i.i.i.i, 6 - %sub.i119.i.i.i.i.i = and i32 %add.i16.i.i.i.i.i.i, 63 + %div.i.i.i.i.i.i = ashr i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, 6 + %sub.i119.i.i.i.i.i = and i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, 63 %sh_prom.i.i120.i.i.i.i.i = zext nneg i32 %sub.i119.i.i.i.i.i to i64 %notmask.i.i121.i.i.i.i.i = shl nsw i64 -1, %sh_prom.i.i120.i.i.i.i.i %sub.i22.i.i.i.i.i.i = xor i64 %notmask.i.i121.i.i.i.i.i, -1 @@ -7601,22 +7610,22 @@ if.then3.i.i.i.i.i.i: ; preds = %if.end.i.i.i.i.i.i br i1 %tobool4.not.i.i.i.i.i.i.i, label %_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_.exit.i.i.i.i.i, label %if.then.i.i.i.i.i.i.i if.then.i.i.i.i.i.i.i: ; preds = %if.then3.i.i.i.i.i.i - %add.i26.i.i.i.i.i.i = or i32 %add.i16.i.i.i.i.i.i, 63 + %add.i26.i.i.i.i.i.i = or i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, 63 %99 = call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 %and.i.i.i.i.i.i.i, i1 true) %cast.i.i.i.i.i.i.i = trunc nuw nsw i64 %99 to i32 %sub.i27.i.i.i.i.i.i = sub nuw nsw i32 %add.i26.i.i.i.i.i.i, %cast.i.i.i.i.i.i.i br label %_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_.exit.i.i.i.i.i if.end9.i.i.i.i.i.i: ; preds = %if.end.i.i.i.i.i.i - %cmp10.not.i.i.i.i.i.i = icmp eq i32 %add.i16.i.i.i.i.i.i, %97 + %cmp10.not.i.i.i.i.i.i = icmp eq i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, %97 br i1 %cmp10.not.i.i.i.i.i.i, label %for.cond.i.i.i.i.i.i.preheader, label %if.then11.i.i.i.i.i.i for.cond.i.i.i.i.i.i.preheader: ; preds = %if.then11.i.i.i.i.i.i, %if.end9.i.i.i.i.i.i br label %for.cond.i.i.i.i.i.i if.then11.i.i.i.i.i.i: ; preds = %if.end9.i.i.i.i.i.i - %div12.i.i.i.i.i.i = ashr i32 %add.i16.i.i.i.i.i.i, 6 - %sub13.i.i.i.i.i.i = and i32 %add.i16.i.i.i.i.i.i, 63 + %div12.i.i.i.i.i.i = ashr i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, 6 + %sub13.i.i.i.i.i.i = and i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, 63 %sh_prom.i28.i.i.i.i.i.i = zext nneg i32 %sub13.i.i.i.i.i.i to i64 %notmask.i29.i.i.i.i.i.i = shl nsw i64 -1, %sh_prom.i28.i.i.i.i.i.i %sub.i30.i.i.i.i.i.i = xor i64 %notmask.i29.i.i.i.i.i.i, -1 @@ -7628,7 +7637,7 @@ if.then11.i.i.i.i.i.i: ; preds = %if.end9.i.i.i.i.i.i br i1 %tobool4.not.i36.i.i.i.i.i.i, label %for.cond.i.i.i.i.i.i.preheader, label %_ZZN8facebook5velox4bits11findLastBitEPKmiibENKUlimE_clEim.exit42.i.i.i.i.i.i _ZZN8facebook5velox4bits11findLastBitEPKmiibENKUlimE_clEim.exit42.i.i.i.i.i.i: ; preds = %if.then11.i.i.i.i.i.i - %add.i39.i.i.i.i.i.i = or i32 %add.i16.i.i.i.i.i.i, 63 + %add.i39.i.i.i.i.i.i = or i32 %add.i16.i.i.i.i.i.reass.i.reass.reass.reass, 63 %101 = call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 %and.i35.i.i.i.i.i.i, i1 true) %cast.i40.i.i.i.i.i.i = trunc nuw nsw i64 %101 to i32 %sub.i41.i.i.i.i.i.i = sub nuw nsw i32 %add.i39.i.i.i.i.i.i, %cast.i40.i.i.i.i.i.i @@ -7720,6 +7729,7 @@ while.body.preheader.i96.i.i.i.i.i: ; preds = %if.then19.i.i.i.i.i %110 = getelementptr inbounds nuw i8, ptr %agg.tmp.i.i.i88.i.i.i.i.i, i64 16 %111 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i89.i.i.i.i.i, i64 8 %112 = getelementptr inbounds nuw i8, ptr %agg.tmp2.i.i.i89.i.i.i.i.i, i64 16 + %invariant.op189 = sub i32 1, %extractNullsResult.sroa.0.0.extract.trunc.i br label %while.body.i98.i.i.i.i.i while.body.i98.i.i.i.i.i: ; preds = %while.body.i98.i.i.i.i.i, %while.body.preheader.i96.i.i.i.i.i @@ -7733,8 +7743,7 @@ while.body.i98.i.i.i.i.i: ; preds = %while.body.i98.i.i. %arrayidx3.i.i104.i.i.i.i.i = getelementptr inbounds i32, ptr %32, i64 %idxprom.i.i102.i.i.i.i.i %115 = load i32, ptr %arrayidx3.i.i104.i.i.i.i.i, align 4 %sub.i.i105.i.i.i.i.i = sub nsw i32 %114, %extractNullsResult.sroa.0.0.extract.trunc.i - %reass.sub127 = sub i32 %115, %extractNullsResult.sroa.0.0.extract.trunc.i - %add.i.i107.i.i.i.i.i = add i32 %reass.sub127, 1 + %add.i.i107.i.i.i.i.reass.i.reass.reass = add i32 %115, %invariant.op189 call void @llvm.lifetime.start.p0(ptr nonnull %found.i.i.i87.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp.i.i.i88.i.i.i.i.i) call void @llvm.lifetime.start.p0(ptr nonnull %agg.tmp2.i.i.i89.i.i.i.i.i) @@ -7745,7 +7754,7 @@ while.body.i98.i.i.i.i.i: ; preds = %while.body.i98.i.i. store ptr %28, ptr %agg.tmp2.i.i.i89.i.i.i.i.i, align 8 store ptr %found.i.i.i87.i.i.i.i.i, ptr %111, align 8 store i8 1, ptr %112, align 8 - %call.i.i.i108.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i105.i.i.i.i.i, i32 noundef %add.i.i107.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i88.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i89.i.i.i.i.i) + %call.i.i.i108.i.i.i.i.i = call noundef zeroext i1 @_ZN8facebook5velox4bits16testWordsReverseIZNS1_11findLastBitEPKmiibEUlimE_ZNS1_11findLastBitES4_iibEUliE_EEbiiT_T0_(i32 noundef %sub.i.i105.i.i.i.i.i, i32 noundef %add.i.i107.i.i.i.i.reass.i.reass.reass, ptr noundef nonnull byval(%class.anon.150) align 8 %agg.tmp.i.i.i88.i.i.i.i.i, ptr noundef nonnull byval(%class.anon.152) align 8 %agg.tmp2.i.i.i89.i.i.i.i.i) %116 = load i32, ptr %found.i.i.i87.i.i.i.i.i, align 4 call void @llvm.lifetime.end.p0(ptr nonnull %found.i.i.i87.i.i.i.i.i) call void @llvm.lifetime.end.p0(ptr nonnull %agg.tmp.i.i.i88.i.i.i.i.i) diff --git a/bench/velox/optimized/StringFunctions.ll b/bench/velox/optimized/StringFunctions.ll index 9656d4e6355..4813321d955 100644 --- a/bench/velox/optimized/StringFunctions.ll +++ b/bench/velox/optimized/StringFunctions.ll @@ -15166,14 +15166,18 @@ while.body.lr.ph.i.i.i.i: ; preds = %if.end6.i.i.i.i %14 = load i8, ptr %agg.tmp.sroa.2.0.copyload.i, align 1 %conv.i.i.i.i.i = sext i8 %14 to i32 %sub.ptr.lhs.cast21.i.i.i.i = ptrtoint ptr %add.ptr9.i.i.i.i to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i + %invariant.op = sub i64 1, %agg.tmp.sroa.0.0.copyload.i + br label %while.body.i.i.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i: ; preds = %if.end20.i.i.i.i, %while.body.lr.ph.i.i.i.i %__len.022.i.i.i.i = phi i64 [ %sub.i.i.i.i, %while.body.lr.ph.i.i.i.i ], [ %sub.ptr.sub23.i.i.i.i, %if.end20.i.i.i.i ] %__first.021.i.i.i.i = phi ptr [ %add.ptr.i.i.i.i, %while.body.lr.ph.i.i.i.i ], [ %incdec.ptr.i.i.i.i, %if.end20.i.i.i.i ] - %reass.sub = sub i64 %__len.022.i.i.i.i, %agg.tmp.sroa.0.0.copyload.i - %add.i.i.i.i = add i64 %reass.sub, 1 - %call.i.i.i.i.i = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.021.i.i.i.i, i32 noundef %conv.i.i.i.i.i, i64 noundef %add.i.i.i.i) #24 + %add.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass = add i64 %__len.022.i.i.i.i, %invariant.op + %cmp.i.i.i.i.i = icmp eq i64 %add.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass, 0 + br i1 %cmp.i.i.i.i.i, label %while.end, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i: ; preds = %while.body.i.i.i.i + %call.i.i.i.i.i = tail call ptr @memchr(ptr noundef %__first.021.i.i.i.i, i32 noundef %conv.i.i.i.i.i, i64 noundef %add.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.i.reass.reass.reass) #24 %tobool.not.i.i.i.i = icmp eq ptr %call.i.i.i.i.i, null br i1 %tobool.not.i.i.i.i, label %while.end, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i.i.i @@ -15249,10 +15253,10 @@ _ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt %cmp25 = icmp ult i64 %add6.i35, %20 br i1 %cmp25, label %if.end.i.i, label %while.end, !llvm.loop !188 -while.end: ; preds = %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit, %if.end6.i.i.i.i, %if.end20.i.i.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i - %readPosition.1139 = phi i64 [ %readPosition.1141, %if.end20.i.i.i.i ], [ %readPosition.1141, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %add6.i35, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36 ], [ %readPosition.1141, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit ], [ %readPosition.1141, %if.end6.i.i.i.i ] - %writePosition.1137 = phi i64 [ %writePosition.1142, %if.end20.i.i.i.i ], [ %writePosition.1142, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %writePosition.5, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36 ], [ %writePosition.1142, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit ], [ %writePosition.1142, %if.end6.i.i.i.i ] - %21 = phi i64 [ %13, %if.end20.i.i.i.i ], [ %13, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %20, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36 ], [ %13, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit ], [ %13, %if.end6.i.i.i.i ] +while.end: ; preds = %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit, %if.end6.i.i.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i, %if.end20.i.i.i.i, %while.body.i.i.i.i + %readPosition.1139 = phi i64 [ %readPosition.1140, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %readPosition.1140, %while.body.i.i.i.i ], [ %readPosition.1140, %if.end20.i.i.i.i ], [ %add6.i35, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36 ], [ %readPosition.1141, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit ], [ %readPosition.1141, %if.end6.i.i.i.i ] + %writePosition.1137 = phi i64 [ %writePosition.1142, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %writePosition.1141, %while.body.i.i.i.i ], [ %writePosition.1141, %if.end20.i.i.i.i ], [ %writePosition.5, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36 ], [ %writePosition.1142, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit ], [ %writePosition.1142, %if.end6.i.i.i.i ] + %21 = phi i64 [ %13, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i.i.i ], [ %13, %while.body.i.i.i.i ], [ %13, %if.end20.i.i.i.i ], [ %20, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE0_clEv.exit36 ], [ %13, %_ZZN8facebook5velox9functions10stringCoreL7replaceEPcRKSt17basic_string_viewIcSt11char_traitsIcEES9_S9_bENKUlvE_clEv.exit ], [ %13, %if.end6.i.i.i.i ] %sub32 = sub i64 %21, %readPosition.1139 %cmp.i37 = icmp slt i64 %sub32, 1 br i1 %cmp.i37, label %return, label %if.end.i38 diff --git a/bench/velox/optimized/VectorFuzzer.ll b/bench/velox/optimized/VectorFuzzer.ll index 9caef4571f3..4fc7601a1c6 100644 --- a/bench/velox/optimized/VectorFuzzer.ll +++ b/bench/velox/optimized/VectorFuzzer.ll @@ -2625,8 +2625,8 @@ entry: %0 = load i8, ptr %allowLazyVector, align 2 %tobool = trunc i8 %0 to i1 %ref.tmp12.sink534.sroa.gep = getelementptr inbounds nuw i8, ptr %ref.tmp, i64 8 - %ref.tmp12.sink534.sroa.gep535 = getelementptr inbounds nuw i8, ptr %ref.tmp12, i64 8 %ref.tmp12.sink534.sroa.gep536 = getelementptr inbounds nuw i8, ptr %ref.tmp12, i64 8 + %ref.tmp12.sink534.sroa.gep537 = getelementptr inbounds nuw i8, ptr %ref.tmp12, i64 8 br i1 %tobool, label %land.rhs, label %land.lhs.true land.rhs: ; preds = %entry @@ -2744,7 +2744,7 @@ cond.false: ; preds = %invoke.cont14 to label %if.end19 unwind label %lpad.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp if.end19: ; preds = %cond.false, %cond.true, %if.then9 - %ref.tmp12.sink534.sroa.phi = phi ptr [ %ref.tmp12.sink534.sroa.gep, %if.then9 ], [ %ref.tmp12.sink534.sroa.gep535, %cond.true ], [ %ref.tmp12.sink534.sroa.gep536, %cond.false ] + %ref.tmp12.sink534.sroa.phi = phi ptr [ %ref.tmp12.sink534.sroa.gep, %if.then9 ], [ %ref.tmp12.sink534.sroa.gep536, %cond.true ], [ %ref.tmp12.sink534.sroa.gep537, %cond.false ] %ref.tmp12.sink534 = phi ptr [ %ref.tmp, %if.then9 ], [ %ref.tmp12, %cond.true ], [ %ref.tmp12, %cond.false ] %4 = load ptr, ptr %ref.tmp12.sink534, align 8 %5 = load ptr, ptr %ref.tmp12.sink534.sroa.phi, align 8 @@ -3200,6 +3200,7 @@ if.end39: ; preds = %if.end8.sink.split. %_M_refcount4.i.i.i305 = getelementptr inbounds nuw i8, ptr %ref.tmp55, i64 8 %_M_refcount3.i.i.i306 = getelementptr inbounds nuw i8, ptr %agg.result, i64 8 %_M_refcount4.i.i.i373 = getelementptr inbounds nuw i8, ptr %ref.tmp67, i64 8 + %invariant.op = sub i32 1, %size br label %while.cond while.cond: ; preds = %while.cond.backedge, %if.end39 @@ -3587,9 +3588,8 @@ if.then59: ; preds = %_ZNSt10shared_ptrIN invoke.cont62: ; preds = %if.then59 %conv.i.i.i.i.i370 = trunc i64 %call9.i.i.i.i371 to i32 - %reass.sub516 = sub i32 %vectorSize.1, %size - %add65 = add i32 %reass.sub516, 1 - %rem66 = urem i32 %conv.i.i.i.i.i370, %add65 + %add65.reass.reass = add i32 %vectorSize.1, %invariant.op + %rem66 = urem i32 %conv.i.i.i.i.i370, %add65.reass.reass %118 = load ptr, ptr %agg.result, align 8 %vtable69 = load ptr, ptr %118, align 8 %vfn70 = getelementptr inbounds nuw i8, ptr %vtable69, i64 224 diff --git a/bench/wireshark/optimized/androiddump.ll b/bench/wireshark/optimized/androiddump.ll index 39f06f17527..6cdcf269222 100644 --- a/bench/wireshark/optimized/androiddump.ll +++ b/bench/wireshark/optimized/androiddump.ll @@ -1746,12 +1746,12 @@ get_serial_from_interface.exit: ; preds = %24, %21 %.not110125 = icmp eq i64 %74, 0 br i1 %.not110125, label %.outer.backedge, label %.lr.ph -.outer.backedge: ; preds = %105, %.lr.ph, %73 - %.087.ph.be = phi i64 [ 0, %73 ], [ 0, %105 ], [ %.1126, %.lr.ph ] +.outer.backedge: ; preds = %103, %.lr.ph, %73 + %.087.ph.be = phi i64 [ 0, %73 ], [ 0, %103 ], [ %.1126, %.lr.ph ] br label %.outer, !llvm.loop !23 -.lr.ph: ; preds = %73, %105 - %.1126 = phi i64 [ %.2, %105 ], [ %74, %73 ] +.lr.ph: ; preds = %73, %103 + %.1126 = phi i64 [ %.2, %103 ], [ %74, %73 ] %75 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) getelementptr inbounds nuw (i8, ptr @capture_android_logcat_text.packet, i64 32), i32 noundef 10, i64 noundef %.1126) #22 %.not111 = icmp eq ptr %75, null br i1 %.not111, label %.outer.backedge, label %76, !llvm.loop !23 @@ -1760,51 +1760,49 @@ get_serial_from_interface.exit: ; preds = %24, %21 call void @llvm.lifetime.start.p0(ptr nonnull %7) call void @llvm.lifetime.start.p0(ptr nonnull %8) %77 = ptrtoint ptr %75 to i64 - %78 = sub i64 %77, ptrtoint (ptr @capture_android_logcat_text.packet to i64) - %79 = add i64 %78, 1 - %.neg117 = xor i64 %78, -1 - %80 = call i64 @time(ptr noundef null) #23 - store i64 %80, ptr %8, align 8 - %81 = call ptr @localtime(ptr noundef nonnull %8) #23 - %.not112 = icmp eq ptr %81, null - br i1 %.not112, label %105, label %82, !llvm.loop !24 - -82: ; preds = %76 - %83 = getelementptr inbounds nuw i8, ptr %81, i64 16 - %84 = getelementptr inbounds nuw i8, ptr %81, i64 12 - %85 = getelementptr inbounds nuw i8, ptr %81, i64 8 - %86 = getelementptr inbounds nuw i8, ptr %81, i64 4 - %87 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @capture_android_logcat_text.packet, i64 32), ptr noundef nonnull @.str.164, ptr noundef nonnull %83, ptr noundef nonnull %84, ptr noundef nonnull %85, ptr noundef nonnull %86, ptr noundef nonnull %81, ptr noundef nonnull %7) #23 - %88 = icmp eq i32 %87, 6 - br i1 %88, label %89, label %98 - -89: ; preds = %82 - %90 = load i32, ptr %83, align 8 - %91 = add i32 %90, -1 - store i32 %91, ptr %83, align 8 - %92 = getelementptr inbounds nuw i8, ptr %81, i64 32 - store i32 -1, ptr %92, align 8 - %93 = call i64 @mktime(ptr noundef nonnull %81) #23 - %94 = load i32, ptr %7, align 4 - %95 = sitofp i32 %94 to double - %96 = fmul nnan double %95, 1.000000e+06 - %97 = fptosi double %96 to i32 - br label %98 - -98: ; preds = %89, %82 - %.085 = phi i64 [ %93, %89 ], [ 0, %82 ] - %.0 = phi i32 [ %97, %89 ], [ 0, %82 ] - %99 = call fastcc zeroext i1 @extcap_dumper_dump(i32 %10, ptr %11, ptr noundef %1, ptr noundef nonnull @capture_android_logcat_text.packet, i64 noundef %79, i64 noundef %79, i64 noundef %.085, i32 noundef %.0) - %100 = zext i1 %99 to i32 - store i32 %100, ptr @endless_loop, align 4 - %101 = getelementptr i8, ptr @capture_android_logcat_text.packet, i64 %79 - %102 = add i64 %.1126, 32 - %103 = add i64 %102, %.neg117 - %104 = call ptr @__memmove_chk(ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @capture_android_logcat_text.packet, i64 32), ptr noundef %101, i64 noundef %103, i64 noundef 65503) #23 - br label %105 - -105: ; preds = %76, %98 - %.2 = phi i64 [ %103, %98 ], [ %.1126, %76 ] + %.reass = add i64 %77, sub (i64 1, i64 ptrtoint (ptr @capture_android_logcat_text.packet to i64)) + %78 = call i64 @time(ptr noundef null) #23 + store i64 %78, ptr %8, align 8 + %80 = call ptr @localtime(ptr noundef nonnull %8) #23 + %.not112 = icmp eq ptr %80, null + br i1 %.not112, label %103, label %80, !llvm.loop !24 + +80:; preds = %76 + %81 = getelementptr inbounds nuw i8, ptr %79, i64 16 + %82 = getelementptr inbounds nuw i8, ptr %79, i64 12 + %83 = getelementptr inbounds nuw i8, ptr %80, i64 8 + %84 = getelementptr inbounds nuw i8, ptr %80, i64 4 + %85 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @capture_android_logcat_text.packet, i64 32), ptr noundef nonnull @.str.164, ptr noundef nonnull %81, ptr noundef nonnull %82, ptr noundef nonnull %83, ptr noundef nonnull %84, ptr noundef nonnull %79, ptr noundef nonnull %7) #23 + %86 = icmp eq i32 %85, 6 + br i1 %86, label %87, label %96 + +87:; preds = %80 + %88 = load i32, ptr %81, align 8 + %89 = add i32 %88, -1 + store i32 %89, ptr %81, align 8 + %90 = getelementptr inbounds nuw i8, ptr %79, i64 32 + store i32 -1, ptr %90, align 8 + %91 = call i64 @mktime(ptr noundef nonnull %79) #23 + %92 = load i32, ptr %7, align 4 + %93 = sitofp i32 %92 to double + %94 = fmul nnan double %93, 1.000000e+06 + %95 = fptosi double %94 to i32 + br label %96 + +96:; preds = %87, %80 + %.085 = phi i64 [ %91, %87 ], [ 0, %80 ] + %.0 = phi i32 [ %95, %87 ], [ 0, %80 ] + %97 = call fastcc zeroext i1 @extcap_dumper_dump(i32 %10, ptr %11, ptr noundef %1, ptr noundef nonnull @capture_android_logcat_text.packet, i64 noundef %.reass, i64 noundef %.reass, i64 noundef %.085, i32 noundef %.0) + %98 = zext i1 %97 to i32 + store i32 %98, ptr @endless_loop, align 4 + %99 = getelementptr i8, ptr @capture_android_logcat_text.packet, i64 %.reass + %100 = add i64 %.1126, 32 + %101 = sub i64 %100, %.reass + %102 = call ptr @__memmove_chk(ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @capture_android_logcat_text.packet, i64 32), ptr noundef %99, i64 noundef %101, i64 noundef 65503) #23 + br label %103 + +103:; preds = %76, %96 + %.2 = phi i64 [ %101, %96 ], [ %.1126, %76 ] call void @llvm.lifetime.end.p0(ptr nonnull %8) call void @llvm.lifetime.end.p0(ptr nonnull %7) %.not110 = icmp eq i64 %.2, 0 @@ -1815,7 +1813,7 @@ get_serial_from_interface.exit: ; preds = %24, %21 br label %108 108: ; preds = %get_serial_from_interface.exit, %106, %71, %66, %54, %50, %45 - %.086 = phi i32 [ -1, %45 ], [ 24, %50 ], [ 30, %54 ], [ -1, %66 ], [ -1, %71 ], [ 0, %106 ], [ 42, %get_serial_from_interface.exit ] + %.086 = phi i32 [ -1, %45 ], [ 24, %50 ], [ 30, %54 ], [ -1, %66 ], [ -1, %71 ], [ 0, %104 ], [ 42, %get_serial_from_interface.exit ] ret i32 %.086 } diff --git a/bench/wireshark/optimized/packet-gsm_a_bssmap.ll b/bench/wireshark/optimized/packet-gsm_a_bssmap.ll index e723832a4e1..d7bd6bbb17b 100644 --- a/bench/wireshark/optimized/packet-gsm_a_bssmap.ll +++ b/bench/wireshark/optimized/packet-gsm_a_bssmap.ll @@ -2138,9 +2138,13 @@ define internal noundef zeroext i16 @be_field_element_dissect(ptr noundef %0, pt %9 = icmp ugt i32 %4, 2 br i1 %9, label %.lr.ph, label %._crit_edge -.lr.ph: ; preds = %7, %49 - %.064 = phi i32 [ %.2, %49 ], [ %3, %7 ] - %.05463 = phi i1 [ %.155, %49 ], [ true, %7 ] +.lr.ph: ; preds = %7 + %invariant.op = sub i32 2, %3 + br label %.lr.ph + +.lr.ph: ; preds = %.lr.ph.preheader, %49 + %.064 = phi i32 [ %.2, %49 ], [ %3, %.lr.ph.preheader ] + %.05463 = phi i1 [ %.155, %49 ], [ true, %.lr.ph.preheader ] %10 = add i32 %.064, 1 %11 = call zeroext i8 @tvb_get_uint8(ptr noundef %0, i32 noundef %.064) %12 = zext i8 %11 to i32 @@ -2209,10 +2213,9 @@ define internal noundef zeroext i16 @be_field_element_dissect(ptr noundef %0, pt 49: ; preds = %38, %45, %35 %.2 = phi i32 [ %37, %35 ], [ %48, %45 ], [ %43, %38 ] - %reass.sub = sub i32 %.2, %3 - %50 = add i32 %reass.sub, 2 - %51 = icmp ult i32 %50, %4 - br i1 %51, label %.lr.ph, label %._crit_edge, !llvm.loop !9 + %.reass.reass = add i32 %.2, %invariant.op + %50 = icmp ult i32 %.reass.reass, %4 + br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !9 ._crit_edge: ; preds = %49, %7 %52 = trunc i32 %4 to i16 diff --git a/bench/wireshark/optimized/packet-ipsec.ll b/bench/wireshark/optimized/packet-ipsec.ll index 6e360a46e7a..09348da4cd9 100644 --- a/bench/wireshark/optimized/packet-ipsec.ll +++ b/bench/wireshark/optimized/packet-ipsec.ll @@ -4337,18 +4337,18 @@ define internal fastcc i32 @get_ipv6_suffix(ptr noundef %0, ptr noundef readonly .lr.ph70: ; preds = %.loopexit %wide.trip.count = zext nneg i32 %.047 to i64 + %invariant.op = sub i32 32, %.047 br label %51 51: ; preds = %.lr.ph70, %51 %indvars.iv = phi i64 [ 0, %.lr.ph70 ], [ %indvars.iv.next, %51 ] %52 = trunc i64 %indvars.iv to i32 - %53 = sub i32 %52, %.047 - %54 = add i32 %53, 32 - %55 = sext i32 %54 to i64 - %56 = getelementptr i8, ptr %3, i64 %55 - %57 = load i8, ptr %56, align 1 - %58 = getelementptr i8, ptr %3, i64 %indvars.iv - store i8 %57, ptr %58, align 1 + %.reass.reass = add i32 %52, %invariant.op + %53 = sext i32 %.reass.reass to i64 + %54 = getelementptr i8, ptr %3, i64 %53 + %55 = load i8, ptr %54, align 1 + %56 = getelementptr i8, ptr %3, i64 %indvars.iv + store i8 %55, ptr %56, align 1 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond79.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond79.not, label %._crit_edge71, label %51, !llvm.loop !56 diff --git a/bench/wireshark/optimized/packet-xmcp.ll b/bench/wireshark/optimized/packet-xmcp.ll index 48e1eb37f1f..20aad8c7004 100644 --- a/bench/wireshark/optimized/packet-xmcp.ll +++ b/bench/wireshark/optimized/packet-xmcp.ll @@ -1190,13 +1190,12 @@ proto_item_set_generated.exit.i: ; preds = %243, %240, %232 br i1 %406, label %.lr.ph.preheader.i, label %.loopexit.i .lr.ph.preheader.i: ; preds = %405 - %invariant.op.i = add nsw i32 %180, -3 - %invariant.op = add nsw i32 %invariant.op.i, %191 + %invariant.op = sub i32 3, %191 br label %.lr.ph.i -.lr.ph.i: ; preds = %445, %.lr.ph.preheader.i - %407 = phi i32 [ %447, %445 ], [ %191, %.lr.ph.preheader.i ] - %.0396.i = phi i16 [ %446, %445 ], [ %190, %.lr.ph.preheader.i ] +.lr.ph.i: ; preds = %.lr.ph.preheader.i, %445 + %407 = phi i32 [ %447, %445 ], [ %191, %.lr.ph.i.preheader ] + %.0396.i = phi i16 [ %446, %445 ], [ %190, %.lr.ph.i.preheader ] %408 = call zeroext i16 @tvb_get_ntohs(ptr noundef %0, i32 noundef %407) %409 = add nuw nsw i32 %407, 2 %410 = call zeroext i16 @tvb_get_ntohs(ptr noundef %0, i32 noundef %409) @@ -1275,7 +1274,8 @@ proto_item_set_generated.exit.i: ; preds = %243, %240, %232 445: ; preds = %441, %440, %439, %.thread385.i, %428, %427, %426, %.thread.i %446 = add i16 %.0396.i, 4 %447 = zext i16 %446 to i32 - %448 = icmp sgt i32 %invariant.op, %447 + %.reass.i.reass.reass = add i32 %447, %invariant.op + %448 = icmp slt i32 %.reass.i.reass.reass, %180 br i1 %448, label %.lr.ph.i, label %.loopexit.i, !llvm.loop !8 449: ; preds = %196 @@ -1547,7 +1547,7 @@ proto_item_set_generated.exit176: ; preds = %521, %524, %527 br label %558 558: ; preds = %.sink.split209, %14, %12, %4 - %.0144 = phi i32 [ 0, %14 ], [ 0, %4 ], [ 0, %12 ], [ %557, %.sink.split209 ] + %.0144 = phi i32 [ 0, %14 ], [ 0, %4 ], [ 0, %12 ], [ %557, %.sink.split208 ] call void @llvm.lifetime.end.p0(ptr nonnull %8) call void @llvm.lifetime.end.p0(ptr nonnull %7) ret i32 %.0144 diff --git a/bench/wolfssl/optimized/sp_int.ll b/bench/wolfssl/optimized/sp_int.ll index acbcdcb8d87..325fdf41584 100644 --- a/bench/wolfssl/optimized/sp_int.ll +++ b/bench/wolfssl/optimized/sp_int.ll @@ -13531,6 +13531,7 @@ define internal fastcc void @_sp_div_same_size(ptr noundef captures(none) %0, pt %7 = getelementptr inbounds nuw i8, ptr %1, i64 8 %.pre.pre = load i16, ptr %0, align 8, !tbaa !12 %8 = zext i16 %.pre.pre to i32 + %invariant.op = sub nsw i32 %8, %6 br label %9 9: ; preds = %11, %3 @@ -13546,48 +13547,47 @@ define internal fastcc void @_sp_div_same_size(ptr noundef captures(none) %0, pt br label %split 11: ; preds = %9 - %12 = sub nsw i32 %10, %6 - %13 = add nsw i32 %12, %8 - %14 = sext i32 %13 to i64 - %15 = getelementptr inbounds i64, ptr %5, i64 %14 - %16 = load i64, ptr %15, align 8, !tbaa !8 - %17 = zext i16 %.0 to i64 - %18 = getelementptr inbounds nuw i64, ptr %7, i64 %17 - %19 = load i64, ptr %18, align 8, !tbaa !8 - %.not26 = icmp eq i64 %16, %19 + %.reass = add nsw i32 %invariant.op, %10 + %12 = sext i32 %.reass to i64 + %13 = getelementptr inbounds i64, ptr %5, i64 %12 + %14 = load i64, ptr %13, align 8, !tbaa !8 + %15 = zext i16 %.0 to i64 + %16 = getelementptr inbounds nuw i64, ptr %7, i64 %15 + %17 = load i64, ptr %16, align 8, !tbaa !8 + %.not26 = icmp eq i64 %14, %17 br i1 %.not26, label %9, label %split, !llvm.loop !133 split: ; preds = %11, %._crit_edge %.pre-phi = phi i32 [ %.pre, %._crit_edge ], [ %8, %11 ] - %20 = phi i64 [ %.pre31, %._crit_edge ], [ %19, %11 ] + %20 = phi i64 [ %.pre31, %._crit_edge ], [ %17, %11 ] %21 = sub nsw i32 %.pre-phi, %6 %22 = add nsw i32 %21, %10 %23 = sext i32 %22 to i64 %24 = getelementptr inbounds i64, ptr %5, i64 %23 %25 = load i64, ptr %24, align 8, !tbaa !8 %.not27 = icmp ult i64 %25, %20 - br i1 %.not27, label %_sp_sub_off.exit, label %26 + br i1 %.not27, label %_sp_sub_off.exit, label %24 -26: ; preds = %split - %27 = getelementptr inbounds nuw i8, ptr %2, i64 8 - %28 = sext i32 %21 to i64 - %29 = getelementptr inbounds i64, ptr %27, i64 %28 - %30 = load i64, ptr %29, align 8, !tbaa !8 - %31 = add i64 %30, 1 - store i64 %31, ptr %29, align 8, !tbaa !8 - %32 = sub i16 %.pre.pre, %4 - %33 = icmp ult i16 %32, %.pre.pre - br i1 %33, label %.lr.ph65.i, label %.critedge2.i - -.lr.ph65.i: ; preds = %26 - %34 = zext i16 %32 to i64 +.lr.ph65.i: ; preds = %split + %25 = getelementptr inbounds nuw i8, ptr %2, i64 8 + %26 = sext i32 %19 to i64 + %27 = getelementptr inbounds i64, ptr %25, i64 %26 + %28 = load i64, ptr %27, align 8, !tbaa !8 + %29 = add i64 %28, 1 + store i64 %29, ptr %27, align 8, !tbaa !8 + %30 = sub i16 %.pre.pre, %4 + %31 = icmp ult i16 %30, %.pre.pre + br i1 %31, label %.lr.ph65.i, label %.critedge2.i + +.lr.ph65.i: ; preds = %24 + %32 = zext i16 %30 to i64 %wide.trip.count89.i = zext i16 %4 to i64 br label %35 35: ; preds = %36, %.lr.ph65.i - %indvars.iv83.i = phi i64 [ %34, %.lr.ph65.i ], [ %indvars.iv.next84.i, %36 ] - %indvars.iv81.i = phi i64 [ 0, %.lr.ph65.i ], [ %indvars.iv.next82.i, %36 ] - %.05164.i = phi i128 [ 0, %.lr.ph65.i ], [ %46, %36 ] + %indvars.iv83.i = phi i64 [ %32, %.lr.ph65.i ], [ %indvars.iv.next84.i, %34 ] + %indvars.iv81.i = phi i64 [ 0, %.lr.ph65.i ], [ %indvars.iv.next82.i, %34 ] + %.05164.i = phi i128 [ 0, %.lr.ph65.i ], [ %46, %34 ] %exitcond90.not.i = icmp eq i64 %indvars.iv81.i, %wide.trip.count89.i br i1 %exitcond90.not.i, label %.critedge2.loopexit.i, label %36 @@ -13610,14 +13610,14 @@ split: ; preds = %11, %._crit_edge br i1 %exitcond, label %.critedge2.loopexit.i, label %35, !llvm.loop !48 .critedge2.loopexit.i: ; preds = %36, %35 - %.2.lcssa.ph.in.i = phi i64 [ %indvars.iv83.i, %35 ], [ %indvars.iv.next84.i, %36 ] - %.051.lcssa.ph.i = phi i128 [ %.05164.i, %35 ], [ %46, %36 ] + %.2.lcssa.ph.in.i = phi i64 [ %indvars.iv83.i, %33 ], [ %indvars.iv.next84.i, %34 ] + %.051.lcssa.ph.i = phi i128 [ %.05164.i, %33 ], [ %46, %34 ] %.2.lcssa.ph.i = trunc i64 %.2.lcssa.ph.in.i to i16 br label %.critedge2.i -.critedge2.i: ; preds = %.critedge2.loopexit.i, %26 - %.2.lcssa.i = phi i16 [ %32, %26 ], [ %.2.lcssa.ph.i, %.critedge2.loopexit.i ] - %.051.lcssa.i = phi i128 [ 0, %26 ], [ %.051.lcssa.ph.i, %.critedge2.loopexit.i ] +.critedge2.i: ; preds = %.critedge2.loopexit.i, %24 + %.2.lcssa.i = phi i16 [ %30, %24 ], [ %.2.lcssa.ph.i, %.critedge2.loopexit.i ] + %.051.lcssa.i = phi i128 [ 0, %24 ], [ %.051.lcssa.ph.i, %.critedge2.loopexit.i ] %47 = icmp ult i16 %.2.lcssa.i, %.pre.pre br i1 %47, label %.lr.ph75.i, label %_sp_sub_off.exit @@ -13627,8 +13627,8 @@ split: ; preds = %11, %._crit_edge br label %49 49: ; preds = %49, %.lr.ph75.i - %indvars.iv92.i = phi i64 [ %48, %.lr.ph75.i ], [ %indvars.iv.next93.i, %49 ] - %.174.i = phi i128 [ %.051.lcssa.i, %.lr.ph75.i ], [ %55, %49 ] + %indvars.iv92.i = phi i64 [ %48, %.lr.ph75.i ], [ %indvars.iv.next93.i, %47 ] + %.174.i = phi i128 [ %.051.lcssa.i, %.lr.ph75.i ], [ %55, %47 ] %50 = getelementptr inbounds nuw i64, ptr %5, i64 %indvars.iv92.i %51 = load i64, ptr %50, align 8, !tbaa !8 %52 = zext i64 %51 to i128 diff --git a/bench/yalantinglibs/optimized/EnumFieldGenerator.ll b/bench/yalantinglibs/optimized/EnumFieldGenerator.ll index cc11f022ac3..76f4a191cec 100644 --- a/bench/yalantinglibs/optimized/EnumFieldGenerator.ll +++ b/bench/yalantinglibs/optimized/EnumFieldGenerator.ll @@ -7571,14 +7571,18 @@ while.body.lr.ph.i.i: ; preds = %if.end5.i.i %4 = load i8, ptr %0, align 1 %conv.i.i.i = sext i8 %4 to i32 %sub.ptr.lhs.cast18.i.i = ptrtoint ptr %add.ptr7.i.i to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + %invariant.op = sub i64 1, %1 + br label %while.body.i.i _ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %if.end17.i.i, %while.body.lr.ph.i.i %__len.027.i.i = phi i64 [ %sub.i.i, %while.body.lr.ph.i.i ], [ %sub.ptr.sub20.i.i, %if.end17.i.i ] %__first.026.i.i = phi ptr [ %add.ptr.i.i, %while.body.lr.ph.i.i ], [ %incdec.ptr.i.i, %if.end17.i.i ] - %reass.sub = sub i64 %__len.027.i.i, %1 - %add.i.i = add i64 %reass.sub, 1 - %call.i.i.i = tail call ptr @memchr(ptr noundef nonnull dereferenceable(1) %__first.026.i.i, i32 noundef %conv.i.i.i, i64 noundef %add.i.i) #21 + %add.reass.reass.i.reass.reass.i.reass.reass.reass = add i64 %__len.027.i.i, %invariant.op + %cmp.i.i.i = icmp eq i64 %add.reass.reass.i.reass.reass.i.reass.reass.reass, 0 + br i1 %cmp.i.i.i, label %while.end, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %while.body.i.i + %call.i.i.i = tail call ptr @memchr(ptr noundef %__first.026.i.i, i32 noundef %conv.i.i.i, i64 noundef %add.reass.reass.i.reass.reass.i.reass.reass.reass) #21 %tobool.not.i.i = icmp eq ptr %call.i.i.i, null br i1 %tobool.not.i.i, label %while.end, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i @@ -7623,7 +7627,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7replaceEmmRKS4_.exit: ; pr %add = add i64 %7, %retval.0.i.i br label %while.cond, !llvm.loop !44 -while.end: ; preds = %if.then.i.i, %if.end5.i.i, %if.end.i.i, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end17.i.i +while.end: ; preds = %if.then.i.i, %if.end5.i.i, %if.end.i.i, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, %while.body.i.i, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %if.end17.i.i %8 = getelementptr inbounds nuw i8, ptr %agg.result, i64 16 tail call void @_ZNSaIcEC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %agg.result, ptr noundef nonnull align 8 dereferenceable(32) %str) #21 store ptr %8, ptr %agg.result, align 8 diff --git a/bench/z3/optimized/model.ll b/bench/z3/optimized/model.ll index 59a97743306..b7741f8456f 100644 --- a/bench/z3/optimized/model.ll +++ b/bench/z3/optimized/model.ll @@ -12818,38 +12818,42 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit: ; preds = %_ZN6s %35 = load i8, ptr %27, align 1, !tbaa !188 %36 = sext i8 %35 to i32 %37 = ptrtoint ptr %34 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %46, %.lr.ph.i.i - %.041.i.i = phi i64 [ %31, %.lr.ph.i.i ], [ %49, %46 ] - %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %47, %46 ] - %reass.sub = sub i64 %.041.i.i, %29 - %38 = add i64 %reass.sub, 1 - %39 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i, i32 noundef %36, i64 noundef %38) #25 - %.not34.i.i = icmp eq ptr %39, null + %invariant.op = sub i64 1, %29 + br label %38 + +38:; preds = %47, %.lr.ph.i.i + %.02840.i.i = phi i64 [ %31, %.lr.ph.i.i ], [ %49, %47 ] + %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %48, %47 ] + %38 = add i64 %.041.i.i, %invariant.op + %39 = icmp eq i64 %38, 0 + br i1 %39, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %38 + %40 = call ptr @memchr(ptr noundef %.02840.i.i, i32 noundef %36, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #25 + %.not34.i.i = icmp eq ptr %40, null br i1 %.not34.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = call i32 @bcmp(ptr nonnull %39, ptr nonnull %27, i64 %29) + %bcmp.i.i = call i32 @bcmp(ptr nonnull %40, ptr nonnull %27, i64 %29) %40 = icmp eq i32 %bcmp.i.i, 0 br i1 %40, label %41, label %46 41: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %42 = ptrtoint ptr %39 to i64 + %42 = ptrtoint ptr %40 to i64 %43 = ptrtoint ptr %.pre to i64 %44 = sub i64 %42, %43 %45 = icmp eq i64 %44, -1 br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit 46: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %47 = getelementptr inbounds nuw i8, ptr %39, i64 1 + %47 = getelementptr inbounds nuw i8, ptr %40, i64 1 %48 = ptrtoint ptr %47 to i64 %49 = sub i64 %37, %48 %.not33.i.i = icmp ult i64 %49, %29 - br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !515 + br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %38, !llvm.loop !515 -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %46, %25, %33, %41 - %.027.i.i = phi i1 [ false, %25 ], [ true, %33 ], [ %45, %41 ], [ true, %46 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %38, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %46, %25, %33, %41 + %.027.i.i = phi i1 [ false, %25 ], [ true, %33 ], [ %45, %42 ], [ true, %47 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ true, %38 ] %50 = getelementptr inbounds nuw i8, ptr %7, i64 16 %51 = icmp eq ptr %.pre, %50 br i1 %51, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i11, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i10 @@ -12871,7 +12875,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit12: ; preds = %_ZN 55: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit12 invoke void @_ZN11seq_factory13add_new_delimEv(ptr noundef nonnull align 8 dereferenceable(272) %0) - to label %71 unwind label %67 + to label %72 unwind label %67 56: ; preds = %2 %57 = landingpad { ptr, i32 } @@ -12945,7 +12949,7 @@ _ZN7zstringD2Ev.exit: ; preds = %73, %76 ret void 80: ; preds = %72, %56 - %.pn7.pn = phi { ptr, i32 } [ %.pn7, %72 ], [ %57, %56 ] + %.pn7.pn = phi { ptr, i32 } [ %.pn7, %73 ], [ %57, %56 ] call void @_ZN7zstringD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #25 call void @llvm.lifetime.end.p0(ptr nonnull %4) resume { ptr, i32 } %.pn7.pn @@ -13946,15 +13950,19 @@ _ZNK14core_hashtableI18default_hash_entryI6symbolE16symbol_hash_proc14symbol_eq_ %44 = load i8, ptr %38, align 1, !tbaa !188 %45 = sext i8 %44 to i32 %46 = ptrtoint ptr %43 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %55, %.lr.ph.i.i - %.041.i.i = phi i64 [ %40, %.lr.ph.i.i ], [ %58, %55 ] - %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %56, %55 ] - %reass.sub = sub i64 %.041.i.i, %39 - %47 = add i64 %reass.sub, 1 - %48 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i, i32 noundef %45, i64 noundef %47) #25 - %.not34.i.i = icmp eq ptr %48, null + %invariant.op = sub i64 1, %39 + br label %47 + +47:; preds = %56, %.lr.ph.i.i + %.02840.i.i = phi i64 [ %40, %.lr.ph.i.i ], [ %59, %56 ] + %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %57, %56 ] + %47 = add i64 %.041.i.i, %invariant.op + %48 = icmp eq i64 %47, 0 + br i1 %48, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %47 + %49 = call ptr @memchr(ptr noundef %.02840.i.i, i32 noundef %45, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #25 + %.not34.i.i = icmp eq ptr %49, null br i1 %.not34.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i @@ -13974,10 +13982,10 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsI %57 = ptrtoint ptr %56 to i64 %58 = sub i64 %46, %57 %.not33.i.i = icmp ult i64 %58, %39 - br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !515 + br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %47, !llvm.loop !515 -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %55, %.lr.ph, %42, %50 - %.027.i.i = phi i1 [ false, %.lr.ph ], [ true, %42 ], [ %54, %50 ], [ true, %55 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %47, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %55, %.lr.ph, %42, %50 + %.027.i.i = phi i1 [ false, %.lr.ph ], [ true, %42 ], [ %54, %50 ], [ true, %56 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ true, %47 ] %59 = icmp eq ptr %.pre, %11 br i1 %59, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i diff --git a/bench/z3/optimized/theory_seq.ll b/bench/z3/optimized/theory_seq.ll index ea499e29ef9..e88deffdb52 100644 --- a/bench/z3/optimized/theory_seq.ll +++ b/bench/z3/optimized/theory_seq.ll @@ -57111,38 +57111,42 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit: ; preds = %_ZN6s %35 = load i8, ptr %27, align 1, !tbaa !71 %36 = sext i8 %35 to i32 %37 = ptrtoint ptr %34 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %46, %.lr.ph.i.i - %.041.i.i = phi i64 [ %31, %.lr.ph.i.i ], [ %49, %46 ] - %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %47, %46 ] - %reass.sub = sub i64 %.041.i.i, %29 - %38 = add i64 %reass.sub, 1 - %39 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i, i32 noundef %36, i64 noundef %38) #27 - %.not34.i.i = icmp eq ptr %39, null + %invariant.op = sub i64 1, %29 + br label %38 + +38:; preds = %47, %.lr.ph.i.i + %.02840.i.i = phi i64 [ %31, %.lr.ph.i.i ], [ %49, %47 ] + %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %48, %47 ] + %38 = add i64 %.041.i.i, %invariant.op + %39 = icmp eq i64 %38, 0 + br i1 %39, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %38 + %40 = call ptr @memchr(ptr noundef %.02840.i.i, i32 noundef %36, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #27 + %.not34.i.i = icmp eq ptr %40, null br i1 %.not34.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - %bcmp.i.i = call i32 @bcmp(ptr nonnull %39, ptr nonnull %27, i64 %29) + %bcmp.i.i = call i32 @bcmp(ptr nonnull %40, ptr nonnull %27, i64 %29) %40 = icmp eq i32 %bcmp.i.i, 0 br i1 %40, label %41, label %46 41: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %42 = ptrtoint ptr %39 to i64 + %42 = ptrtoint ptr %40 to i64 %43 = ptrtoint ptr %.pre to i64 %44 = sub i64 %42, %43 %45 = icmp eq i64 %44, -1 br label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit 46: ; preds = %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i - %47 = getelementptr inbounds nuw i8, ptr %39, i64 1 + %47 = getelementptr inbounds nuw i8, ptr %40, i64 1 %48 = ptrtoint ptr %47 to i64 %49 = sub i64 %37, %48 %.not33.i.i = icmp ult i64 %49, %29 - br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !1413 + br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %38, !llvm.loop !1413 -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %46, %25, %33, %41 - %.027.i.i = phi i1 [ false, %25 ], [ true, %33 ], [ %45, %41 ], [ true, %46 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %38, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %46, %25, %33, %41 + %.027.i.i = phi i1 [ false, %25 ], [ true, %33 ], [ %45, %42 ], [ true, %47 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ true, %38 ] %50 = getelementptr inbounds nuw i8, ptr %7, i64 16 %51 = icmp eq ptr %.pre, %50 br i1 %51, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i11, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i10 @@ -57164,7 +57168,7 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit12: ; preds = %_ZN 55: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit12 invoke void @_ZN11seq_factory13add_new_delimEv(ptr noundef nonnull align 8 dereferenceable(272) %0) - to label %71 unwind label %67 + to label %72 unwind label %67 56: ; preds = %2 %57 = landingpad { ptr, i32 } @@ -57238,7 +57242,7 @@ _ZN7zstringD2Ev.exit: ; preds = %73, %76 ret void 80: ; preds = %72, %56 - %.pn7.pn = phi { ptr, i32 } [ %.pn7, %72 ], [ %57, %56 ] + %.pn7.pn = phi { ptr, i32 } [ %.pn7, %73 ], [ %57, %56 ] call void @_ZN7zstringD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #27 call void @llvm.lifetime.end.p0(ptr nonnull %4) resume { ptr, i32 } %.pn7.pn @@ -58158,15 +58162,19 @@ _ZNK14core_hashtableI18default_hash_entryI6symbolE16symbol_hash_proc14symbol_eq_ %44 = load i8, ptr %38, align 1, !tbaa !71 %45 = sext i8 %44 to i32 %46 = ptrtoint ptr %43 to i64 - br label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i - -_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %55, %.lr.ph.i.i - %.041.i.i = phi i64 [ %40, %.lr.ph.i.i ], [ %58, %55 ] - %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %56, %55 ] - %reass.sub = sub i64 %.041.i.i, %39 - %47 = add i64 %reass.sub, 1 - %48 = call ptr @memchr(ptr noundef nonnull dereferenceable(1) %.02840.i.i, i32 noundef %45, i64 noundef %47) #27 - %.not34.i.i = icmp eq ptr %48, null + %invariant.op = sub i64 1, %39 + br label %47 + +47:; preds = %56, %.lr.ph.i.i + %.02840.i.i = phi i64 [ %40, %.lr.ph.i.i ], [ %59, %56 ] + %.02840.i.i = phi ptr [ %.pre, %.lr.ph.i.i ], [ %57, %56 ] + %47 = add i64 %.041.i.i, %invariant.op + %48 = icmp eq i64 %47, 0 + br i1 %48, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i + +_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i: ; preds = %47 + %49 = call ptr @memchr(ptr noundef %.02840.i.i, i32 noundef %45, i64 noundef %.reass.reass.i.reass.reass.i.reass.reass.reass) #27 + %.not34.i.i = icmp eq ptr %49, null br i1 %.not34.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i @@ -58186,10 +58194,10 @@ _ZNSt11char_traitsIcE7compareEPKcS2_m.exit.i.i: ; preds = %_ZNSt11char_traitsI %57 = ptrtoint ptr %56 to i64 %58 = sub i64 %46, %57 %.not33.i.i = icmp ult i64 %58, %39 - br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, !llvm.loop !1413 + br i1 %.not33.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit, label %47, !llvm.loop !1413 -_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %55, %.lr.ph, %42, %50 - %.027.i.i = phi i1 [ false, %.lr.ph ], [ true, %42 ], [ %54, %50 ], [ true, %55 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ] +_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE4findERKS4_m.exit: ; preds = %47, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i, %55, %.lr.ph, %42, %50 + %.027.i.i = phi i1 [ false, %.lr.ph ], [ true, %42 ], [ %54, %50 ], [ true, %56 ], [ true, %_ZNSt11char_traitsIcE4findEPKcmRS1_.exit.i.i ], [ true, %47 ] %59 = icmp eq ptr %.pre, %11 br i1 %59, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i diff --git a/bench/z3/optimized/upolynomial.ll b/bench/z3/optimized/upolynomial.ll index f0e40153110..f825f16d233 100644 --- a/bench/z3/optimized/upolynomial.ll +++ b/bench/z3/optimized/upolynomial.ll @@ -17692,6 +17692,7 @@ define hidden noundef i32 @_ZN11upolynomial7manager31knuth_positive_root_upper_b .lr.ph: ; preds = %17 %19 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %invariant.op = sub i32 1, %18 br label %21 ._crit_edge.loopexit: ; preds = %45 @@ -17699,8 +17700,8 @@ define hidden noundef i32 @_ZN11upolynomial7manager31knuth_positive_root_upper_b br label %._crit_edge 21: ; preds = %.lr.ph, %45 - %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %45 ] - %.03947 = phi i32 [ 0, %.lr.ph ], [ %.1, %45 ] + %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %44 ] + %.03947 = phi i32 [ 0, %.lr.ph ], [ %.1, %44 ] %22 = sub nuw nsw i64 %7, %indvars.iv %23 = getelementptr inbounds nuw %class.mpz, ptr %2, i64 %22 %24 = load i32, ptr %23, align 8, !tbaa !8 @@ -17730,14 +17731,13 @@ define hidden noundef i32 @_ZN11upolynomial7manager31knuth_positive_root_upper_b br i1 %37, label %45, label %38 38: ; preds = %35 - %reass.sub = sub nuw i32 %36, %18 - %39 = add i32 %reass.sub, 1 - %40 = trunc nuw i64 %indvars.iv to i32 - %41 = urem i32 %39, %40 - %42 = icmp ne i32 %41, 0 - %43 = udiv i32 %39, %40 - %44 = zext i1 %42 to i32 - %.0 = add i32 %43, %44 + %.reass.reass = add i32 %36, %invariant.op + %39 = trunc nuw i64 %indvars.iv to i32 + %40 = urem i32 %.reass.reass, %39 + %41 = icmp ne i32 %40, 0 + %42 = udiv i32 %.reass.reass, %39 + %43 = zext i1 %41 to i32 + %.0 = add i32 %42, %43 %spec.select = tail call i32 @llvm.umax.i32(i32 %.0, i32 %.03947) br label %45 diff --git a/bench/zed-rs/optimized/5qf95fx0pqn6duuq4hkly3hl0.ll b/bench/zed-rs/optimized/5qf95fx0pqn6duuq4hkly3hl0.ll index 6126399b816..eaa1d3a6fad 100644 --- a/bench/zed-rs/optimized/5qf95fx0pqn6duuq4hkly3hl0.ll +++ b/bench/zed-rs/optimized/5qf95fx0pqn6duuq4hkly3hl0.ll @@ -7665,14 +7665,14 @@ define hidden void @"_ZN87_$LT$core..str..pattern..StrSearcher$u20$as$u20$core.. %110 = getelementptr inbounds nuw i8, ptr %1, i64 24 %111 = load i64, ptr %110, align 8, !alias.scope !1504, !noalias !1511 %.promoted54.i = load i64, ptr %109, align 8, !alias.scope !1504, !noalias !1511 + %invariant.op.i = sub i64 %10, %108 %112 = sub i64 %10, %111 - %.neg.i = sub i64 %10, %108 br label %113 113: ; preds = %138, %.lr.ph.i - %114 = phi i64 [ %.promoted54.i, %.lr.ph.i ], [ %139, %138 ] - %115 = phi i64 [ %103, %.lr.ph.i ], [ %141, %138 ] - %116 = phi i64 [ %10, %.lr.ph.i ], [ %140, %138 ] + %114 = phi i64 [ %.promoted54.i, %.lr.ph.i ], [ %139, %137 ] + %115 = phi i64 [ %103, %.lr.ph.i ], [ %141, %137 ] + %116 = phi i64 [ %10, %.lr.ph.i ], [ %140, %137 ] %.not.i = icmp eq i64 %10, %116 br i1 %.not.i, label %117, label %.loopexit @@ -7718,7 +7718,7 @@ define hidden void @"_ZN87_$LT$core..str..pattern..StrSearcher$u20$as$u20$core.. br i1 %.not26.i.us, label %.split42.us, label %.split48.us .split48.us: ; preds = %132 - %137 = add i64 %.neg.i, %129 + %137 = add i64 %129, %invariant.op.i store i64 %137, ptr %9, align 8, !alias.scope !1504, !noalias !1511 br i1 %94, label %138, label %.sink.split.i @@ -7727,14 +7727,14 @@ define hidden void @"_ZN87_$LT$core..str..pattern..StrSearcher$u20$as$u20$core.. br i1 %.not24.i, label %.split44.us, label %143 .sink.split.i: ; preds = %.split48.us, %162, %125 - %.sink109.i = phi i64 [ %111, %162 ], [ %102, %.split48.us ], [ %102, %125 ] - %.ph108.i = phi i64 [ %112, %162 ], [ %137, %.split48.us ], [ %115, %125 ] + %.sink109.i = phi i64 [ %111, %161 ], [ %102, %.split48.us ], [ %102, %125 ] + %.ph108.i = phi i64 [ %112, %161 ], [ %137, %.split48.us ], [ %115, %125 ] store i64 %.sink109.i, ptr %109, align 8, !alias.scope !1504, !noalias !1511 br label %138 138: ; preds = %.split48.us, %162, %.sink.split.i, %125 - %139 = phi i64 [ %114, %.split48.us ], [ %114, %162 ], [ %114, %125 ], [ %.sink109.i, %.sink.split.i ] - %140 = phi i64 [ %137, %.split48.us ], [ %112, %162 ], [ %115, %125 ], [ %.ph108.i, %.sink.split.i ] + %139 = phi i64 [ %114, %.split48.us ], [ %114, %161 ], [ %114, %125 ], [ %.sink109.i, %.sink.split.i ] + %140 = phi i64 [ %137, %.split48.us ], [ %112, %161 ], [ %115, %125 ], [ %.ph108.i, %.sink.split.i ] %141 = sub i64 %140, %102 %142 = icmp ult i64 %141, %98 br i1 %142, label %113, label %.split11 @@ -7748,7 +7748,7 @@ define hidden void @"_ZN87_$LT$core..str..pattern..StrSearcher$u20$as$u20$core.. unreachable 144: ; preds = %155, %.split44.us - %.sroa.010.0.i = phi i64 [ %108, %.split44.us ], [ %148, %155 ] + %.sroa.010.0.i = phi i64 [ %108, %.split44.us ], [ %148, %154 ] %145 = icmp ult i64 %.sroa.010.0.i, %.sroa.09.0.i br i1 %145, label %147, label %146 @@ -7810,13 +7810,13 @@ _ZN4core3str7pattern14TwoWaySearcher9next_back17h0cc4054227d49a87E.exit: ; preds br label %89 .lr.ph: ; preds = %.loopexit, %173 - %.sroa.02.054 = phi i64 [ %174, %173 ], [ %116, %.loopexit ] + %.sroa.02.054 = phi i64 [ %174, %172 ], [ %116, %.loopexit ] %164 = icmp ult i64 %.sroa.02.054, %98 br i1 %164, label %167, label %171 .split11: ; preds = %138, %173, %91, %.loopexit, %.split - %.sroa.02.023 = phi i64 [ %.sroa.02.054.lcssa, %.split ], [ 0, %.loopexit ], [ 0, %91 ], [ 0, %173 ], [ 0, %138 ] - %phi.call = phi i64 [ %.sroa.0.0.sroa.speculated.i, %.split ], [ 0, %.loopexit ], [ 0, %91 ], [ 0, %173 ], [ 0, %138 ] + %.sroa.02.023 = phi i64 [ %.sroa.02.054.lcssa, %.split ], [ 0, %.loopexit ], [ 0, %91 ], [ 0, %172 ], [ 0, %137 ] + %phi.call = phi i64 [ %.sroa.0.0.sroa.speculated.i, %.split ], [ 0, %.loopexit ], [ 0, %91 ], [ 0, %172 ], [ 0, %137 ] store i64 %phi.call, ptr %9, align 8 %165 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %.sroa.02.023, ptr %165, align 8 @@ -7836,7 +7836,7 @@ _ZN4core3str7pattern14TwoWaySearcher9next_back17h0cc4054227d49a87E.exit: ; preds br i1 %172, label %.split, label %173 .split: ; preds = %167, %171 - %.sroa.02.054.lcssa = phi i64 [ %.sroa.02.054, %167 ], [ %98, %171 ] + %.sroa.02.054.lcssa = phi i64 [ %.sroa.02.054, %166 ], [ %98, %170 ] %.sroa.0.0.sroa.speculated.i = tail call noundef i64 @llvm.umin.i64(i64 %.sroa.02.054.lcssa, i64 %116) br label %.split11 diff --git a/scripts/setup_pre_commit_patch.sh b/scripts/setup_pre_commit_patch.sh index c8d0fce0bf7..0372beb81a6 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/183082 export COMPTIME_MODE=0 export STAT_MODE=0 export STAT_NAME=""