diff --git a/bench/actix-rs/optimized/1ghd7r3h0kcgux6d.ll b/bench/actix-rs/optimized/1ghd7r3h0kcgux6d.ll index 81016f601ba..f918dfd3024 100644 --- a/bench/actix-rs/optimized/1ghd7r3h0kcgux6d.ll +++ b/bench/actix-rs/optimized/1ghd7r3h0kcgux6d.ll @@ -10520,19 +10520,18 @@ _ZN6brotli3enc7command17GetCopyLengthCode17hab981e27915e86caE.exit: ; preds = %1 %151 = and i32 %150, 192 %152 = add nuw nsw i32 %148, %151 %153 = trunc i32 %152 to i16 - %154 = or disjoint i16 %139, %153 br label %_ZN6brotli3enc7command18CombineLengthCodes17he28c5563882f5f20E.exit 155: ; preds = %_ZN6brotli3enc7command17GetCopyLengthCode17hab981e27915e86caE.exit - %156 = icmp samesign ult i16 %.0.i, 8 - %157 = or disjoint i16 %139, 64 - %spec.select.i = select i1 %156, i16 %139, i16 %157 + %155 = shl nuw nsw i16 %.0.i, 3 + %156 = and i16 %155, 64 br label %_ZN6brotli3enc7command18CombineLengthCodes17he28c5563882f5f20E.exit _ZN6brotli3enc7command18CombineLengthCodes17he28c5563882f5f20E.exit: ; preds = %142, %155 - %.0.i13 = phi i16 [ %154, %142 ], [ %spec.select.i, %155 ] - %158 = getelementptr inbounds nuw i8, ptr %11, i64 12 - store i16 %.0.i13, ptr %158, align 4 + %.0.i13 = phi i16 [ %153, %142 ], [ %156, %155 ] + %.0.i13 = or disjoint i16 %139, %.0.i13 + %157 = getelementptr inbounds nuw i8, ptr %11, i64 12 + store i16 %.0.i13, ptr %157, align 4 br label %70 159: ; preds = %.preheader, %181 diff --git a/bench/actix-rs/optimized/4pmtvrahn6eloepe.ll b/bench/actix-rs/optimized/4pmtvrahn6eloepe.ll index 47769b8d43c..cc914ab0bc5 100644 --- a/bench/actix-rs/optimized/4pmtvrahn6eloepe.ll +++ b/bench/actix-rs/optimized/4pmtvrahn6eloepe.ll @@ -5716,9 +5716,9 @@ _ZN6brotli3enc7command17GetCopyLengthCode17hab981e27915e86caE.exit: ; preds = %2 br i1 %or.cond6.i, label %.thread, label %_ZN6brotli3enc7command18CombineLengthCodes17he28c5563882f5f20E.exit .thread: ; preds = %_ZN6brotli3enc7command17GetCopyLengthCode17hab981e27915e86caE.exit - %235 = icmp samesign ult i16 %.0.i143, 8 - %236 = or disjoint i16 %233, 64 - %spec.select.i = select i1 %235, i16 %233, i16 %236 + %235 = shl nuw nsw i16 %.0.i143, 3 + %236 = and i16 %235, 64 + %spec.select.i = or disjoint i16 %233, %236 %237 = zext nneg i16 %.0.i143 to i64 %238 = zext nneg i16 %spec.select.i to i64 br label %261 diff --git a/bench/draco/optimized/symbol_encoding.ll b/bench/draco/optimized/symbol_encoding.ll index 877d7015265..a8c582f6cab 100644 --- a/bench/draco/optimized/symbol_encoding.ll +++ b/bench/draco/optimized/symbol_encoding.ll @@ -1855,9 +1855,8 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit124: ; preds = %_Z br label %.thread147 86: ; preds = %82 - %87 = icmp samesign ugt i32 %58, 7 - %88 = zext i1 %87 to i32 - %spec.select = add nuw nsw i32 %.0, %88 + %87 = lshr i32 %58, 3 + %spec.select = add nuw nsw i32 %.0, %87 br label %.thread147 .thread147: ; preds = %86, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit, %.thread, %80, %84, %76 diff --git a/bench/folly/optimized/EpollBackend.ll b/bench/folly/optimized/EpollBackend.ll index c4a2a1b388c..82fa2dfc591 100644 --- a/bench/folly/optimized/EpollBackend.ll +++ b/bench/folly/optimized/EpollBackend.ll @@ -626,10 +626,10 @@ _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc.exit48: ; preds = %9 %38 = getelementptr inbounds nuw i8, ptr %.0, i64 16 store ptr %1, ptr %38, align 8, !tbaa !56 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #21 - %39 = and i16 %17, 4 - %40 = lshr i16 %17, 1 - %.lobit.i = and i16 %40, 1 - %.1.i55 = or disjoint i16 %.lobit.i, %39 + %39 = lshr i16 %17, 1 + %.lobit.i = and i16 %39, 1 + %.lobit.i = and i16 %17, 4 + %.1.i55 = or disjoint i16 %.lobit.i, %40 %.1.i = zext nneg i16 %.1.i55 to i32 store i32 %.1.i, ptr %4, align 4, !tbaa !61 %41 = getelementptr inbounds nuw i8, ptr %4, i64 4 @@ -871,10 +871,10 @@ define noundef zeroext i1 @_ZN5folly12EpollBackend16setEdgeTriggeredERNS_14Event call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #21 %7 = getelementptr inbounds nuw i8, ptr %1, i64 104 %8 = load i16, ptr %7, align 8, !tbaa !64 - %9 = and i16 %8, 4 - %10 = lshr i16 %8, 1 - %.lobit.i = and i16 %10, 1 - %.1.i18 = or disjoint i16 %.lobit.i, %9 + %9 = lshr i16 %8, 1 + %.lobit.i = and i16 %9, 1 + %.lobit.i = and i16 %8, 4 + %.1.i18 = or disjoint i16 %.lobit.i, %10 %.1.i = zext nneg i16 %.1.i18 to i32 %11 = or disjoint i32 %.1.i, -2147483648 store i32 %11, ptr %2, align 4, !tbaa !61 diff --git a/bench/linux/optimized/open.ll b/bench/linux/optimized/open.ll index e3f929b01f7..e93f4f82844 100644 --- a/bench/linux/optimized/open.ll +++ b/bench/linux/optimized/open.ll @@ -1632,10 +1632,10 @@ define dso_local range(i64 -2147483648, 2147483648) i64 @__x64_sys_fchmodat2(ptr call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false), !annotation !6 %18 = lshr exact i32 %14, 8 %19 = and i32 %18, 1 - %20 = xor i32 %19, 1 - %21 = icmp samesign ult i32 %14, 4096 - %22 = or disjoint i32 %20, 16384 - %23 = select i1 %21, i32 %20, i32 %22 + %20 = shl nuw nsw i32 %14, 2 + %21 = and i32 %20, 16384 + %22 = or disjoint i32 %19, %21 + %23 = xor i32 %22, 1 %24 = call i32 @user_path_at_empty(i32 noundef %11, ptr noundef %12, i32 noundef %23, ptr noundef nonnull %2, ptr noundef null) #14 %25 = icmp eq i32 %24, 0 br i1 %25, label %26, label %do_fchmodat.exit @@ -1689,10 +1689,10 @@ define dso_local range(i64 -2147483648, 2147483648) i64 @__ia32_sys_fchmodat2(pt call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %2, i8 0, i64 16, i1 false), !annotation !6 %19 = lshr exact i32 %15, 8 %20 = and i32 %19, 1 - %21 = xor i32 %20, 1 - %22 = icmp samesign ult i32 %15, 4096 - %23 = or disjoint i32 %21, 16384 - %24 = select i1 %22, i32 %21, i32 %23 + %21 = shl nuw nsw i32 %15, 2 + %22 = and i32 %21, 16384 + %23 = or disjoint i32 %20, %22 + %24 = xor i32 %23, 1 %25 = call i32 @user_path_at_empty(i32 noundef %12, ptr noundef %13, i32 noundef %24, ptr noundef nonnull %2, ptr noundef null) #14 %26 = icmp eq i32 %25, 0 br i1 %26, label %27, label %do_fchmodat.exit @@ -2003,10 +2003,10 @@ define dso_local i32 @do_fchownat(i32 noundef %0, ptr noundef %1, i32 noundef %2 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false), !annotation !6 %10 = lshr exact i32 %4, 8 %11 = and i32 %10, 1 - %12 = xor i32 %11, 1 - %13 = icmp samesign ult i32 %4, 4096 - %14 = or disjoint i32 %12, 16384 - %15 = select i1 %13, i32 %12, i32 %14 + %12 = shl nuw nsw i32 %4, 2 + %13 = and i32 %12, 16384 + %14 = or disjoint i32 %11, %13 + %15 = xor i32 %14, 1 %16 = call i32 @user_path_at_empty(i32 noundef %0, ptr noundef %1, i32 noundef %15, ptr noundef nonnull %6, ptr noundef null) #14 %17 = icmp eq i32 %16, 0 br i1 %17, label %18, label %.loopexit @@ -4102,10 +4102,10 @@ define internal fastcc range(i64 -2147483648, 2147483648) i64 @do_faccessat(i32 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false), !annotation !6 %11 = lshr exact i32 %3, 8 %12 = and i32 %11, 1 - %13 = xor i32 %12, 1 - %14 = icmp samesign ult i32 %3, 4096 - %15 = or disjoint i32 %13, 16384 - %16 = select i1 %14, i32 %13, i32 %15 + %13 = shl nuw nsw i32 %3, 2 + %14 = and i32 %13, 16384 + %15 = or disjoint i32 %12, %14 + %16 = xor i32 %15, 1 %17 = and i32 %3, 512 %18 = icmp eq i32 %17, 0 br i1 %18, label %19, label %83 diff --git a/bench/linux/optimized/utimes.ll b/bench/linux/optimized/utimes.ll index 0e703a83d8b..87645812d42 100644 --- a/bench/linux/optimized/utimes.ll +++ b/bench/linux/optimized/utimes.ll @@ -234,10 +234,10 @@ define dso_local range(i64 -2147483648, 2147483648) i64 @do_utimes(i32 noundef % 25: ; preds = %22 %26 = lshr exact i32 %3, 8 %27 = and i32 %26, 1 - %28 = xor i32 %27, 1 - %29 = icmp samesign ult i32 %3, 4096 - %30 = or disjoint i32 %28, 16384 - %31 = select i1 %29, i32 %28, i32 %30 + %28 = shl nuw nsw i32 %3, 2 + %29 = and i32 %28, 16384 + %30 = or disjoint i32 %27, %29 + %31 = xor i32 %30, 1 %32 = call i32 @user_path_at_empty(i32 noundef %0, ptr noundef %1, i32 noundef %31, ptr noundef nonnull %5, ptr noundef null) #7 %33 = icmp eq i32 %32, 0 br i1 %33, label %34, label %.loopexit diff --git a/bench/quickjs/optimized/libbf.ll b/bench/quickjs/optimized/libbf.ll index 910ffe159e5..4d8123c5d9b 100644 --- a/bench/quickjs/optimized/libbf.ll +++ b/bench/quickjs/optimized/libbf.ll @@ -1115,9 +1115,9 @@ bf_resize.exit: ; preds = %.bf_resize.exit_cri br i1 %.not109, label %131, label %129 129: ; preds = %127 - %.not110 = icmp samesign ult i32 %spec.select, 16 - %130 = or i32 %spec.select, 8 - %spec.select129 = select i1 %.not110, i32 %spec.select, i32 %130 + %130 = lshr i32 %spec.select, 1 + %131 = and i32 %130, 8 + %spec.select129 = or i32 %131, %spec.select br label %142 131: ; preds = %127, %91 @@ -1160,58 +1160,58 @@ bf_set_zero.exit: ; preds = %131, %137 %149 = sub i64 %.pre.i, %.089 %150 = ashr i64 %149, 6 %151 = icmp sgt i64 %150, -1 - br i1 %151, label %152, label %.preheader - -152: ; preds = %148 - %153 = trunc i64 %149 to i32 - %154 = and i32 %153, 63 - %.not111 = icmp eq i32 %154, 0 - br i1 %.not111, label %.preheader, label %155 - -155: ; preds = %152 - %156 = sub nuw nsw i32 64, %154 - %157 = zext nneg i32 %156 to i64 - %notmask.i = shl nsw i64 -1, %157 - %158 = xor i64 %notmask.i, -1 - %159 = and i64 %149, 63 - %160 = shl i64 %158, %159 - %161 = getelementptr inbounds nuw i64, ptr %54, i64 %150 - %162 = load i64, ptr %161, align 8, !tbaa !33 - %163 = and i64 %162, %160 - store i64 %163, ptr %161, align 8, !tbaa !33 - br label %.preheader - -.preheader: ; preds = %148, %152, %155 - %.3.ph = phi i64 [ 0, %148 ], [ %150, %152 ], [ %150, %155 ] - br label %164 + br i1 %151, label %153, label %.preheader -164: ; preds = %.preheader, %164 - %.3 = phi i64 [ %168, %164 ], [ %.3.ph, %.preheader ] - %165 = getelementptr inbounds i64, ptr %54, i64 %.3 - %166 = load i64, ptr %165, align 8, !tbaa !33 - %167 = icmp eq i64 %166, 0 - %168 = add i64 %.3, 1 - br i1 %167, label %164, label %169, !llvm.loop !43 +164: ; preds = %149 + %154 = trunc i64 %149 to i32 + %155 = and i32 %154, 63 + %.not111 = icmp eq i32 %155, 0 + br i1 %.not111, label %171, label %156 169: ; preds = %164 - %170 = icmp sgt i64 %.3, 0 - br i1 %170, label %171, label %175 + %157 = sub nuw nsw i32 64, %155 + %158 = zext nneg i32 %157 to i64 + %notmask.i = shl nsw i64 -1, %158 + %159 = xor i64 %notmask.i, -1 + %160 = and i64 %150, 63 + %161 = shl i64 %159, %160 + %162 = getelementptr inbounds nuw i64, ptr %54, i64 %151 + %163 = load i64, ptr %162, align 8, !tbaa !33 + %164 = and i64 %163, %161 + store i64 %164, ptr %162, align 8, !tbaa !33 + br label %.preheader -171: ; preds = %169 - %172 = getelementptr inbounds nuw i64, ptr %54, i64 %.3 - %173 = sub i64 %3, %.3 - %174 = shl i64 %173, 3 - tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 8 %54, ptr nonnull align 8 %172, i64 %174, i1 false) - br label %175 - -175: ; preds = %171, %169 - %.091 = phi i64 [ %173, %171 ], [ %3, %169 ] - %176 = getelementptr inbounds nuw i8, ptr %0, i64 24 - %177 = load i64, ptr %176, align 8, !tbaa !32 - %.not.i118 = icmp eq i64 %.091, %177 - br i1 %.not.i118, label %bf_resize.exit122, label %178 +171: ; preds = %149, %153, %169 + %.3.ph = phi i64 [ 0, %149 ], [ %151, %153 ], [ %151, %156 ] + br label %165 + +165:; preds = %171, %165 + %.3 = phi i64 [ %169, %165 ], [ %.3.ph, %171 ] + %166 = getelementptr inbounds i64, ptr %54, i64 %.3 + %167 = load i64, ptr %166, align 8, !tbaa !33 + %168 = icmp eq i64 %167, 0 + %169 = add i64 %.3, 1 + br i1 %168, label %165, label %170, !llvm.loop !43 + +170: ; preds = %165 + %171 = icmp sgt i64 %.3, 0 + br i1 %171, label %172, label %176 + +172: ; preds = %170 + %173 = getelementptr inbounds nuw i64, ptr %54, i64 %.3 + %174 = sub i64 %3, %.3 + %175 = shl i64 %174, 3 + tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 8 %54, ptr nonnull align 8 %173, i64 %175, i1 false) + br label %176 + +176: ; preds = %172, %170 + %.091 = phi i64 [ %174, %172 ], [ %3, %170 ] + %177 = getelementptr inbounds nuw i8, ptr %0, i64 24 + %178 = load i64, ptr %177, align 8, !tbaa !32 + %.not.i118 = icmp eq i64 %.091, %178 + br i1 %.not.i118, label %bf_resize.exit122, label %179 -178: ; preds = %175 +178: ; preds = %176 %179 = load ptr, ptr %0, align 8, !tbaa !28 %180 = load ptr, ptr %53, align 8, !tbaa !29 %181 = shl i64 %.091, 3 @@ -1226,11 +1226,11 @@ bf_set_zero.exit: ; preds = %131, %137 186: ; preds = %178 store ptr %183, ptr %53, align 8, !tbaa !29 - store i64 %.091, ptr %176, align 8, !tbaa !32 + store i64 %.091, ptr %177, align 8, !tbaa !32 br label %bf_resize.exit122 -bf_resize.exit122: ; preds = %186, %178, %175, %144, %bf_set_zero.exit, %bf_resize.exit - %.090 = phi i32 [ %105, %bf_resize.exit ], [ %132, %bf_set_zero.exit ], [ %147, %144 ], [ %.0128, %175 ], [ %.0128, %178 ], [ %.0128, %186 ] +bf_resize.exit122: ; preds = %186, %178, %176, %144, %bf_set_zero.exit, %bf_resize.exit + %.090 = phi i32 [ %105, %bf_resize.exit ], [ %132, %bf_set_zero.exit ], [ %147, %144 ], [ %.0128, %176 ], [ %.0128, %178 ], [ %.0128, %186 ] ret i32 %.090 } diff --git a/bench/softposit-rs/optimized/3yl6353p3hwrtv6y.ll b/bench/softposit-rs/optimized/3yl6353p3hwrtv6y.ll index e38b18a8983..84c3f57a2a4 100644 --- a/bench/softposit-rs/optimized/3yl6353p3hwrtv6y.ll +++ b/bench/softposit-rs/optimized/3yl6353p3hwrtv6y.ll @@ -183,65 +183,56 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64: ; preds %48 = zext nneg i16 %44 to i32 %49 = mul nuw nsw i32 %48, %47 %50 = icmp samesign ugt i8 %46, 1 - %51 = xor i8 %46, 2 - %52 = zext i1 %50 to i8 - %.040 = add i8 %45, %52 - %.037 = select i1 %50, i8 %51, i8 %46 - %53 = icmp samesign ult i32 %49, 536870912 - br i1 %53, label %55, label %62 - -.sink.split: ; preds = %4, %78 - %.sink = phi i128 [ %.039, %78 ], [ -170141183460469231731687303715884105728, %4 ] + %51 = zext i1 %50 to i8 + %.040 = add i8 %45, %51 + %.037 = and i8 %46, 1 + %52 = icmp samesign ugt i32 %49, 536870911 + %spec.select49 = select i1 %52, i8 %.037, i8 0 + %.141 = add i8 %.040, %spec.select49 + %53 = zext i1 %52 to i8 + %.138 = xor i8 %.037, %53 + %54 = zext i1 %52 to i32 + %.035 = lshr exact i32 %49, %54 + %55 = sext i8 %.141 to i16 + %56 = shl nsw i16 %55, 1 + %57 = or disjoint i8 %.138, 28 + %58 = zext nneg i8 %57 to i16 + %59 = add nsw i16 %56, %58 + %60 = icmp sgt i16 %59, 0 + br i1 %60, label %68, label %62 + +.sink.split: ; preds = %4, %73 + %.sink = phi i128 [ %.039, %73 ], [ -170141183460469231731687303715884105728, %4 ] store i128 %.sink, ptr %0, align 16 br label %54 54: ; preds = %.sink.split, %9 ret void -55: ; preds = %62, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64 - %.141 = phi i8 [ %.040, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64 ], [ %spec.select49, %62 ] - %.138 = phi i8 [ %.037, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64 ], [ %65, %62 ] - %.035 = phi i32 [ %49, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64 ], [ %66, %62 ] - %56 = sext i8 %.141 to i16 - %57 = shl nsw i16 %56, 1 - %58 = add nsw i16 %57, 28 - %59 = zext nneg i8 %.138 to i16 - %60 = add nsw i16 %58, %59 - %61 = icmp sgt i16 %60, 0 - br i1 %61, label %73, label %67 - 62: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64 - %63 = icmp ne i8 %.037, 0 - %64 = zext i1 %63 to i8 - %spec.select49 = add i8 %.040, %64 - %65 = xor i8 %.037, 1 - %66 = lshr exact i32 %49, 1 - br label %55 - -67: ; preds = %55 - %68 = sub nsw i16 0, %60 + %63 = sub nsw i16 0, %59 + %64 = zext nneg i32 %.035 to i128 + %65 = and i16 %63, 127 + %66 = zext nneg i16 %65 to i128 + %66 = lshr i128 %64, %66 + br label %73 + +67: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit64 %69 = zext nneg i32 %.035 to i128 - %70 = and i16 %68, 127 + %70 = and i16 %59, 127 %71 = zext nneg i16 %70 to i128 - %72 = lshr i128 %69, %71 - br label %78 - -73: ; preds = %55 - %74 = zext nneg i32 %.035 to i128 - %75 = and i16 %60, 127 - %76 = zext nneg i16 %75 to i128 - %77 = shl i128 %74, %76 - br label %78 - -78: ; preds = %73, %67 - %.036 = phi i128 [ %77, %73 ], [ %72, %67 ] - %79 = xor i1 %14, %3 - %80 = xor i1 %15, %79 - %81 = sub i128 0, %.036 - %spec.select50 = select i1 %80, i128 %.036, i128 %81 - %82 = add i128 %spec.select50, %5 - %83 = icmp eq i128 %82, -170141183460469231731687303715884105728 - %.039 = select i1 %83, i128 0, i128 %82 + %72 = shl i128 %69, %71 + br label %73 + +73: ; preds = %68, %62 + %.036 = phi i128 [ %72, %68 ], [ %67, %62 ] + %74 = xor i1 %14, %3 + %75 = xor i1 %15, %74 + %76 = sub i128 0, %.036 + %spec.select50 = select i1 %75, i128 %.036, i128 %76 + %77 = add i128 %spec.select50, %5 + %78 = icmp eq i128 %77, -170141183460469231731687303715884105728 + %.039 = select i1 %78, i128 0, i128 %77 br label %.sink.split } diff --git a/bench/softposit-rs/optimized/5az6c15ag5q4gib5.ll b/bench/softposit-rs/optimized/5az6c15ag5q4gib5.ll index d2a012d43bd..2fc837361c0 100644 --- a/bench/softposit-rs/optimized/5az6c15ag5q4gib5.ll +++ b/bench/softposit-rs/optimized/5az6c15ag5q4gib5.ll @@ -2853,12 +2853,11 @@ define noundef i16 @"_ZN9softposit5p16e14math4sqrt41_$LT$impl$u20$softposit..p16 ; Function Attrs: nonlazybind uwtable define noundef i16 @"_ZN9softposit5p16e14math6tan_pi41_$LT$impl$u20$softposit..p16e1..P16E1$GT$6tan_pi17hd1c4fa4d534000e7E"(i16 noundef %0) unnamed_addr #2 { %2 = zext i16 %0 to i64 - %3 = and i64 %2, 32768 - %4 = icmp eq i64 %3, 0 - %5 = sub nuw nsw i64 65536, %2 - %spec.select = select i1 %4, i64 %2, i64 %5 - %6 = icmp samesign ugt i64 %spec.select, 31743 - br i1 %6, label %9, label %7 + %3 = sub nuw nsw i64 65536, %2 + %4 = icmp slt i16 %0, 0 + %spec.select = select i1 %4, i64 %3, i64 %2 + %5 = icmp samesign ugt i64 %spec.select, 31743 + br i1 %5, label %8, label %7 7: ; preds = %1 %8 = icmp eq i64 %spec.select, 0 @@ -2882,11 +2881,11 @@ define noundef i16 @"_ZN9softposit5p16e14math6tan_pi41_$LT$impl$u20$softposit..p %15 = icmp samesign ult i64 %spec.select, 8192 br i1 %15, label %.lr.ph89, label %.loopexit.thread -16: ; preds = %38, %43 - %.165 = phi i64 [ %47, %43 ], [ %42, %38 ] +16: ; preds = %38, %42 + %.165 = phi i64 [ %47, %42 ], [ %42, %38 ] %17 = and i64 %.165, 268435455 %18 = icmp eq i64 %17, 0 - br i1 %18, label %.thread, label %48 + br i1 %18, label %.thread, label %47 .lr.ph89: ; preds = %.preheader81, %.lr.ph89 %.06088 = phi i32 [ %20, %.lr.ph89 ], [ 14, %.preheader81 ] @@ -2917,7 +2916,7 @@ define noundef i16 @"_ZN9softposit5p16e14math6tan_pi41_$LT$impl$u20$softposit..p %31 = and i64 %.4, 4094 %32 = or disjoint i64 %31, 4096 %33 = icmp slt i32 %.2, 0 - br i1 %33, label %43, label %38 + br i1 %33, label %42, label %38 .lr.ph: ; preds = %.preheader82, %.lr.ph %.185 = phi i32 [ %35, %.lr.ph ], [ 16, %.preheader82 ] @@ -2936,75 +2935,74 @@ define noundef i16 @"_ZN9softposit5p16e14math6tan_pi41_$LT$impl$u20$softposit..p %42 = shl i64 %39, %41 br label %16 -43: ; preds = %.loopexit - %44 = sub i32 0, %spec.select73 - %45 = and i32 %44, 63 - %46 = zext nneg i32 %45 to i64 - %47 = lshr i64 %32, %46 - br label %16 +51: ; preds = %.loopexit + %43 = sub i32 0, %spec.select73 + %44 = and i32 %43, 63 + %45 = zext nneg i32 %44 to i64 + %46 = lshr i64 %31, %45 + br label %15 -48: ; preds = %16 - %49 = and i64 %.165, 134217727 - %50 = icmp eq i64 %49, 0 - br i1 %50, label %.thread, label %51 +56: ; preds = %15 + %48 = and i64 %.165, 134217727 + %49 = icmp eq i64 %48, 0 + br i1 %49, label %.thread, label %50 -.thread: ; preds = %7, %48, %16, %9, %129, %56 - %.0 = phi i16 [ %58, %56 ], [ %134, %129 ], [ %., %9 ], [ 0, %16 ], [ -32768, %48 ], [ 0, %7 ] +.thread: ; preds = %6, %47, %15, %8, %127, %55 + %.0 = phi i16 [ %57, %55 ], [ %132, %127 ], [ %., %8 ], [ 0, %15 ], [ -32768, %47 ], [ 0, %6 ] ret i16 %.0 -51: ; preds = %48 - %52 = icmp samesign ult i64 %17, 134217728 - %53 = xor i64 %3, 32768 - %spec.select74 = select i1 %52, i64 %3, i64 %53 - %54 = and i64 %.165, 67108863 - %55 = icmp eq i64 %54, 0 - br i1 %55, label %56, label %59 - -56: ; preds = %51 - %57 = trunc nuw i64 %spec.select74 to i16 - %58 = or disjoint i16 %57, 16384 +50: ; preds = %47 + %51 = lshr i64 %.165, 12 + %52 = xor i64 %51, %2 + %spec.select74 = and i64 %52, 32768 + %53 = and i64 %.165, 67108863 + %54 = icmp eq i64 %53, 0 + br i1 %54, label %55, label %58 + +55: ; preds = %50 + %56 = trunc nuw i64 %spec.select74 to i16 + %57 = or disjoint i16 %56, 16384 br label %.thread -59: ; preds = %51 +59: ; preds = %50 %60 = icmp eq i64 %spec.select74, 0 %61 = sub nuw nsw i64 134217728, %49 %spec.select75 = select i1 %60, i64 %49, i64 %61 %62 = sub nuw nsw i64 134217728, %spec.select75 - %63 = icmp slt i16 %0, 0 - %.6 = select i1 %63, i64 %62, i64 %spec.select75 - %64 = icmp samesign ult i64 %.6, 57345 - br i1 %64, label %.preheader80.thread, label %65 - -65: ; preds = %59 - %66 = lshr i64 %.6, 9 - %67 = mul nuw nsw i64 %66, %66 - %68 = lshr i64 %67, 10 - %69 = mul nuw nsw i64 %68, 13335493 - %70 = lshr i64 %69, 25 - %71 = sub nuw nsw i64 295106440, %70 - %72 = mul nuw nsw i64 %71, %68 - %73 = lshr i64 %72, 27 - %74 = icmp eq i64 %73, 134217728 - br i1 %74, label %77, label %_ZN9softposit5p16e14math6tan_pi4poly17hf9acaa0c33313d20E.exit, !prof !4 - -.preheader80.thread: ; preds = %59 - %75 = mul nuw nsw i64 %.6, 102943 - %76 = lshr i64 %75, 15 + %.6 = select i1 %4, i64 %61, i64 %spec.select75 + %62 = icmp samesign ult i64 %.6, 57345 + br i1 %62, label %.preheader80.thread, label %63 + +63: ; preds = %58 + %64 = lshr i64 %.6, 9 + %65 = mul nuw nsw i64 %64, %64 + %67 = lshr i64 %65, 10 + %67 = mul nuw nsw i64 %67, 13335493 + %69 = lshr i64 %67, 25 + %74 = sub nuw nsw i64 295106440, %68 + %70 = mul nuw nsw i64 %69, %67 + %71 = lshr i64 %70, 27 + %72 = icmp eq i64 %71, 134217728 + br i1 %72, label %75, label %_ZN9softposit5p16e14math6tan_pi4poly17hf9acaa0c33313d20E.exit, !prof !4 + +.preheader80.thread: ; preds = %58 + %73 = mul nuw nsw i64 %.6, 102943 + %74 = lshr i64 %73, 15 br label %.lr.ph94.preheader -77: ; preds = %65 +77: ; preds = %63 tail call void @_ZN4core9panicking5panic17h8ddd58dc57c2dc00E(ptr noalias noundef nonnull readonly align 1 @str.0, i64 noundef 25, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.06d1d8cc65b6b1d93b1e1c71e54a7dce.18) #8 unreachable -_ZN9softposit5p16e14math6tan_pi4poly17hf9acaa0c33313d20E.exit: ; preds = %65 - %78 = sub nsw i64 134217728, %73 - %79 = mul nuw nsw i64 %68, 182527 +_ZN9softposit5p16e14math6tan_pi4poly17hf9acaa0c33313d20E.exit: ; preds = %63 + %78 = sub nsw i64 134217728, %71 + %79 = mul nuw nsw i64 %66, 182527 %80 = lshr i64 %79, 27 %81 = sub nuw nsw i64 3648552, %80 - %82 = mul nuw nsw i64 %81, %68 + %82 = mul nuw nsw i64 %81, %66 %83 = lshr i64 %82, 23 %84 = sub nuw nsw i64 105414368, %83 - %85 = shl nuw nsw i64 %66, 11 + %85 = shl nuw nsw i64 %64, 11 %86 = mul nuw nsw i64 %85, %84 %87 = udiv i64 %86, %78 %88 = icmp samesign ugt i64 %87, 268435455 @@ -3015,12 +3013,12 @@ _ZN9softposit5p16e14math6tan_pi4poly17hf9acaa0c33313d20E.exit: ; preds = %65 br i1 %89, label %.lr.ph94.preheader, label %._crit_edge .lr.ph94.preheader: ; preds = %.preheader80.thread, %.preheader80 - %.792.ph = phi i64 [ %87, %.preheader80 ], [ %76, %.preheader80.thread ] + %.792.ph = phi i64 [ %87, %.preheader80 ], [ %74, %.preheader80.thread ] br label %.lr.ph94 .preheader: ; preds = %_ZN9softposit5p16e14math6tan_pi4poly17hf9acaa0c33313d20E.exit - %90 = and i64 %87, 1099511627776 - %91 = icmp eq i64 %90, 0 + %89 = and i64 %87, 1099511627776 + %91 = icmp eq i64 %89, 0 br i1 %91, label %.lr.ph99, label %._crit_edge100 .lr.ph94: ; preds = %.lr.ph94.preheader, %.lr.ph94 @@ -3657,13 +3655,13 @@ define noundef i16 @"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P1 %3 = icmp eq i16 %0, -32768 %4 = icmp eq i16 %1, -32768 %or.cond = or i1 %3, %4 - br i1 %or.cond, label %51, label %5 + br i1 %or.cond, label %53, label %5 5: ; preds = %2 %6 = icmp eq i16 %0, 0 %7 = icmp eq i16 %1, 0 %or.cond1 = or i1 %6, %7 - br i1 %or.cond1, label %51, label %8 + br i1 %or.cond1, label %53, label %8 8: ; preds = %5 %9 = and i16 %0, -32768 @@ -3759,25 +3757,24 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51: ; preds %45 = zext nneg i16 %41 to i32 %46 = mul nuw nsw i32 %45, %44 %47 = icmp samesign ugt i8 %43, 1 - %48 = xor i8 %43, 2 - %49 = zext i1 %47 to i8 - %.029 = add i8 %42, %49 - %.028 = select i1 %47, i8 %48, i8 %43 - %50 = icmp samesign ult i32 %46, 536870912 - br i1 %50, label %52, label %66 - -51: ; preds = %5, %2, %"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit" + %48 = zext i1 %47 to i8 + %.029 = add i9 %42, %48 + %.029 = and i8 %43, 1 + %49 = icmp samesign ugt i32 %47, 536870911 + %50 = zext i1 %49 to i32 + %.032 = lshr exact i32 %46, %50 + %spec.select37 = select i1 %49, i8 %.028, i8 0 + %.130 = add i8 %.029, %spec.select37 + %51 = zext i1 %49 to i8 + %.1 = xor i8 %.028, %51 + %52 = icmp slt i8 %.130, 0 + br i1 %52, label %60, label %54 + +53: ; preds = %5, %2, %"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit" %.0 = phi i16 [ %.0.i52, %"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit" ], [ -32768, %2 ], [ 0, %5 ] ret i16 %.0 -52: ; preds = %66, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 - %.032 = phi i32 [ %46, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 ], [ %70, %66 ] - %.130 = phi i8 [ %.029, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 ], [ %spec.select37, %66 ] - %.1 = phi i8 [ %.028, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 ], [ %69, %66 ] - %53 = icmp slt i8 %.130, 0 - br i1 %53, label %60, label %54 - -54: ; preds = %52 +52: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 %55 = add nuw i8 %.130, 1 %56 = and i8 %55, 15 %57 = zext nneg i8 %56 to i16 @@ -3785,7 +3782,7 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51: ; preds %59 = xor i16 %58, 32767 br label %_ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit -60: ; preds = %52 +60: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 %61 = sub i8 0, %.130 %62 = and i8 %61, 15 %63 = zext nneg i8 %62 to i16 @@ -3796,26 +3793,18 @@ _ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit: ; preds = %.sroa.51.0.in.i = phi i8 [ %61, %60 ], [ %55, %54 ] %.sroa.0.0.i = phi i16 [ %64, %60 ], [ %59, %54 ] %65 = icmp ugt i8 %.sroa.51.0.in.i, 14 - br i1 %65, label %96, label %71 - -66: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit51 - %67 = icmp ne i8 %.028, 0 - %68 = zext i1 %67 to i8 - %spec.select37 = add i8 %.029, %68 - %69 = xor i8 %.028, 1 - %70 = lshr exact i32 %46, 1 - br label %52 - -71: ; preds = %_ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit - %72 = and i32 %.032, 268435455 + br i1 %65, label %96, label %67 + +66: ; preds = %_ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit + %67 = and i32 %.032, 268435455 %narrow = add nuw nsw i8 %.sroa.51.0.in.i, 31 %73 = and i8 %narrow, 31 %74 = zext nneg i8 %73 to i32 - %75 = lshr i32 %72, %74 + %75 = lshr i32 %67, %74 %76 = lshr i32 %75, 16 %77 = trunc nuw nsw i32 %76 to i16 %78 = icmp eq i8 %.sroa.51.0.in.i, 14 - %79 = icmp ne i8 %.1, 0 + %79 = icmp ne i8 %.028, %51 %80 = and i32 %75, 32768 %81 = icmp ne i32 %80, 0 %.08.i = select i1 %78, i1 %79, i1 %81 @@ -3824,33 +3813,33 @@ _ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit: ; preds = %83 = sub nsw i8 13, %.sroa.51.0.in.i %84 = and i8 %83, 15 %85 = zext nneg i8 %84 to i16 - %86 = shl i16 %82, %85 + %86 = shl nuw i16 %82, %85 %.011.i = select i1 %78, i16 0, i16 %86 - %87 = add i16 %.011.i, %.sroa.0.0.i + %87 = add nuw i16 %.011.i, %.sroa.0.0.i %88 = add i16 %87, %.1.i br i1 %.08.i, label %89, label %"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit" -89: ; preds = %71 +89: ; preds = %67 %.not.i = icmp ne i32 %75, 0 %.110.i = and i1 %78, %.not.i %90 = and i32 %75, 32767 %91 = icmp ne i32 %90, 0 %spec.select13.i = or i1 %91, %.110.i %92 = and i16 %88, 1 - %93 = zext i1 %spec.select13.i to i16 - %94 = or i16 %92, %93 + %89 = zext i1 %spec.select13.i to i16 + %94 = or i16 %92, %89 %95 = add i16 %94, %88 br label %"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit" 96: ; preds = %_ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit - %. = select i1 %53, i16 1, i16 32767 + %. = select i1 %52, i16 1, i16 32767 br label %"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit" -"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit": ; preds = %89, %71, %96 - %.031 = phi i16 [ %., %96 ], [ %95, %89 ], [ %88, %71 ] +"_ZN9softposit5p16e13ops41_$LT$impl$u20$softposit..p16e1..P16E1$GT$7form_ui17h54757fb1168219bbE.exit": ; preds = %89, %67, %96 + %.031 = phi i16 [ %., %96 ], [ %95, %89 ], [ %88, %67 ] %97 = sub i16 0, %.031 %.0.i52 = select i1 %12, i16 %97, i16 %.031 - br label %51 + br label %53 } ; Function Attrs: nofree norecurse nosync nounwind nonlazybind memory(none) uwtable diff --git a/bench/softposit-rs/optimized/oveg98n4r9tnk39.ll b/bench/softposit-rs/optimized/oveg98n4r9tnk39.ll index fdf7eab393a..8095e0c265c 100644 --- a/bench/softposit-rs/optimized/oveg98n4r9tnk39.ll +++ b/bench/softposit-rs/optimized/oveg98n4r9tnk39.ll @@ -121,47 +121,37 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241: ; pred %53 = or i16 %52, -32768 %54 = zext i16 %53 to i32 %55 = mul nuw i32 %54, %51 - %56 = icmp samesign ugt i8 %50, 1 - %57 = xor i8 %50, 2 - %.0180 = select i1 %56, i8 %57, i8 %50 - %58 = zext i1 %56 to i8 - %.0168 = add i8 %47, %58 - %59 = icmp sgt i32 %55, -1 - br i1 %59, label %61, label %63 - -60: ; preds = %11, %108, %4, %219 - %.0165 = phi i16 [ %.0.i, %219 ], [ -32768, %4 ], [ 0, %108 ], [ %spec.select227, %11 ] + %.0180 = and i8 %50, 1 + %56 = and i8 %49, %34 + %.0168 = add i8 %47, %56 + %57 = icmp slt i32 %55, 0 + %.lobit296 = lshr i32 %55, 31 + %.0193 = lshr exact i32 %55, %.lobit296 + %58 = trunc nuw nsw i32 %.lobit296 to i8 + %.1181 = xor i8 %.0180, %58 + %spec.select221 = select i1 %57, i8 %.0180, i8 0 + %.1169 = add i8 %.0168, %spec.select221 + %59 = icmp eq i16 %2, 0 + br i1 %59, label %84, label %61 + +60: ; preds = %11, %101, %4, %212 + %.0165 = phi i16 [ %.0.i, %212 ], [ -32768, %4 ], [ 0, %101 ], [ %spec.select227, %11 ] ret i16 %.0165 -61: ; preds = %63, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 - %.0186 = phi i32 [ %55, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ], [ %67, %63 ] - %.1181 = phi i8 [ %.0180, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ], [ %66, %63 ] - %.1169 = phi i8 [ %.0168, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ], [ %spec.select221, %63 ] - %62 = icmp eq i16 %2, 0 - br i1 %62, label %91, label %68 - -63: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 - %64 = icmp ne i8 %.0180, 0 - %65 = zext i1 %64 to i8 - %spec.select221 = add i8 %.0168, %65 - %66 = xor i8 %.0180, 1 - %67 = lshr exact i32 %55, 1 - br label %61 - -68: ; preds = %61 - %69 = shl i16 %.0163, 2 - %70 = icmp samesign ult i16 %.0163, 16384 - %71 = icmp sgt i16 %69, -1 - br i1 %70, label %.preheader.i248, label %.preheader12.i242 - -.preheader12.i242: ; preds = %68 - br i1 %71, label %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255, label %.lr.ph.i243 - -.preheader.i248: ; preds = %68 - br i1 %71, label %.lr.ph18.i252, label %._crit_edge.i249 +61: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 + %62 = shl i16 %.0163, 2 + %63 = icmp samesign ult i16 %.0163, 16384 + %64 = icmp sgt i16 %62, -1 + br i1 %63, label %.preheader.i248, label %.preheader12.i242 + +.preheader12.i242: ; preds = %61 + br i1 %64, label %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255, label %.lr.ph.i243 + +.preheader.i248: ; preds = %61 + br i1 %64, label %.lr.ph18.i252, label %._crit_edge.i249 .lr.ph18.i252: ; preds = %.preheader.i248, %.lr.ph18.i252 - %.017.i253 = phi i16 [ %73, %.lr.ph18.i252 ], [ %69, %.preheader.i248 ] + %.017.i253 = phi i16 [ %73, %.lr.ph18.i252 ], [ %62, %.preheader.i248 ] %.0916.i254 = phi i8 [ %72, %.lr.ph18.i252 ], [ -1, %.preheader.i248 ] %72 = add i8 %.0916.i254, -1 %73 = shl nuw i16 %.017.i253, 1 @@ -170,12 +160,12 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241: ; pred ._crit_edge.i249: ; preds = %.lr.ph18.i252, %.preheader.i248 %.09.lcssa.i250 = phi i8 [ -1, %.preheader.i248 ], [ %72, %.lr.ph18.i252 ] - %.0.lcssa.i251 = phi i16 [ %69, %.preheader.i248 ], [ %73, %.lr.ph18.i252 ] + %.0.lcssa.i251 = phi i16 [ %62, %.preheader.i248 ], [ %73, %.lr.ph18.i252 ] %75 = and i16 %.0.lcssa.i251, 32764 br label %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255 .lr.ph.i243: ; preds = %.preheader12.i242, %.lr.ph.i243 - %.114.i244 = phi i16 [ %77, %.lr.ph.i243 ], [ %69, %.preheader12.i242 ] + %.114.i244 = phi i16 [ %77, %.lr.ph.i243 ], [ %62, %.preheader12.i242 ] %.11013.i245 = phi i8 [ %76, %.lr.ph.i243 ], [ 0, %.preheader12.i242 ] %76 = add nuw nsw i8 %.11013.i245, 1 %77 = shl i16 %.114.i244, 1 @@ -184,7 +174,7 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241: ; pred _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255: ; preds = %.lr.ph.i243, %.preheader12.i242, %._crit_edge.i249 %.211.i246 = phi i8 [ %.09.lcssa.i250, %._crit_edge.i249 ], [ 0, %.preheader12.i242 ], [ %76, %.lr.ph.i243 ] - %.2.i247 = phi i16 [ %75, %._crit_edge.i249 ], [ %69, %.preheader12.i242 ], [ %77, %.lr.ph.i243 ] + %.2.i247 = phi i16 [ %75, %._crit_edge.i249 ], [ %62, %.preheader12.i242 ], [ %77, %.lr.ph.i243 ] %79 = lshr i16 %.2.i247, 14 %80 = trunc nuw nsw i16 %79 to i8 %81 = or i16 %.2.i247, 16384 @@ -197,14 +187,14 @@ _ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255: ; pred %88 = sext i8 %87 to i16 %89 = add nsw i16 %86, %88 %90 = icmp slt i16 %89, 0 - br i1 %90, label %106, label %105 - -91: ; preds = %61, %._crit_edge, %.thread277, %173 - %.0192 = phi i8 [ %.1193261321, %.thread277 ], [ %.1193261320336, %._crit_edge ], [ %.8200, %173 ], [ 0, %61 ] - %.1187 = phi i32 [ %188, %.thread277 ], [ %.10.lcssa, %._crit_edge ], [ %179, %173 ], [ %.0186, %61 ] - %.2182 = phi i8 [ %187, %.thread277 ], [ %.3183263317337, %._crit_edge ], [ %176, %173 ], [ %.1181, %61 ] - %.0173 = phi i1 [ %.2175264316, %.thread277 ], [ %.2175264315338, %._crit_edge ], [ %19, %173 ], [ %19, %61 ] - %.0170 = phi i8 [ %spec.select223, %.thread277 ], [ %.3.lcssa, %._crit_edge ], [ %spec.select222, %173 ], [ %.1169, %61 ] + br i1 %90, label %99, label %98 + +91: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241, %._crit_edge, %.thread277, %166 + %.0192 = phi i8 [ %.1193261321, %.thread277 ], [ %.1193261322329, %._crit_edge ], [ %.8200, %166 ], [ 0, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ] + %.1187 = phi i32 [ %188, %.thread277 ], [ %.10.lcssa, %._crit_edge ], [ %172, %166 ], [ %.0186, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ] + %.2182 = phi i8 [ %187, %.thread277 ], [ %.3183263319330, %._crit_edge ], [ %169, %166 ], [ %.1181, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ] + %.0173 = phi i1 [ %.2175264316, %.thread277 ], [ %.2175264317331, %._crit_edge ], [ %19, %166 ], [ %19, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ] + %.0170 = phi i8 [ %spec.select223, %.thread277 ], [ %.3.lcssa, %._crit_edge ], [ %spec.select222, %166 ], [ %.1169, %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit241 ] %92 = icmp slt i8 %.0170, 0 br i1 %92, label %99, label %93 @@ -230,191 +220,186 @@ _ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit: ; preds = %104 = icmp ugt i8 %.sroa.51.0.in.i, 14 br i1 %104, label %192, label %189 -105: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255 - %.not = icmp eq i16 %89, 0 - br i1 %.not, label %108, label %111 +98: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255 + %.not = icmp eq i16 %82, 0 + br i1 %.not, label %101, label %104 + +99: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255 + %100 = icmp samesign ult i16 %82, -30 + br i1 %100, label %146, label %140 -106: ; preds = %_ZN9softposit5p16e15P16E117separate_bits_tmp17hb53692effe90da8fE.exit255 - %107 = icmp samesign ult i16 %89, -30 - br i1 %107, label %153, label %147 +105: ; preds = %98 + %.not = icmp eq i32 %83, %.0186 + %103 = xor i1 %19, %18 + %or.cond8 = and i1 %103, %102 + br i1 %or.cond8, label %60, label %106 + +106: ; preds = %98 + %107 = icmp samesign ugt i16 %89, 30 + br i1 %107, label %121, label %114 108: ; preds = %105 - %109 = icmp eq i32 %83, %.0186 - %110 = xor i1 %19, %18 - %or.cond8 = and i1 %110, %109 - br i1 %or.cond8, label %60, label %113 + br i1 %103, label %107, label %.thread266 -111: ; preds = %105 - %112 = icmp samesign ugt i16 %89, 30 - br i1 %112, label %128, label %121 +111: ; preds = %106 + %112 = icmp samesign ult i32 %.0186, %83 + br i1 %112, label %112, label %110 113: ; preds = %108 - br i1 %110, label %114, label %.thread266 + %109 = add nuw i32 %76, %.0186 + br label %166 -114: ; preds = %113 - %115 = icmp samesign ult i32 %.0186, %83 - br i1 %115, label %119, label %117 +114: ; preds = %111 + %111 = sub nuw nsw i32 %.0186, %83 + br label %.thread -.thread266: ; preds = %113 - %116 = add nuw i32 %83, %.0186 - br label %173 +.thread266: ; preds = %111 + %113 = sub nuw nsw i32 %83, %.0186 + br label %.thread -117: ; preds = %114 - %118 = sub nuw nsw i32 %.0186, %83 +117: ; preds = %104 + %118 = sub nsw i16 0, %82 + %116 = and i16 %115, 31 + %117 = zext nneg i16 %116 to i32 + %118 = shl i32 %76, %117 + %119 = icmp eq i32 %118, 0 + %120 = xor i1 %19, %18 + br i1 %119, label %123, label %124 + +121: ; preds = %104 + %122 = xor i1 %19, %18 + br i1 %122, label %129, label %135 + +123: ; preds = %114 + br i1 %120, label %125, label %135 + +124: ; preds = %114 + br i1 %120, label %131, label %135 + +125: ; preds = %123 + %126 = zext nneg i16 %82 to i32 + %127 = lshr i32 %76, %126 + %128 = sub nuw nsw i32 %.0186, %127 br label %.thread -119: ; preds = %114 - %120 = sub nuw nsw i32 %83, %.0186 +119: ; preds = %121, %131 + %.4190 = phi i32 [ %134, %131 ], [ %.0186, %121 ] + %130 = add nsw i32 %.4190, -1 br label %.thread -121: ; preds = %111 - %122 = sub nsw i16 0, %89 - %123 = and i16 %122, 31 - %124 = zext nneg i16 %123 to i32 - %125 = shl i32 %83, %124 - %126 = icmp eq i32 %125, 0 - %127 = xor i1 %19, %18 - br i1 %126, label %130, label %131 - -128: ; preds = %111 - %129 = xor i1 %19, %18 - br i1 %129, label %136, label %142 - -130: ; preds = %121 - br i1 %127, label %132, label %142 - -131: ; preds = %121 - br i1 %127, label %138, label %142 - -132: ; preds = %130 - %133 = zext nneg i16 %89 to i32 - %134 = lshr i32 %83, %133 - %135 = sub nuw nsw i32 %.0186, %134 - br label %.preheader - -136: ; preds = %128, %138 - %.4190 = phi i32 [ %141, %138 ], [ %.0186, %128 ] - %137 = add nsw i32 %.4190, -1 - br label %.preheader - -138: ; preds = %131 - %139 = zext nneg i16 %89 to i32 - %140 = lshr i32 %83, %139 - %141 = sub nuw nsw i32 %.0186, %140 - br label %136 - -142: ; preds = %128, %130, %131, %162 - %.sink = phi i16 [ %163, %162 ], [ 0, %128 ], [ %89, %130 ], [ %89, %131 ] - %.6.sink = phi i32 [ %.6, %162 ], [ 0, %128 ], [ %83, %130 ], [ %83, %131 ] - %.sink352 = phi i32 [ %83, %162 ], [ %.0186, %128 ], [ %.0186, %130 ], [ %.0186, %131 ] - %.1193 = phi i8 [ %.5197, %162 ], [ 1, %128 ], [ 0, %130 ], [ 1, %131 ] - %.3183 = phi i8 [ %80, %162 ], [ %.1181, %128 ], [ %.1181, %130 ], [ %.1181, %131 ] - %.1171 = phi i8 [ %.211.i246, %162 ], [ %.1169, %128 ], [ %.1169, %130 ], [ %.1169, %131 ] - %143 = zext nneg i16 %.sink to i32 - %144 = lshr i32 %.6.sink, %143 - %145 = add nuw i32 %144, %.sink352 - %146 = icmp sgt i32 %145, -1 - br i1 %146, label %._crit_edge, label %173 - -147: ; preds = %106 - %148 = and i16 %89, 31 - %149 = zext nneg i16 %148 to i32 - %150 = shl i32 %.0186, %149 - %151 = icmp eq i32 %150, 0 - %152 = xor i1 %19, %18 - br i1 %151, label %155, label %156 - -153: ; preds = %106 - %154 = xor i1 %19, %18 - br i1 %154, label %164, label %162 - -155: ; preds = %147 - br i1 %152, label %157, label %162 - -156: ; preds = %147 - br i1 %152, label %166, label %162 - -157: ; preds = %155 - %158 = sub nsw i16 0, %89 - %159 = zext nneg i16 %158 to i32 - %160 = lshr i32 %.0186, %159 - %161 = sub nuw nsw i32 %83, %160 - br label %.preheader - -162: ; preds = %156, %155, %153 - %.5197 = phi i8 [ 1, %153 ], [ 0, %155 ], [ 1, %156 ] - %.6 = phi i32 [ 0, %153 ], [ %.0186, %155 ], [ %.0186, %156 ] - %.1 = phi i16 [ 0, %153 ], [ %89, %155 ], [ %89, %156 ] - %163 = sub nsw i16 0, %.1 - br label %142 - -164: ; preds = %153, %166 - %.7 = phi i32 [ %170, %166 ], [ %83, %153 ] - %165 = add nsw i32 %.7, -1 +121: ; preds = %124 + %132 = zext nneg i16 %89 to i32 + %133 = lshr i32 %76, %132 + %134 = sub nuw nsw i32 %.0186, %133 + br label %129 + +135:; preds = %121, %123, %124, %155 + %.sink = phi i16 [ %156, %155 ], [ 0, %121 ], [ %82, %123 ], [ %82, %124 ] + %.6.sink = phi i32 [ %.6, %155 ], [ 0, %121 ], [ %76, %123 ], [ %76, %124 ] + %.sink354 = phi i32 [ %76, %155 ], [ %.0186, %121 ], [ %.0186, %123 ], [ %.0186, %124 ] + %.1193 = phi i8 [ %.5197, %155 ], [ 1, %121 ], [ 0, %123 ], [ 1, %124 ] + %.3183 = phi i8 [ %73, %155 ], [ %.1181, %121 ], [ %.1181, %123 ], [ %.1181, %124 ] + %.1171 = phi i8 [ %.211.i246, %155 ], [ %.1169, %121 ], [ %.1169, %123 ], [ %.1169, %124 ] + %136 = zext nneg i16 %.sink to i32 + %137 = lshr i32 %.6.sink, %136 + %138 = add nuw i32 %137, %.sink354 + %139 = icmp sgt i32 %138, -1 + br i1 %139, label %._crit_edge, label %166 + +132: ; preds = %99 + %141 = and i16 %89, 31 + %142 = zext nneg i16 %141 to i32 + %143 = shl i32 %.0186, %142 + %144 = icmp eq i32 %143, 0 + %145 = xor i1 %19, %18 + br i1 %144, label %148, label %149 + +146:; preds = %99 + %147 = xor i1 %19, %18 + br i1 %147, label %157, label %155 + +148:; preds = %132 + br i1 %145, label %150, label %155 + +149:; preds = %132 + br i1 %145, label %159, label %155 + +150:; preds = %148 + %151 = sub nsw i16 0, %82 + %152 = zext nneg i16 %151 to i32 + %153 = lshr i32 %.0193, %152 + %154 = sub nuw nsw i32 %83, %153 br label %.thread -166: ; preds = %156 +155:; preds = %149, %148, %146 + %.5197 = phi i8 [ 1, %146 ], [ 0, %148 ], [ 1, %149 ] + %.6 = phi i32 [ 0, %146 ], [ %.0186, %148 ], [ %.0186, %149 ] + %.1 = phi i16 [ 0, %146 ], [ %82, %148 ], [ %82, %149 ] + %156 = sub nsw i16 0, %.1 + br label %135 + +157:; preds = %146, %159 + %.7 = phi i32 [ %163, %159 ], [ %76, %146 ] + %158 = add nsw i32 %.7, -1 + br label %.thread + +166: ; preds = %149 %167 = sub nsw i16 0, %89 %168 = zext nneg i16 %167 to i32 %169 = lshr i32 %.0186, %168 %170 = sub nuw nsw i32 %83, %169 - br label %164 - -.thread: ; preds = %164, %117, %119 - %.1171265 = phi i8 [ %.211.i246, %164 ], [ %.1169, %119 ], [ %.1169, %117 ] - %.2175264 = phi i1 [ %18, %164 ], [ %18, %119 ], [ %19, %117 ] - %.3183263 = phi i8 [ %80, %164 ], [ %.1181, %119 ], [ %.1181, %117 ] - %.3189262 = phi i32 [ %165, %164 ], [ %120, %119 ], [ %118, %117 ] - %.1193261 = phi i8 [ 1, %164 ], [ 0, %119 ], [ 0, %117 ] + br label %157 + +.thread: ; preds = %150, %157, %125, %129, %110, %112 + %.1171265 = phi i8 [ %.211.i246, %157 ], [ %.211.i246, %150 ], [ %.1169, %119 ], [ %.1169, %125 ], [ %.1169, %112 ], [ %.1169, %110 ] + %.2175264 = phi i1 [ %18, %157 ], [ %18, %150 ], [ %19, %129 ], [ %19, %125 ], [ %18, %112 ], [ %19, %110 ] + %.3183263 = phi i8 [ %80, %157 ], [ %73, %150 ], [ %.1181, %119 ], [ %.1181, %125 ], [ %.1181, %112 ], [ %.1181, %110 ] + %.3189262 = phi i32 [ %158, %157 ], [ %154, %150 ], [ %130, %119 ], [ %128, %125 ], [ %113, %112 ], [ %111, %110 ] + %.1193261 = phi i8 [ 1, %157 ], [ 0, %150 ], [ 1, %129 ], [ 0, %125 ], [ 0, %112 ], [ 0, %110 ] %171 = icmp eq i32 %.3189262, 0 br i1 %171, label %.thread277, label %.preheader -.preheader: ; preds = %132, %136, %157, %.thread - %.1193261320 = phi i8 [ %.1193261, %.thread ], [ 0, %132 ], [ 1, %136 ], [ 0, %157 ] - %.3189262319 = phi i32 [ %.3189262, %.thread ], [ %135, %132 ], [ %137, %136 ], [ %161, %157 ] - %.3183263317 = phi i8 [ %.3183263, %.thread ], [ %.1181, %132 ], [ %.1181, %136 ], [ %80, %157 ] - %.2175264315 = phi i1 [ %.2175264, %.thread ], [ %19, %132 ], [ %19, %136 ], [ %18, %157 ] - %.1171265314 = phi i8 [ %.1171265, %.thread ], [ %.1169, %132 ], [ %.1169, %136 ], [ %.211.i246, %157 ] - %172 = icmp samesign ult i32 %.3189262319, 536870912 - br i1 %172, label %.lr.ph, label %._crit_edge - -173: ; preds = %.thread266, %142 - %.1171276 = phi i8 [ %.1169, %.thread266 ], [ %.1171, %142 ] - %.3183274 = phi i8 [ %.1181, %.thread266 ], [ %.3183, %142 ] - %.3189273 = phi i32 [ %116, %.thread266 ], [ %145, %142 ] - %.1193272 = phi i8 [ 0, %.thread266 ], [ %.1193, %142 ] - %174 = icmp ne i8 %.3183274, 0 - %175 = zext i1 %174 to i8 - %spec.select222 = add i8 %.1171276, %175 - %176 = xor i8 %.3183274, 1 - %177 = and i32 %.3189273, 1 - %178 = icmp eq i32 %177, 0 - %.8200 = select i1 %178, i8 %.1193272, i8 1 - %179 = lshr i32 %.3189273, 1 - br label %91 - -._crit_edge: ; preds = %.lr.ph, %142, %.preheader - %.2175264315338 = phi i1 [ %.2175264315, %.preheader ], [ %19, %142 ], [ %.2175264315, %.lr.ph ] - %.3183263317337 = phi i8 [ %.3183263317, %.preheader ], [ %.3183, %142 ], [ %.3183263317, %.lr.ph ] - %.1193261320336 = phi i8 [ %.1193261320, %.preheader ], [ %.1193, %142 ], [ %.1193261320, %.lr.ph ] - %.10.lcssa = phi i32 [ %.3189262319, %.preheader ], [ %145, %142 ], [ %183, %.lr.ph ] - %.3.lcssa = phi i8 [ %.1171265314, %.preheader ], [ %.1171, %142 ], [ %182, %.lr.ph ] - %180 = and i32 %.10.lcssa, 1073741824 - %181 = icmp eq i32 %180, 0 - br i1 %181, label %.thread277, label %91 +.preheader: ; preds = %.thread + %165 = icmp samesign ult i32 %.3189262, 536870912 + br i1 %165, label %.lr.ph, label %._crit_edge + +166: ; preds = %.thread266, %135 + %.1171265314 = phi i8 [ %.1169, %.thread266 ], [ %.1171, %135 ] + %.3183274 = phi i8 [ %.1181, %113 ], [ %.3183, %135 ] + %.3189273 = phi i32 [ %109, %.thread266 ], [ %138, %135 ] + %.1193272 = phi i8 [ 0, %.thread266 ], [ %.1193, %135 ] + %167 = icmp ne i8 %.3183274, 0 + %168 = zext i1 %167 to i8 + %spec.select222 = add i8 %.1171265314, %168 + %169 = xor i8 %.3183274, 1 + %170 = and i32 %.3189273, 1 + %174 = icmp eq i32 %170, 0 + %.8200 = select i1 %174, i8 %.1193272, i8 1 + %172 = lshr i32 %.3189273, 1 + br label %84 + +._crit_edge:; preds = %.lr.ph, %135, %.preheader + %.2175264317331 = phi i1 [ %.2175264, %.preheader ], [ %19, %135 ], [ %.2175264, %.lr.ph ] + %.3183263319330 = phi i8 [ %.3183263, %.preheader ], [ %.3183, %135 ], [ %.3183263, %.lr.ph ] + %.1193261322329 = phi i8 [ %.1193261, %.preheader ], [ %.1193, %135 ], [ %.1193261, %.lr.ph ] + %.10.lcssa = phi i32 [ %.3189262, %.preheader ], [ %138, %135 ], [ %176, %.lr.ph ] + %.3.lcssa = phi i8 [ %.1171265, %.preheader ], [ %.1171, %135 ], [ %175, %.lr.ph ] + %173 = and i32 %.10.lcssa, 1073741824 + %174 = icmp eq i32 %173, 0 + br i1 %174, label %.thread277, label %84 .lr.ph: ; preds = %.preheader, %.lr.ph - %.3294 = phi i8 [ %182, %.lr.ph ], [ %.1171265314, %.preheader ] - %.10293 = phi i32 [ %183, %.lr.ph ], [ %.3189262319, %.preheader ] + %.3294 = phi i8 [ %182, %.lr.ph ], [ %.1171265, %.preheader ] + %.10293 = phi i32 [ %183, %.lr.ph ], [ %.3189262, %.preheader ] %182 = add i8 %.3294, -1 %183 = shl nuw nsw i32 %.10293, 2 %184 = icmp samesign ult i32 %.10293, 134217728 br i1 %184, label %.lr.ph, label %._crit_edge .thread277: ; preds = %.thread, %._crit_edge - %.1193261321 = phi i8 [ %.1193261320336, %._crit_edge ], [ %.1193261, %.thread ] - %.3183263318 = phi i8 [ %.3183263317337, %._crit_edge ], [ %.3183263, %.thread ] - %.2175264316 = phi i1 [ %.2175264315338, %._crit_edge ], [ %.2175264, %.thread ] + %.1193261321 = phi i8 [ %.1193261322329, %._crit_edge ], [ %.1193261, %.thread ] + %.3183263318 = phi i8 [ %.3183263319330, %._crit_edge ], [ %.3183263, %.thread ] + %.2175264316 = phi i1 [ %.2175264317331, %._crit_edge ], [ %.2175264, %.thread ] %.2172281 = phi i8 [ %.3.lcssa, %._crit_edge ], [ %.1171265, %.thread ] %.9280 = phi i32 [ %.10.lcssa, %._crit_edge ], [ 0, %.thread ] %185 = icmp eq i8 %.3183263318, 0 @@ -457,9 +442,9 @@ _ZN9softposit5p16e15P16E116calculate_regime17he80d131ebda81979E.exit: ; preds = %204 = sub nsw i8 13, %.sroa.51.0.in.i %205 = and i8 %204, 15 %206 = zext nneg i8 %205 to i16 - %207 = shl i16 %203, %206 + %207 = shl nuw i16 %203, %206 %.0164 = select i1 %191, i16 0, i16 %207 - %208 = add i16 %.0164, %.sroa.0.0.i + %208 = add nuw i16 %.0164, %.sroa.0.0.i %209 = add i16 %208, %.0184330 br i1 %.0185329, label %210, label %219 diff --git a/bench/wireshark/optimized/in_cksum.ll b/bench/wireshark/optimized/in_cksum.ll index f9ab47b640b..f0ccdb26cbd 100644 --- a/bench/wireshark/optimized/in_cksum.ll +++ b/bench/wireshark/optimized/in_cksum.ll @@ -289,12 +289,11 @@ define range(i32 0, 65536) i32 @in_cksum_ret_partial(ptr noundef readonly captur %.sroa.12.0.extract.shift20 = lshr i32 %.12, 16 %169 = and i32 %.12, 65535 %170 = add nuw nsw i32 %169, %.sroa.12.0.extract.shift20 - %171 = icmp samesign ugt i32 %170, 65535 - %172 = zext i1 %171 to i32 - %.13 = add nuw nsw i32 %170, %172 - %173 = and i32 %.13, 65535 - %174 = xor i32 %173, 65535 - ret i32 %174 + %171 = lshr i32 %170, 16 + %.13 = add nuw nsw i32 %171, %170 + %172 = and i32 %.13, 65535 + %173 = xor i32 %172, 65535 + ret i32 %173 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) diff --git a/scripts/setup_pre_commit_patch.sh b/scripts/setup_pre_commit_patch.sh index c5409e09ef4..1f49033a0fe 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/131902 export COMPTIME_MODE=0 # Please rebase manually