diff --git a/bench/cpython/optimized/parking_lot.ll b/bench/cpython/optimized/parking_lot.ll index 6158a68f2cf..1d7f56312cc 100644 --- a/bench/cpython/optimized/parking_lot.ll +++ b/bench/cpython/optimized/parking_lot.ll @@ -174,11 +174,12 @@ define dso_local range(i32 -3, 1) i32 @_PyParkingLot_Park(ptr noundef %0, ptr no br label %_PyRawMutex_Lock.exit _PyRawMutex_Lock.exit: ; preds = %6, %15 - switch i64 %2, label %28 [ - i64 1, label %16 - i64 2, label %20 - i64 4, label %24 - i64 8, label %atomic_memcmp.exit + %16 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %2, i1 true) + switch i64 %16, label %29 [ + i64 0, label %17 + i64 1, label %21 + i64 2, label %25 + i64 3, label %atomic_memcmp.exit ] 16: ; preds = %_PyRawMutex_Lock.exit @@ -320,7 +321,7 @@ _PyRawMutex_Unlock.exit27.split: ; preds = %_PyRawMutex_Unlock. br label %75 75: ; preds = %74, %71, %_PyRawMutex_Unlock.exit27.split - %.0.i28 = phi ptr [ %70, %74 ], [ null, %71 ], [ null, %_PyRawMutex_Unlock.exit27.split ] + %.0.i28 = phi ptr [ %70, %75 ], [ null, %72 ], [ null, %_PyRawMutex_Unlock.exit27.split ] %76 = call i32 @sem_wait(ptr noundef nonnull %37) #9 %.not = icmp eq i32 %76, -1 br i1 %.not, label %77, label %_PySemaphore_PlatformWait.exit.i @@ -334,7 +335,7 @@ _PyRawMutex_Unlock.exit27.split: ; preds = %_PyRawMutex_Unlock. ] .split.us: ; preds = %77, %.lr.ph - %.us-phi = phi i32 [ %68, %.lr.ph ], [ %79, %77 ] + %.us-phi = phi i32 [ %68, %.lr.ph ], [ %79, %78 ] call void (ptr, ptr, ...) @_Py_FatalErrorFormat(ptr noundef nonnull @__func__._PySemaphore_PlatformWait, ptr noundef nonnull @.str.2, i32 noundef %.us-phi) #10 unreachable @@ -368,12 +369,12 @@ _PySemaphore_Wait.exit: ; preds = %_PySemaphore_Platfo br label %_PyRawMutex_Unlock.exit29 _PyRawMutex_Unlock.exit29: ; preds = %_PySemaphore_Wait.exit, %_PySemaphore_PlatformWait.exit.i.us, %_PyRawMutex_Unlock.exit27.split.us.preheader, %89, %81, %_PyRawMutex_Unlock.exit25 - %.0 = phi i32 [ 0, %_PyRawMutex_Unlock.exit25 ], [ %52, %81 ], [ %52, %89 ], [ 0, %_PyRawMutex_Unlock.exit27.split.us.preheader ], [ 0, %_PySemaphore_PlatformWait.exit.i.us ], [ 0, %_PySemaphore_Wait.exit ] + %.0 = phi i32 [ 0, %_PyRawMutex_Unlock.exit25 ], [ %52, %82 ], [ %52, %90 ], [ 0, %_PyRawMutex_Unlock.exit27.split.us.preheader ], [ 0, %_PySemaphore_PlatformWait.exit.i.us ], [ 0, %_PySemaphore_Wait.exit ] %90 = call i32 @sem_destroy(ptr noundef nonnull %37) #9 br label %_PyRawMutex_Unlock.exit _PyRawMutex_Unlock.exit: ; preds = %35, %32, %_PyRawMutex_Unlock.exit29 - %.021 = phi i32 [ %.0, %_PyRawMutex_Unlock.exit29 ], [ -1, %32 ], [ -1, %35 ] + %.021 = phi i32 [ %.0, %_PyRawMutex_Unlock.exit29 ], [ -1, %33 ], [ -1, %36 ] call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %7) #9 ret i32 %.021 } @@ -608,6 +609,9 @@ declare void @_PyRawMutex_LockSlow(ptr noundef) local_unnamed_addr #4 declare void @_PyRawMutex_UnlockSlow(ptr noundef) local_unnamed_addr #4 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i64 @llvm.cttz.i64(i64, i1 immarg) #9 + attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } @@ -617,9 +621,10 @@ attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argm attributes #6 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #9 = { nounwind } -attributes #10 = { noreturn nounwind } -attributes #11 = { nounwind willreturn memory(none) } +attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #10 = { nounwind } +attributes #11 = { noreturn nounwind } +attributes #12 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} diff --git a/bench/hermes/optimized/TypedArray.ll b/bench/hermes/optimized/TypedArray.ll index 4cfe7532f7a..a3fc512feda 100644 --- a/bench/hermes/optimized/TypedArray.ll +++ b/bench/hermes/optimized/TypedArray.ll @@ -7739,11 +7739,12 @@ _ZN6hermes2vm16JSTypedArrayBase5beginERNS0_7RuntimeE.exit: ; preds = %if.end100 %37 = load i32, ptr %offset_.i, align 4 %idx.ext.i = zext i32 %37 to i64 %add.ptr.i = getelementptr inbounds nuw i8, ptr %36, i64 %idx.ext.i - switch i8 %call102, label %sw.default123 [ - i8 1, label %sw.bb106 - i8 2, label %sw.bb109 - i8 4, label %sw.bb113 - i8 8, label %sw.bb118 + %38 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %call102, i1 true) + switch i8 %38, label %sw.default123 [ + i8 0, label %sw.bb106 + i8 1, label %sw.bb109 + i8 2, label %sw.bb113 + i8 3, label %sw.bb118 ] sw.bb106: ; preds = %_ZN6hermes2vm16JSTypedArrayBase5beginERNS0_7RuntimeE.exit @@ -13626,6 +13627,9 @@ declare ptr @_ZN6hermes2vm12JSTypedArrayImLNS0_8CellKindE45EE12getPrototypeERKNS declare ptr @_ZN6hermes2vm17NativeConstructor15creatorFunctionINS0_12JSTypedArrayImLNS0_8CellKindE45EEEEENS0_10CallResultINS0_12PseudoHandleINS0_8JSObjectEEELNS0_6detail20CallResultSpecializeE6EEERNS0_7RuntimeENS0_6HandleIS8_EEPv(ptr noundef nonnull align 8 dereferenceable(9832), ptr, ptr noundef) #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #7 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) declare void @llvm.experimental.noalias.scope.decl(metadata) #7 @@ -13645,9 +13649,9 @@ attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argm attributes #4 = { nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { noreturn "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nobuiltin nounwind "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #7 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #9 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #10 = { nounwind } attributes #11 = { noreturn nounwind } attributes #12 = { builtin nounwind } diff --git a/bench/image-rs/optimized/2s4mh02dvph60euq.ll b/bench/image-rs/optimized/2s4mh02dvph60euq.ll index d1841cab967..e776dd9b73e 100644 --- a/bench/image-rs/optimized/2s4mh02dvph60euq.ll +++ b/bench/image-rs/optimized/2s4mh02dvph60euq.ll @@ -294,6 +294,8 @@ target triple = "x86_64-unknown-linux-gnu" @anon.8554c8e21b8cbc9380508c54347b7519.121.llvm.9832446184049035033 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @anon.b16754a467d3cf51c98f9660b4d015ba.116.llvm.17224713629878502917 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h4e18cffafe4e2acfE.109" = private unnamed_addr constant [5 x ptr] [ptr @anon.df12dd7d62f56185f0383eceae1d36f2.462, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.463, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.464, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.465, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.466], align 8 +@"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h6d101b02beeb49b3E" = private unnamed_addr constant [5 x i64] [i64 3, i64 3, i64 4, i64 5, i64 7], align 8 +@"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h6d101b02beeb49b3E.110" = private unnamed_addr constant [5 x ptr] [ptr @anon.df12dd7d62f56185f0383eceae1d36f2.68, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.69, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.70, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.71, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.72], align 8 @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h8ba1dbd3e6462eeaE" = private unnamed_addr constant [7 x i64] [i64 9, i64 poison, i64 3, i64 7, i64 14, i64 poison, i64 4], align 8 @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h8ba1dbd3e6462eeaE.110" = private unnamed_addr constant [7 x ptr] [ptr @anon.df12dd7d62f56185f0383eceae1d36f2.77, ptr poison, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.78, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.79, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.80, ptr poison, ptr @anon.df12dd7d62f56185f0383eceae1d36f2.81], align 8 @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h91d78c8ce969faa1E" = private unnamed_addr constant [16 x i64] [i64 13, i64 17, i64 16, i64 30, i64 11, i64 12, i64 23, i64 24, i64 27, i64 22, i64 24, i64 19, i64 18, i64 18, i64 13, i64 10], align 8 @@ -1616,36 +1618,18 @@ switch.lookup: ; Function Attrs: nonlazybind uwtable define hidden noundef zeroext i1 @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h6d101b02beeb49b3E"(ptr noalias noundef readonly align 8 captures(none) dereferenceable(8) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #1 { - %3 = load ptr, ptr %0, align 8, !nonnull !4, !align !122, !noundef !4 - %.val = load i8, ptr %3, align 1, !range !103, !noundef !4 - switch i8 %.val, label %4 [ - i8 1, label %"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.exit" - i8 2, label %5 - i8 4, label %6 - i8 8, label %7 - i8 16, label %8 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.exit" - -6: ; preds = %2 - br label %"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.exit" - -7: ; preds = %2 - br label %"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.exit" - -8: ; preds = %2 - br label %"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.exit" - -"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.exit": ; preds = %2, %5, %6, %7, %8 - %.sroa.6.0.i = phi i64 [ 3, %5 ], [ 4, %6 ], [ 5, %7 ], [ 7, %8 ], [ 3, %2 ] - %.sroa.0.0.i = phi ptr [ @anon.df12dd7d62f56185f0383eceae1d36f2.69, %5 ], [ @anon.df12dd7d62f56185f0383eceae1d36f2.70, %6 ], [ @anon.df12dd7d62f56185f0383eceae1d36f2.71, %7 ], [ @anon.df12dd7d62f56185f0383eceae1d36f2.72, %8 ], [ @anon.df12dd7d62f56185f0383eceae1d36f2.68, %2 ] - %9 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0.i, i64 noundef %.sroa.6.0.i) - ret i1 %9 +switch.lookup: + %.val = load ptr, ptr %0, align 8, !nonnull !4, !align !122, !noundef !4 + %.val = load i8, ptr %.val, align 1, !range !99, !noundef !4 + %3 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %.val, i1 true) + %4 = zext nneg i8 %3 to i64 + %switch.gep = getelementptr inbounds nuw [5 x i64], ptr @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h6d101b02beeb49b3E", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i8 %3 to i64 + %switch.gep1 = getelementptr inbounds nuw [5 x ptr], ptr @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h6d101b02beeb49b3E.110", i64 0, i64 %5 + %switch.load2 = load ptr, ptr %switch.gep1, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load2, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: nonlazybind uwtable @@ -25242,7 +25226,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17h33 unreachable common.resume: ; preds = %115, %64, %111, %19 - %common.resume.op = phi { ptr, i32 } [ %20, %19 ], [ %112, %111 ], [ %lpad.thr_comm.split-lp, %115 ], [ %65, %64 ] + %common.resume.op = phi { ptr, i32 } [ %20, %19 ], [ %112, %115 ], [ %lpad.thr_comm.split-lp, %119 ], [ %65, %64 ] resume { ptr, i32 } %common.resume.op "_ZN3png7decoder16Decoder$LT$R$GT$15new_with_limits17h568db9753a9971abE.exit": ; preds = %3 @@ -25413,39 +25397,43 @@ common.resume: ; preds = %115, %64, %111, %19 ] 69: ; preds = %66 - switch i8 %68, label %18 [ - i8 1, label %74 - i8 2, label %77 - i8 4, label %79 - i8 8, label %81 - i8 16, label %73 + %70 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %68, i1 true) + switch i8 %70, label %18 [ + i8 0, label %78 + i8 1, label %77 + i8 2, label %83 + i8 3, label %85 + i8 4, label %77 ] 70: ; preds = %66 - switch i8 %68, label %18 [ - i8 1, label %83 - i8 2, label %85 - i8 4, label %87 - i8 8, label %81 - i8 16, label %82 + %72 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %68, i1 true) + switch i8 %72, label %18 [ + i8 0, label %87 + i8 1, label %89 + i8 2, label %91 + i8 3, label %85 + i8 4, label %86 ] 71: ; preds = %66 - switch i8 %68, label %18 [ - i8 1, label %94 - i8 2, label %96 - i8 4, label %98 - i8 8, label %81 - i8 16, label %93 + %74 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %68, i1 true) + switch i8 %74, label %18 [ + i8 0, label %98 + i8 1, label %96 + i8 2, label %98 + i8 3, label %85 + i8 4, label %97 ] 72: ; preds = %66 - switch i8 %68, label %18 [ - i8 1, label %101 - i8 2, label %103 - i8 4, label %105 - i8 8, label %81 - i8 16, label %100 + %76 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %68, i1 true) + switch i8 %76, label %18 [ + i8 0, label %105 + i8 1, label %107 + i8 2, label %109 + i8 3, label %81 + i8 4, label %104 ] 73: ; preds = %69 @@ -25490,7 +25478,7 @@ common.resume: ; preds = %115, %64, %111, %19 br label %76 81: ; preds = %72, %71, %70, %69, %100, %93, %82, %73 - %.0101 = phi i8 [ 4, %73 ], [ 6, %82 ], [ 5, %93 ], [ 7, %100 ], [ 0, %69 ], [ 2, %70 ], [ 1, %71 ], [ 3, %72 ] + %.0101 = phi i8 [ 4, %77 ], [ 6, %82 ], [ 5, %97 ], [ 7, %104 ], [ 0, %69 ], [ 2, %71 ], [ 1, %73 ], [ %76, %75 ] call void @llvm.lifetime.start.p0(i64 720, ptr nonnull %.sroa.065) %.sroa.065.32..sroa_idx = getelementptr inbounds nuw i8, ptr %.sroa.065, i64 32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(688) %.sroa.065.32..sroa_idx, ptr noundef nonnull align 8 dereferenceable(688) %10, i64 688, i1 false) @@ -25851,39 +25839,43 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17hd8 ] 61: ; preds = %58 - switch i8 %60, label %17 [ - i8 1, label %66 - i8 2, label %69 - i8 4, label %71 - i8 8, label %73 - i8 16, label %65 + %62 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %60, i1 true) + switch i8 %62, label %17 [ + i8 0, label %66 + i8 1, label %71 + i8 2, label %75 + i8 3, label %77 + i8 4, label %69 ] 62: ; preds = %58 - switch i8 %60, label %17 [ - i8 1, label %75 - i8 2, label %77 - i8 4, label %79 - i8 8, label %73 - i8 16, label %74 + %64 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %60, i1 true) + switch i8 %64, label %17 [ + i8 0, label %79 + i8 1, label %77 + i8 2, label %83 + i8 3, label %77 + i8 4, label %78 ] 63: ; preds = %58 - switch i8 %60, label %17 [ - i8 1, label %86 - i8 2, label %88 - i8 4, label %90 - i8 8, label %73 - i8 16, label %85 + %66 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %60, i1 true) + switch i8 %66, label %17 [ + i8 0, label %86 + i8 1, label %92 + i8 2, label %94 + i8 3, label %77 + i8 4, label %89 ] 64: ; preds = %58 - switch i8 %60, label %17 [ - i8 1, label %93 - i8 2, label %95 - i8 4, label %97 - i8 8, label %73 - i8 16, label %92 + %68 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %60, i1 true) + switch i8 %68, label %17 [ + i8 0, label %97 + i8 1, label %99 + i8 2, label %97 + i8 3, label %77 + i8 4, label %96 ] 65: ; preds = %61 @@ -25900,7 +25892,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17hd8 store i8 1, ptr %.sroa.6179.0..sroa_idx, align 1 br label %68 -68: ; preds = %97, %95, %93, %90, %88, %86, %81, %79, %77, %75, %71, %69, %66 +68: ; preds = %97, %95, %93, %94, %92, %90, %85, %83, %81, %79, %75, %71, %66 store i64 2, ptr %0, align 8 call void @"_ZN4core3ptr109drop_in_place$LT$png..decoder..Reader$LT$std..io..buffered..bufreader..BufReader$LT$std..fs..File$GT$$GT$$GT$17h9e00774c73443febE"(ptr noalias noundef nonnull align 8 dereferenceable(712) %9) br label %.critedge @@ -25928,7 +25920,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17hd8 br label %68 73: ; preds = %64, %63, %62, %61, %92, %85, %74, %65 - %.0106 = phi i8 [ 4, %65 ], [ 6, %74 ], [ 5, %85 ], [ 7, %92 ], [ 0, %61 ], [ 2, %62 ], [ 1, %63 ], [ 3, %64 ] + %.0106 = phi i8 [ 4, %69 ], [ 6, %78 ], [ 5, %89 ], [ 7, %92 ], [ 0, %61 ], [ 2, %63 ], [ 1, %65 ], [ %68, %67 ] call void @llvm.lifetime.start.p0(i64 744, ptr nonnull %.sroa.065) %.sroa.065.32..sroa_idx = getelementptr inbounds nuw i8, ptr %.sroa.065, i64 32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(712) %.sroa.065.32..sroa_idx, ptr noundef nonnull align 8 dereferenceable(712) %9, i64 712, i1 false) @@ -26090,7 +26082,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17hd8 to label %.thread unwind label %100 .thread: ; preds = %56, %103 - %.pn112 = phi { ptr, i32 } [ %57, %56 ], [ %lpad.thr_comm.split-lp, %103 ] + %.pn112 = phi { ptr, i32 } [ %57, %56 ], [ %lpad.thr_comm.split-lp, %107 ] resume { ptr, i32 } %.pn112 } @@ -34761,6 +34753,9 @@ declare hidden void @"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec. ; Function Attrs: nonlazybind uwtable declare hidden void @"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec..spec_from_iter_nested..SpecFromIterNested$LT$T$C$I$GT$$GT$9from_iter17haacb7caaac7c9aefE.llvm.17224713629878502917"(ptr noalias noundef sret({ { i64, ptr }, i64 }) align 8 captures(none) dereferenceable(24), ptr noalias noundef align 8 captures(none) dereferenceable(32)) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #30 + ; Function Attrs: nocallback nofree nounwind nonlazybind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #30 @@ -34812,9 +34807,9 @@ attributes #26 = { mustprogress nocallback nofree nounwind nonlazybind willretur attributes #27 = { cold noreturn nounwind nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #28 = { cold nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #29 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -attributes #30 = { nocallback nofree nounwind nonlazybind willreturn memory(argmem: read) } -attributes #31 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -attributes #32 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #30 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #31 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: read) } +attributes #32 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #33 = { noreturn } attributes #34 = { cold } attributes #35 = { cold noreturn nounwind } diff --git a/bench/image-rs/optimized/5ez7udly19o3uj1p.ll b/bench/image-rs/optimized/5ez7udly19o3uj1p.ll index 8bef1f527bf..24d3c924a13 100644 --- a/bench/image-rs/optimized/5ez7udly19o3uj1p.ll +++ b/bench/image-rs/optimized/5ez7udly19o3uj1p.ll @@ -310,6 +310,8 @@ target triple = "x86_64-unknown-linux-gnu" @switch.table._ZN4tiff7decoder5image5Image11from_reader17h932431bb328c04d2E = private unnamed_addr constant [9 x i8] [i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 poison, i8 7], align 1 @switch.table._ZN4tiff7decoder5image5Image12expand_chunk17hdad818f34c0e107dE.88 = private unnamed_addr constant [10 x i64] [i64 8, i64 16, i64 32, i64 64, i64 32, i64 64, i64 8, i64 16, i64 32, i64 64], align 8 @switch.table._ZN4tiff7decoder5image5Image12expand_chunk17hdad818f34c0e107dE.89 = private unnamed_addr constant [10 x i64] [i64 1, i64 2, i64 4, i64 8, i64 4, i64 8, i64 1, i64 2, i64 4, i64 8], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE" = private unnamed_addr constant [5 x i64] [i64 3, i64 3, i64 4, i64 5, i64 7], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.90" = private unnamed_addr constant [5 x ptr] [ptr @anon.dbc83011fcb707429349569d3c6bc524.189, ptr @anon.dbc83011fcb707429349569d3c6bc524.190, ptr @anon.dbc83011fcb707429349569d3c6bc524.191, ptr @anon.dbc83011fcb707429349569d3c6bc524.192, ptr @anon.dbc83011fcb707429349569d3c6bc524.193], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17ha166cdb27df82a8bE" = private unnamed_addr constant [7 x i64] [i64 9, i64 poison, i64 3, i64 7, i64 14, i64 poison, i64 4], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17ha166cdb27df82a8bE.90" = private unnamed_addr constant [7 x ptr] [ptr @anon.dbc83011fcb707429349569d3c6bc524.194, ptr poison, ptr @anon.dbc83011fcb707429349569d3c6bc524.195, ptr @anon.dbc83011fcb707429349569d3c6bc524.196, ptr @anon.dbc83011fcb707429349569d3c6bc524.197, ptr poison, ptr @anon.dbc83011fcb707429349569d3c6bc524.198], align 8 @switch.table._ZN5image6codecs3pnm7encoder17CheckedDimensions18check_header_color17h0b4fb6ea25ca00ddE = private unnamed_addr constant [27 x i32] [i32 1, i32 1, i32 2, i32 3, i32 4, i32 1, i32 2, i32 3, i32 4, i32 1, i32 2, i32 3, i32 4, i32 1, i32 2, i32 3, i32 4, i32 1, i32 2, i32 3, i32 4, i32 3, i32 4, i32 3, i32 4, i32 4, i32 1], align 4 @@ -25868,35 +25870,17 @@ switch.lookup: ; preds = %93 ; Function Attrs: inlinehint nonlazybind uwtable define internal noundef zeroext i1 @"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE"(ptr noalias noundef readonly align 1 captures(none) dereferenceable(1) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #0 { - %3 = load i8, ptr %0, align 1, !range !2355, !noundef !19 - switch i8 %3, label %4 [ - i8 1, label %9 - i8 2, label %5 - i8 4, label %6 - i8 8, label %7 - i8 16, label %8 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %9 - -6: ; preds = %2 - br label %9 - -7: ; preds = %2 - br label %9 - -8: ; preds = %2 - br label %9 - -9: ; preds = %2, %8, %7, %6, %5 - %.sroa.6.0 = phi i64 [ 3, %5 ], [ 4, %6 ], [ 5, %7 ], [ 7, %8 ], [ 3, %2 ] - %.sroa.0.0 = phi ptr [ @anon.dbc83011fcb707429349569d3c6bc524.190, %5 ], [ @anon.dbc83011fcb707429349569d3c6bc524.191, %6 ], [ @anon.dbc83011fcb707429349569d3c6bc524.192, %7 ], [ @anon.dbc83011fcb707429349569d3c6bc524.193, %8 ], [ @anon.dbc83011fcb707429349569d3c6bc524.189, %2 ] - %10 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0, i64 noundef %.sroa.6.0) - ret i1 %10 +switch.lookup: + %2 = load i8, ptr %0, align 1, !range !2355, !noundef !19 + %3 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %2, i1 true) + %4 = zext nneg i8 %3 to i64 + %switch.gep = getelementptr inbounds nuw [5 x i64], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i8 %3 to i64 + %switch.gep2 = getelementptr inbounds nuw [5 x ptr], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h217f5e47436bf9edE.90", i64 0, i64 %5 + %switch.load3 = load ptr, ptr %switch.gep2, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load3, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: inlinehint nonlazybind uwtable @@ -35831,6 +35815,9 @@ declare hidden void @"_ZN5image7buffer_97ImageBuffer$LT$P$C$alloc..vec..Vec$LT$$ ; Function Attrs: nonlazybind uwtable declare hidden void @"_ZN5alloc3vec16Vec$LT$T$C$A$GT$11extend_with17h9478d6f47c96feedE.llvm.17224713629878502917"(ptr noalias noundef align 8 dereferenceable(24), i64 noundef, i8 noundef) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #18 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #18 diff --git a/bench/llvm/optimized/CGOpenMPRuntime.ll b/bench/llvm/optimized/CGOpenMPRuntime.ll index d663fe68f0d..b332492e0bd 100644 --- a/bench/llvm/optimized/CGOpenMPRuntime.ll +++ b/bench/llvm/optimized/CGOpenMPRuntime.ll @@ -64391,12 +64391,13 @@ _ZN4llvm11SmallVectorIcLj256EED2Ev.exit: ; preds = %_ZN4llvm11raw_ostre ; Function Attrs: mustprogress nounwind uwtable define internal fastcc void @_ZL25addAArch64AdvSIMDNDSNamesjN4llvm9StringRefES0_cS0_S0_bPNS_8FunctionE(i32 noundef %0, ptr %1, i64 %2, ptr %3, i64 %4, i8 noundef signext range(i8 110, 116) %5, ptr noundef readonly byval(%"class.llvm::StringRef") align 8 captures(none) %6, ptr noundef readonly byval(%"class.llvm::StringRef") align 8 captures(none) %7, i1 noundef zeroext %8, ptr noundef %9) unnamed_addr #0 { - switch i32 %0, label %15 [ - i32 8, label %11 - i32 16, label %12 - i32 32, label %13 - i32 64, label %14 - i32 128, label %14 + %11 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %0, i1 true) + switch i32 %11, label %16 [ + i32 3, label %12 + i32 4, label %13 + i32 5, label %14 + i32 6, label %14 + i32 7, label %15 ] 11: ; preds = %10 @@ -106445,6 +106446,9 @@ declare void @_ZN5clang7CodeGen15CodeGenFunction18EmitStoreOfComplexESt4pairIPN4 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #26 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #27 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.ctpop.i32(i32) #27 diff --git a/bench/llvm/optimized/CodeGenPrepare.ll b/bench/llvm/optimized/CodeGenPrepare.ll index 56b44db8464..ad14ebe2981 100644 --- a/bench/llvm/optimized/CodeGenPrepare.ll +++ b/bench/llvm/optimized/CodeGenPrepare.ll @@ -62821,11 +62821,12 @@ declare i32 @llvm.ctpop.i32(i32) #14 ; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define internal fastcc void @_ZN12_GLOBAL__N_111ExtAddrMode16SetCombinedFieldENS0_9FieldNameEPN4llvm5ValueERKNS2_15SmallVectorImplIS0_EE(ptr noundef nonnull align 8 captures(none) dereferenceable(65) %0, i32 noundef %1, ptr noundef %2, ptr readonly captures(address) %.0.val, i32 %.8.val) unnamed_addr #20 align 2 { - switch i32 %1, label %4 [ - i32 1, label %5 - i32 2, label %7 - i32 8, label %9 - i32 4, label %21 + %4 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + switch i32 %4, label %5 [ + i32 0, label %6 + i32 1, label %8 + i32 3, label %10 + i32 2, label %22 ] 4: ; preds = %3 @@ -62862,7 +62863,7 @@ define internal fastcc void @_ZN12_GLOBAL__N_111ExtAddrMode16SetCombinedFieldENS br i1 %.not17, label %.loopexit, label %.critedge .critedge: ; preds = %13, %16 - %.02 = phi ptr [ %17, %16 ], [ %.0.val, %13 ] + %.02 = phi ptr [ %17, %17 ], [ %.0.val, %14 ] %18 = getelementptr inbounds nuw i8, ptr %.02, i64 24 %19 = load i64, ptr %18, align 8, !tbaa !1056 %.not18 = icmp eq i64 %19, 0 @@ -75525,6 +75526,9 @@ define internal void @_GLOBAL__sub_I_CodeGenPrepare.cpp() #23 section ".text.sta ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #24 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #25 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.ctpop.i64(i64) #25 diff --git a/bench/llvm/optimized/DataExtractor.ll b/bench/llvm/optimized/DataExtractor.ll index 87d0443c89a..054079c5814 100644 --- a/bench/llvm/optimized/DataExtractor.ll +++ b/bench/llvm/optimized/DataExtractor.ll @@ -796,12 +796,13 @@ _ZNK4llvm13DataExtractor5getUsImEEPT_PmS3_jPNS_5ErrorE.exit: ; preds = %4, %._cr ; Function Attrs: mustprogress nounwind uwtable define dso_local noundef i64 @_ZNK4llvm13DataExtractor11getUnsignedEPmjPNS_5ErrorE(ptr noundef nonnull readonly align 8 captures(none) dereferenceable(18) %0, ptr noundef captures(none) %1, i32 noundef %2, ptr noundef captures(address_is_null) %3) local_unnamed_addr #0 align 2 { + %5 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %2, i1 true) %.not.i.i.i = icmp eq ptr %3, null - switch i32 %2, label %56 [ - i32 1, label %5 - i32 2, label %16 - i32 4, label %29 - i32 8, label %43 + switch i32 %5, label %56 [ + i32 0, label %5 + i32 1, label %16 + i32 2, label %29 + i32 3, label %43 ] 5: ; preds = %4 @@ -920,34 +921,35 @@ _ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit: ; preds = %33, %_ZL7isErrorP ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef nonnull readonly align 8 captures(none) dereferenceable(18) %0, ptr noundef captures(none) %1, i32 noundef %2) local_unnamed_addr #3 align 2 { - %4 = load i64, ptr %1, align 8, !tbaa !62 - switch i32 %2, label %59 [ - i32 1, label %5 - i32 2, label %16 - i32 4, label %30 - i32 8, label %45 + %4 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %2, i1 true) + %5 = load i64, ptr %1, align 8, !tbaa !62 + switch i32 %4, label %60 [ + i32 0, label %6 + i32 1, label %17 + i32 2, label %31 + i32 3, label %46 ] 5: ; preds = %3 - %.not.i.i13 = icmp ne i64 %4, -1 + %.not.i.i13 = icmp ne i64 %5, -1 %6 = getelementptr inbounds nuw i8, ptr %0, i64 8 %7 = load i64, ptr %6, align 8 - %8 = icmp ugt i64 %7, %4 + %8 = icmp ugt i64 %7, %5 %9 = select i1 %.not.i.i13, i1 %8, i1 false br i1 %9, label %10, label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 10: ; preds = %5 - %11 = add nuw i64 %4, 1 + %11 = add nuw i64 %5, 1 %12 = load ptr, ptr %0, align 8, !tbaa !63 - %13 = getelementptr inbounds nuw i8, ptr %12, i64 %4 + %13 = getelementptr inbounds nuw i8, ptr %12, i64 %5 %14 = load i8, ptr %13, align 1 store i64 %11, ptr %1, align 8, !tbaa !62 %15 = sext i8 %14 to i64 br label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 16: ; preds = %3 - %.not.i.i14 = icmp ult i64 %4, -2 - %17 = add i64 %4, 1 + %.not.i.i14 = icmp ult i64 %5, -2 + %17 = add i64 %5, 1 %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 %19 = load i64, ptr %18, align 8 %20 = icmp ugt i64 %19, %17 @@ -955,9 +957,9 @@ define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef br i1 %21, label %22, label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 22: ; preds = %16 - %23 = add nuw i64 %4, 2 + %23 = add nuw i64 %5, 2 %24 = load ptr, ptr %0, align 8, !tbaa !63 - %25 = getelementptr inbounds nuw i8, ptr %24, i64 %4 + %25 = getelementptr inbounds nuw i8, ptr %24, i64 %5 %26 = load i16, ptr %25, align 1 %27 = getelementptr inbounds nuw i8, ptr %0, i64 16 %28 = load i8, ptr %27, align 8, !tbaa !67 @@ -969,8 +971,8 @@ define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef br label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 30: ; preds = %3 - %.not.i.i15 = icmp ult i64 %4, -4 - %31 = add i64 %4, 3 + %.not.i.i15 = icmp ult i64 %5, -4 + %31 = add i64 %5, 3 %32 = getelementptr inbounds nuw i8, ptr %0, i64 8 %33 = load i64, ptr %32, align 8 %34 = icmp ugt i64 %33, %31 @@ -978,9 +980,9 @@ define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef br i1 %35, label %36, label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 36: ; preds = %30 - %37 = add nuw i64 %4, 4 + %37 = add nuw i64 %5, 4 %38 = load ptr, ptr %0, align 8, !tbaa !63 - %39 = getelementptr inbounds nuw i8, ptr %38, i64 %4 + %39 = getelementptr inbounds nuw i8, ptr %38, i64 %5 %40 = load i32, ptr %39, align 1 %41 = getelementptr inbounds nuw i8, ptr %0, i64 16 %42 = load i8, ptr %41, align 8, !tbaa !67 @@ -992,8 +994,8 @@ define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef br label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 45: ; preds = %3 - %.not.i.i16 = icmp ult i64 %4, -8 - %46 = add i64 %4, 7 + %.not.i.i16 = icmp ult i64 %5, -8 + %46 = add i64 %5, 7 %47 = getelementptr inbounds nuw i8, ptr %0, i64 8 %48 = load i64, ptr %47, align 8 %49 = icmp ugt i64 %48, %46 @@ -1001,9 +1003,9 @@ define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef br i1 %50, label %51, label %_ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit 51: ; preds = %45 - %52 = add nuw i64 %4, 8 + %52 = add nuw i64 %5, 8 %53 = load ptr, ptr %0, align 8, !tbaa !63 - %54 = getelementptr inbounds nuw i8, ptr %53, i64 %4 + %54 = getelementptr inbounds nuw i8, ptr %53, i64 %5 %55 = load i64, ptr %54, align 1 %56 = getelementptr inbounds nuw i8, ptr %0, i64 16 %57 = load i8, ptr %56, align 8, !tbaa !67 @@ -1017,7 +1019,7 @@ define dso_local noundef i64 @_ZNK4llvm13DataExtractor9getSignedEPmj(ptr noundef unreachable _ZNK4llvm13DataExtractor6getU64EPmPNS_5ErrorE.exit: ; preds = %36, %30, %22, %16, %10, %5, %51, %45 - %.0 = phi i64 [ %spec.select.i.i12, %51 ], [ 0, %45 ], [ %15, %10 ], [ 0, %5 ], [ %29, %22 ], [ 0, %16 ], [ %44, %36 ], [ 0, %30 ] + %.0 = phi i64 [ %spec.select.i.i12, %51 ], [ 0, %45 ], [ %15, %10 ], [ 0, %6 ], [ %29, %22 ], [ 0, %17 ], [ %44, %36 ], [ 0, %30 ] ret i64 %.0 } @@ -1627,6 +1629,9 @@ define linkonce_odr hidden noundef i32 @_ZNK4llvm13format_objectIJmPKcEE7snprint ret i32 %11 } +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #13 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #13 @@ -1655,8 +1660,8 @@ attributes #9 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protec attributes #10 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #11 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #12 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #13 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } -attributes #14 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #14 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #15 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #16 = { nounwind willreturn memory(none) } attributes #17 = { nounwind } diff --git a/bench/llvm/optimized/DeclSpec.ll b/bench/llvm/optimized/DeclSpec.ll index 39660aa5e84..e8bc3193887 100644 --- a/bench/llvm/optimized/DeclSpec.ll +++ b/bench/llvm/optimized/DeclSpec.ll @@ -227,6 +227,7 @@ $_ZNK5clang19StreamingDiagnostic9AddStringEN4llvm9StringRefE = comdat any @switch.table._ZN5clang8DeclSpec6FinishERNS_4SemaERKNS_14PrintingPolicyE.8 = private unnamed_addr constant [4 x ptr] [ptr @.str.4, ptr @.str.12, ptr @.str.13, ptr @.str.14], align 8 @switch.table._ZN5clang8DeclSpec6FinishERNS_4SemaERKNS_14PrintingPolicyE.9 = private unnamed_addr constant [8 x ptr] [ptr @.str.4, ptr @.str.5, ptr @.str.6, ptr @.str.7, ptr @.str.8, ptr @.str.9, ptr @.str.10, ptr @.str.11], align 8 @switch.table._ZN5clang8DeclSpec6FinishERNS_4SemaERKNS_14PrintingPolicyE.10 = private unnamed_addr constant [3 x ptr] [ptr @.str.12, ptr @.str.13, ptr @.str.14], align 8 +@switch.table._ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE = private unnamed_addr constant [5 x ptr] [ptr @.str.110, ptr @.str.111, ptr @.str.113, ptr @.str.112, ptr @.str.114], align 8 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @_ZN5clang13UnqualifiedId13setTemplateIdEPNS_20TemplateIdAnnotationE(ptr noundef nonnull writeonly align 8 captures(none) dereferenceable(32) initializes((0, 4), (8, 16), (24, 32)) %0, ptr noundef %1) local_unnamed_addr #0 align 2 { @@ -2779,12 +2780,13 @@ _ZL12BadSpecifierIN5clang8DeclSpec2TQEEbT_S3_RPKcRjb.exit: ; preds = %12, %15, % %27 = and i64 %7, -2080374785 %28 = or disjoint i64 %27, %26 store i64 %28, ptr %0, align 8 - switch i32 %1, label %39 [ - i32 16, label %37 - i32 1, label %29 - i32 2, label %31 - i32 4, label %33 - i32 8, label %35 + %29 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + switch i32 %29, label %40 [ + i32 4, label %38 + i32 0, label %30 + i32 1, label %32 + i32 2, label %34 + i32 3, label %36 ] 29: ; preds = %22 @@ -2830,12 +2832,13 @@ define dso_local noundef zeroext i1 @_ZN5clang8DeclSpec11SetTypeQualENS0_2TQENS_ %10 = and i64 %4, -2080374785 %11 = or disjoint i64 %10, %9 store i64 %11, ptr %0, align 8 - switch i32 %1, label %22 [ - i32 16, label %20 - i32 1, label %12 - i32 2, label %14 - i32 4, label %16 - i32 8, label %18 + %12 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + switch i32 %12, label %23 [ + i32 4, label %21 + i32 0, label %13 + i32 1, label %16 + i32 2, label %17 + i32 3, label %19 ] 12: ; preds = %3 @@ -8192,98 +8195,58 @@ define dso_local noundef zeroext i1 @_ZN5clang14VirtSpecifiers12SetSpecifierENS0 %11 = load i32, ptr %0, align 4, !tbaa !1205 %12 = and i32 %11, %1 %.not = icmp ne i32 %12, 0 - br i1 %.not, label %13, label %19 + br i1 %.not, label %13, label %15 13: ; preds = %8 - switch i32 %1, label %14 [ - i32 1, label %_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit - i32 2, label %15 - i32 8, label %16 - i32 4, label %17 - i32 16, label %18 - ] - -14: ; preds = %13 - unreachable - -15: ; preds = %13 - br label %_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit - -16: ; preds = %13 - br label %_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit - -17: ; preds = %13 - br label %_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit - -18: ; preds = %13 - br label %_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit - -_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit: ; preds = %13, %15, %16, %17, %18 - %.0.i = phi ptr [ @.str.111, %15 ], [ @.str.112, %16 ], [ @.str.113, %17 ], [ @.str.114, %18 ], [ @.str.110, %13 ] - store ptr %.0.i, ptr %3, align 8, !tbaa !771 + %13 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + %14 = zext nneg i32 %13 to i64 + %switch.gep = getelementptr inbounds nuw [5 x ptr], ptr @switch.table._ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE, i64 0, i64 %14 + %switch.load = load ptr, ptr %switch.gep, align 8 + store ptr %switch.load, ptr %3, align 8, !tbaa !771 br label %28 -19: ; preds = %8 - %20 = or i32 %11, %1 - store i32 %20, ptr %0, align 4, !tbaa !1205 - switch i32 %1, label %21 [ - i32 1, label %22 - i32 8, label %24 - i32 4, label %24 - i32 2, label %24 - i32 16, label %26 +16: ; preds = %8 + %16 = or i32 %11, %1 + store i32 %16, ptr %0, align 4, !tbaa !1205 + %17 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + switch i32 %17, label %18 [ + i32 0, label %19 + i32 3, label %21 + i32 2, label %21 + i32 1, label %21 + i32 4, label %26 ] -21: ; preds = %19 +21: ; preds = %15 unreachable -22: ; preds = %19 +22: ; preds = %15 %23 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i32 %2, ptr %23, align 4, !tbaa !11 br label %28 -24: ; preds = %19, %19, %19 +24: ; preds = %15, %15, %15 %25 = getelementptr inbounds nuw i8, ptr %0, i64 12 store i32 %2, ptr %25, align 4, !tbaa !11 br label %28 -26: ; preds = %19 +26: ; preds = %15 %27 = getelementptr inbounds nuw i8, ptr %0, i64 16 store i32 %2, ptr %27, align 4, !tbaa !11 br label %28 -28: ; preds = %22, %24, %26, %_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE.exit +28: ; preds = %22, %24, %26, %13 ret i1 %.not } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local noundef nonnull ptr @_ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE(i32 noundef %0) local_unnamed_addr #11 align 2 { - switch i32 %0, label %2 [ - i32 1, label %7 - i32 2, label %3 - i32 8, label %4 - i32 4, label %5 - i32 16, label %6 - ] - -2: ; preds = %1 - unreachable - -3: ; preds = %1 - br label %7 - -4: ; preds = %1 - br label %7 - -5: ; preds = %1 - br label %7 - -6: ; preds = %1 - br label %7 - -7: ; preds = %1, %6, %5, %4, %3 - %.0 = phi ptr [ @.str.111, %3 ], [ @.str.112, %4 ], [ @.str.113, %5 ], [ @.str.114, %6 ], [ @.str.110, %1 ] - ret ptr %.0 +switch.lookup: + %1 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %0, i1 true) + %2 = zext nneg i32 %1 to i64 + %switch.gep = getelementptr inbounds nuw [5 x ptr], ptr @switch.table._ZN5clang14VirtSpecifiers16getSpecifierNameENS0_9SpecifierE, i64 0, i64 %2 + %switch.load = load ptr, ptr %switch.gep, align 8 + ret ptr %switch.load } declare i64 @_ZNK5clang22NestedNameSpecifierLoc19getLocalSourceRangeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 @@ -9820,6 +9783,9 @@ _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit: ; preds = %_ZNKS ret void } +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #20 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #20 @@ -9846,8 +9812,8 @@ attributes #16 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector attributes #17 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #18 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #19 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #20 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } -attributes #21 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #20 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #21 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #22 = { nounwind } attributes #23 = { nounwind willreturn memory(read) } attributes #24 = { builtin nounwind allocsize(0) } diff --git a/bench/llvm/optimized/DiagnosticBuilderWrappers.ll b/bench/llvm/optimized/DiagnosticBuilderWrappers.ll index 2bb02496d15..86411af0ba2 100644 --- a/bench/llvm/optimized/DiagnosticBuilderWrappers.ll +++ b/bench/llvm/optimized/DiagnosticBuilderWrappers.ll @@ -687,15 +687,16 @@ declare void @_ZN4llvm11raw_ostreamD2Ev(ptr noundef nonnull align 8 dereferencea ; Function Attrs: mustprogress nounwind uwtable define dso_local noundef nonnull align 8 dereferenceable(66) ptr @_ZN4llvm5MachOlsERKN5clang17DiagnosticBuilderERKNS0_8FileTypeE(ptr noundef nonnull returned align 8 dereferenceable(66) %0, ptr noundef nonnull readonly align 4 captures(none) dereferenceable(4) %1) local_unnamed_addr #0 { %3 = load i32, ptr %1, align 4, !tbaa !88 - switch i32 %3, label %12 [ - i32 4, label %4 - i32 1, label %5 - i32 2, label %6 - i32 8, label %7 - i32 16, label %8 - i32 32, label %9 - i32 64, label %10 - i32 128, label %11 + %4 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %3, i1 true) + switch i32 %4, label %13 [ + i32 2, label %5 + i32 0, label %6 + i32 1, label %7 + i32 3, label %8 + i32 4, label %9 + i32 4, label %10 + i32 6, label %11 + i32 7, label %12 ] 4: ; preds = %2 @@ -733,7 +734,7 @@ define dso_local noundef nonnull align 8 dereferenceable(66) ptr @_ZN4llvm5MachO 12: ; preds = %2 unreachable -13: ; preds = %11, %10, %9, %8, %7, %6, %5, %4 +13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5 ret ptr %0 } @@ -942,6 +943,9 @@ declare void @_ZNK4llvm12VersionTuple11getAsStringB5cxx11Ev(ptr dead_on_unwind w ; Function Attrs: mustprogress nofree nounwind willreturn memory(read) declare noundef ptr @_ZSt18_Rb_tree_incrementPKSt18_Rb_tree_node_base(ptr noundef) local_unnamed_addr #8 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #9 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #9 @@ -957,13 +961,14 @@ attributes #5 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protec attributes #6 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { mustprogress nofree nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #9 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } +attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) } -attributes #11 = { nounwind } -attributes #12 = { builtin nounwind allocsize(0) } -attributes #13 = { builtin nounwind } -attributes #14 = { noreturn nounwind } -attributes #15 = { nounwind willreturn memory(read) } +attributes #11 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #12 = { nounwind } +attributes #13 = { builtin nounwind allocsize(0) } +attributes #14 = { builtin nounwind } +attributes #15 = { noreturn nounwind } +attributes #16 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2} diff --git a/bench/llvm/optimized/IndexingContext.ll b/bench/llvm/optimized/IndexingContext.ll index f31a9327294..0fc86d8278c 100644 --- a/bench/llvm/optimized/IndexingContext.ll +++ b/bench/llvm/optimized/IndexingContext.ll @@ -2284,28 +2284,29 @@ declare noundef zeroext i1 @_ZN5clang5index35applyForEachSymbolRoleInterruptible ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable define internal noundef zeroext i1 @"_ZN4llvm12function_refIFbN5clang5index10SymbolRoleEEE11callback_fnIZZL43shouldReportOccurrenceForSystemDeclOnlyModebjNS_8ArrayRefINS2_14SymbolRelationEEEENK3$_0clEjEUlS3_E_EEblS3_"(i64 noundef %0, i32 noundef %1) #8 align 2 { - switch i32 %1, label %5 [ - i32 1024, label %3 - i32 2048, label %3 - i32 4096, label %3 - i32 32768, label %3 - i32 65536, label %3 - i32 262144, label %3 + %3 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + switch i32 %3, label %6 [ + i32 10, label %3 + i32 11, label %3 + i32 12, label %3 + i32 15, label %3 + i32 16, label %3 + i32 18, label %4 + i32 0, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" i32 1, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" i32 2, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 3, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" i32 4, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 5, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 6, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 7, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" i32 8, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 16, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 32, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 64, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 128, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 256, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 512, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 8192, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 16384, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 131072, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 524288, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" - i32 1048576, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 9, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 13, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 14, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 17, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 19, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" + i32 20, label %"_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit" ] 3: ; preds = %2, %2, %2, %2, %2, %2 @@ -2318,7 +2319,7 @@ define internal noundef zeroext i1 @"_ZN4llvm12function_refIFbN5clang5index10Sym unreachable "_ZZZL43shouldReportOccurrenceForSystemDeclOnlyModebjN4llvm8ArrayRefIN5clang5index14SymbolRelationEEEENK3$_0clEjENKUlNS2_10SymbolRoleEE_clES6_.exit": ; preds = %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %2, %3 - %.0.i = phi i1 [ false, %3 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ] + %.0.i = phi i1 [ false, %4 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ], [ true, %2 ] ret i1 %.0.i } @@ -2386,6 +2387,9 @@ declare noundef zeroext i1 @_ZNK5clang4Decl15hasDefiningAttrEv(ptr noundef nonnu ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr noundef captures(none)) local_unnamed_addr #9 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #10 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #10 diff --git a/bench/llvm/optimized/LowLevelTypeUtils.ll b/bench/llvm/optimized/LowLevelTypeUtils.ll index d825472db20..2f6dfe9870b 100644 --- a/bench/llvm/optimized/LowLevelTypeUtils.ll +++ b/bench/llvm/optimized/LowLevelTypeUtils.ll @@ -750,13 +750,12 @@ _ZNK4llvm3LLT13getSizeInBitsEv.exit: ; preds = %9, %11 store i8 %.sroa.3.0.i, ptr %.sroa.2.0..sroa_idx, align 8 %19 = call noundef i64 @_ZNK4llvm8TypeSizecvmEv(ptr noundef nonnull align 8 dereferenceable(9) %2) #6 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6 - %20 = add i64 %19, -16 - %21 = call i64 @llvm.fshl.i64(i64 %20, i64 %20, i64 60) - switch i64 %21, label %30 [ - i64 0, label %22 - i64 1, label %24 - i64 3, label %26 - i64 7, label %28 + %20 = call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %19, i1 true) + switch i64 %20, label %29 [ + i64 4, label %21 + i64 5, label %23 + i64 6, label %25 + i64 7, label %27 ] 22: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit @@ -779,7 +778,7 @@ _ZNK4llvm3LLT13getSizeInBitsEv.exit: ; preds = %9, %11 unreachable 31: ; preds = %28, %26, %24, %22 - %.0 = phi ptr [ %23, %22 ], [ %25, %24 ], [ %27, %26 ], [ %29, %28 ] + %.0 = phi ptr [ %23, %21 ], [ %25, %23 ], [ %27, %25 ], [ %29, %27 ] ret ptr %.0 } @@ -1568,7 +1567,7 @@ declare { i16, ptr } @_ZN4llvm3EVT19getExtendedVectorVTERNS_11LLVMContextES0_NS_ declare { i16, ptr } @_ZN4llvm3EVT20getExtendedIntegerVTERNS_11LLVMContextEj(ptr noundef nonnull align 1, i32 noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i64 @llvm.fshl.i64(i64, i64, i64) #5 +declare i64 @llvm.cttz.i64(i64, i1 immarg) #5 attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } diff --git a/bench/llvm/optimized/MCAsmStreamer.ll b/bench/llvm/optimized/MCAsmStreamer.ll index 2f0cfee8280..6ce9edb58d8 100644 --- a/bench/llvm/optimized/MCAsmStreamer.ll +++ b/bench/llvm/optimized/MCAsmStreamer.ll @@ -15801,68 +15801,69 @@ _ZN4llvm11raw_ostreamlsEPKc.exit: ; preds = %25, %27 br label %206 34: ; preds = %6 - %35 = getelementptr inbounds nuw i8, ptr %0, i64 304 - %36 = load ptr, ptr %35, align 8, !tbaa !295 - %37 = getelementptr inbounds nuw i8, ptr %36, i64 24 - %38 = load ptr, ptr %37, align 8, !tbaa !296 - %39 = getelementptr inbounds nuw i8, ptr %36, i64 32 - %40 = load ptr, ptr %39, align 8, !tbaa !297 - %41 = ptrtoint ptr %38 to i64 - %42 = ptrtoint ptr %40 to i64 - %43 = sub i64 %41, %42 - br i1 %or.cond60, label %44, label %_ZN4llvm13isPowerOf2_64Em.exit18.thread - -44: ; preds = %34 - %45 = icmp ult i64 %43, 10 - switch i32 %4, label %46 [ - i32 1, label %47 - i32 2, label %53 - i32 4, label %59 + %35 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %4, i1 true) + %36 = getelementptr inbounds nuw i8, ptr %0, i64 304 + %37 = load ptr, ptr %36, align 8, !tbaa !295 + %38 = getelementptr inbounds nuw i8, ptr %37, i64 24 + %39 = load ptr, ptr %38, align 8, !tbaa !296 + %40 = getelementptr inbounds nuw i8, ptr %37, i64 32 + %41 = load ptr, ptr %40, align 8, !tbaa !297 + %42 = ptrtoint ptr %39 to i64 + %43 = ptrtoint ptr %41 to i64 + %44 = sub i64 %42, %43 + br i1 %or.cond60, label %45, label %_ZN4llvm13isPowerOf2_64Em.exit18.thread + +45:; preds = %34 + %46 = icmp ult i64 %44, 10 + switch i32 %35, label %47 [ + i32 0, label %48 + i32 1, label %54 + i32 2, label %60 ] -46: ; preds = %44 +46: ; preds = %45 unreachable -47: ; preds = %44 - br i1 %45, label %48, label %50 +47: ; preds = %45 + br i1 %46, label %48, label %50 48: ; preds = %47 - %49 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull @.str.122, i64 noundef 10) #22 + %49 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull @.str.122, i64 noundef 10) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit21 50: ; preds = %47 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %40, ptr noundef nonnull align 1 dereferenceable(10) @.str.122, i64 10, i1 false) - %51 = load ptr, ptr %39, align 8, !tbaa !297 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %41, ptr noundef nonnull align 1 dereferenceable(10) @.str.122, i64 10, i1 false) + %51 = load ptr, ptr %40, align 8, !tbaa !297 %52 = getelementptr inbounds nuw i8, ptr %51, i64 10 - store ptr %52, ptr %39, align 8, !tbaa !297 + store ptr %52, ptr %40, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit21 -53: ; preds = %44 - br i1 %45, label %54, label %56 +53: ; preds = %45 + br i1 %46, label %54, label %56 54: ; preds = %53 - %55 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull @.str.123, i64 noundef 10) #22 + %55 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull @.str.123, i64 noundef 10) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit21 56: ; preds = %53 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %40, ptr noundef nonnull align 1 dereferenceable(10) @.str.123, i64 10, i1 false) - %57 = load ptr, ptr %39, align 8, !tbaa !297 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %41, ptr noundef nonnull align 1 dereferenceable(10) @.str.123, i64 10, i1 false) + %57 = load ptr, ptr %40, align 8, !tbaa !297 %58 = getelementptr inbounds nuw i8, ptr %57, i64 10 - store ptr %58, ptr %39, align 8, !tbaa !297 + store ptr %58, ptr %40, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit21 -59: ; preds = %44 - br i1 %45, label %60, label %62 +59: ; preds = %45 + br i1 %46, label %60, label %62 60: ; preds = %59 - %61 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull @.str.124, i64 noundef 10) #22 + %61 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull @.str.124, i64 noundef 10) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit21 62: ; preds = %59 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %40, ptr noundef nonnull align 1 dereferenceable(10) @.str.124, i64 10, i1 false) - %63 = load ptr, ptr %39, align 8, !tbaa !297 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %41, ptr noundef nonnull align 1 dereferenceable(10) @.str.124, i64 10, i1 false) + %63 = load ptr, ptr %40, align 8, !tbaa !297 %64 = getelementptr inbounds nuw i8, ptr %63, i64 10 - store ptr %64, ptr %39, align 8, !tbaa !297 + store ptr %64, ptr %40, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit21 _ZN4llvm11raw_ostreamlsEPKc.exit21: ; preds = %62, %60, %56, %54, %50, %48 @@ -15885,27 +15886,27 @@ _ZN4llvm11raw_ostreamlsEPKc.exit21: ; preds = %62, %60, %56, %54, %78 = ptrtoint ptr %75 to i64 %79 = ptrtoint ptr %77 to i64 %80 = sub i64 %78, %79 - br i1 %70, label %81, label %95 + br i1 %70, label %82, label %95 -81: ; preds = %72 - %82 = icmp ult i64 %80, 4 - br i1 %82, label %83, label %85 +83: ; preds = %73 + %83 = icmp ult i64 %81, 4 + br i1 %83, label %84, label %86 -83: ; preds = %81 - %84 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %73, ptr noundef nonnull @.str.119, i64 noundef 4) #22 +84: ; preds = %82 + %85 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %74, ptr noundef nonnull @.str.119, i64 noundef 4) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit30 -85: ; preds = %81 +85: ; preds = %82 store i32 2016419884, ptr %77, align 1 %86 = load ptr, ptr %76, align 8, !tbaa !297 %87 = getelementptr inbounds nuw i8, ptr %86, i64 4 store ptr %87, ptr %76, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit30 -_ZN4llvm11raw_ostreamlsEPKc.exit30: ; preds = %83, %85 +_ZN4llvm11raw_ostreamlsEPKc.exit30: ; preds = %84, %85 %88 = load ptr, ptr %65, align 8, !tbaa !295 - %89 = shl nuw nsw i32 %4, 3 - %90 = sub nuw nsw i32 64, %89 + %89 = shl i32 %4, 3 + %90 = sub i32 64, %89 %91 = zext nneg i32 %90 to i64 %92 = lshr i64 -1, %91 %93 = and i64 %92, %2 @@ -15954,64 +15955,64 @@ _ZN4llvm11raw_ostreamlsEPKc.exit33: ; preds = %99, %97, %_ZN4llvm1 br label %_ZN4llvm11raw_ostreamlsEPKc.exit36 _ZN4llvm11raw_ostreamlsEPKc.exit36: ; preds = %112, %114 - %.0.i.i35 = phi ptr [ %113, %112 ], [ %103, %114 ] + %.0.i.i35 = phi ptr [ %113, %113 ], [ %103, %115 ] %117 = zext i32 %5 to i64 %118 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostreamlsEm(ptr noundef nonnull align 8 dereferenceable(48) %.0.i.i35, i64 noundef %117) #22 br label %206 _ZN4llvm13isPowerOf2_64Em.exit18.thread: ; preds = %34 - switch i32 %4, label %119 [ - i32 1, label %120 - i32 2, label %127 - i32 4, label %134 + switch i32 %35, label %120 [ + i32 0, label %120 + i32 1, label %127 + i32 2, label %134 ] 119: ; preds = %_ZN4llvm13isPowerOf2_64Em.exit18.thread unreachable 120: ; preds = %_ZN4llvm13isPowerOf2_64Em.exit18.thread - %121 = icmp ult i64 %43, 7 + %121 = icmp ult i64 %44, 7 br i1 %121, label %122, label %124 122: ; preds = %120 - %123 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull @.str.125, i64 noundef 7) #22 + %123 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull @.str.125, i64 noundef 7) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit39 124: ; preds = %120 - tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %40, ptr noundef nonnull align 1 dereferenceable(7) @.str.125, i64 7, i1 false) - %125 = load ptr, ptr %39, align 8, !tbaa !297 + tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %41, ptr noundef nonnull align 1 dereferenceable(7) @.str.125, i64 7, i1 false) + %125 = load ptr, ptr %40, align 8, !tbaa !297 %126 = getelementptr inbounds nuw i8, ptr %125, i64 7 - store ptr %126, ptr %39, align 8, !tbaa !297 + store ptr %126, ptr %40, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit39 127: ; preds = %_ZN4llvm13isPowerOf2_64Em.exit18.thread - %128 = icmp ult i64 %43, 8 + %128 = icmp ult i64 %44, 8 br i1 %128, label %129, label %131 129: ; preds = %127 - %130 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull @.str.126, i64 noundef 8) #22 + %130 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull @.str.126, i64 noundef 8) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit39 131: ; preds = %127 - store i64 8605929640439145006, ptr %40, align 1 - %132 = load ptr, ptr %39, align 8, !tbaa !297 + store i64 8605929640439145006, ptr %41, align 1 + %132 = load ptr, ptr %40, align 8, !tbaa !297 %133 = getelementptr inbounds nuw i8, ptr %132, i64 8 - store ptr %133, ptr %39, align 8, !tbaa !297 + store ptr %133, ptr %40, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit39 134: ; preds = %_ZN4llvm13isPowerOf2_64Em.exit18.thread - %135 = icmp ult i64 %43, 8 + %135 = icmp ult i64 %44, 8 br i1 %135, label %136, label %138 136: ; preds = %134 - %137 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull @.str.127, i64 noundef 8) #22 + %137 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream5writeEPKcm(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull @.str.127, i64 noundef 8) #22 br label %_ZN4llvm11raw_ostreamlsEPKc.exit39 138: ; preds = %134 - store i64 7813296106021937710, ptr %40, align 1 - %139 = load ptr, ptr %39, align 8, !tbaa !297 + store i64 7813296106021937710, ptr %41, align 1 + %139 = load ptr, ptr %40, align 8, !tbaa !297 %140 = getelementptr inbounds nuw i8, ptr %139, i64 8 - store ptr %140, ptr %39, align 8, !tbaa !297 + store ptr %140, ptr %40, align 8, !tbaa !297 br label %_ZN4llvm11raw_ostreamlsEPKc.exit39 _ZN4llvm11raw_ostreamlsEPKc.exit39: ; preds = %138, %136, %131, %129, %124, %122 @@ -16035,7 +16036,7 @@ _ZN4llvm11raw_ostreamlsEPKc.exit39: ; preds = %138, %136, %131, %1 br label %_ZN4llvm11raw_ostreamlsEc.exit _ZN4llvm11raw_ostreamlsEc.exit: ; preds = %147, %149 - %.0.i = phi ptr [ %148, %147 ], [ %142, %149 ] + %.0.i = phi ptr [ %148, %148 ], [ %142, %150 ] %151 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostreamlsEm(ptr noundef nonnull align 8 dereferenceable(48) %.0.i, i64 noundef %1) #22 %152 = trunc nuw i8 %3 to i1 br i1 %152, label %153, label %168 @@ -16091,9 +16092,9 @@ _ZN4llvm11raw_ostreamlsEc.exit: ; preds = %147, %149 br label %_ZN4llvm11raw_ostreamlsEPKc.exit51.thread _ZN4llvm11raw_ostreamlsEPKc.exit51: ; preds = %165, %163 - %.0.i.i47 = phi ptr [ %164, %163 ], [ %154, %165 ] - %184 = shl nuw nsw i32 %4, 3 - %185 = sub nuw nsw i32 64, %184 + %.0.i.i47 = phi ptr [ %164, %164 ], [ %154, %166 ] + %184 = shl i32 %4, 3 + %185 = sub i32 64, %184 %186 = zext nneg i32 %185 to i64 %187 = lshr i64 -1, %186 %188 = and i64 %187, %2 @@ -16125,7 +16126,7 @@ _ZN4llvm11raw_ostreamlsEPKc.exit51.thread: ; preds = %179, %181, %_ZN4llv br label %_ZN4llvm11raw_ostreamlsEPKc.exit54 _ZN4llvm11raw_ostreamlsEPKc.exit54: ; preds = %199, %201 - %.0.i.i53 = phi ptr [ %200, %199 ], [ %190, %201 ] + %.0.i.i53 = phi ptr [ %200, %200 ], [ %190, %202 ] %204 = zext i32 %5 to i64 %205 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostreamlsEm(ptr noundef nonnull align 8 dereferenceable(48) %.0.i.i53, i64 noundef %204) #22 br label %206 @@ -17747,6 +17748,9 @@ declare void @_ZN4llvm10MCStreamer15emitSymbolValueEPKNS_8MCSymbolEjb(ptr nounde declare void @_ZN4llvm15MCDwarfLineAddr4EmitEPNS_10MCStreamerENS_22MCDwarfLineTableParamsElm(ptr noundef, i24, i64 noundef, i64 noundef) local_unnamed_addr #3 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #18 + ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #18 @@ -17783,8 +17787,8 @@ attributes #14 = { mustprogress nocallback nofree nosync nounwind willreturn mem attributes #15 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #16 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #17 = { mustprogress nofree nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #18 = { nocallback nofree nounwind willreturn memory(argmem: read) } -attributes #19 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #18 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #19 = { nocallback nofree nounwind willreturn memory(argmem: read) } attributes #20 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #21 = { builtin nounwind allocsize(0) } attributes #22 = { nounwind } diff --git a/bench/llvm/optimized/MCObjectStreamer.ll b/bench/llvm/optimized/MCObjectStreamer.ll index 3fdcb752444..4588e48d0c9 100644 --- a/bench/llvm/optimized/MCObjectStreamer.ll +++ b/bench/llvm/optimized/MCObjectStreamer.ll @@ -159,7 +159,6 @@ $_ZN4llvm23SmallVectorTemplateBaseINS_16MCObjectStreamer14PendingMCFixupELb1EE18 @.str.17 = private unnamed_addr constant [26 x i8] c"vector::_M_realloc_insert\00", align 1 @.str.18 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1 @.str.19 = private unnamed_addr constant [50 x i8] c"basic_string: construction from null is not valid\00", align 1 -@switch.table._ZN4llvm16MCObjectStreamer13emitValueImplEPKNS_6MCExprEjNS_5SMLocE = private unnamed_addr constant [8 x i32] [i32 1, i32 2, i32 poison, i32 3, i32 poison, i32 poison, i32 poison, i32 4], align 4 @_ZN4llvm16MCObjectStreamerD1Ev = unnamed_addr alias void (ptr), ptr @_ZN4llvm16MCObjectStreamerD2Ev @@ -1191,14 +1190,14 @@ _ZN4llvmplERKNS_5TwineES2_.exit31: ; preds = %26, %_ZN4llvm6isInt call void @_ZN4llvm9MCContext11reportErrorENS_5SMLocERKNS_5TwineE(ptr noundef nonnull align 8 dereferenceable(2432) %31, ptr %3, ptr noundef nonnull align 8 dereferenceable(34) %6) #21 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #21 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #21 - br label %85 + br label %88 _ZN4llvm7isUIntNEjm.exit.thread: ; preds = %19, %_ZN4llvm6isIntNEjl.exit, %_ZN4llvm7isUIntNEjm.exit %38 = load ptr, ptr %0, align 8, !tbaa !3 %39 = getelementptr inbounds nuw i8, ptr %38, i64 544 %40 = load ptr, ptr %39, align 8 call void %40(ptr noundef nonnull align 8 dereferenceable(296) %0, i64 noundef %21, i32 noundef %2) #21 - br label %85 + br label %88 switch.lookup: ; preds = %4 %41 = getelementptr inbounds nuw i8, ptr %9, i64 96 @@ -1207,15 +1206,13 @@ switch.lookup: ; preds = %4 %43 = getelementptr inbounds nuw i8, ptr %9, i64 48 %44 = load i64, ptr %43, align 8, !tbaa !301 %45 = trunc i64 %44 to i32 - %switch.tableidx = add nsw i32 %2, -1 - %46 = sext i32 %switch.tableidx to i64 - %switch.gep = getelementptr inbounds [8 x i32], ptr @switch.table._ZN4llvm16MCObjectStreamer13emitValueImplEPKNS_6MCExprEjNS_5SMLocE, i64 0, i64 %46 - %switch.load = load i32, ptr %switch.gep, align 4 + %46 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %2, i1 true) + %switch.offset = add nuw nsw i32 %46, 1 store ptr %1, ptr %8, align 8, !tbaa !331, !alias.scope !332 %47 = getelementptr inbounds nuw i8, ptr %8, i64 8 store i32 %45, ptr %47, align 8, !tbaa !277, !alias.scope !332 %48 = getelementptr inbounds nuw i8, ptr %8, i64 12 - store i32 %switch.load, ptr %48, align 4, !tbaa !335, !alias.scope !332 + store i32 %switch.offset, ptr %48, align 4, !tbaa !335, !alias.scope !332 %49 = getelementptr inbounds nuw i8, ptr %8, i64 16 store ptr %3, ptr %49, align 8, !tbaa !279, !alias.scope !332 %50 = getelementptr inbounds nuw i8, ptr %9, i64 104 @@ -1262,7 +1259,7 @@ _ZN4llvm23SmallVectorTemplateBaseINS_7MCFixupELb1EE9push_backERKS1_.exit: ; pred %74 = add i32 %73, 1 store i32 %74, ptr %50, align 8, !tbaa !73 call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #21 - %75 = zext nneg i32 %2 to i64 + %75 = zext i32 %2 to i64 %76 = load i64, ptr %43, align 8, !tbaa !301 %77 = add i64 %76, %75 %78 = getelementptr inbounds nuw i8, ptr %9, i64 56 @@ -1278,15 +1275,23 @@ _ZN4llvm23SmallVectorTemplateBaseINS_7MCFixupELb1EE9push_backERKS1_.exit: ; pred _ZN4llvm27MCEncodedFragmentWithFixupsILj32ELj4EE14appendContentsEmc.exit: ; preds = %80, %_ZN4llvm23SmallVectorTemplateBaseINS_7MCFixupELb1EE9push_backERKS1_.exit %.pre4.i.i = phi i64 [ %76, %_ZN4llvm23SmallVectorTemplateBaseINS_7MCFixupELb1EE9push_backERKS1_.exit ], [ %.pre4.pre.i.i, %80 ] - %82 = load ptr, ptr %42, align 8, !tbaa !300 - %83 = getelementptr inbounds nuw i8, ptr %82, i64 %.pre4.i.i - call void @llvm.memset.p0.i64(ptr align 1 %83, i8 0, i64 %75, i1 false) + %82 = icmp eq i32 %2, 0 + br i1 %82, label %85, label %83 + +83: ; preds = %_ZN4llvm23SmallVectorTemplateBaseIcLb1EE28reserveForParamAndGetAddressERcm.exit.i.i + %84 = load ptr, ptr %42, align 8, !tbaa !300 + %85 = getelementptr inbounds nuw i8, ptr %84, i64 %.pre4.i.i + call void @llvm.memset.p0.i64(ptr align 1 %85, i8 0, i64 %75, i1 false) %.pre.i.i = load i64, ptr %43, align 8, !tbaa !301 - %84 = add i64 %.pre.i.i, %75 - store i64 %84, ptr %43, align 8, !tbaa !301 br label %85 -85: ; preds = %_ZN4llvm27MCEncodedFragmentWithFixupsILj32ELj4EE14appendContentsEmc.exit, %_ZN4llvm7isUIntNEjm.exit.thread, %_ZN4llvmplERKNS_5TwineES2_.exit31 +85: ; preds = %_ZN4llvm27MCEncodedFragmentWithFixupsILj32ELj4EE14appendContentsEmc.exit, %83 + %86 = phi i64 [ %.pre4.i.i, %_ZN4llvm23SmallVectorTemplateBaseIcLb1EE28reserveForParamAndGetAddressERcm.exit.i.i ], [ %.pre.i.i, %83 ] + %87 = add i64 %86, %75 + store i64 %87, ptr %43, align 8, !tbaa !301 + br label %88 + +88: ; preds = %_ZN4llvm27MCEncodedFragmentWithFixupsILj32ELj4EE14appendContentsEmc.exit, %_ZN4llvm7isUIntNEjm.exit.thread, %_ZN4llvmplERKNS_5TwineES2_.exit31 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #21 ret void } @@ -6103,6 +6108,9 @@ _ZN4llvm23SmallVectorTemplateBaseINS_16MCObjectStreamer14PendingMCFixupELb1EE9pu ret ptr %38 } +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #18 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #18 @@ -6142,8 +6150,8 @@ attributes #14 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-prote attributes #15 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #17 = { mustprogress noinline nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #18 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } -attributes #19 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #18 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #19 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #20 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #21 = { nounwind } attributes #22 = { builtin nounwind allocsize(0) } diff --git a/bench/llvm/optimized/RISCVAsmBackend.ll b/bench/llvm/optimized/RISCVAsmBackend.ll index 1fb0dcdfdf0..aa61623dcc1 100644 --- a/bench/llvm/optimized/RISCVAsmBackend.ll +++ b/bench/llvm/optimized/RISCVAsmBackend.ll @@ -271,7 +271,6 @@ $_ZTVN4llvm2cl11OptionValueIbEE = comdat any @_ZTVN4llvm2cl11OptionValueIbEE = linkonce_odr unnamed_addr constant { [4 x ptr] } { [4 x ptr] [ptr null, ptr null, ptr @_ZNK4llvm2cl15OptionValueCopyIbE7compareERKNS0_18GenericOptionValueE, ptr @_ZN4llvm2cl18GenericOptionValue6anchorEv] }, comdat, align 8 @_ZTVN4llvm2cl6parserIbEE = external unnamed_addr constant { [6 x ptr] }, align 8 @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_RISCVAsmBackend.cpp, ptr null }] -@switch.table._ZNK4llvm15RISCVAsmBackend18relaxDwarfLineAddrERKNS_11MCAssemblerERNS_23MCDwarfLineAddrFragmentERb = private unnamed_addr constant [8 x i64] [i64 1258425418017, i64 1262720385314, i64 poison, i64 1267015352611, i64 poison, i64 poison, i64 poison, i64 1271310319908], align 8 @switch.table._ZNK4llvm15RISCVAsmBackend23handleAddSubRelocationsERKNS_11MCAssemblerERKNS_10MCFragmentERKNS_7MCFixupERKNS_7MCValueERm = private unnamed_addr constant [5 x i32] [i32 293, i32 294, i32 295, i32 296, i32 317], align 4 @switch.table._ZNK4llvm15RISCVAsmBackend23handleAddSubRelocationsERKNS_11MCAssemblerERKNS_10MCFragmentERKNS_7MCFixupERKNS_7MCValueERm.3 = private unnamed_addr constant [5 x i32] [i32 289, i32 290, i32 291, i32 292, i32 316], align 4 @@ -1952,12 +1951,12 @@ _ZN4llvm11raw_ostreamlsEh.exit38: ; preds = %80, %82 %91 = ptrtoint ptr %89 to i64 %92 = add i64 %87, %90 %93 = sub i64 %92, %91 - %switch.tableidx = add nsw i32 %57, -1 - %94 = sext i32 %switch.tableidx to i64 - %switch.gep = getelementptr inbounds [8 x i64], ptr @switch.table._ZNK4llvm15RISCVAsmBackend18relaxDwarfLineAddrERKNS_11MCAssemblerERNS_23MCDwarfLineAddrFragmentERb, i64 0, i64 %94 - %switch.load = load i64, ptr %switch.gep, align 8 - %.sroa.063.0.extract.trunc = trunc i64 %switch.load to i32 - %.sroa.464.0.extract.shift = lshr i64 %switch.load, 32 + %94 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %57, i1 true) + %switch.idx.cast = zext nneg i32 %94 to i64 + %switch.idx.mult = mul nuw nsw i64 %switch.idx.cast, 4294967297 + %switch.offset = add nuw nsw i64 %switch.idx.mult, 1258425418017 + %.sroa.063.0.extract.trunc = trunc i64 %switch.offset to i32 + %.sroa.464.0.extract.shift = lshr i64 %switch.offset, 32 %.sroa.464.0.extract.trunc = trunc nuw nsw i64 %.sroa.464.0.extract.shift to i32 %95 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN4llvm11raw_ostream11write_zerosEj(ptr noundef nonnull align 8 dereferenceable(48) %7, i32 noundef %57) #20 br label %116 @@ -3567,6 +3566,9 @@ define internal void @_GLOBAL__sub_I_RISCVAsmBackend.cpp() #17 section ".text.st ret void } +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #18 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #18 @@ -3591,11 +3593,12 @@ attributes #14 = { mustprogress nounwind willreturn allockind("free") memory(arg attributes #15 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #16 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #17 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } -attributes #18 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } -attributes #19 = { nocallback nofree nounwind willreturn memory(argmem: read) } -attributes #20 = { nounwind } -attributes #21 = { builtin nounwind allocsize(0) } -attributes #22 = { builtin nounwind } +attributes #18 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #19 = { nocallback nofree nounwind willreturn memory(argmem: write) } +attributes #20 = { nocallback nofree nounwind willreturn memory(argmem: read) } +attributes #21 = { nounwind } +attributes #22 = { builtin nounwind allocsize(0) } +attributes #23 = { builtin nounwind } !llvm.module.flags = !{!0, !1, !2} diff --git a/bench/llvm/optimized/SveEmitter.ll b/bench/llvm/optimized/SveEmitter.ll index 817c13259a0..c71f0df1162 100644 --- a/bench/llvm/optimized/SveEmitter.ll +++ b/bench/llvm/optimized/SveEmitter.ll @@ -16279,7 +16279,7 @@ _ZNK12_GLOBAL__N_19Intrinsic12getNumParamsEv.exit.i: ; preds = %_ZN4llvm5countIR %.val24.i = load i32, ptr %128, align 4, !tbaa !13 %243 = getelementptr inbounds nuw i8, ptr %21, i64 272 %.val25.i = load i32, ptr %243, align 4 - switch i32 %.val24.i, label %281 [ + switch i32 %.val24.i, label %280 [ i32 2, label %244 i32 5, label %256 i32 6, label %260 @@ -16326,47 +16326,47 @@ _ZNK12_GLOBAL__N_19Intrinsic12getNumParamsEv.exit.i: ; preds = %_ZN4llvm5countIR br label %_ZN12_GLOBAL__N_110SVEEmitter15encodeTypeFlagsERKNS_7SVETypeE.exit.i 264: ; preds = %242, %242 - %265 = add i32 %.val25.i, -8 - %266 = call i32 @llvm.fshl.i32(i32 %265, i32 %265, i32 29) - %267 = getelementptr inbounds nuw i8, ptr %3, i64 8 - switch i32 %266, label %280 [ - i32 0, label %268 - i32 1, label %271 - i32 3, label %274 - i32 7, label %277 + %265 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %.val25.i, i1 true) + %266 = getelementptr inbounds nuw i8, ptr %3, i64 8 + switch i32 %265, label %279 [ + i32 3, label %268 + i32 4, label %268 + i32 5, label %273 + i32 6, label %276 ] 268: ; preds = %264 %269 = call noundef i32 @_ZN4llvm13StringMapImpl4hashENS_9StringRefE(ptr nonnull @.str.213, i64 10) #22 - %270 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %267, ptr nonnull @.str.213, i64 10, i32 noundef %269) #22 + %270 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %266, ptr nonnull @.str.213, i64 10, i32 noundef %269) #22 br label %_ZN12_GLOBAL__N_110SVEEmitter15encodeTypeFlagsERKNS_7SVETypeE.exit.i 271: ; preds = %264 %272 = call noundef i32 @_ZN4llvm13StringMapImpl4hashENS_9StringRefE(ptr nonnull @.str.214, i64 11) #22 - %273 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %267, ptr nonnull @.str.214, i64 11, i32 noundef %272) #22 + %273 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %266, ptr nonnull @.str.214, i64 11, i32 noundef %272) #22 br label %_ZN12_GLOBAL__N_110SVEEmitter15encodeTypeFlagsERKNS_7SVETypeE.exit.i 274: ; preds = %264 %275 = call noundef i32 @_ZN4llvm13StringMapImpl4hashENS_9StringRefE(ptr nonnull @.str.215, i64 11) #22 - %276 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %267, ptr nonnull @.str.215, i64 11, i32 noundef %275) #22 + %276 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %266, ptr nonnull @.str.215, i64 11, i32 noundef %275) #22 br label %_ZN12_GLOBAL__N_110SVEEmitter15encodeTypeFlagsERKNS_7SVETypeE.exit.i 277: ; preds = %264 %278 = call noundef i32 @_ZN4llvm13StringMapImpl4hashENS_9StringRefE(ptr nonnull @.str.216, i64 11) #22 - %279 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %267, ptr nonnull @.str.216, i64 11, i32 noundef %278) #22 + %279 = call noundef i32 @_ZNK4llvm13StringMapImpl7FindKeyENS_9StringRefEj(ptr noundef nonnull align 8 dereferenceable(24) %266, ptr nonnull @.str.216, i64 11, i32 noundef %278) #22 br label %_ZN12_GLOBAL__N_110SVEEmitter15encodeTypeFlagsERKNS_7SVETypeE.exit.i 280: ; preds = %264 unreachable 281: ; preds = %242 + %281 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %.val25.i, i1 true) %282 = getelementptr inbounds nuw i8, ptr %3, i64 8 - switch i32 %.val25.i, label %298 [ - i32 8, label %283 - i32 16, label %286 - i32 32, label %289 - i32 64, label %292 - i32 128, label %295 + switch i32 %281, label %298 [ + i32 3, label %283 + i32 4, label %286 + i32 5, label %289 + i32 6, label %292 + i32 7, label %295 ] 283: ; preds = %281 @@ -16398,8 +16398,8 @@ _ZNK12_GLOBAL__N_19Intrinsic12getNumParamsEv.exit.i: ; preds = %_ZN4llvm5countIR unreachable _ZN12_GLOBAL__N_110SVEEmitter15encodeTypeFlagsERKNS_7SVETypeE.exit.i: ; preds = %295, %292, %289, %286, %283, %277, %274, %271, %268, %260, %256, %252, %249, %246 - %.sink38 = phi i32 [ %297, %295 ], [ %294, %292 ], [ %291, %289 ], [ %288, %286 ], [ %285, %283 ], [ %279, %277 ], [ %276, %274 ], [ %273, %271 ], [ %270, %268 ], [ %263, %260 ], [ %259, %256 ], [ %254, %252 ], [ %251, %249 ], [ %248, %246 ] - %.sink33.in = phi ptr [ %282, %295 ], [ %282, %292 ], [ %282, %289 ], [ %282, %286 ], [ %282, %283 ], [ %267, %277 ], [ %267, %274 ], [ %267, %271 ], [ %267, %268 ], [ %261, %260 ], [ %257, %256 ], [ %245, %252 ], [ %245, %249 ], [ %245, %246 ] + %.sink38 = phi i32 [ %297, %295 ], [ %294, %292 ], [ %291, %289 ], [ %288, %286 ], [ %285, %283 ], [ %279, %276 ], [ %275, %273 ], [ %271, %270 ], [ %269, %267 ], [ %263, %260 ], [ %259, %256 ], [ %254, %252 ], [ %251, %249 ], [ %248, %246 ] + %.sink33.in = phi ptr [ %282, %295 ], [ %282, %292 ], [ %282, %289 ], [ %282, %286 ], [ %282, %283 ], [ %266, %276 ], [ %266, %273 ], [ %266, %269 ], [ %266, %267 ], [ %261, %260 ], [ %257, %256 ], [ %245, %252 ], [ %245, %249 ], [ %245, %246 ] %.sink33 = load ptr, ptr %.sink33.in, align 8 %.sink35 = icmp eq i32 %.sink38, -1 %.sink39.in = getelementptr inbounds nuw i8, ptr %3, i64 16 @@ -24436,7 +24436,7 @@ thread-pre-split: ; preds = %201 call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #22 %.val11 = load i32, ptr %1, align 4, !tbaa !13 %.val12 = load i32, ptr %202, align 4 - switch i32 %.val11, label %255 [ + switch i32 %.val11, label %256 [ i32 1, label %._crit_edge.i.i.i50 i32 7, label %._crit_edge.i.i1.i i32 8, label %._crit_edge.i.i3.i @@ -24553,56 +24553,57 @@ thread-pre-split: ; preds = %201 unreachable 245: ; preds = %218, %218 - %246 = getelementptr inbounds nuw i8, ptr %12, i64 16 - store ptr %246, ptr %12, align 8, !tbaa !149, !alias.scope !412 - %247 = getelementptr inbounds nuw i8, ptr %12, i64 8 - switch i32 %.val12, label %254 [ - i32 1, label %._crit_edge.i.i19.i - i32 8, label %._crit_edge.i.i21.i - i32 16, label %._crit_edge.i.i23.i - i32 32, label %._crit_edge.i.i25.i - i32 64, label %._crit_edge.i.i27.i - i32 128, label %._crit_edge.i.i29.i + %246 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %.val12, i1 true) + %247 = getelementptr inbounds nuw i8, ptr %12, i64 16 + store ptr %247, ptr %12, align 8, !tbaa !149, !alias.scope !412 + %248 = getelementptr inbounds nuw i8, ptr %12, i64 8 + switch i32 %246, label %255 [ + i32 0, label %._crit_edge.i.i19.i + i32 3, label %._crit_edge.i.i23.i + i32 4, label %._crit_edge.i.i25.i + i32 5, label %._crit_edge.i.i25.i + i32 6, label %._crit_edge.i.i27.i + i32 7, label %._crit_edge.i.i29.i ] ._crit_edge.i.i19.i: ; preds = %245 - store i8 98, ptr %246, align 8, !tbaa !12, !alias.scope !412 - store i64 1, ptr %247, align 8, !tbaa !41, !alias.scope !412 - %248 = getelementptr inbounds nuw i8, ptr %12, i64 17 - store i8 0, ptr %248, align 1, !tbaa !12, !alias.scope !412 - br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit - -._crit_edge.i.i21.i: ; preds = %245 - store i8 99, ptr %246, align 8, !tbaa !12, !alias.scope !412 - store i64 1, ptr %247, align 8, !tbaa !41, !alias.scope !412 + store i8 98, ptr %247, align 8, !tbaa !12, !alias.scope !412 + store i64 1, ptr %248, align 8, !tbaa !41, !alias.scope !412 %249 = getelementptr inbounds nuw i8, ptr %12, i64 17 store i8 0, ptr %249, align 1, !tbaa !12, !alias.scope !412 br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit ._crit_edge.i.i23.i: ; preds = %245 - store i8 115, ptr %246, align 8, !tbaa !12, !alias.scope !412 - store i64 1, ptr %247, align 8, !tbaa !41, !alias.scope !412 + store i8 99, ptr %247, align 8, !tbaa !12, !alias.scope !412 + store i64 1, ptr %248, align 8, !tbaa !41, !alias.scope !412 %250 = getelementptr inbounds nuw i8, ptr %12, i64 17 store i8 0, ptr %250, align 1, !tbaa !12, !alias.scope !412 br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit ._crit_edge.i.i25.i: ; preds = %245 - store i8 105, ptr %246, align 8, !tbaa !12, !alias.scope !412 - store i64 1, ptr %247, align 8, !tbaa !41, !alias.scope !412 + store i8 115, ptr %247, align 8, !tbaa !12, !alias.scope !412 + store i64 1, ptr %248, align 8, !tbaa !41, !alias.scope !412 %251 = getelementptr inbounds nuw i8, ptr %12, i64 17 store i8 0, ptr %251, align 1, !tbaa !12, !alias.scope !412 br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit +._crit_edge.i.i25.i: ; preds = %245 + store i8 105, ptr %247, align 8, !tbaa !12, !alias.scope !412 + store i64 1, ptr %248, align 8, !tbaa !41, !alias.scope !412 + %252 = getelementptr inbounds nuw i8, ptr %12, i64 17 + store i8 0, ptr %252, align 1, !tbaa !12, !alias.scope !412 + br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit + ._crit_edge.i.i27.i: ; preds = %245 - store i16 26967, ptr %246, align 8, !alias.scope !412 - store i64 2, ptr %247, align 8, !tbaa !41, !alias.scope !412 + store i16 26967, ptr %247, align 8, !alias.scope !412 + store i64 2, ptr %248, align 8, !tbaa !41, !alias.scope !412 %252 = getelementptr inbounds nuw i8, ptr %12, i64 18 store i8 0, ptr %252, align 2, !tbaa !12, !alias.scope !412 br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit ._crit_edge.i.i29.i: ; preds = %245 - store i32 1766607948, ptr %246, align 8, !alias.scope !412 - store i64 4, ptr %247, align 8, !tbaa !41, !alias.scope !412 + store i32 1766607948, ptr %247, align 8, !alias.scope !412 + store i64 4, ptr %248, align 8, !tbaa !41, !alias.scope !412 %253 = getelementptr inbounds nuw i8, ptr %12, i64 20 store i8 0, ptr %253, align 4, !tbaa !12, !alias.scope !412 br label %_ZNK12_GLOBAL__N_17SVEType15builtinBaseTypeB5cxx11Ev.exit @@ -24643,7 +24644,7 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i51 br label %_ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_OS8_.exit _ZStplIcSt11char_traitsIcESaIcEENSt7__cxx1112basic_stringIT_T0_T1_EERKS8_OS8_.exit: ; preds = %263, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i51 - %269 = phi i64 [ %265, %263 ], [ %.pre.i53, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i51 ] + %269 = phi i64 [ %265, %264 ], [ %.pre.i53, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i51 ] %270 = getelementptr inbounds nuw i8, ptr %258, i64 8 %271 = getelementptr inbounds nuw i8, ptr %0, i64 8 store i64 %269, ptr %271, align 8, !tbaa !41, !alias.scope !415 @@ -30008,7 +30009,7 @@ define internal void @_GLOBAL__sub_I_SveEmitter.cpp() #17 section ".text.startup declare void @llvm.assume(i1 noundef) #18 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.fshl.i32(i32, i32, i32) #19 +declare i32 @llvm.cttz.i32(i32, i1 immarg) #19 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #20 diff --git a/bench/llvm/optimized/TextStub.ll b/bench/llvm/optimized/TextStub.ll index b65d3d3dccd..18c31723330 100644 --- a/bench/llvm/optimized/TextStub.ll +++ b/bench/llvm/optimized/TextStub.ll @@ -2372,13 +2372,12 @@ _ZN4llvm4yaml13MappingTraitsIPKNS_5MachO13InterfaceFileEE19setFileTypeForInputEP 44: ; preds = %2 %45 = getelementptr inbounds nuw i8, ptr %4, i64 64 %46 = load i32, ptr %45, align 8, !tbaa !45 - %47 = add i32 %46, -8 - %48 = tail call i32 @llvm.fshl.i32(i32 %47, i32 %47, i32 29) - switch i32 %48, label %49 [ - i32 7, label %50 - i32 3, label %51 - i32 1, label %56 - i32 0, label %61 + %47 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %46, i1 true) + switch i32 %47, label %48 [ + i32 6, label %49 + i32 5, label %50 + i32 4, label %55 + i32 3, label %60 ] 49: ; preds = %44 @@ -2392,14 +2391,14 @@ _ZN4llvm4yaml13MappingTraitsIPKNS_5MachO13InterfaceFileEE19setFileTypeForInputEP %52 = load ptr, ptr %0, align 8, !tbaa !53 %53 = getelementptr inbounds nuw i8, ptr %52, i64 96 %54 = load ptr, ptr %53, align 8 - %55 = tail call noundef zeroext i1 %54(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr nonnull @.str.12, i64 12, i1 noundef zeroext true) #20 + %55 = tail call noundef zeroext i1 %53(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr nonnull @.str.12, i64 12, i1 noundef zeroext true) #20 br label %61 56: ; preds = %44 %57 = load ptr, ptr %0, align 8, !tbaa !53 %58 = getelementptr inbounds nuw i8, ptr %57, i64 96 %59 = load ptr, ptr %58, align 8 - %60 = tail call noundef zeroext i1 %59(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr nonnull @.str.13, i64 12, i1 noundef zeroext true) #20 + %60 = tail call noundef zeroext i1 %58(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr nonnull @.str.13, i64 12, i1 noundef zeroext true) #20 br label %61 61: ; preds = %_ZN4llvm4yaml13MappingTraitsIPKNS_5MachO13InterfaceFileEE19setFileTypeForInputEPNS2_14TextAPIContextERNS0_2IOE.exit.thread, %44, %51, %56 @@ -26457,7 +26456,7 @@ declare void @_ZN4llvm4yaml6Output12endDocumentsEv(ptr noundef nonnull align 8 d declare void @llvm.assume(i1 noundef) #16 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) -declare i32 @llvm.fshl.i32(i32, i32, i32) #17 +declare i32 @llvm.cttz.i32(i32, i1 immarg) #17 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #18 diff --git a/bench/llvm/optimized/WinCOFFObjectWriter.ll b/bench/llvm/optimized/WinCOFFObjectWriter.ll index 031094dd7a9..112ae39d50a 100644 --- a/bench/llvm/optimized/WinCOFFObjectWriter.ll +++ b/bench/llvm/optimized/WinCOFFObjectWriter.ll @@ -475,104 +475,44 @@ _ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit: ; preds = % store i32 %101, ptr %102, align 4, !tbaa !178 %103 = getelementptr inbounds nuw i8, ptr %2, i64 32 %.val53 = load i8, ptr %103, align 8, !tbaa !17 - %104 = zext nneg i8 %.val53 to i64 - %105 = shl nuw i64 1, %104 - switch i64 %105, label %119 [ - i64 1, label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - i64 2, label %106 - i64 4, label %107 - i64 8, label %108 - i64 16, label %109 - i64 32, label %110 - i64 64, label %111 - i64 128, label %112 - i64 256, label %113 - i64 512, label %114 - i64 1024, label %115 - i64 2048, label %116 - i64 4096, label %117 - i64 8192, label %118 - ] - -106: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -107: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -108: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -109: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -110: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit + %104 = zext i8 %.val53 to i32 + %105 = shl nuw nsw i32 %104, 20 + %switch.offset = add nuw nsw i32 %105, 1048576 + %104 = or i32 %switch.offset, %101 + store i32 %104, ptr %102, align 4, !tbaa !178 + %105 = getelementptr inbounds nuw i8, ptr %.val.i, i64 80 + store ptr %2, ptr %105, align 8, !tbaa !179 + %106 = getelementptr inbounds nuw i8, ptr %0, i64 136 + %107 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZN4llvm12DenseMapBaseINS_8DenseMapIPKNS_9MCSectionEPN12_GLOBAL__N_111COFFSectionENS_12DenseMapInfoIS4_vEENS_6detail12DenseMapPairIS4_S7_EEEES4_S7_S9_SC_EixEOS4_(ptr noundef nonnull align 1 dereferenceable(1) %106, ptr nonnull %2) + store ptr %.val.i, ptr %107, align 8, !tbaa !127 + %108 = getelementptr inbounds nuw i8, ptr %0, i64 209 + %109 = load i8, ptr %108, align 1, !tbaa !103, !range !180, !noundef !181 + %110 = trunc nuw i8 %109 to i1 + br i1 %110, label %111, label %.loopexit 111: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -112: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -113: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -114: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -115: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -116: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -117: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -118: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - br label %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - -119: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit - unreachable - -_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit: ; preds = %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit, %106, %107, %108, %109, %110, %111, %112, %113, %114, %115, %116, %117, %118 - %.0.i = phi i32 [ 2097152, %106 ], [ 3145728, %107 ], [ 4194304, %108 ], [ 5242880, %109 ], [ 6291456, %110 ], [ 7340032, %111 ], [ 8388608, %112 ], [ 9437184, %113 ], [ 10485760, %114 ], [ 11534336, %115 ], [ 12582912, %116 ], [ 13631488, %117 ], [ 14680064, %118 ], [ 1048576, %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit ] - %120 = or i32 %.0.i, %101 - store i32 %120, ptr %102, align 4, !tbaa !178 - %121 = getelementptr inbounds nuw i8, ptr %.val.i, i64 80 - store ptr %2, ptr %121, align 8, !tbaa !179 - %122 = getelementptr inbounds nuw i8, ptr %0, i64 136 - %123 = call fastcc noundef nonnull align 8 dereferenceable(8) ptr @_ZN4llvm12DenseMapBaseINS_8DenseMapIPKNS_9MCSectionEPN12_GLOBAL__N_111COFFSectionENS_12DenseMapInfoIS4_vEENS_6detail12DenseMapPairIS4_S7_EEEES4_S7_S9_SC_EixEOS4_(ptr noundef nonnull align 1 dereferenceable(1) %122, ptr nonnull %2) - store ptr %.val.i, ptr %123, align 8, !tbaa !127 - %124 = getelementptr inbounds nuw i8, ptr %0, i64 209 - %125 = load i8, ptr %124, align 1, !tbaa !103, !range !180, !noundef !181 - %126 = trunc nuw i8 %125 to i1 - br i1 %126, label %127, label %.loopexit - -127: ; preds = %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit - %128 = call noundef i64 @_ZNK4llvm11MCAssembler21getSectionAddressSizeERKNS_9MCSectionE(ptr noundef nonnull align 8 dereferenceable(364) %1, ptr noundef nonnull align 8 dereferenceable(148) %2) #24 - %129 = trunc i64 %128 to i32 - %130 = icmp ugt i32 %129, 1048576 - br i1 %130, label %_ZN4llvmplERKNS_5TwineES2_.exit.lr.ph, label %.loopexit - -_ZN4llvmplERKNS_5TwineES2_.exit.lr.ph: ; preds = %127 - %131 = getelementptr inbounds nuw i8, ptr %8, i64 32 - %132 = getelementptr inbounds nuw i8, ptr %8, i64 33 - %133 = getelementptr inbounds nuw i8, ptr %8, i64 16 - %134 = getelementptr inbounds nuw i8, ptr %8, i64 24 - %135 = getelementptr inbounds nuw i8, ptr %7, i64 16 - %136 = getelementptr inbounds nuw i8, ptr %7, i64 32 - %137 = getelementptr inbounds nuw i8, ptr %7, i64 33 - %138 = getelementptr inbounds nuw i8, ptr %6, i64 32 - %139 = getelementptr inbounds nuw i8, ptr %6, i64 33 - %140 = getelementptr inbounds nuw i8, ptr %6, i64 16 - %141 = getelementptr inbounds nuw i8, ptr %5, i64 8 - %142 = getelementptr inbounds nuw i8, ptr %.val.i, i64 120 - %143 = getelementptr inbounds nuw i8, ptr %.val.i, i64 128 - %144 = getelementptr inbounds nuw i8, ptr %.val.i, i64 132 - %145 = getelementptr inbounds nuw i8, ptr %.val.i, i64 136 - %146 = getelementptr inbounds nuw i8, ptr %5, i64 16 + %112 = call noundef i64 @_ZNK4llvm11MCAssembler21getSectionAddressSizeERKNS_9MCSectionE(ptr noundef nonnull align 8 dereferenceable(364) %1, ptr noundef nonnull align 8 dereferenceable(148) %2) #24 + %113 = trunc i64 %112 to i32 + %114 = icmp ugt i32 %113, 1048576 + br i1 %114, label %113, label %.loopexit + +113: ; preds = %111 + %115 = getelementptr inbounds nuw i8, ptr %8, i64 32 + %116 = getelementptr inbounds nuw i8, ptr %8, i64 33 + %117 = getelementptr inbounds nuw i8, ptr %8, i64 16 + %118 = getelementptr inbounds nuw i8, ptr %8, i64 24 + %119 = getelementptr inbounds nuw i8, ptr %7, i64 16 + %120 = getelementptr inbounds nuw i8, ptr %7, i64 32 + %121 = getelementptr inbounds nuw i8, ptr %7, i64 33 + %122 = getelementptr inbounds nuw i8, ptr %6, i64 32 + %123 = getelementptr inbounds nuw i8, ptr %6, i64 33 + %124 = getelementptr inbounds nuw i8, ptr %6, i64 16 + %125 = getelementptr inbounds nuw i8, ptr %5, i64 8 + %126 = getelementptr inbounds nuw i8, ptr %.val.i, i64 120 + %127 = getelementptr inbounds nuw i8, ptr %.val.i, i64 128 + %128 = getelementptr inbounds nuw i8, ptr %.val.i, i64 132 + %129 = getelementptr inbounds nuw i8, ptr %.val.i, i64 136 + %130 = getelementptr inbounds nuw i8, ptr %5, i64 16 br label %_ZN4llvmplERKNS_5TwineES2_.exit78 _ZN4llvmplERKNS_5TwineES2_.exit78: ; preds = %_ZN4llvmplERKNS_5TwineES2_.exit.lr.ph, %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit @@ -585,30 +525,30 @@ _ZN4llvmplERKNS_5TwineES2_.exit78: ; preds = %_ZN4llvmplERKNS_5Tw call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #24 %.sroa.0.0.copyload.i59 = load ptr, ptr %9, align 8, !tbaa !104 %.sroa.2.0.copyload.i61 = load i64, ptr %.sroa.2.0..sroa_idx.i, align 8, !tbaa !105 - store i8 3, ptr %131, align 8, !tbaa !182, !alias.scope !185 - store i8 5, ptr %132, align 1, !tbaa !188, !alias.scope !185 + store i8 3, ptr %115, align 8, !tbaa !182, !alias.scope !185 + store i8 5, ptr %116, align 1, !tbaa !188, !alias.scope !185 store ptr @.str.1, ptr %8, align 8, !tbaa !17, !alias.scope !185 - store ptr %.sroa.0.0.copyload.i59, ptr %133, align 8, !tbaa !17, !alias.scope !185 - store i64 %.sroa.2.0.copyload.i61, ptr %134, align 8, !tbaa !17, !alias.scope !185 + store ptr %.sroa.0.0.copyload.i59, ptr %117, align 8, !tbaa !17, !alias.scope !185 + store i64 %.sroa.2.0.copyload.i61, ptr %118, align 8, !tbaa !17, !alias.scope !185 store ptr %8, ptr %7, align 8, !alias.scope !189 - store ptr @.str.2, ptr %135, align 8, !alias.scope !189 - store i8 2, ptr %136, align 8, !tbaa !182, !alias.scope !189 - store i8 3, ptr %137, align 1, !tbaa !188, !alias.scope !189 + store ptr @.str.2, ptr %119, align 8, !alias.scope !189 + store i8 2, ptr %120, align 8, !tbaa !182, !alias.scope !189 + store i8 3, ptr %121, align 1, !tbaa !188, !alias.scope !189 %147 = add i32 %.083, 1 %.sroa.0.0.insert.ext = zext i32 %.083 to i64 %.sroa.0.0.insert.mask = and i64 %.sroa.0.0, -4294967296 %.sroa.0.0.insert.insert = or disjoint i64 %.sroa.0.0.insert.mask, %.sroa.0.0.insert.ext %148 = inttoptr i64 %.sroa.0.0.insert.insert to ptr store ptr %7, ptr %6, align 8, !alias.scope !194 - store ptr %148, ptr %140, align 8, !alias.scope !194 - store i8 2, ptr %138, align 8, !tbaa !182, !alias.scope !194 - store i8 9, ptr %139, align 1, !tbaa !188, !alias.scope !194 + store ptr %148, ptr %124, align 8, !alias.scope !194 + store i8 2, ptr %122, align 8, !tbaa !182, !alias.scope !194 + store i8 9, ptr %123, align 1, !tbaa !188, !alias.scope !194 call void @_ZNK4llvm5Twine3strB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(34) %6) #24 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #24 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #24 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #24 %149 = load ptr, ptr %5, align 8, !tbaa !109 - %150 = load i64, ptr %141, align 8, !tbaa !14 + %150 = load i64, ptr %125, align 8, !tbaa !14 %151 = call fastcc noundef ptr @_ZN4llvm13WinCOFFWriter12createSymbolENS_9StringRefE(ptr noundef nonnull align 8 dereferenceable(216) %0, ptr %149, i64 %150) %152 = getelementptr inbounds nuw i8, ptr %151, i64 112 store ptr %.val.i, ptr %152, align 8, !tbaa !156 @@ -616,40 +556,40 @@ _ZN4llvmplERKNS_5TwineES2_.exit78: ; preds = %_ZN4llvmplERKNS_5Tw store i8 6, ptr %153, align 2, !tbaa !171 %154 = getelementptr inbounds nuw i8, ptr %151, i64 8 store i32 %.04582, ptr %154, align 8, !tbaa !199 - %155 = load i32, ptr %143, align 8, !tbaa !9 - %156 = load i32, ptr %144, align 4, !tbaa !10 + %155 = load i32, ptr %127, align 8, !tbaa !9 + %156 = load i32, ptr %128, align 4, !tbaa !10 %.not.not.i.i.i = icmp ult i32 %155, %156 br i1 %.not.not.i.i.i, label %_ZN4llvm23SmallVectorTemplateBaseIPN12_GLOBAL__N_110COFFSymbolELb1EE9push_backES3_.exit, label %157, !prof !200 157: ; preds = %_ZN4llvmplERKNS_5TwineES2_.exit78 %158 = zext i32 %155 to i64 %159 = add nuw nsw i64 %158, 1 - call void @_ZN4llvm15SmallVectorBaseIjE8grow_podEPvmm(ptr noundef nonnull align 8 dereferenceable(16) %142, ptr noundef nonnull %145, i64 noundef %159, i64 noundef 8) #24 - %.val2.pre.i = load i32, ptr %143, align 8, !tbaa !9 + call void @_ZN4llvm15SmallVectorBaseIjE8grow_podEPvmm(ptr noundef nonnull align 8 dereferenceable(16) %126, ptr noundef nonnull %129, i64 noundef %159, i64 noundef 8) #24 + %.val2.pre.i = load i32, ptr %127, align 8, !tbaa !9 br label %_ZN4llvm23SmallVectorTemplateBaseIPN12_GLOBAL__N_110COFFSymbolELb1EE9push_backES3_.exit _ZN4llvm23SmallVectorTemplateBaseIPN12_GLOBAL__N_110COFFSymbolELb1EE9push_backES3_.exit: ; preds = %_ZN4llvmplERKNS_5TwineES2_.exit78, %157 - %.val2.i = phi i32 [ %155, %_ZN4llvmplERKNS_5TwineES2_.exit78 ], [ %.val2.pre.i, %157 ] - %.val.i79 = load ptr, ptr %142, align 8, !tbaa !3 + %.val2.i = phi i32 [ %155, %_ZN4llvmplERKNS_5TwineES2_.exit78 ], [ %.val2.pre.i, %141 ] + %.val.i79 = load ptr, ptr %126, align 8, !tbaa !3 %160 = zext i32 %.val2.i to i64 %161 = getelementptr inbounds nuw ptr, ptr %.val.i79, i64 %160 %162 = ptrtoint ptr %151 to i64 store i64 %162, ptr %161, align 1 - %163 = load i32, ptr %143, align 8, !tbaa !9 + %163 = load i32, ptr %127, align 8, !tbaa !9 %164 = add i32 %163, 1 - store i32 %164, ptr %143, align 8, !tbaa !9 + store i32 %164, ptr %127, align 8, !tbaa !9 %165 = load ptr, ptr %5, align 8, !tbaa !109 - %166 = icmp eq ptr %165, %146 + %166 = icmp eq ptr %165, %130 br i1 %166, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i, label %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i: ; preds = %_ZN4llvm23SmallVectorTemplateBaseIPN12_GLOBAL__N_110COFFSymbolELb1EE9push_backES3_.exit - %167 = load i64, ptr %141, align 8, !tbaa !14 + %167 = load i64, ptr %125, align 8, !tbaa !14 %168 = icmp ult i64 %167, 16 call void @llvm.assume(i1 %168) br label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i: ; preds = %_ZN4llvm23SmallVectorTemplateBaseIPN12_GLOBAL__N_110COFFSymbolELb1EE9push_backES3_.exit - %169 = load i64, ptr %146, align 8, !tbaa !17 + %169 = load i64, ptr %130, align 8, !tbaa !17 %170 = add i64 %169, 1 call void @_ZdlPvm(ptr noundef %165, i64 noundef %170) #26 br label %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit @@ -657,10 +597,10 @@ _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i: _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit: ; preds = %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.thread.i.i, %_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE11_M_is_localEv.exit.i.i call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #24 %171 = add i32 %.04582, 1048576 - %172 = icmp ult i32 %171, %129 + %172 = icmp ult i32 %171, %113 br i1 %172, label %_ZN4llvmplERKNS_5TwineES2_.exit78, label %.loopexit, !llvm.loop !201 -.loopexit: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit, %127, %_ZL12getAlignmentRKN4llvm13MCSectionCOFFE.exit +.loopexit: ; preds = %_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev.exit, %111, %_ZN4llvm15SmallVectorImplIN12_GLOBAL__N_19AuxSymbolEE6resizeEm.exit ret void } diff --git a/bench/llvm/optimized/X86MCCodeEmitter.ll b/bench/llvm/optimized/X86MCCodeEmitter.ll index 7b5a6f60105..58121cc23cc 100644 --- a/bench/llvm/optimized/X86MCCodeEmitter.ll +++ b/bench/llvm/optimized/X86MCCodeEmitter.ll @@ -4748,11 +4748,12 @@ _ZN4llvm5X86II10isImmPCRelEm.exit.i: ; preds = %_ZN4llvm5X86II12get br i1 %switch.i.i, label %_ZL15getImmFixupKindm.exit, label %664 664: ; preds = %_ZN4llvm5X86II10isImmPCRelEm.exit.i - switch i32 %.0.i10.i, label %665 [ - i32 1, label %666 - i32 2, label %668 - i32 4, label %670 - i32 8, label %672 + %665 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %.0.i10.i, i1 true) + switch i32 %665, label %default.unreachable [ + i32 0, label %666 + i32 1, label %668 + i32 2, label %670 + i32 3, label %672 ] 665: ; preds = %664 @@ -4902,47 +4903,61 @@ define internal fastcc noundef zeroext i1 @_ZL15isPCRel32BranchRKN4llvm6MCInstER i64 0, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i i64 1, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i i64 2, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i - i64 3, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i - i64 4, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i - i64 5, label %11 - i64 7, label %11 - i64 6, label %11 - i64 8, label %_ZL15getImmFixupKindm.exit.thread + i64 3, label %11 + i64 4, label %11 + i64 5, label %12 + i64 7, label %12 + i64 6, label %12 + i64 8, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i ] 10: ; preds = %4 unreachable -11: ; preds = %4, %4, %4 +11: ; preds = %4, %4 + br label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i + +12: ; preds = %4, %4, %4 br label %_ZN4llvm5X86II12getSizeOfImmEm.exit.i -_ZN4llvm5X86II12getSizeOfImmEm.exit.i: ; preds = %4, %4, %11, %4, %4, %4 - %switch = phi i1 [ false, %11 ], [ true, %4 ], [ true, %4 ], [ true, %4 ], [ true, %4 ], [ true, %4 ] - switch i64 %9, label %12 [ +_ZN4llvm5X86II12getSizeOfImmEm.exit.i: ; preds = %12, %11, %4, %4, %4 + %switch = phi i32 [ 2, %11 ], [ 4, %12 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ] + switch i64 %9, label %13 [ i64 1, label %_ZN4llvm5X86II10isImmPCRelEm.exit.i i64 4, label %_ZN4llvm5X86II10isImmPCRelEm.exit.i i64 6, label %_ZN4llvm5X86II10isImmPCRelEm.exit.i - i64 0, label %_ZL15getImmFixupKindm.exit.thread - i64 2, label %_ZL15getImmFixupKindm.exit.thread - i64 3, label %_ZL15getImmFixupKindm.exit.thread - i64 5, label %_ZL15getImmFixupKindm.exit.thread - i64 7, label %_ZL15getImmFixupKindm.exit.thread + i64 0, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i + i64 2, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i + i64 3, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i + i64 5, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i + i64 7, label %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i ] 12: ; preds = %_ZN4llvm5X86II12getSizeOfImmEm.exit.i unreachable -_ZN4llvm5X86II10isImmPCRelEm.exit.i: ; preds = %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i +_ZN4llvm5X86II10isImmPCRelEm.exit.i: ; preds = %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %4 + %.0.i9.i = phi i32 [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ 8, %4 ] + br label %_ZN4llvm5X86II10isImmPCRelEm.exit.i + +_ZN4llvm5X86II10isImmPCRelEm.exit.i: ; preds = %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i + %.0.i10.i = phi i32 [ %.0.i9.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ %.0.i.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ] + %.0.i6.i.not = phi i1 [ true, %_ZN4llvm5X86II12getSizeOfImmEm.exit.thread.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ] %switch.i.i = icmp eq i64 %7, 2097152 - %or.cond.not5 = or i1 %switch.i.i, %switch - br i1 %or.cond.not5, label %_ZL15getImmFixupKindm.exit.thread, label %_ZL15getImmFixupKindm.exit - -_ZL15getImmFixupKindm.exit: ; preds = %_ZN4llvm5X86II10isImmPCRelEm.exit.i - %13 = getelementptr inbounds nuw i8, ptr %3, i64 4 - %14 = load i8, ptr %13, align 4, !tbaa !30 - %15 = getelementptr inbounds nuw i8, ptr %3, i64 2 - %16 = load i16, ptr %15, align 2, !tbaa !31 - switch i8 %14, label %17 [ + br i1 %switch.i.i, label %_ZL15getImmFixupKindm.exit.thread, label %14 + +14: ; preds = %_ZN4llvm5X86II10isImmPCRelEm.exit.i + %15 = and i32 %.0.i10.i, 7 + %switch = icmp ne i32 %15, 4 + %brmerge = or i1 %.0.i6.i.not, %switch + br i1 %brmerge, label %_ZL15getImmFixupKindm.exit.thread, label %_ZL15getImmFixupKindm.exit + +_ZL15getImmFixupKindm.exit:; preds = %14 + %16 = getelementptr inbounds nuw i8, ptr %3, i64 4 + %17 = load i8, ptr %16, align 4, !tbaa !30 + %18 = getelementptr inbounds nuw i8, ptr %3, i64 2 + %19 = load i16, ptr %18, align 2, !tbaa !31 + switch i8 %17, label %20 [ i8 0, label %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit i8 1, label %18 i8 2, label %37 @@ -4952,7 +4967,7 @@ _ZL15getImmFixupKindm.exit: ; preds = %_ZN4llvm5X86II10isI unreachable 18: ; preds = %_ZL15getImmFixupKindm.exit - %19 = icmp ugt i16 %16, 1 + %19 = icmp ugt i16 %19, 1 br i1 %19, label %20, label %.thread.i 20: ; preds = %18 @@ -4971,7 +4986,7 @@ _ZL15getImmFixupKindm.exit: ; preds = %_ZN4llvm5X86II10isI br i1 %or.cond.i, label %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit, label %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit.thread.i _ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit.thread.i: ; preds = %20 - %32 = icmp eq i16 %16, 8 + %32 = icmp eq i16 %19, 8 br i1 %32, label %33, label %.thread.i 33: ; preds = %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit.thread.i @@ -4985,7 +5000,7 @@ _ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit. br label %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit 37: ; preds = %_ZL15getImmFixupKindm.exit - %38 = icmp ugt i16 %16, 3 + %38 = icmp ugt i16 %19, 3 br i1 %38, label %39, label %.thread36.i 39: ; preds = %37 @@ -5011,7 +5026,7 @@ _ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit. br i1 %or.cond46.i, label %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit, label %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit19.thread.i _ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit19.thread.i: ; preds = %51 - %55 = icmp eq i16 %16, 9 + %55 = icmp eq i16 %19, 9 br i1 %55, label %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit28.thread.i, label %.thread36.i _ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit28.thread.i: ; preds = %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit19.thread.i @@ -5025,7 +5040,7 @@ _ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit2 br label %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit _ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit: ; preds = %_ZL15getImmFixupKindm.exit, %20, %33, %.thread.i, %51, %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit28.thread.i, %.thread36.i - %.0.i19 = phi i64 [ 0, %.thread.i ], [ 0, %.thread36.i ], [ 0, %_ZL15getImmFixupKindm.exit ], [ 1, %20 ], [ 1, %33 ], [ 2, %51 ], [ 2, %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit28.thread.i ] + %.0.i19 = phi i64 [ 0, %.thread.i ], [ 0, %.thread36.i ], [ 0, %_ZL15getImmFixupKindm.exit ], [ 1, %23 ], [ 1, %36 ], [ 2, %54 ], [ 2, %_ZNK4llvm11MCInstrDesc20getOperandConstraintEjNS_4MCOI17OperandConstraintE.exit28.thread.i ] %59 = getelementptr inbounds nuw %"class.llvm::MCOperand", ptr %.16.val, i64 %.0.i19 %60 = load i8, ptr %59, align 8, !tbaa !224 %61 = icmp eq i8 %60, 5 @@ -5045,8 +5060,8 @@ _ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit: ; preds = %_ZL15getImmF %70 = icmp eq i32 %69, 0 br label %_ZL15getImmFixupKindm.exit.thread -_ZL15getImmFixupKindm.exit.thread: ; preds = %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i, %4, %_ZN4llvm5X86II10isImmPCRelEm.exit.i, %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit, %66, %62, %0 - %.0 = phi i1 [ false, %0 ], [ false, %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit ], [ false, %62 ], [ %70, %66 ], [ false, %_ZN4llvm5X86II10isImmPCRelEm.exit.i ], [ false, %4 ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ], [ false, %_ZN4llvm5X86II12getSizeOfImmEm.exit.i ] +_ZL15getImmFixupKindm.exit.thread: ; preds = %14, %_ZN4llvm5X86II10isImmPCRelEm.exit.i, %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit, %66, %62, %0 + %.0 = phi i1 [ false, %0 ], [ false, %_ZN4llvm5X86II14getOperandBiasERKNS_11MCInstrDescE.exit ], [ false, %65 ], [ %70, %69 ], [ false, %_ZN4llvm5X86II10isImmPCRelEm.exit.i ], [ false, %14 ] ret i1 %.0 } @@ -5470,11 +5485,12 @@ _ZN4llvm5X86II10isImmPCRelEm.exit: ; preds = %_ZN4llvm5X86II12get br i1 %switch.i, label %_ZN4llvm7MCFixup14getKindForSizeEjb.exit, label %9 9: ; preds = %_ZN4llvm5X86II10isImmPCRelEm.exit - switch i32 %.0.i10, label %10 [ - i32 1, label %11 - i32 2, label %13 - i32 4, label %15 - i32 8, label %17 + %10 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %.0.i10, i1 true) + switch i32 %10, label %default.unreachable [ + i32 0, label %11 + i32 1, label %13 + i32 2, label %15 + i32 3, label %17 ] 10: ; preds = %9 @@ -6246,6 +6262,9 @@ define internal fastcc noundef zeroext i1 @_ZL14isDispOrCDisp8miRi(i64 noundef % ret i1 %.0 } +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #13 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i4 @llvm.bitreverse.i4(i4) #13 diff --git a/bench/llvm/optimized/X86RegisterBankInfo.ll b/bench/llvm/optimized/X86RegisterBankInfo.ll index e1024a8ba2b..1568b492b03 100644 --- a/bench/llvm/optimized/X86RegisterBankInfo.ll +++ b/bench/llvm/optimized/X86RegisterBankInfo.ll @@ -114,6 +114,7 @@ $_ZN4llvm19X86RegisterBankInfoD0Ev = comdat any @_ZN4llvm3X86L23VECRRegBankCoverageDataE = internal constant [5 x i32] [i32 25165824, i32 132, i32 16896, i32 -2147483648, i32 31], align 16 @_ZN4llvm16RegisterBankInfo16InvalidMappingIDE = external local_unnamed_addr constant i32, align 4 @_ZTVN4llvm16RegisterBankInfoE = external unnamed_addr constant { [11 x ptr] }, align 8 +@switch.table._ZN4llvm22X86GenRegisterBankInfo20getPartialMappingIdxERKNS_12MachineInstrERKNS_3LLTEb = private unnamed_addr constant [8 x i32] [i32 0, i32 poison, i32 poison, i32 0, i32 1, i32 2, i32 3, i32 6], align 4 @_ZN4llvm22X86GenRegisterBankInfoC1Ej = unnamed_addr alias void (ptr, i32), ptr @_ZN4llvm22X86GenRegisterBankInfoC2Ej @_ZN4llvm19X86RegisterBankInfoC1ERKNS_18TargetRegisterInfoE = unnamed_addr alias void (ptr, ptr), ptr @_ZN4llvm19X86RegisterBankInfoC2ERKNS_18TargetRegisterInfoE @@ -599,29 +600,10 @@ _ZNK4llvm3LLT13getSizeInBitsEv.exit43: ; preds = %_ZNK4llvm3LLT13getS store i8 0, ptr %.sroa.29.0..sroa_idx, align 8 %41 = call noundef i64 @_ZNK4llvm8TypeSizecvmEv(ptr noundef nonnull align 8 dereferenceable(9) %5) #13 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #13 - switch i64 %41, label %46 [ - i64 1, label %67 - i64 8, label %67 - i64 16, label %42 - i64 32, label %43 - i64 64, label %44 - i64 128, label %45 - ] - -42: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 - br label %67 - -43: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 - br label %67 - -44: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 - br label %67 - -45: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 - br label %67 - -46: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 - unreachable + %42 = call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %41, i1 true) + %switch.gep = getelementptr inbounds nuw [8 x i32], ptr @switch.table._ZN4llvm22X86GenRegisterBankInfo20getPartialMappingIdxERKNS_12MachineInstrERKNS_3LLTEb, i64 0, i64 %42 + %switch.load = load i32, ptr %switch.gep, align 4 + br label %63 _ZNK4llvm3LLT9isPointerEv.exit.thread: ; preds = %36 br i1 %.not80, label %_ZNK4llvm3LLT13getSizeInBitsEv.exit73, label %_ZNK4llvm3LLT13getSizeInBitsEv.exit58 @@ -638,7 +620,7 @@ _ZNK4llvm3LLT13getSizeInBitsEv.exit58: ; preds = %_ZNK4llvm3LLT9isPoi call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #13 %48 = add i64 %47, -32 %49 = call i64 @llvm.fshl.i64(i64 %48, i64 %48, i64 60) - switch i64 %49, label %55 [ + switch i64 %49, label %51 [ i64 0, label %50 i64 2, label %52 i64 6, label %67 @@ -677,7 +659,7 @@ _ZNK4llvm3LLT13getSizeInBitsEv.exit73: ; preds = %_ZNK4llvm3LLT9isPoi store i8 %58, ptr %.sroa.2.0..sroa_idx, align 8 %63 = call noundef i64 @_ZNK4llvm8TypeSizecvmEv(ptr noundef nonnull align 8 dereferenceable(9) %7) #13 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #13 - switch i64 %63, label %66 [ + switch i64 %63, label %62 [ i64 128, label %67 i64 256, label %64 i64 512, label %65 @@ -692,8 +674,8 @@ _ZNK4llvm3LLT13getSizeInBitsEv.exit73: ; preds = %_ZNK4llvm3LLT9isPoi 66: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit73 unreachable -67: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit73, %_ZNK4llvm3LLT13getSizeInBitsEv.exit58, %_ZNK4llvm3LLT13getSizeInBitsEv.exit43, %_ZNK4llvm3LLT13getSizeInBitsEv.exit43, %65, %64, %54, %52, %50, %45, %44, %43, %42 - %.0 = phi i32 [ 1, %42 ], [ 2, %43 ], [ 3, %44 ], [ 6, %45 ], [ %51, %50 ], [ %53, %52 ], [ 11, %54 ], [ 7, %64 ], [ 8, %65 ], [ 0, %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 ], [ 0, %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 ], [ 6, %_ZNK4llvm3LLT13getSizeInBitsEv.exit58 ], [ 6, %_ZNK4llvm3LLT13getSizeInBitsEv.exit73 ] +67: ; preds = %_ZNK4llvm3LLT13getSizeInBitsEv.exit43, %_ZNK4llvm3LLT13getSizeInBitsEv.exit73, %_ZNK4llvm3LLT13getSizeInBitsEv.exit58, %65, %64, %54, %52, %50 + %.0 = phi i32 [ %47, %46 ], [ %49, %48 ], [ 11, %50 ], [ 7, %60 ], [ 8, %61 ], [ 6, %_ZNK4llvm3LLT13getSizeInBitsEv.exit58 ], [ 6, %_ZNK4llvm3LLT13getSizeInBitsEv.exit73 ], [ %switch.load, %_ZNK4llvm3LLT13getSizeInBitsEv.exit43 ] ret i32 %.0 } @@ -2524,6 +2506,9 @@ declare void @free(ptr allocptr noundef captures(none)) local_unnamed_addr #9 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #10 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i64 @llvm.cttz.i64(i64, i1 immarg) #11 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.fshl.i64(i64, i64, i64) #11 diff --git a/bench/php/optimized/zend_execute.ll b/bench/php/optimized/zend_execute.ll index bf519fd4d0d..a39af6a6658 100644 --- a/bench/php/optimized/zend_execute.ll +++ b/bench/php/optimized/zend_execute.ll @@ -168763,18 +168763,19 @@ zval_try_get_tmp_string.exit: ; preds = %2 9: ; preds = %zval_try_get_tmp_string.exit.thread, %zval_try_get_tmp_string.exit %.0.i48 = phi ptr [ %7, %zval_try_get_tmp_string.exit.thread ], [ %8, %zval_try_get_tmp_string.exit ] %storemerge.i47 = phi ptr [ null, %zval_try_get_tmp_string.exit.thread ], [ %8, %zval_try_get_tmp_string.exit ] - switch i32 %1, label %92 [ - i32 4, label %10 - i32 16, label %10 - i32 2, label %78 - i32 8, label %78 - i32 1, label %88 + %10 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %1, i1 true) + switch i32 %10, label %93 [ + i32 2, label %10 + i32 4, label %11 + i32 1, label %78 + i32 3, label %78 + i32 0, label %89 ] 10: ; preds = %9, %9 call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #31 %11 = load ptr, ptr @zend_resolve_path, align 8, !tbaa !102 - %12 = tail call ptr %11(ptr noundef nonnull %.0.i48) #31 + %12 = tail call ptr %12(ptr noundef nonnull %.0.i48) #31 %.not32 = icmp eq ptr %12, null br i1 %.not32, label %25, label %13, !prof !60 @@ -168836,7 +168837,7 @@ zval_try_get_tmp_string.exit: ; preds = %2 br label %zend_string_copy.exit42 zend_string_copy.exit42: ; preds = %39, %35, %13 - %.028 = phi ptr [ %12, %13 ], [ %.0.i48, %35 ], [ %.0.i48, %39 ] + %.028 = phi ptr [ %12, %14 ], [ %.0.i48, %36 ], [ %.0.i48, %40 ] call void @zend_stream_init_filename_ex(ptr noundef nonnull %3, ptr noundef nonnull %.028) #31 %42 = call i32 @zend_stream_open(ptr noundef nonnull %3) #31 %43 = icmp eq i32 %42, 0 @@ -168866,7 +168867,7 @@ zend_string_copy.exit: ; preds = %47, %51 br label %54 54: ; preds = %zend_string_copy.exit, %44 - %55 = phi ptr [ %.028, %zend_string_copy.exit ], [ %46, %44 ] + %55 = phi ptr [ %.028, %zend_string_copy.exit ], [ %46, %45 ] %56 = call ptr @zend_hash_add_empty_element(ptr noundef nonnull getelementptr inbounds nuw (i8, ptr @executor_globals, i64 360), ptr noundef nonnull %55) #31 %.not37 = icmp eq ptr %56, null br i1 %.not37, label %68, label %57 @@ -168875,7 +168876,7 @@ zend_string_copy.exit: ; preds = %47, %51 %58 = load ptr, ptr @zend_compile_file, align 8, !tbaa !102 %59 = icmp eq i32 %1, 4 %60 = select i1 %59, i32 2, i32 8 - %61 = call ptr %58(ptr noundef nonnull %3, i32 noundef %60) #31 + %61 = call ptr %59(ptr noundef nonnull %3, i32 noundef %60) #31 br label %68 62: ; preds = %zend_string_copy.exit42 @@ -168891,7 +168892,7 @@ zend_string_copy.exit: ; preds = %47, %51 br label %68 68: ; preds = %54, %62, %64, %57 - %.1 = phi ptr [ %61, %57 ], [ null, %62 ], [ null, %64 ], [ inttoptr (i64 -1 to ptr), %54 ] + %.1 = phi ptr [ %61, %58 ], [ null, %63 ], [ null, %65 ], [ inttoptr (i64 -1 to ptr), %55 ] call void @zend_destroy_file_handle(ptr noundef nonnull %3) #31 %69 = getelementptr inbounds nuw i8, ptr %.028, i64 4 %70 = load i32, ptr %69, align 4, !tbaa !55 @@ -168913,7 +168914,7 @@ zend_string_copy.exit: ; preds = %47, %51 br label %zend_string_release_ex.exit39 zend_string_release_ex.exit39: ; preds = %77, %72, %68, %24, %19, %15, %25, %32 - %.029 = phi ptr [ null, %32 ], [ null, %25 ], [ inttoptr (i64 -1 to ptr), %15 ], [ inttoptr (i64 -1 to ptr), %19 ], [ inttoptr (i64 -1 to ptr), %24 ], [ %.1, %68 ], [ %.1, %72 ], [ %.1, %77 ] + %.029 = phi ptr [ null, %33 ], [ null, %26 ], [ inttoptr (i64 -1 to ptr), %16 ], [ inttoptr (i64 -1 to ptr), %20 ], [ inttoptr (i64 -1 to ptr), %25 ], [ %.1, %69 ], [ %.1, %73 ], [ %.1, %78 ] call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #31 br label %93 @@ -168938,7 +168939,7 @@ zend_string_release_ex.exit39: ; preds = %77, %72, %68, %24, 88: ; preds = %9 %89 = tail call ptr @zend_make_compiled_string_description(ptr noundef nonnull @.str.96) #31 %90 = load ptr, ptr @zend_compile_string, align 8, !tbaa !102 - %91 = tail call ptr %90(ptr noundef nonnull %.0.i48, ptr noundef %89, i32 noundef 2) #31 + %91 = tail call ptr %91(ptr noundef nonnull %.0.i48, ptr noundef %89, i32 noundef 2) #31 tail call void @_efree(ptr noundef %89) #31 br label %93 @@ -168946,7 +168947,7 @@ zend_string_release_ex.exit39: ; preds = %77, %72, %68, %24, unreachable 93: ; preds = %zend_string_release_ex.exit39, %88, %86, %83 - %.2 = phi ptr [ %.029, %zend_string_release_ex.exit39 ], [ null, %83 ], [ %87, %86 ], [ %91, %88 ] + %.2 = phi ptr [ %.029, %zend_string_release_ex.exit39 ], [ null, %84 ], [ %87, %87 ], [ %91, %89 ] %.not.i43 = icmp eq ptr %storemerge.i47, null br i1 %.not.i43, label %zend_tmp_string_release.exit, label %94, !prof !49 @@ -168971,7 +168972,7 @@ zend_string_release_ex.exit39: ; preds = %77, %72, %68, %24, br label %zend_tmp_string_release.exit zend_tmp_string_release.exit: ; preds = %93, %103, %98, %94, %zval_try_get_tmp_string.exit - %.0 = phi ptr [ null, %zval_try_get_tmp_string.exit ], [ %.2, %94 ], [ %.2, %98 ], [ %.2, %103 ], [ %.2, %93 ] + %.0 = phi ptr [ null, %zval_try_get_tmp_string.exit ], [ %.2, %95 ], [ %.2, %99 ], [ %.2, %104 ], [ %.2, %94 ] ret ptr %.0 } @@ -176753,6 +176754,9 @@ declare void @zend_hash_real_init(ptr noundef, i1 noundef zeroext) local_unnamed declare ptr @zend_hash_index_add(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #28 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.ctpop.i64(i64) #28 diff --git a/bench/regex-rs/optimized/154fzydpihuymjog.ll b/bench/regex-rs/optimized/154fzydpihuymjog.ll index dd9871cd018..2cdde232cfc 100644 --- a/bench/regex-rs/optimized/154fzydpihuymjog.ll +++ b/bench/regex-rs/optimized/154fzydpihuymjog.ll @@ -85,6 +85,7 @@ target triple = "x86_64-unknown-linux-gnu" @anon.c99d10738715c65bad44182c6f678d15.53.llvm.14842887858627331974 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @"switch.table._ZN67_$LT$regex_syntax..hir..ErrorKind$u20$as$u20$core..fmt..Display$GT$3fmt17h71c9be994aad9b21E" = private unnamed_addr constant [7 x i64] [i64 24, i64 31, i64 38, i64 26, i64 32, i64 82, i64 106], align 8 @"switch.table._ZN67_$LT$regex_syntax..hir..ErrorKind$u20$as$u20$core..fmt..Display$GT$3fmt17h71c9be994aad9b21E.29" = private unnamed_addr constant [7 x ptr] [ptr @anon.e7a22afab2d73454c3fec61b403322c0.31.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.32.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.33.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.34.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.35.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.36.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.37.llvm.5188572562200175411], align 8 +@"switch.table._ZN63_$LT$regex_syntax..hir..LookSet$u20$as$u20$core..fmt..Debug$GT$3fmt17h43980ddaf38838a3E" = private unnamed_addr constant [18 x i32] [i32 65, i32 122, i32 94, i32 36, i32 114, i32 82, i32 98, i32 66, i32 120515, i32 120489, i32 60, i32 62, i32 12296, i32 12297, i32 9665, i32 9655, i32 9664, i32 9654], align 4 ; Function Attrs: inlinehint nonlazybind uwtable define hidden void @"_ZN45_$LT$T$u20$as$u20$alloc..string..ToString$GT$9to_string17hd6833b5698f2fd36E.llvm.5188572562200175411"(ptr noalias noundef writeonly sret({ { { i64, ptr }, i64 } }) align 8 captures(none) dereferenceable(24) %0, ptr noalias noundef readonly align 8 captures(none) dereferenceable(16) %1) unnamed_addr #0 personality ptr @rust_eh_personality { @@ -7954,12 +7955,12 @@ define noundef zeroext i1 @"_ZN63_$LT$regex_syntax..hir..LookSet$u20$as$u20$core call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) br label %.loopexit -.loopexit: ; preds = %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit, %.split13.i, %42, %14 - %.0 = phi i1 [ %19, %14 ], [ false, %42 ], [ false, %.split13.i ], [ true, %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit ] +.loopexit: ; preds = %21, %.split13.i, %42, %14 + %.0 = phi i1 [ %19, %14 ], [ false, %24 ], [ false, %.split13.i ], [ true, %switch.lookup ] ret i1 %.0 .split13.i: ; preds = %.preheader, %42 - %.01417 = phi i32 [ %7, %.preheader ], [ %22, %42 ] + %.01417 = phi i32 [ %7, %.preheader ], [ %25, %24 ] %neg.i = sub i32 0, %.01417 %20 = and i32 %.01417, %neg.i switch i32 %20, label %.loopexit [ @@ -7984,88 +7985,14 @@ define noundef zeroext i1 @"_ZN63_$LT$regex_syntax..hir..LookSet$u20$as$u20$core ] 21: ; preds = %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i - %22 = xor i32 %20, %.01417 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) - switch i32 %20, label %23 [ - i32 1, label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - i32 2, label %24 - i32 4, label %25 - i32 8, label %26 - i32 16, label %27 - i32 32, label %28 - i32 64, label %29 - i32 128, label %30 - i32 256, label %31 - i32 512, label %32 - i32 1024, label %33 - i32 2048, label %34 - i32 4096, label %35 - i32 8192, label %36 - i32 16384, label %37 - i32 32768, label %38 - i32 65536, label %39 - i32 131072, label %40 - ] - -23: ; preds = %21 - unreachable - -24: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -25: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -26: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -27: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -28: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -29: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -30: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -31: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -32: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -33: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -34: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -35: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -36: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -37: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -38: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -39: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -40: ; preds = %21 - br label %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - -_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit: ; preds = %21, %24, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %40 - %.0.i13 = phi i32 [ 122, %24 ], [ 94, %25 ], [ 36, %26 ], [ 114, %27 ], [ 82, %28 ], [ 98, %29 ], [ 66, %30 ], [ 120515, %31 ], [ 120489, %32 ], [ 60, %33 ], [ 62, %34 ], [ 12296, %35 ], [ 12297, %36 ], [ 9665, %37 ], [ 9655, %38 ], [ 9664, %39 ], [ 9654, %40 ], [ 65, %21 ] - store i32 %.0.i13, ptr %3, align 4 + %21 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 range(i32 1, 0) %.01417, i1 true) + %22 = zext nneg i32 %21 to i64 + %switch.gep = getelementptr inbounds nuw [18 x i32], ptr @"switch.table._ZN63_$LT$regex_syntax..hir..LookSet$u20$as$u20$core..fmt..Debug$GT$3fmt17h43980ddaf38838a3E", i64 0, i64 %22 + %switch.load = load i32, ptr %switch.gep, align 4 + store i32 %switch.load, ptr %3, align 4 store ptr %3, ptr %4, align 8 store ptr @"_ZN43_$LT$char$u20$as$u20$core..fmt..Display$GT$3fmt17he4f8681ce2737fc3E", ptr %9, align 8 store ptr @anon.e7a22afab2d73454c3fec61b403322c0.73, ptr %5, align 8, !alias.scope !1353, !noalias !1356 @@ -8079,9 +8006,10 @@ _ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit: ; preds = %21, %24, call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) br i1 %41, label %.loopexit, label %42 -42: ; preds = %_ZN12regex_syntax3hir4Look7as_char17h5afb16e8ea6083bfE.exit - %43 = icmp eq i32 %20, %.01417 - br i1 %43, label %.loopexit, label %.split13.i +42: ; preds = %21 + %25 = xor i32 %20, %.01417 + %26 = icmp eq i32 %20, %.01417 + br i1 %26, label %.loopexit, label %.split13.i } ; Function Attrs: inlinehint nonlazybind uwtable @@ -8759,6 +8687,9 @@ declare noundef zeroext i1 @_ZN4core3fmt9Formatter9write_fmt17heacf5dba8c40948fE ; Function Attrs: nonlazybind uwtable declare noundef zeroext i1 @"_ZN43_$LT$char$u20$as$u20$core..fmt..Display$GT$3fmt17he4f8681ce2737fc3E"(ptr noalias noundef readonly align 4 dereferenceable(4), ptr noalias noundef align 8 dereferenceable(64)) unnamed_addr #4 +; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #17 + ; Function Attrs: nonlazybind uwtable declare hidden i64 @_ZN12regex_syntax5debug11utf8_decode17hba173251560b97f0E(ptr noalias noundef nonnull readonly align 1, i64 noundef) unnamed_addr #4 diff --git a/bench/regex-rs/optimized/33whcn8n29l9c6ys.ll b/bench/regex-rs/optimized/33whcn8n29l9c6ys.ll index 4f1bc632cb4..fd2d1ea01ea 100644 --- a/bench/regex-rs/optimized/33whcn8n29l9c6ys.ll +++ b/bench/regex-rs/optimized/33whcn8n29l9c6ys.ll @@ -176,6 +176,8 @@ target triple = "x86_64-unknown-linux-gnu" @anon.451e762c733db03501c72f969938ebf7.229 = private unnamed_addr constant <{ ptr, [16 x i8] }> <{ ptr @anon.451e762c733db03501c72f969938ebf7.228, [16 x i8] c"%\00\00\00\00\00\00\00\F2\02\00\00\01\00\00\00" }>, align 8 @anon.451e762c733db03501c72f969938ebf7.230 = private unnamed_addr constant <{ [12 x i8] }> <{ [12 x i8] c"StateIDError" }>, align 1 @anon.451e762c733db03501c72f969938ebf7.231 = private unnamed_addr constant <{ ptr, [16 x i8], ptr }> <{ ptr @"_ZN4core3ptr74drop_in_place$LT$$RF$regex_automata..util..primitives..SmallIndexError$GT$17h881dd5ed15d43335E", [16 x i8] c"\08\00\00\00\00\00\00\00\08\00\00\00\00\00\00\00", ptr @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h53a5ce6618f78712E" }>, align 8 +@"switch.table._ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E" = private unnamed_addr constant [18 x i64] [i64 5, i64 3, i64 7, i64 5, i64 9, i64 7, i64 9, i64 15, i64 11, i64 17, i64 14, i64 12, i64 16, i64 14, i64 18, i64 16, i64 20, i64 18], align 8 +@"switch.table._ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.53" = private unnamed_addr constant [18 x ptr] [ptr @anon.451e762c733db03501c72f969938ebf7.208, ptr @anon.451e762c733db03501c72f969938ebf7.209, ptr @anon.451e762c733db03501c72f969938ebf7.210, ptr @anon.451e762c733db03501c72f969938ebf7.211, ptr @anon.451e762c733db03501c72f969938ebf7.212, ptr @anon.451e762c733db03501c72f969938ebf7.213, ptr @anon.451e762c733db03501c72f969938ebf7.214, ptr @anon.451e762c733db03501c72f969938ebf7.215, ptr @anon.451e762c733db03501c72f969938ebf7.216, ptr @anon.451e762c733db03501c72f969938ebf7.217, ptr @anon.451e762c733db03501c72f969938ebf7.218, ptr @anon.451e762c733db03501c72f969938ebf7.219, ptr @anon.451e762c733db03501c72f969938ebf7.220, ptr @anon.451e762c733db03501c72f969938ebf7.221, ptr @anon.451e762c733db03501c72f969938ebf7.222, ptr @anon.451e762c733db03501c72f969938ebf7.223, ptr @anon.451e762c733db03501c72f969938ebf7.224, ptr @anon.451e762c733db03501c72f969938ebf7.225], align 8 ; Function Attrs: inlinehint nonlazybind uwtable define hidden { ptr, i64 } @"_ZN106_$LT$core..ops..range..Range$LT$usize$GT$$u20$as$u20$core..slice..index..SliceIndex$LT$$u5b$T$u5d$$GT$$GT$5index17h364e2176bd393ad4E.llvm.17849184579231348327"(i64 noundef %0, i64 noundef %1, ptr noalias noundef nonnull readonly align 1 %2, i64 noundef %3, ptr noalias noundef readonly align 8 dereferenceable(24) %4) unnamed_addr #0 { @@ -215,89 +217,19 @@ define hidden noundef zeroext i1 @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$G ; Function Attrs: nonlazybind uwtable define hidden noundef zeroext i1 @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hec7db5ceb1599627E"(ptr noalias noundef readonly align 8 captures(none) dereferenceable(8) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #1 { - %3 = load ptr, ptr %0, align 8, !nonnull !4, !align !10, !noundef !4 +switch.lookup: + %2 = load ptr, ptr %0, align 8, !nonnull !4, !align !10, !noundef !4 tail call void @llvm.experimental.noalias.scope.decl(metadata !11) - %4 = load i32, ptr %3, align 4, !range !14, !alias.scope !11, !noalias !15, !noundef !4 - switch i32 %4, label %5 [ - i32 1, label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - i32 2, label %6 - i32 4, label %7 - i32 8, label %8 - i32 16, label %9 - i32 32, label %10 - i32 64, label %11 - i32 128, label %12 - i32 256, label %13 - i32 512, label %14 - i32 1024, label %15 - i32 2048, label %16 - i32 4096, label %17 - i32 8192, label %18 - i32 16384, label %19 - i32 32768, label %20 - i32 65536, label %21 - i32 131072, label %22 - ] - -5: ; preds = %2 - unreachable - -6: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -7: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -8: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -9: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -10: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -11: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -12: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -13: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -14: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -15: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -16: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -17: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -18: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -19: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -20: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -21: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -22: ; preds = %2 - br label %"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit" - -"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.exit": ; preds = %2, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16, %17, %18, %19, %20, %21, %22 - %.sroa.19.0.i = phi i64 [ 3, %6 ], [ 7, %7 ], [ 5, %8 ], [ 9, %9 ], [ 7, %10 ], [ 9, %11 ], [ 15, %12 ], [ 11, %13 ], [ 17, %14 ], [ 14, %15 ], [ 12, %16 ], [ 16, %17 ], [ 14, %18 ], [ 18, %19 ], [ 16, %20 ], [ 20, %21 ], [ 18, %22 ], [ 5, %2 ] - %.sroa.0.0.i = phi ptr [ @anon.451e762c733db03501c72f969938ebf7.209, %6 ], [ @anon.451e762c733db03501c72f969938ebf7.210, %7 ], [ @anon.451e762c733db03501c72f969938ebf7.211, %8 ], [ @anon.451e762c733db03501c72f969938ebf7.212, %9 ], [ @anon.451e762c733db03501c72f969938ebf7.213, %10 ], [ @anon.451e762c733db03501c72f969938ebf7.214, %11 ], [ @anon.451e762c733db03501c72f969938ebf7.215, %12 ], [ @anon.451e762c733db03501c72f969938ebf7.216, %13 ], [ @anon.451e762c733db03501c72f969938ebf7.217, %14 ], [ @anon.451e762c733db03501c72f969938ebf7.218, %15 ], [ @anon.451e762c733db03501c72f969938ebf7.219, %16 ], [ @anon.451e762c733db03501c72f969938ebf7.220, %17 ], [ @anon.451e762c733db03501c72f969938ebf7.221, %18 ], [ @anon.451e762c733db03501c72f969938ebf7.222, %19 ], [ @anon.451e762c733db03501c72f969938ebf7.223, %20 ], [ @anon.451e762c733db03501c72f969938ebf7.224, %21 ], [ @anon.451e762c733db03501c72f969938ebf7.225, %22 ], [ @anon.451e762c733db03501c72f969938ebf7.208, %2 ] - %23 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0.i, i64 noundef %.sroa.19.0.i), !noalias !11 - ret i1 %23 + %4 = load i32, ptr %2, align 4, !range !14, !alias.scope !11, !noalias !15, !noundef !4 + %4 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %3, i1 true) + %5 = zext nneg i32 %4 to i64 + %switch.gep = getelementptr inbounds nuw [18 x i64], ptr @"switch.table._ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E", i64 0, i64 %5 + %switch.load = load i64, ptr %switch.gep, align 8 + %6 = zext nneg i32 %4 to i64 + %switch.gep1 = getelementptr inbounds nuw [18 x ptr], ptr @"switch.table._ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.53", i64 0, i64 %6 + %switch.load2 = load ptr, ptr %switch.gep1, align 8 + %7 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load2, i64 noundef %switch.load), !noalias !11 + ret i1 %7 } ; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(none) uwtable @@ -7126,87 +7058,17 @@ define internal noundef zeroext i1 @"_ZN85_$LT$regex_automata..nfa..thompson..er ; Function Attrs: inlinehint nonlazybind uwtable define internal noundef zeroext i1 @"_ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E"(ptr noalias noundef readonly align 4 captures(none) dereferenceable(4) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #0 { - %3 = load i32, ptr %0, align 4, !range !14, !noundef !4 - switch i32 %3, label %4 [ - i32 1, label %22 - i32 2, label %5 - i32 4, label %6 - i32 8, label %7 - i32 16, label %8 - i32 32, label %9 - i32 64, label %10 - i32 128, label %11 - i32 256, label %12 - i32 512, label %13 - i32 1024, label %14 - i32 2048, label %15 - i32 4096, label %16 - i32 8192, label %17 - i32 16384, label %18 - i32 32768, label %19 - i32 65536, label %20 - i32 131072, label %21 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %22 - -6: ; preds = %2 - br label %22 - -7: ; preds = %2 - br label %22 - -8: ; preds = %2 - br label %22 - -9: ; preds = %2 - br label %22 - -10: ; preds = %2 - br label %22 - -11: ; preds = %2 - br label %22 - -12: ; preds = %2 - br label %22 - -13: ; preds = %2 - br label %22 - -14: ; preds = %2 - br label %22 - -15: ; preds = %2 - br label %22 - -16: ; preds = %2 - br label %22 - -17: ; preds = %2 - br label %22 - -18: ; preds = %2 - br label %22 - -19: ; preds = %2 - br label %22 - -20: ; preds = %2 - br label %22 - -21: ; preds = %2 - br label %22 - -22: ; preds = %2, %21, %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6, %5 - %.sroa.19.0 = phi i64 [ 3, %5 ], [ 7, %6 ], [ 5, %7 ], [ 9, %8 ], [ 7, %9 ], [ 9, %10 ], [ 15, %11 ], [ 11, %12 ], [ 17, %13 ], [ 14, %14 ], [ 12, %15 ], [ 16, %16 ], [ 14, %17 ], [ 18, %18 ], [ 16, %19 ], [ 20, %20 ], [ 18, %21 ], [ 5, %2 ] - %.sroa.0.0 = phi ptr [ @anon.451e762c733db03501c72f969938ebf7.209, %5 ], [ @anon.451e762c733db03501c72f969938ebf7.210, %6 ], [ @anon.451e762c733db03501c72f969938ebf7.211, %7 ], [ @anon.451e762c733db03501c72f969938ebf7.212, %8 ], [ @anon.451e762c733db03501c72f969938ebf7.213, %9 ], [ @anon.451e762c733db03501c72f969938ebf7.214, %10 ], [ @anon.451e762c733db03501c72f969938ebf7.215, %11 ], [ @anon.451e762c733db03501c72f969938ebf7.216, %12 ], [ @anon.451e762c733db03501c72f969938ebf7.217, %13 ], [ @anon.451e762c733db03501c72f969938ebf7.218, %14 ], [ @anon.451e762c733db03501c72f969938ebf7.219, %15 ], [ @anon.451e762c733db03501c72f969938ebf7.220, %16 ], [ @anon.451e762c733db03501c72f969938ebf7.221, %17 ], [ @anon.451e762c733db03501c72f969938ebf7.222, %18 ], [ @anon.451e762c733db03501c72f969938ebf7.223, %19 ], [ @anon.451e762c733db03501c72f969938ebf7.224, %20 ], [ @anon.451e762c733db03501c72f969938ebf7.225, %21 ], [ @anon.451e762c733db03501c72f969938ebf7.208, %2 ] - %23 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0, i64 noundef %.sroa.19.0) - ret i1 %23 +switch.lookup: + %2 = load i32, ptr %0, align 4, !range !14, !noundef !4 + %3 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %2, i1 true) + %4 = zext nneg i32 %3 to i64 + %switch.gep = getelementptr inbounds nuw [18 x i64], ptr @"switch.table._ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i32 %3 to i64 + %switch.gep2 = getelementptr inbounds nuw [18 x ptr], ptr @"switch.table._ZN69_$LT$regex_automata..util..look..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17ha70195a3360f80e1E.53", i64 0, i64 %5 + %switch.load3 = load ptr, ptr %switch.gep2, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load3, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: inlinehint nonlazybind uwtable diff --git a/bench/regex-rs/optimized/3bb5ih3626n2er1d.ll b/bench/regex-rs/optimized/3bb5ih3626n2er1d.ll index 9e5d0cada30..a20df0e7d3a 100644 --- a/bench/regex-rs/optimized/3bb5ih3626n2er1d.ll +++ b/bench/regex-rs/optimized/3bb5ih3626n2er1d.ll @@ -7730,7 +7730,7 @@ define hidden void @_ZN14regex_automata3nfa8thompson9backtrack18BoundedBacktrack tail call void @llvm.memset.p0.i64(ptr nonnull align 8 %4, i8 0, i64 %13, i1 false) br label %._crit_edge -default.unreachable735: ; preds = %_ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit119, %_ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit, %55 +default.unreachable735: ; preds = %513, %_ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit119, %159, %_ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit, %55 unreachable ._crit_edge: ; preds = %.lr.ph.preheader, %6 @@ -7820,7 +7820,7 @@ _ZN14regex_automata3nfa8thompson9backtrack5Cache12setup_search17h660cf617ced671d 55: ; preds = %51 %56 = load i32, ptr %3, align 8, !range !713, !noundef !20 - switch i32 %56, label %default.unreachable735 [ + switch i32 %56, label %default.unreachable737 [ i32 0, label %68 i32 1, label %58 i32 2, label %61 @@ -8007,7 +8007,7 @@ _ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit: ; preds %150 = load ptr, ptr %116, align 8, !nonnull !20, !noundef !20 %151 = getelementptr inbounds nuw [0 x { i32, [5 x i32] }], ptr %150, i64 0, i64 %139 %152 = load i32, ptr %151, align 8, !range !1496, !noalias !1487, !noundef !20 - switch i32 %152, label %default.unreachable735 [ + switch i32 %152, label %default.unreachable737 [ i32 0, label %153 i32 1, label %155 i32 2, label %157 @@ -8042,30 +8042,28 @@ _ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit: ; preds %164 = load i64, ptr %8, align 8, !noalias !1479, !noundef !20 call void @llvm.experimental.noalias.scope.decl(metadata !1498) call void @llvm.experimental.noalias.scope.decl(metadata !1501) - switch i32 %161, label %165 [ - i32 1, label %166 - i32 2, label %168 - i32 4, label %170 - i32 8, label %172 - i32 16, label %174 - i32 32, label %187 - i32 64, label %201 - i32 128, label %224 - i32 256, label %249 - i32 512, label %252 - i32 1024, label %255 - i32 2048, label %277 - i32 4096, label %299 - i32 8192, label %302 - i32 16384, label %305 - i32 32768, label %317 - i32 65536, label %326 - i32 131072, label %329 + %165 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 range(i32 1, 131073) %161, i1 true) + switch i32 %165, label %default.unreachable737 [ + i32 0, label %166 + i32 1, label %168 + i32 2, label %170 + i32 3, label %172 + i32 4, label %174 + i32 5, label %187 + i32 6, label %201 + i32 7, label %224 + i32 8, label %249 + i32 9, label %252 + i32 10, label %255 + i32 11, label %277 + i32 12, label %299 + i32 13, label %302 + i32 14, label %305 + i32 15, label %317 + i32 16, label %326 + i32 17, label %329 ] -165: ; preds = %159 - unreachable - 166: ; preds = %159 %167 = icmp eq i64 %164, 0 br i1 %167, label %.backedge, label %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit.thread @@ -8459,7 +8457,7 @@ _ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074 br label %.backedge .backedge: ; preds = %.thread738, %.thread738._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit92_crit_edge, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit92_crit_edge, %375, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit110", %172, %170, %174, %179, %183, %187, %191, %195, %305, %317, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit101", %391, %411, %426, %428, %166, %168, %335, %343, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit92, %249, %252, %_ZN14regex_automata4util4look11LookMatcher19is_word_start_ascii17h9805bd83da0c6cbfE.exit, %_ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074E.exit, %299, %302, %326, %329, %184, %197, %310, %319, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit_crit_edge, %.thread271._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit_crit_edge - %.0.i52.be = phi i32 [ %392, %391 ], [ %412, %411 ], [ %425, %426 ], [ %431, %428 ], [ %354, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit101" ], [ %163, %166 ], [ %163, %168 ], [ %163, %335 ], [ %163, %343 ], [ %163, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit ], [ %163, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit92 ], [ %163, %249 ], [ %163, %252 ], [ %163, %_ZN14regex_automata4util4look11LookMatcher19is_word_start_ascii17h9805bd83da0c6cbfE.exit ], [ %163, %_ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074E.exit ], [ %163, %299 ], [ %163, %302 ], [ %163, %326 ], [ %163, %329 ], [ %163, %184 ], [ %163, %197 ], [ %163, %310 ], [ %163, %319 ], [ %163, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit_crit_edge ], [ %163, %.thread271._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit_crit_edge ], [ %163, %317 ], [ %163, %305 ], [ %163, %195 ], [ %163, %191 ], [ %163, %187 ], [ %163, %183 ], [ %163, %179 ], [ %163, %174 ], [ %163, %170 ], [ %163, %172 ], [ %377, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit110" ], [ %377, %375 ], [ %163, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit92_crit_edge ], [ %163, %.thread738._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit92_crit_edge ], [ %163, %.thread738 ] + %.0.i52.be = phi i32 [ %392, %391 ], [ %412, %411 ], [ %425, %426 ], [ %431, %428 ], [ %354, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit103" ], [ %163, %166 ], [ %163, %168 ], [ %163, %335 ], [ %163, %343 ], [ %163, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit ], [ %163, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit94 ], [ %163, %249 ], [ %163, %252 ], [ %163, %_ZN14regex_automata4util4look11LookMatcher19is_word_start_ascii17h9805bd83da0c6cbfE.exit ], [ %163, %_ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074E.exit ], [ %163, %299 ], [ %163, %302 ], [ %163, %326 ], [ %163, %329 ], [ %163, %184 ], [ %163, %197 ], [ %163, %310 ], [ %163, %319 ], [ %163, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit_crit_edge ], [ %163, %.thread273._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit_crit_edge ], [ %163, %317 ], [ %163, %305 ], [ %163, %195 ], [ %163, %191 ], [ %163, %187 ], [ %163, %183 ], [ %163, %179 ], [ %163, %174 ], [ %163, %170 ], [ %163, %172 ], [ %377, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit112" ], [ %377, %375 ], [ %163, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit94_crit_edge ], [ %163, %.thread740._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit94_crit_edge ], [ %163, %.thread740 ] %367 = load i64, ptr %8, align 8, !noalias !1479, !noundef !20 %368 = sub i64 %367, %.val %369 = zext i32 %.0.i52.be to i64 @@ -8670,7 +8668,7 @@ _ZN14regex_automata3nfa8thompson9backtrack18BoundedBacktracker9backtrack17h960e9 br label %80 460: ; preds = %.lr.ph519, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113.thread" - %.033517 = phi i64 [ %.val, %.lr.ph519 ], [ %817, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113.thread" ] + %.033517 = phi i64 [ %.val, %.lr.ph521 ], [ %817, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit115.thread" ] br i1 %87, label %467, label %461 .loopexit: ; preds = %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113.thread", %810 @@ -8718,7 +8716,7 @@ _ZN14regex_automata3nfa8thompson9backtrack18BoundedBacktracker9backtrack17h960e9 br i1 %477, label %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113.thread", label %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113" "_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113": ; preds = %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit112", %805 - %478 = phi i64 [ %.pr230, %805 ], [ %476, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit112" ] + %478 = phi i64 [ %.pr230, %805 ], [ %476, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit114" ] call void @llvm.experimental.noalias.scope.decl(metadata !1589) %479 = add i64 %478, -1 store i64 %479, ptr %16, align 8, !alias.scope !1589, !noalias !1592 @@ -8753,15 +8751,15 @@ _ZN14regex_automata3nfa8thompson9backtrack18BoundedBacktracker9backtrack17h960e9 br i1 %491, label %"_ZN81_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..index..Index$LT$I$GT$$GT$5index17h2ed19b4a3c0f2aa6E.exit.i115", label %._crit_edge511, !prof !1488 ._crit_edge511: ; preds = %484, %.backedge291 - %.lcssa474 = phi i64 [ %727, %.backedge291 ], [ %490, %484 ] - %.val2.i114.lcssa = phi i64 [ %.val2.i114, %.backedge291 ], [ %.val2.i114510, %484 ] + %.lcssa474 = phi i64 [ %727, %.backedge293 ], [ %490, %484 ] + %.val2.i114.lcssa = phi i64 [ %.val2.i114, %.backedge293 ], [ %.val2.i114510, %484 ] call void @_ZN4core9panicking18panic_bounds_check17h8331054858f0bf20E(i64 noundef range(i64 0, 288230376151711744) %.lcssa474, i64 noundef %.val2.i114.lcssa, ptr noalias noundef readonly align 8 dereferenceable(24) @anon.aef2ba79577a57b07f107cfc70efd80d.54) #55, !noalias !1608 unreachable "_ZN81_$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..ops..index..Index$LT$I$GT$$GT$5index17h2ed19b4a3c0f2aa6E.exit.i115": ; preds = %484, %.backedge291 - %.pn.in = phi i64 [ %726, %.backedge291 ], [ %489, %484 ] - %492 = phi i64 [ %727, %.backedge291 ], [ %490, %484 ] - %493 = phi i64 [ %723, %.backedge291 ], [ %486, %484 ] + %.pn.in = phi i64 [ %726, %.backedge293 ], [ %489, %484 ] + %492 = phi i64 [ %727, %.backedge293 ], [ %490, %484 ] + %493 = phi i64 [ %723, %.backedge293 ], [ %486, %484 ] %.pn = and i64 %.pn.in, 63 %494 = shl nuw i64 1, %.pn call void @llvm.experimental.noalias.scope.decl(metadata !1612) @@ -8787,7 +8785,7 @@ _ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit119: ; pr %504 = load ptr, ptr %100, align 8, !nonnull !20, !noundef !20 %505 = getelementptr inbounds nuw [0 x { i32, [5 x i32] }], ptr %504, i64 0, i64 %493 %506 = load i32, ptr %505, align 8, !range !1496, !noalias !1607, !noundef !20 - switch i32 %506, label %default.unreachable735 [ + switch i32 %506, label %default.unreachable737 [ i32 0, label %507 i32 1, label %509 i32 2, label %511 @@ -8822,30 +8820,28 @@ _ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit119: ; pr %518 = load i64, ptr %10, align 8, !noalias !1599, !noundef !20 call void @llvm.experimental.noalias.scope.decl(metadata !1614) call void @llvm.experimental.noalias.scope.decl(metadata !1617) - switch i32 %515, label %519 [ - i32 1, label %520 - i32 2, label %522 - i32 4, label %524 - i32 8, label %526 - i32 16, label %528 - i32 32, label %541 - i32 64, label %555 - i32 128, label %578 - i32 256, label %603 - i32 512, label %606 - i32 1024, label %609 - i32 2048, label %631 - i32 4096, label %653 - i32 8192, label %656 - i32 16384, label %659 - i32 32768, label %671 - i32 65536, label %680 - i32 131072, label %683 + %519 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 range(i32 1, 131073) %515, i1 true) + switch i32 %519, label %default.unreachable737 [ + i32 0, label %520 + i32 1, label %522 + i32 2, label %524 + i32 3, label %526 + i32 4, label %528 + i32 5, label %541 + i32 6, label %555 + i32 7, label %578 + i32 8, label %603 + i32 9, label %606 + i32 10, label %609 + i32 11, label %631 + i32 12, label %653 + i32 13, label %656 + i32 14, label %659 + i32 15, label %671 + i32 16, label %680 + i32 17, label %683 ] -519: ; preds = %513 - unreachable - 520: ; preds = %513 %521 = icmp eq i64 %518, 0 br i1 %521, label %.backedge291, label %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit69.thread @@ -8875,7 +8871,7 @@ _ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit119: ; pr 533: ; preds = %530 %534 = getelementptr inbounds [0 x i8], ptr %89, i64 0, i64 %531 %535 = load i8, ptr %534, align 1, !alias.scope !1619, !noundef !20 - switch i8 %535, label %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit69.thread [ + switch i8 %535, label %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit71.thread [ i8 10, label %.backedge291 i8 13, label %537 ] @@ -8906,7 +8902,7 @@ _ZN14regex_automata3nfa8thompson3nfa3NFA5state17he41afc9d81615eb8E.exit119: ; pr 545: ; preds = %543 %546 = getelementptr inbounds [0 x i8], ptr %89, i64 0, i64 %518 %547 = load i8, ptr %546, align 1, !alias.scope !1622, !noundef !20 - switch i8 %547, label %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit69.thread [ + switch i8 %547, label %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit71.thread [ i8 13, label %.backedge291 i8 10, label %549 ] @@ -9239,7 +9235,7 @@ _ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074 br label %.backedge291 .backedge291: ; preds = %.thread743, %.thread743._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit132_crit_edge, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit132_crit_edge, %729, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit168", %526, %524, %528, %533, %537, %541, %545, %549, %659, %671, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit148", %745, %765, %780, %782, %520, %522, %689, %697, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit128, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit132, %603, %606, %_ZN14regex_automata4util4look11LookMatcher19is_word_start_ascii17h9805bd83da0c6cbfE.exit136, %_ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074E.exit141, %653, %656, %680, %683, %538, %551, %664, %673, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit128_crit_edge, %.thread276._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit128_crit_edge - %.0.i.be = phi i32 [ %746, %745 ], [ %766, %765 ], [ %779, %780 ], [ %785, %782 ], [ %708, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit148" ], [ %517, %520 ], [ %517, %522 ], [ %517, %689 ], [ %517, %697 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit128 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit132 ], [ %517, %603 ], [ %517, %606 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher19is_word_start_ascii17h9805bd83da0c6cbfE.exit136 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074E.exit141 ], [ %517, %653 ], [ %517, %656 ], [ %517, %680 ], [ %517, %683 ], [ %517, %538 ], [ %517, %551 ], [ %517, %664 ], [ %517, %673 ], [ %517, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit128_crit_edge ], [ %517, %.thread276._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit128_crit_edge ], [ %517, %671 ], [ %517, %659 ], [ %517, %549 ], [ %517, %545 ], [ %517, %541 ], [ %517, %537 ], [ %517, %533 ], [ %517, %528 ], [ %517, %524 ], [ %517, %526 ], [ %731, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit168" ], [ %731, %729 ], [ %517, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit132_crit_edge ], [ %517, %.thread743._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit132_crit_edge ], [ %517, %.thread743 ] + %.0.i.be = phi i32 [ %746, %745 ], [ %766, %765 ], [ %779, %780 ], [ %785, %782 ], [ %708, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit150" ], [ %517, %520 ], [ %517, %522 ], [ %517, %689 ], [ %517, %697 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit130 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit134 ], [ %517, %603 ], [ %517, %606 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher19is_word_start_ascii17h9805bd83da0c6cbfE.exit138 ], [ %517, %_ZN14regex_automata4util4look11LookMatcher17is_word_end_ascii17h212097b5ac445074E.exit143 ], [ %517, %653 ], [ %517, %656 ], [ %517, %680 ], [ %517, %683 ], [ %517, %538 ], [ %517, %551 ], [ %517, %664 ], [ %517, %673 ], [ %517, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit130_crit_edge ], [ %517, %.thread278._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit130_crit_edge ], [ %517, %671 ], [ %517, %659 ], [ %517, %549 ], [ %517, %545 ], [ %517, %541 ], [ %517, %537 ], [ %517, %533 ], [ %517, %528 ], [ %517, %524 ], [ %517, %526 ], [ %731, %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$4push17h1175d7985a323fa2E.exit170" ], [ %731, %729 ], [ %517, %._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit134_crit_edge ], [ %517, %.thread745._ZN14regex_automata4util4look11LookMatcher13is_word_ascii17hebbfd5d695ea5afaE.exit134_crit_edge ], [ %517, %.thread745 ] %721 = load i64, ptr %10, align 8, !noalias !1599, !noundef !20 %722 = sub i64 %721, %.val %723 = zext i32 %.0.i.be to i64 @@ -9417,7 +9413,7 @@ _ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.e br label %805 805: ; preds = %807, %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit69.thread - %.pr230 = phi i64 [ %479, %807 ], [ %.pr230.pre, %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit69.thread ] + %.pr230 = phi i64 [ %479, %807 ], [ %.pr230.pre, %_ZN14regex_automata4util4look11LookMatcher14matches_inline17hfb6f75d19f1ee05cE.exit71.thread ] %806 = icmp eq i64 %.pr230, 0 br i1 %806, label %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113.thread", label %"_ZN5alloc3vec16Vec$LT$T$C$A$GT$3pop17h1bddf6d3a0ca4645E.exit113" @@ -12773,6 +12769,9 @@ declare hidden { i64, i64 } @_ZN14regex_automata4util10primitives13PatternIDIter ; Function Attrs: nocallback nofree nounwind nonlazybind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #52 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #53 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #53 diff --git a/bench/regex-rs/optimized/43rm3k0zg7aeemwj.ll b/bench/regex-rs/optimized/43rm3k0zg7aeemwj.ll index 4b1fdf3d5df..a3285fa23c6 100644 --- a/bench/regex-rs/optimized/43rm3k0zg7aeemwj.ll +++ b/bench/regex-rs/optimized/43rm3k0zg7aeemwj.ll @@ -90,6 +90,8 @@ target triple = "x86_64-unknown-linux-gnu" @anon.7eb7d200dc2f46b7a5cd845b93f5ca09.44.llvm.4042359526532701921 = external hidden unnamed_addr constant <{ [43 x i8] }>, align 1 @anon.7eb7d200dc2f46b7a5cd845b93f5ca09.50.llvm.4042359526532701921 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @anon.7eb7d200dc2f46b7a5cd845b93f5ca09.52.llvm.4042359526532701921 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 +@"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb15990bc61a0e7feE" = private unnamed_addr constant [18 x i64] [i64 5, i64 3, i64 7, i64 5, i64 9, i64 7, i64 9, i64 15, i64 11, i64 17, i64 14, i64 12, i64 16, i64 14, i64 18, i64 16, i64 20, i64 18], align 8 +@"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb15990bc61a0e7feE.33" = private unnamed_addr constant [18 x ptr] [ptr @anon.458ea570a757e25242704d80b74fe601.42, ptr @anon.458ea570a757e25242704d80b74fe601.43, ptr @anon.458ea570a757e25242704d80b74fe601.44, ptr @anon.458ea570a757e25242704d80b74fe601.45, ptr @anon.458ea570a757e25242704d80b74fe601.46, ptr @anon.458ea570a757e25242704d80b74fe601.47, ptr @anon.458ea570a757e25242704d80b74fe601.48, ptr @anon.458ea570a757e25242704d80b74fe601.49, ptr @anon.458ea570a757e25242704d80b74fe601.50, ptr @anon.458ea570a757e25242704d80b74fe601.51, ptr @anon.458ea570a757e25242704d80b74fe601.52, ptr @anon.458ea570a757e25242704d80b74fe601.53, ptr @anon.458ea570a757e25242704d80b74fe601.54, ptr @anon.458ea570a757e25242704d80b74fe601.55, ptr @anon.458ea570a757e25242704d80b74fe601.56, ptr @anon.458ea570a757e25242704d80b74fe601.57, ptr @anon.458ea570a757e25242704d80b74fe601.58, ptr @anon.458ea570a757e25242704d80b74fe601.59], align 8 @"switch.table._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hc6c94f41291d53abE" = private unnamed_addr constant [7 x i64] [i64 24, i64 31, i64 38, i64 26, i64 32, i64 82, i64 106], align 8 @"switch.table._ZN44_$LT$$RF$T$u20$as$u20$core..fmt..Display$GT$3fmt17hc6c94f41291d53abE.33" = private unnamed_addr constant [7 x ptr] [ptr @anon.e7a22afab2d73454c3fec61b403322c0.31.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.32.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.33.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.34.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.35.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.36.llvm.5188572562200175411, ptr @anon.e7a22afab2d73454c3fec61b403322c0.37.llvm.5188572562200175411], align 8 @@ -256,88 +258,18 @@ define hidden noundef zeroext i1 @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$G ; Function Attrs: nonlazybind uwtable define hidden noundef zeroext i1 @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb15990bc61a0e7feE"(ptr noalias noundef readonly align 8 captures(none) dereferenceable(8) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #1 { - %3 = load ptr, ptr %0, align 8, !nonnull !4, !align !21, !noundef !4 - %.val = load i32, ptr %3, align 4, !range !40, !noundef !4 - switch i32 %.val, label %4 [ - i32 1, label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - i32 2, label %5 - i32 4, label %6 - i32 8, label %7 - i32 16, label %8 - i32 32, label %9 - i32 64, label %10 - i32 128, label %11 - i32 256, label %12 - i32 512, label %13 - i32 1024, label %14 - i32 2048, label %15 - i32 4096, label %16 - i32 8192, label %17 - i32 16384, label %18 - i32 32768, label %19 - i32 65536, label %20 - i32 131072, label %21 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -6: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -7: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -8: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -9: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -10: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -11: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -12: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -13: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -14: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -15: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -16: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -17: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -18: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -19: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -20: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -21: ; preds = %2 - br label %"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit" - -"_ZN60_$LT$regex_syntax..hir..Look$u20$as$u20$core..fmt..Debug$GT$3fmt17hd4ced92ed85d4213E.exit": ; preds = %2, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14, %15, %16, %17, %18, %19, %20, %21 - %.sroa.19.0.i = phi i64 [ 3, %5 ], [ 7, %6 ], [ 5, %7 ], [ 9, %8 ], [ 7, %9 ], [ 9, %10 ], [ 15, %11 ], [ 11, %12 ], [ 17, %13 ], [ 14, %14 ], [ 12, %15 ], [ 16, %16 ], [ 14, %17 ], [ 18, %18 ], [ 16, %19 ], [ 20, %20 ], [ 18, %21 ], [ 5, %2 ] - %.sroa.0.0.i = phi ptr [ @anon.458ea570a757e25242704d80b74fe601.43, %5 ], [ @anon.458ea570a757e25242704d80b74fe601.44, %6 ], [ @anon.458ea570a757e25242704d80b74fe601.45, %7 ], [ @anon.458ea570a757e25242704d80b74fe601.46, %8 ], [ @anon.458ea570a757e25242704d80b74fe601.47, %9 ], [ @anon.458ea570a757e25242704d80b74fe601.48, %10 ], [ @anon.458ea570a757e25242704d80b74fe601.49, %11 ], [ @anon.458ea570a757e25242704d80b74fe601.50, %12 ], [ @anon.458ea570a757e25242704d80b74fe601.51, %13 ], [ @anon.458ea570a757e25242704d80b74fe601.52, %14 ], [ @anon.458ea570a757e25242704d80b74fe601.53, %15 ], [ @anon.458ea570a757e25242704d80b74fe601.54, %16 ], [ @anon.458ea570a757e25242704d80b74fe601.55, %17 ], [ @anon.458ea570a757e25242704d80b74fe601.56, %18 ], [ @anon.458ea570a757e25242704d80b74fe601.57, %19 ], [ @anon.458ea570a757e25242704d80b74fe601.58, %20 ], [ @anon.458ea570a757e25242704d80b74fe601.59, %21 ], [ @anon.458ea570a757e25242704d80b74fe601.42, %2 ] - %22 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0.i, i64 noundef %.sroa.19.0.i) - ret i1 %22 +switch.lookup: + %.val = load ptr, ptr %0, align 8, !nonnull !4, !align !21, !noundef !4 + %.val = load i32, ptr %.val, align 4, !range !40, !noundef !4 + %3 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %.val, i1 true) + %4 = zext nneg i32 %3 to i64 + %switch.gep = getelementptr inbounds nuw [18 x i64], ptr @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb15990bc61a0e7feE", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i32 %3 to i64 + %switch.gep1 = getelementptr inbounds nuw [18 x ptr], ptr @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hb15990bc61a0e7feE.33", i64 0, i64 %5 + %switch.load2 = load ptr, ptr %switch.gep1, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17hff61c25f281f3854E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load2, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: nonlazybind uwtable @@ -3377,6 +3309,9 @@ declare hidden void @"_ZN63_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..All ; Function Attrs: nonlazybind uwtable declare hidden void @"_ZN4core3ptr60drop_in_place$LT$regex_syntax..hir..visitor..HeapVisitor$GT$17h509e88063c49da77E"(ptr noalias noundef align 8 dereferenceable(24)) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #26 + ; Function Attrs: nocallback nofree nounwind nonlazybind willreturn memory(argmem: read) declare i32 @bcmp(ptr captures(none), ptr captures(none), i64) local_unnamed_addr #26 @@ -3430,9 +3365,9 @@ attributes #22 = { nounwind nonlazybind allockind("alloc,uninitialized,aligned") attributes #23 = { nounwind nonlazybind allockind("free") uwtable "alloc-family"="__rust_alloc" "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #24 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #25 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -attributes #26 = { nocallback nofree nounwind nonlazybind willreturn memory(argmem: read) } -attributes #27 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -attributes #28 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #26 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #27 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: read) } +attributes #28 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #29 = { noreturn } attributes #30 = { nounwind } attributes #31 = { cold } diff --git a/bench/regex-rs/optimized/6f4i3c8223u3bmw.ll b/bench/regex-rs/optimized/6f4i3c8223u3bmw.ll index a63a68556ca..efbbfaa3f82 100644 --- a/bench/regex-rs/optimized/6f4i3c8223u3bmw.ll +++ b/bench/regex-rs/optimized/6f4i3c8223u3bmw.ll @@ -273,6 +273,7 @@ target triple = "x86_64-unknown-linux-gnu" @anon.5a48a2ebb7f06f3dffebe9420965407a.130.llvm.11684209855903828990 = external hidden unnamed_addr constant <{ [43 x i8] }>, align 1 @anon.5a48a2ebb7f06f3dffebe9420965407a.135.llvm.11684209855903828990 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @__rust_no_alloc_shim_is_unstable = external global i8 +@"switch.table._ZN72_$LT$regex_automata..util..look..LookSet$u20$as$u20$core..fmt..Debug$GT$3fmt17h155e02beaa681d4cE" = private unnamed_addr constant [18 x i32] [i32 65, i32 122, i32 94, i32 36, i32 114, i32 82, i32 98, i32 66, i32 120515, i32 120489, i32 60, i32 62, i32 12296, i32 12297, i32 9665, i32 9655, i32 9664, i32 9654], align 4 ; Function Attrs: nonlazybind uwtable define hidden noundef ptr @_ZN3std2io5Write9write_all17he684e871a418d263E(ptr noalias noundef nonnull align 1 %0, ptr noalias noundef nonnull readonly align 1 %1, i64 noundef %2) unnamed_addr #0 personality ptr @rust_eh_personality { @@ -3414,7 +3415,7 @@ define hidden noundef range(i32 0, 2147483647) i32 @_ZN14regex_automata3nfa8thom i32 8, label %.loopexit ] -default.unreachable45: ; preds = %129, %2 +default.unreachable45: ; preds = %129, %39, %2 unreachable 6: ; preds = %2 @@ -3481,33 +3482,31 @@ _ZN14regex_automata4util8alphabet12ByteClassSet9set_range17h80899899759d6f5dE.ex %43 = getelementptr inbounds nuw i8, ptr %0, i64 64 %.val = load i8, ptr %42, align 4 tail call void @llvm.experimental.noalias.scope.decl(metadata !375) - switch i32 %41, label %44 [ + %44 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 range(i32 1, 131073) %41, i1 true) + switch i32 %44, label %default.unreachable45 [ + i32 0, label %_ZN14regex_automata4util4look11LookMatcher14add_to_byteset17h632e907fe7ebe569E.exit i32 1, label %_ZN14regex_automata4util4look11LookMatcher14add_to_byteset17h632e907fe7ebe569E.exit - i32 2, label %_ZN14regex_automata4util4look11LookMatcher14add_to_byteset17h632e907fe7ebe569E.exit - i32 4, label %45 - i32 8, label %45 - i32 16, label %62 - i32 32, label %62 - i32 64, label %.preheader.i.preheader - i32 128, label %.preheader.i.preheader - i32 256, label %.preheader.i.preheader - i32 512, label %.preheader.i.preheader - i32 1024, label %.preheader.i.preheader - i32 2048, label %.preheader.i.preheader - i32 4096, label %.preheader.i.preheader - i32 8192, label %.preheader.i.preheader - i32 16384, label %.preheader.i.preheader - i32 32768, label %.preheader.i.preheader - i32 65536, label %.preheader.i.preheader - i32 131072, label %.preheader.i.preheader + i32 2, label %45 + i32 3, label %45 + i32 4, label %62 + i32 5, label %62 + i32 6, label %.preheader.i.preheader + i32 7, label %.preheader.i.preheader + i32 8, label %.preheader.i.preheader + i32 9, label %.preheader.i.preheader + i32 10, label %.preheader.i.preheader + i32 11, label %.preheader.i.preheader + i32 12, label %.preheader.i.preheader + i32 13, label %.preheader.i.preheader + i32 14, label %.preheader.i.preheader + i32 15, label %.preheader.i.preheader + i32 16, label %.preheader.i.preheader + i32 17, label %.preheader.i.preheader ] .preheader.i.preheader: ; preds = %39, %39, %39, %39, %39, %39, %39, %39, %39, %39, %39, %39 br label %.preheader.i -44: ; preds = %39 - unreachable - 45: ; preds = %39, %39 %.not.i.i = icmp eq i8 %.val, 0 br i1 %.not.i.i, label %_ZN14regex_automata4util8alphabet12ByteClassSet9set_range17h80899899759d6f5dE.exit.i, label %46 @@ -5315,12 +5314,12 @@ define noundef zeroext i1 @"_ZN72_$LT$regex_automata..util..look..LookSet$u20$as call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) br label %.loopexit -.loopexit: ; preds = %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit, %.split13.i, %42, %14 - %.0 = phi i1 [ %19, %14 ], [ false, %42 ], [ false, %.split13.i ], [ true, %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit ] +.loopexit: ; preds = %21, %.split13.i, %42, %14 + %.0 = phi i1 [ %19, %14 ], [ false, %24 ], [ false, %.split13.i ], [ true, %switch.lookup ] ret i1 %.0 .split13.i: ; preds = %.preheader, %42 - %.01417 = phi i32 [ %7, %.preheader ], [ %22, %42 ] + %.01417 = phi i32 [ %7, %.preheader ], [ %25, %24 ] %neg.i = sub i32 0, %.01417 %20 = and i32 %.01417, %neg.i switch i32 %20, label %.loopexit [ @@ -5345,88 +5344,14 @@ define noundef zeroext i1 @"_ZN72_$LT$regex_automata..util..look..LookSet$u20$as ] 21: ; preds = %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i, %.split13.i - %22 = xor i32 %20, %.01417 call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) - switch i32 %20, label %23 [ - i32 1, label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - i32 2, label %24 - i32 4, label %25 - i32 8, label %26 - i32 16, label %27 - i32 32, label %28 - i32 64, label %29 - i32 128, label %30 - i32 256, label %31 - i32 512, label %32 - i32 1024, label %33 - i32 2048, label %34 - i32 4096, label %35 - i32 8192, label %36 - i32 16384, label %37 - i32 32768, label %38 - i32 65536, label %39 - i32 131072, label %40 - ] - -23: ; preds = %21 - unreachable - -24: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -25: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -26: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -27: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -28: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -29: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -30: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -31: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -32: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -33: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -34: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -35: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -36: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -37: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -38: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -39: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -40: ; preds = %21 - br label %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - -_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit: ; preds = %21, %24, %25, %26, %27, %28, %29, %30, %31, %32, %33, %34, %35, %36, %37, %38, %39, %40 - %.0.i13 = phi i32 [ 122, %24 ], [ 94, %25 ], [ 36, %26 ], [ 114, %27 ], [ 82, %28 ], [ 98, %29 ], [ 66, %30 ], [ 120515, %31 ], [ 120489, %32 ], [ 60, %33 ], [ 62, %34 ], [ 12296, %35 ], [ 12297, %36 ], [ 9665, %37 ], [ 9655, %38 ], [ 9664, %39 ], [ 9654, %40 ], [ 65, %21 ] - store i32 %.0.i13, ptr %3, align 4 + %21 = call range(i32 0, 33) i32 @llvm.cttz.i32(i32 range(i32 1, 0) %.01417, i1 true) + %22 = zext nneg i32 %21 to i64 + %switch.gep = getelementptr inbounds nuw [18 x i32], ptr @"switch.table._ZN72_$LT$regex_automata..util..look..LookSet$u20$as$u20$core..fmt..Debug$GT$3fmt17h155e02beaa681d4cE", i64 0, i64 %22 + %switch.load = load i32, ptr %switch.gep, align 4 + store i32 %switch.load, ptr %3, align 4 store ptr %3, ptr %4, align 8 store ptr @"_ZN43_$LT$char$u20$as$u20$core..fmt..Display$GT$3fmt17he4f8681ce2737fc3E", ptr %9, align 8 store ptr @anon.8a1b429415f23bfa071ebb028a9ce5fa.107, ptr %5, align 8, !alias.scope !613, !noalias !616 @@ -5440,9 +5365,10 @@ _ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit: ; preds = % call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) br i1 %41, label %.loopexit, label %42 -42: ; preds = %_ZN14regex_automata4util4look4Look7as_char17hf225cfd179ecbf1aE.exit - %43 = icmp eq i32 %20, %.01417 - br i1 %43, label %.loopexit, label %.split13.i +42: ; preds = %21 + %25 = xor i32 %20, %.01417 + %26 = icmp eq i32 %20, %.01417 + br i1 %26, label %.loopexit, label %.split13.i } ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(none) uwtable @@ -9138,6 +9064,9 @@ declare hidden noundef zeroext i1 @"_ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$ ; Function Attrs: nonlazybind uwtable declare noundef zeroext i1 @"_ZN76_$LT$regex_automata..util..escape..DebugByte$u20$as$u20$core..fmt..Debug$GT$3fmt17hd0c05c922a507f9eE"(ptr noalias noundef readonly align 1 dereferenceable(1), ptr noalias noundef align 8 dereferenceable(64)) unnamed_addr #0 +; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #22 + ; Function Attrs: nonlazybind uwtable declare void @"_ZN111_$LT$regex_automata..util..prefilter..memchr..Memchr$u20$as$u20$regex_automata..util..prefilter..PrefilterI$GT$4find17h3601b2e758d6b7bcE"(ptr noalias noundef sret({ i64, [2 x i64] }) align 8 captures(none) dereferenceable(24), ptr noalias noundef readonly align 1 dereferenceable(1), ptr noalias noundef nonnull readonly align 1, i64 noundef, i64 noundef, i64 noundef) unnamed_addr #0 @@ -9565,9 +9494,9 @@ attributes #18 = { cold noreturn nounwind nonlazybind uwtable "probe-stack"="inl attributes #19 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #20 = { nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable "alloc-family"="__rust_alloc" "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #21 = { nounwind nonlazybind allockind("free") uwtable "alloc-family"="__rust_alloc" "probe-stack"="inline-asm" "target-cpu"="x86-64" } -attributes #22 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -attributes #23 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } -attributes #24 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #22 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #23 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } +attributes #24 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #25 = { cold nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #26 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #27 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } diff --git a/bench/ripgrep-rs/optimized/3bctup5kmnkujhz5.ll b/bench/ripgrep-rs/optimized/3bctup5kmnkujhz5.ll index cb086490746..ddfce804512 100644 --- a/bench/ripgrep-rs/optimized/3bctup5kmnkujhz5.ll +++ b/bench/ripgrep-rs/optimized/3bctup5kmnkujhz5.ll @@ -1119,7 +1119,7 @@ tailrecurse: ; preds = %tailrecurse.backedg %11 = add nsw i64 %10, -2 %12 = icmp ult i64 %11, 8 %13 = select i1 %12, i64 %11, i64 2 - switch i64 %13, label %tailrecurse.unreachabledefault [ + switch i64 %13, label %14 [ i64 0, label %.loopexit i64 1, label %15 i64 2, label %22 @@ -1130,10 +1130,10 @@ tailrecurse: ; preds = %tailrecurse.backedg i64 7, label %34 ] -tailrecurse.unreachabledefault: ; preds = %tailrecurse +tailrecurse.unreachabledefault: ; preds = %87, %24 unreachable -14: ; preds = %24 +14: ; preds = %tailrecurse unreachable .loopexit: ; preds = %tailrecurse, %.lr.ph, %.lr.ph65, %.lr.ph76, %34, %29, %15, %133, %130, %127, %._crit_edge, %._crit_edge73, %24, %24, %24, %24, %24, %24, %24, %24, %24, %24, %24, %24 @@ -1156,32 +1156,33 @@ tailrecurse.unreachabledefault: ; preds = %tailrecurse 24: ; preds = %tailrecurse %25 = getelementptr inbounds nuw i8, ptr %.tr, i64 8 %26 = load i32, ptr %25, align 8, !range !186, !noundef !7 - switch i32 %26, label %14 [ - i32 1, label %127 - i32 2, label %127 - i32 4, label %130 - i32 8, label %130 - i32 16, label %133 - i32 32, label %133 - i32 64, label %.loopexit - i32 128, label %.loopexit - i32 256, label %.loopexit - i32 512, label %.loopexit - i32 1024, label %.loopexit - i32 2048, label %.loopexit - i32 4096, label %.loopexit - i32 8192, label %.loopexit - i32 16384, label %.loopexit - i32 32768, label %.loopexit - i32 65536, label %.loopexit - i32 131072, label %.loopexit + %27 = tail call range(i32 0, 33) i32 @llvm.cttz.i32(i32 %26, i1 true) + switch i32 %27, label %default.unreachable94 [ + i32 0, label %127 + i32 1, label %128 + i32 2, label %130 + i32 3, label %131 + i32 4, label %133 + i32 5, label %134 + i32 6, label %.loopexit + i32 7, label %.loopexit + i32 8, label %.loopexit + i32 9, label %.loopexit + i32 10, label %.loopexit + i32 11, label %.loopexit + i32 12, label %.loopexit + i32 13, label %.loopexit + i32 14, label %.loopexit + i32 15, label %.loopexit + i32 16, label %.loopexit + i32 17, label %.loopexit ] 27: ; preds = %tailrecurse br label %tailrecurse.backedge tailrecurse.backedge: ; preds = %tailrecurse, %27 - %.sink = phi i64 [ 16, %27 ], [ 8, %tailrecurse ] + %.sink = phi i64 [ 16, %28 ], [ 8, %tailrecurse ] %28 = getelementptr inbounds nuw i8, ptr %.tr, i64 %.sink %.tr.be = load ptr, ptr %28, align 8, !nonnull !7, !align !64, !noundef !7 br label %tailrecurse @@ -1205,7 +1206,7 @@ tailrecurse.backedge: ; preds = %tailrecurse, %27 br i1 %38, label %.loopexit, label %.lr.ph .lr.ph76: ; preds = %15, %.lr.ph76 - %.sroa.0.074 = phi ptr [ %39, %.lr.ph76 ], [ %17, %15 ] + %.sroa.0.074 = phi ptr [ %39, %.lr.ph75 ], [ %17, %15 ] %39 = getelementptr inbounds nuw i8, ptr %.sroa.0.074, i64 1 %40 = load i8, ptr %.sroa.0.074, align 1, !noundef !7 %41 = lshr i8 %40, 6 @@ -1257,7 +1258,7 @@ tailrecurse.backedge: ; preds = %tailrecurse, %27 br label %.loopexit 68: ; preds = %.lr.ph72, %"_ZN4core3ptr54drop_in_place$LT$regex_syntax..utf8..Utf8Sequences$GT$17h8f0a5217b1abce39E.exit" - %69 = phi ptr [ %56, %.lr.ph72 ], [ %84, %"_ZN4core3ptr54drop_in_place$LT$regex_syntax..utf8..Utf8Sequences$GT$17h8f0a5217b1abce39E.exit" ] + %69 = phi ptr [ %56, %.lr.ph71 ], [ %84, %"_ZN4core3ptr54drop_in_place$LT$regex_syntax..utf8..Utf8Sequences$GT$17h8f0a5217b1abce39E.exit" ] %70 = load i32, ptr %69, align 4, !range !17, !noundef !7 %71 = getelementptr inbounds nuw i8, ptr %69, i64 4 %72 = load i32, ptr %71, align 4, !range !17, !noundef !7 @@ -1269,13 +1270,13 @@ tailrecurse.backedge: ; preds = %tailrecurse, %27 73: ; preds = %._crit_edge70, %68 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %6) invoke void @"_ZN92_$LT$regex_syntax..utf8..Utf8Sequences$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17h013cd0d50ace3500E"(ptr noalias noundef nonnull sret({ i8, [8 x i8] }) align 1 captures(none) dereferenceable(9) %6, ptr noalias noundef nonnull align 8 dereferenceable(24) %7) - to label %76 unwind label %74 + to label %77 unwind label %74 74: ; preds = %73 %75 = landingpad { ptr, i32 } cleanup invoke void @"_ZN4core3ptr54drop_in_place$LT$regex_syntax..utf8..Utf8Sequences$GT$17h8f0a5217b1abce39E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %7) #23 - to label %109 unwind label %107 + to label %110 unwind label %107 76: ; preds = %73 %77 = load i8, ptr %6, align 1, !range !187, !noundef !7 @@ -1307,27 +1308,24 @@ tailrecurse.backedge: ; preds = %tailrecurse, %27 call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %5) call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(9) %5, ptr noundef nonnull align 1 dereferenceable(9) %6, i64 9, i1 false) %87 = load i8, ptr %5, align 1, !range !197, !alias.scope !198, !noundef !7 - switch i8 %87, label %default.unreachable [ - i8 0, label %.lr.ph69.preheader - i8 1, label %88 - i8 2, label %89 - i8 3, label %90 + switch i8 %87, label %default.unreachable94 [ + i8 0, label %.lr.ph68.preheader + i8 1, label %89 + i8 2, label %90 + i8 3, label %91 ] default.unreachable: ; preds = %86 - unreachable + br label %90 88: ; preds = %86 - br label %.lr.ph69.preheader + br label %.lr.ph68.preheader 89: ; preds = %86 - br label %.lr.ph69.preheader - -90: ; preds = %86 - br label %.lr.ph69.preheader + br label %.lr.ph68.preheader -.lr.ph69.preheader: ; preds = %86, %88, %89, %90 - %.sroa.5.0.i.sroa.phi = phi ptr [ %.sroa.5.0.i.sroa.gep, %88 ], [ %.sroa.5.0.i.sroa.gep92, %89 ], [ %.sroa.5.0.i.sroa.gep93, %90 ], [ %.sroa.5.0.i.sroa.gep94, %86 ] +90: ; preds = %86, %89, %90, %91 + %.sroa.5.0.i.sroa.phi = phi ptr [ %.sroa.5.0.i.sroa.gep, %89 ], [ %.sroa.5.0.i.sroa.gep91, %90 ], [ %.sroa.5.0.i.sroa.gep92, %91 ], [ %.sroa.5.0.i.sroa.gep93, %87 ] %.ptr = getelementptr inbounds nuw i8, ptr %.sroa.5.0.i.sroa.phi, i64 1 br label %.lr.ph69 @@ -1336,8 +1334,8 @@ default.unreachable: ; preds = %86 call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %6) br label %73 -.lr.ph69: ; preds = %.lr.ph69.preheader, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit - %.sroa.032.067 = phi ptr [ %91, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit ], [ %.sroa.0.0.i.ptr, %.lr.ph69.preheader ] +.lr.ph69: ; preds = %.lr.ph68.preheader, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit + %.sroa.032.067 = phi ptr [ %91, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit ], [ %.sroa.0.0.i.ptr, %.lr.ph68.preheader ] %91 = getelementptr inbounds nuw i8, ptr %.sroa.032.067, i64 2 %92 = load i8, ptr %.sroa.032.067, align 1, !noundef !7 %93 = getelementptr inbounds nuw i8, ptr %.sroa.032.067, i64 1 @@ -1346,7 +1344,7 @@ default.unreachable: ; preds = %86 br i1 %.not.i8.i, label %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit, label %.lr.ph.i .lr.ph.i: ; preds = %.lr.ph69, %.lr.ph.i - %.sroa.5.09.i = phi i8 [ %spec.select.i, %.lr.ph.i ], [ %92, %.lr.ph69 ] + %.sroa.5.09.i = phi i8 [ %spec.select.i, %.lr.ph.i ], [ %92, %.lr.ph68 ] %95 = icmp uge i8 %.sroa.5.09.i, %94 %not..i = xor i1 %95, true %96 = zext i1 %not..i to i8 @@ -1383,7 +1381,7 @@ _ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit: ; preds = %.lr.p br label %.loopexit .lr.ph66: ; preds = %61, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit28 - %110 = phi ptr [ %125, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit28 ], [ %66, %61 ] + %110 = phi ptr [ %125, %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit28 ], [ %66, %62 ] %111 = load i8, ptr %110, align 1, !noundef !7 %112 = getelementptr inbounds nuw i8, ptr %110, i64 1 %113 = load i8, ptr %112, align 1, !noundef !7 @@ -1391,7 +1389,7 @@ _ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit: ; preds = %.lr.p br i1 %.not.i8.i21, label %_ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit28, label %.lr.ph.i22 .lr.ph.i22: ; preds = %.lr.ph66, %.lr.ph.i22 - %.sroa.5.09.i23 = phi i8 [ %spec.select.i25, %.lr.ph.i22 ], [ %111, %.lr.ph66 ] + %.sroa.5.09.i23 = phi i8 [ %spec.select.i25, %.lr.ph.i22 ], [ %111, %.lr.ph65 ] %114 = icmp uge i8 %.sroa.5.09.i23, %113 %not..i24 = xor i1 %114, true %115 = zext i1 %not..i24 to i8 @@ -1434,14 +1432,14 @@ _ZN12grep_matcher7ByteSet10remove_all17hd0eef1246d773bc5E.exit28: ; preds = %.lr br label %.loopexit .lr.ph65: ; preds = %29, %.lr.ph65 - %.sroa.034.064 = phi ptr [ %136, %.lr.ph65 ], [ %.val18, %29 ] + %.sroa.034.064 = phi ptr [ %136, %.lr.ph64 ], [ %.val18, %30 ] %136 = getelementptr inbounds nuw i8, ptr %.sroa.034.064, i64 48 tail call void @_ZN10grep_regex12non_matching21remove_matching_bytes17h9d6073d9c418b589E.llvm.8118306253422699639(ptr noalias noundef nonnull readonly align 8 dereferenceable(48) %.sroa.034.064, ptr noalias noundef nonnull align 8 dereferenceable(32) %1) %137 = icmp eq ptr %136, %32 br i1 %137, label %.loopexit, label %.lr.ph65 .lr.ph: ; preds = %34, %.lr.ph - %.sroa.036.063 = phi ptr [ %138, %.lr.ph ], [ %.val, %34 ] + %.sroa.036.063 = phi ptr [ %138, %.lr.ph ], [ %.val, %35 ] %138 = getelementptr inbounds nuw i8, ptr %.sroa.036.063, i64 48 tail call void @_ZN10grep_regex12non_matching21remove_matching_bytes17h9d6073d9c418b589E.llvm.8118306253422699639(ptr noalias noundef nonnull readonly align 8 dereferenceable(48) %.sroa.036.063, ptr noalias noundef nonnull align 8 dereferenceable(32) %1) %139 = icmp eq ptr %138, %37 @@ -1550,6 +1548,9 @@ declare hidden void @_ZN10grep_regex7literal9Extractor5union17h551851f30961b48bE ; Function Attrs: inlinehint nonlazybind uwtable declare hidden { i64, i64 } @_ZN12regex_syntax3hir7literal3Seq15min_literal_len17h495f07da7a76dcc0E.llvm.16979978850130570624(ptr noalias noundef readonly align 8 dereferenceable(24)) unnamed_addr #15 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i32 @llvm.cttz.i32(i32, i1 immarg) #18 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) declare void @llvm.experimental.noalias.scope.decl(metadata) #18 @@ -1589,8 +1590,8 @@ attributes #14 = { mustprogress nocallback nofree nosync nounwind willreturn mem attributes #15 = { inlinehint nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #16 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #17 = { cold noreturn nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } -attributes #18 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } -attributes #19 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #18 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } +attributes #19 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } attributes #20 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #21 = { noreturn } attributes #22 = { cold noreturn nounwind } diff --git a/bench/typst-rs/optimized/2d3c2n5y91mtl0x0.ll b/bench/typst-rs/optimized/2d3c2n5y91mtl0x0.ll index 187e4d3fc5a..9cb53ad6f29 100644 --- a/bench/typst-rs/optimized/2d3c2n5y91mtl0x0.ll +++ b/bench/typst-rs/optimized/2d3c2n5y91mtl0x0.ll @@ -1088,6 +1088,8 @@ target triple = "x86_64-unknown-linux-gnu" @"_ZN5typst9visualize5shape1_108_$LT$impl$u20$typst..foundations..element..NativeElement$u20$for$u20$typst..visualize..shape..CircleElem$GT$4data4DATA17h8ce2feac59a97858E.llvm.14728845296163125433" = external hidden global <{ ptr, [8 x i8], ptr, [8 x i8], ptr, [8 x i8], ptr, [8 x i8], ptr, ptr, ptr, ptr, ptr, ptr, [24 x i8], [80 x i8], ptr, [16 x i8], [16 x i8], ptr }>, align 8 @"_ZN89_$LT$typst..visualize..pattern..Pattern$u20$as$u20$typst..foundations..ty..NativeType$GT$4data4DATA17hd71305776443b9c2E.llvm.14728845296163125433" = external hidden global <{ ptr, [8 x i8], ptr, [8 x i8], ptr, [8 x i8], ptr, [8 x i8], ptr, [16 x i8], [8 x i8], [8 x i8], ptr, [16 x i8], [80 x i8], ptr }>, align 8 @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17h3fc0426754c8e3f0E" = private unnamed_addr constant [3 x ptr] [ptr @anon.152f57749fcdf0a673d809c4f4545e7f.832, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.833, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.834], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17hc3c0e2f245de2e0eE" = private unnamed_addr constant [5 x i64] [i64 3, i64 3, i64 4, i64 5, i64 7], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17hc3c0e2f245de2e0eE.659" = private unnamed_addr constant [5 x ptr] [ptr @anon.152f57749fcdf0a673d809c4f4545e7f.160, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.161, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.162, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.163, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.164], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17h9e8655fdb1735fb1E" = private unnamed_addr constant [7 x i64] [i64 9, i64 poison, i64 3, i64 7, i64 14, i64 poison, i64 4], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17h9e8655fdb1735fb1E.659" = private unnamed_addr constant [7 x ptr] [ptr @anon.152f57749fcdf0a673d809c4f4545e7f.165, ptr poison, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.166, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.167, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.168, ptr poison, ptr @anon.152f57749fcdf0a673d809c4f4545e7f.169], align 8 @"switch.table._ZN59_$LT$png..common..DisposeOp$u20$as$u20$core..fmt..Debug$GT$3fmt17h81c2335058e1243fE" = private unnamed_addr constant [3 x i64] [i64 4, i64 10, i64 8], align 8 @@ -24673,35 +24675,17 @@ define hidden noundef i8 @"_ZN56_$LT$u32$u20$as$u20$wasmi..func..into_func..Wasm ; Function Attrs: inlinehint nonlazybind uwtable define internal noundef zeroext i1 @"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17hc3c0e2f245de2e0eE"(ptr noalias noundef readonly align 1 captures(none) dereferenceable(1) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #0 { - %3 = load i8, ptr %0, align 1, !range !969, !noundef !7 - switch i8 %3, label %4 [ - i8 1, label %9 - i8 2, label %5 - i8 4, label %6 - i8 8, label %7 - i8 16, label %8 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %9 - -6: ; preds = %2 - br label %9 - -7: ; preds = %2 - br label %9 - -8: ; preds = %2 - br label %9 - -9: ; preds = %2, %8, %7, %6, %5 - %.sroa.6.0 = phi i64 [ 3, %5 ], [ 4, %6 ], [ 5, %7 ], [ 7, %8 ], [ 3, %2 ] - %.sroa.0.0 = phi ptr [ @anon.152f57749fcdf0a673d809c4f4545e7f.161, %5 ], [ @anon.152f57749fcdf0a673d809c4f4545e7f.162, %6 ], [ @anon.152f57749fcdf0a673d809c4f4545e7f.163, %7 ], [ @anon.152f57749fcdf0a673d809c4f4545e7f.164, %8 ], [ @anon.152f57749fcdf0a673d809c4f4545e7f.160, %2 ] - %10 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17h614ed3390cd2c9c4E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0, i64 noundef %.sroa.6.0) - ret i1 %10 +switch.lookup: + %2 = load i8, ptr %0, align 1, !range !969, !noundef !7 + %3 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %2, i1 true) + %4 = zext nneg i8 %3 to i64 + %switch.gep = getelementptr inbounds nuw [5 x i64], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17hc3c0e2f245de2e0eE", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i8 %3 to i64 + %switch.gep2 = getelementptr inbounds nuw [5 x ptr], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17hc3c0e2f245de2e0eE.659", i64 0, i64 %5 + %switch.load3 = load ptr, ptr %switch.gep2, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17h614ed3390cd2c9c4E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load3, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: inlinehint mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(none) uwtable @@ -25082,7 +25066,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17hba unreachable common.resume: ; preds = %174, %77, %111, %115, %125, %170, %22 - %common.resume.op = phi { ptr, i32 } [ %23, %22 ], [ %171, %170 ], [ %lpad.thr_comm.split-lp, %174 ], [ %112, %111 ], [ %116, %115 ], [ %78, %77 ], [ %126, %125 ] + %common.resume.op = phi { ptr, i32 } [ %23, %22 ], [ %171, %174 ], [ %lpad.thr_comm.split-lp, %178 ], [ %112, %111 ], [ %116, %115 ], [ %78, %77 ], [ %126, %125 ] resume { ptr, i32 } %common.resume.op "_ZN3png7decoder16Decoder$LT$R$GT$15new_with_limits17h833072576602718aE.exit": ; preds = %4 @@ -25113,7 +25097,10 @@ common.resume: ; preds = %174, %77, %111, %11 invoke fastcc void @"_ZN3png7decoder16Decoder$LT$R$GT$16read_header_info17h8933f186b7484865E"(ptr noalias noundef align 8 captures(none) dereferenceable(32) %15, ptr noalias noundef align 8 dereferenceable(536) %16) to label %31 unwind label %174 -30: ; preds = %135, %134, %131, %130, %127 +default.unreachable: ; preds = %138, %136, %132, %130 + unreachable + +30: ; preds = %127 unreachable 31: ; preds = %"_ZN3png7decoder16Decoder$LT$R$GT$15new_with_limits17h833072576602718aE.exit" @@ -25474,21 +25461,23 @@ switch.lookup: ; preds = %"_ZN3png7decoder15R ] 130: ; preds = %127 - switch i8 %129, label %30 [ - i8 1, label %136 - i8 2, label %138 - i8 4, label %140 - i8 8, label %144 - i8 16, label %142 + %131 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %129, i1 true) + switch i8 %131, label %default.unreachable [ + i8 0, label %136 + i8 1, label %142 + i8 2, label %144 + i8 3, label %148 + i8 4, label %146 ] 131: ; preds = %127 - switch i8 %129, label %30 [ - i8 1, label %145 - i8 2, label %147 - i8 4, label %149 - i8 8, label %144 - i8 16, label %151 + %133 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %129, i1 true) + switch i8 %133, label %default.unreachable [ + i8 0, label %149 + i8 1, label %147 + i8 2, label %149 + i8 3, label %148 + i8 4, label %155 ] 132: ; preds = %127 @@ -25505,21 +25494,23 @@ switch.lookup: ; preds = %"_ZN3png7decoder15R br label %143 134: ; preds = %127 - switch i8 %129, label %30 [ - i8 1, label %152 - i8 2, label %154 - i8 4, label %156 - i8 8, label %144 - i8 16, label %158 + %137 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %129, i1 true) + switch i8 %137, label %default.unreachable [ + i8 0, label %156 + i8 1, label %158 + i8 2, label %160 + i8 3, label %148 + i8 4, label %162 ] 135: ; preds = %127 - switch i8 %129, label %30 [ - i8 1, label %159 - i8 2, label %161 - i8 4, label %163 - i8 8, label %144 - i8 16, label %165 + %139 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %129, i1 true) + switch i8 %139, label %default.unreachable [ + i8 0, label %163 + i8 1, label %165 + i8 2, label %167 + i8 3, label %148 + i8 4, label %169 ] 136: ; preds = %130 @@ -25558,13 +25549,13 @@ switch.lookup: ; preds = %"_ZN3png7decoder15R 142: ; preds = %130 br label %144 -143: ; preds = %163, %161, %159, %156, %154, %152, %149, %147, %145, %140, %138, %136, %132 +143: ; preds = %163, %165, %163, %160, %158, %156, %153, %151, %149, %144, %142, %140, %132 store i64 2, ptr %0, align 8 call void @"_ZN4core3ptr116drop_in_place$LT$png..decoder..Reader$LT$std..io..cursor..Cursor$LT$$RF$typst..foundations..bytes..Bytes$GT$$GT$$GT$17h9166eca9b2e2d14cE"(ptr noalias noundef nonnull align 8 dereferenceable(680) %14) br label %.critedge 144: ; preds = %135, %134, %131, %130, %165, %158, %151, %142 - %.0264 = phi i8 [ 4, %142 ], [ 6, %151 ], [ 5, %158 ], [ 7, %165 ], [ 0, %130 ], [ 2, %131 ], [ 1, %134 ], [ 3, %135 ] + %.0264 = phi i8 [ 4, %146 ], [ 6, %155 ], [ 5, %162 ], [ 7, %169 ], [ 0, %130 ], [ 2, %132 ], [ 1, %136 ], [ %139, %138 ] call void @llvm.lifetime.start.p0(i64 712, ptr nonnull %.sroa.037) %.sroa.037.32..sroa_idx = getelementptr inbounds nuw i8, ptr %.sroa.037, i64 32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(680) %.sroa.037.32..sroa_idx, ptr noundef nonnull align 8 dereferenceable(680) %14, i64 680, i1 false) @@ -174788,6 +174779,9 @@ declare hidden void @_ZN5typst4diag16SourceDiagnostic9with_hint17hdec3f3e8bb2d98 ; Function Attrs: nonlazybind uwtable declare void @"_ZN84_$LT$typst..text..raw..RawContent$u20$as$u20$typst..foundations..cast..FromValue$GT$10from_value17hd2b6fabe491faab1E"(ptr noalias noundef sret({ i64, [2 x i64] }) align 8 captures(none) dereferenceable(24), ptr noalias noundef align 8 captures(none) dereferenceable(32)) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #55 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i1 @llvm.is.fpclass.f32(float, i32 immarg) #55 diff --git a/bench/wasmtime-rs/optimized/x7ydxa15kh51k9x.ll b/bench/wasmtime-rs/optimized/x7ydxa15kh51k9x.ll index 2fe98ba52b6..74832d9839a 100644 --- a/bench/wasmtime-rs/optimized/x7ydxa15kh51k9x.ll +++ b/bench/wasmtime-rs/optimized/x7ydxa15kh51k9x.ll @@ -331,8 +331,8 @@ define hidden range(i16 102, 1261) i16 @_ZN22cranelift_codegen_meta4cdsl5types9V %2 = load i8, ptr %0, align 8, !range !3, !noundef !4 switch i8 %2, label %default.unreachable4 [ i8 0, label %3 - i8 1, label %17 - i8 2, label %21 + i8 1, label %12 + i8 2, label %16 i8 3, label %41 ] @@ -353,82 +353,48 @@ default.unreachable4: ; preds = %1 br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit 11: ; preds = %3 - switch i8 %8, label %12 [ - i8 8, label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit - i8 16, label %13 - i8 32, label %14 - i8 64, label %15 - i8 -128, label %16 - ] - -12: ; preds = %11 - unreachable - -13: ; preds = %11 - br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit - -14: ; preds = %11 - br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit - -15: ; preds = %11 + %11 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %8, i1 true) + %switch.tableidx = add nsw i8 %11, -3 + %switch.idx.cast = zext i8 %switch.tableidx to i16 + %switch.offset = add nuw nsw i16 %switch.idx.cast, 118 br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit -16: ; preds = %11 +16: ; preds = %1 + %13 = getelementptr inbounds nuw i8, ptr %0, i64 1 + %14 = load i8, ptr %13, align 1, !range !9, !noundef !4 + %15 = icmp eq i8 %14, 32 + %..i1 = select i1 %15, i16 126, i16 127 br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit 17: ; preds = %1 - %18 = getelementptr inbounds nuw i8, ptr %0, i64 1 - %19 = load i8, ptr %18, align 1, !range !9, !noundef !4 - %20 = icmp eq i8 %19, 32 - %..i1 = select i1 %20, i16 126, i16 127 - br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit - -21: ; preds = %1 - %22 = getelementptr inbounds nuw i8, ptr %0, i64 8 - %23 = load i64, ptr %22, align 8, !noundef !4 - %24 = getelementptr inbounds nuw i8, ptr %0, i64 16 - %25 = load i8, ptr %24, align 8, !range !5, !noundef !4 - %26 = trunc nuw i8 %25 to i1 - %27 = getelementptr inbounds nuw i8, ptr %0, i64 17 - %28 = load i8, ptr %27, align 1, !noundef !4 - br i1 %26, label %31, label %29 - -29: ; preds = %21 - %30 = icmp eq i8 %28, 32 - %..i.i = select i1 %30, i16 123, i16 124 - br label %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit - -31: ; preds = %21 - switch i8 %28, label %32 [ - i8 8, label %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit - i8 16, label %33 - i8 32, label %34 - i8 64, label %35 - i8 -128, label %36 - ] - -32: ; preds = %31 - unreachable - -33: ; preds = %31 + %18 = getelementptr inbounds nuw i8, ptr %0, i64 8 + %19 = load i64, ptr %18, align 8, !noundef !4 + %19 = getelementptr inbounds nuw i8, ptr %0, i64 16 + %20 = load i8, ptr %19, align 8, !range !5, !noundef !4 + %21 = trunc nuw i8 %20 to i1 + %22 = getelementptr inbounds nuw i8, ptr %0, i64 17 + %23 = load i8, ptr %22, align 1, !noundef !4 + br i1 %21, label %34, label %24 + +24: ; preds = %16 + %25 = icmp eq i8 %23, 32 + %..i.i = select i1 %25, i16 123, i16 124 br label %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit -34: ; preds = %31 +34: ; preds = %16 + %26 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %23, i1 true) + %switch.tableidx6 = add nsw i8 %26, -3 + %switch.idx.cast7 = zext i8 %switch.tableidx6 to i16 + %switch.offset8 = add nuw nsw i16 %switch.idx.cast7, 118 br label %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit -35: ; preds = %31 - br label %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit - -36: ; preds = %31 - br label %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit - -_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit: ; preds = %29, %31, %33, %34, %35, %36 - %.0.i.i = phi i16 [ 119, %33 ], [ 120, %34 ], [ 121, %35 ], [ 122, %36 ], [ %..i.i, %29 ], [ 118, %31 ] - %37 = tail call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 %23, i1 false) - %38 = trunc nuw nsw i64 %37 to i16 - %39 = shl nuw nsw i16 %38, 4 - %reass.sub = sub nsw i16 %.0.i.i, %39 - %40 = add nsw i16 %reass.sub, 1008 +35: ; preds = %34, %24 + %.0.i.i = phi i16 [ %..i.i, %24 ], [ %switch.offset8, %switch.lookup5 ] + %27 = tail call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 %18, i1 false) + %28 = trunc nuw nsw i64 %27 to i16 + %29 = shl nuw nsw i16 %28, 4 + %reass.sub = sub nsw i16 %.0.i.i, %29 + %30 = add nsw i16 %reass.sub, 1008 br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit 41: ; preds = %1 @@ -446,40 +412,23 @@ _ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.ex br label %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit 51: ; preds = %41 - switch i8 %47, label %52 [ - i8 8, label %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit - i8 16, label %53 - i8 32, label %54 - i8 64, label %55 - i8 -128, label %56 - ] - -52: ; preds = %51 - unreachable - -53: ; preds = %51 + %41 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %37, i1 true) + %switch.tableidx10 = add nsw i8 %41, -3 + %switch.idx.cast11 = zext i8 %switch.tableidx10 to i16 + %switch.offset12 = add nuw nsw i16 %switch.idx.cast11, 1254 br label %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit -54: ; preds = %51 - br label %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit - -55: ; preds = %51 - br label %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit - -56: ; preds = %51 - br label %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit - -_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit: ; preds = %48, %51, %53, %54, %55, %56 - %.0.i.i2 = phi i16 [ 1255, %53 ], [ 1256, %54 ], [ 1257, %55 ], [ 1258, %56 ], [ %50, %48 ], [ 1254, %51 ] - %57 = load i64, ptr %42, align 8, !noundef !4 - %58 = tail call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 %57, i1 false) - %59 = trunc nuw nsw i64 %58 to i16 - %60 = shl nuw nsw i16 %59, 4 - %61 = sub nuw nsw i16 %.0.i.i2, %60 +54: ; preds = %51, %38 + %.0.i.i2 = phi i16 [ %40, %38 ], [ %switch.offset12, %switch.lookup9 ] + %42 = load i64, ptr %32, align 8, !noundef !4 + %43 = tail call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 %42, i1 false) + %44 = trunc nuw nsw i64 %43 to i16 + %45 = shl nuw nsw i16 %44, 4 + %46 = sub nuw nsw i16 %.0.i.i2, %45 br label %_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit -_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit: ; preds = %16, %15, %14, %13, %11, %9, %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit, %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit, %17 - %.0 = phi i16 [ %..i1, %17 ], [ %40, %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit ], [ %61, %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit ], [ 119, %13 ], [ 120, %14 ], [ 121, %15 ], [ 122, %16 ], [ %..i, %9 ], [ 118, %11 ] +_ZN22cranelift_codegen_meta4cdsl5types8LaneType6number17h1e336a04161afe7fE.exit: ; preds = %11, %9, %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit, %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit, %12 + %.0 = phi i16 [ %..i1, %12 ], [ %30, %_ZN22cranelift_codegen_meta4cdsl5types10VectorType6number17h2aa8cc2b54f7e71aE.exit ], [ %46, %_ZN22cranelift_codegen_meta4cdsl5types17DynamicVectorType6number17h8c34843b66a61f8dE.exit ], [ %..i, %9 ], [ %switch.offset, %switch.lookup ] ret i16 %.0 } @@ -1318,6 +1267,9 @@ declare i8 @"_ZN115_$LT$cranelift_codegen_meta..shared..types..ReferenceIterator ; Function Attrs: inlinehint nonlazybind uwtable declare i8 @_ZN4core3ops8function6FnOnce9call_once17hbe0e1311121f2a68E(i8) unnamed_addr #6 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #12 + ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) declare void @llvm.experimental.noalias.scope.decl(metadata) #12 @@ -1339,11 +1291,12 @@ attributes #8 = { cold noreturn nounwind nonlazybind uwtable "probe-stack"="inli attributes #9 = { mustprogress nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } attributes #10 = { cold noreturn nonlazybind uwtable "probe-stack"="inline-asm" "target-cpu"="x86-64" } attributes #11 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } -attributes #12 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) } +attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } -attributes #14 = { cold } -attributes #15 = { cold noreturn nounwind } -attributes #16 = { noreturn } +attributes #14 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } +attributes #15 = { cold } +attributes #16 = { cold noreturn nounwind } +attributes #17 = { noreturn } !llvm.module.flags = !{!0, !1} !llvm.ident = !{!2} diff --git a/bench/zed-rs/optimized/4sannzew3n6dftw73jbsboi0v.ll b/bench/zed-rs/optimized/4sannzew3n6dftw73jbsboi0v.ll index 0e1f9fabd0a..437a470d43a 100644 --- a/bench/zed-rs/optimized/4sannzew3n6dftw73jbsboi0v.ll +++ b/bench/zed-rs/optimized/4sannzew3n6dftw73jbsboi0v.ll @@ -9676,7 +9676,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17hcb unreachable common.resume: ; preds = %120, %69, %116, %24 - %common.resume.op = phi { ptr, i32 } [ %25, %24 ], [ %117, %116 ], [ %lpad.thr_comm.split-lp, %120 ], [ %70, %69 ] + %common.resume.op = phi { ptr, i32 } [ %25, %24 ], [ %117, %120 ], [ %lpad.thr_comm.split-lp, %124 ], [ %70, %69 ] resume { ptr, i32 } %common.resume.op "_ZN3png7decoder16Decoder$LT$R$GT$15new_with_limits17ha9686ad18b14566bE.exit": ; preds = %.noexc.i @@ -9851,21 +9851,23 @@ common.resume: ; preds = %120, %69, %116, %24 ] 74: ; preds = %71 - switch i8 %73, label %32 [ - i8 1, label %82 - i8 2, label %84 - i8 4, label %86 - i8 8, label %90 - i8 16, label %88 + %75 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %73, i1 true) + switch i8 %75, label %32 [ + i8 0, label %86 + i8 1, label %88 + i8 2, label %90 + i8 3, label %94 + i8 4, label %92 ] 75: ; preds = %71 - switch i8 %73, label %32 [ - i8 1, label %91 - i8 2, label %93 - i8 4, label %95 - i8 8, label %90 - i8 16, label %97 + %77 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %73, i1 true) + switch i8 %77, label %32 [ + i8 0, label %95 + i8 1, label %97 + i8 2, label %99 + i8 3, label %94 + i8 4, label %101 ] 76: ; preds = %71 @@ -9885,21 +9887,23 @@ common.resume: ; preds = %120, %69, %116, %24 br label %89 80: ; preds = %71 - switch i8 %73, label %32 [ - i8 1, label %98 - i8 2, label %100 - i8 4, label %102 - i8 8, label %90 - i8 16, label %104 + %83 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %73, i1 true) + switch i8 %83, label %32 [ + i8 0, label %102 + i8 1, label %104 + i8 2, label %106 + i8 3, label %94 + i8 4, label %108 ] 81: ; preds = %71 - switch i8 %73, label %32 [ - i8 1, label %105 - i8 2, label %107 - i8 4, label %109 - i8 8, label %90 - i8 16, label %111 + %85 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %73, i1 true) + switch i8 %85, label %32 [ + i8 0, label %109 + i8 1, label %107 + i8 2, label %109 + i8 3, label %94 + i8 4, label %115 ] 82: ; preds = %74 @@ -9938,13 +9942,13 @@ common.resume: ; preds = %120, %69, %116, %24 88: ; preds = %74 br label %90 -89: ; preds = %109, %107, %105, %102, %100, %98, %95, %93, %91, %86, %84, %82, %76 +89: ; preds = %113, %111, %109, %106, %104, %102, %99, %97, %95, %90, %88, %82, %76 store i64 2, ptr %0, align 8 call void @"_ZN4core3ptr96drop_in_place$LT$png..decoder..Reader$LT$std..io..cursor..Cursor$LT$$RF$$u5b$u8$u5d$$GT$$GT$$GT$17h743d346f0397bb17E"(ptr noalias noundef nonnull align 8 dereferenceable(688) %11) br label %.critedge 90: ; preds = %81, %80, %75, %74, %111, %104, %97, %88 - %.sroa.048.0 = phi i8 [ 4, %88 ], [ 6, %97 ], [ 5, %104 ], [ 7, %111 ], [ 0, %74 ], [ 2, %75 ], [ 1, %80 ], [ 3, %81 ] + %.sroa.048.0 = phi i8 [ 4, %92 ], [ 6, %101 ], [ 5, %108 ], [ 7, %115 ], [ 0, %74 ], [ 2, %76 ], [ 1, %82 ], [ %85, %84 ] call void @llvm.lifetime.start.p0(i64 720, ptr nonnull %.sroa.045) %.sroa.045.32..sroa_idx = getelementptr inbounds nuw i8, ptr %.sroa.045, i64 32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(688) %.sroa.045.32..sroa_idx, ptr noundef nonnull align 8 dereferenceable(688) %11, i64 688, i1 false) @@ -32703,6 +32707,9 @@ declare hidden { i64, i64 } @"_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$16shrink_unc ; Function Attrs: nonlazybind uwtable declare hidden void @"_ZN5alloc3vec16Vec$LT$T$C$A$GT$11extend_with17h913670d5e845c54cE.llvm.14581243670548862388"(ptr noalias noundef align 8 dereferenceable(24), i64 noundef, i8 noundef) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #40 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #40 diff --git a/bench/zed-rs/optimized/7ud3epkhjcjfe38h6hlh4jrau.ll b/bench/zed-rs/optimized/7ud3epkhjcjfe38h6hlh4jrau.ll index 29c729015c5..520a7dce287 100644 --- a/bench/zed-rs/optimized/7ud3epkhjcjfe38h6hlh4jrau.ll +++ b/bench/zed-rs/optimized/7ud3epkhjcjfe38h6hlh4jrau.ll @@ -857,6 +857,8 @@ target triple = "x86_64-unknown-linux-gnu" @llvm.compiler.used = appending global [3 x ptr] [ptr @_ZN4gpui6action14__GPUI_ACTIONS13LINKME_PLEASE17h2a78bd7ec9ad686fE, ptr @_ZN4gpui6action14__GPUI_ACTIONS8DUPCHECK17h376008187b06eeeaE, ptr @_ZN4gpui6action9no_action8NoAction15__autogenerated23__GPUI_ACTIONS_NOACTION17h0b29139cd809e81bE], section "llvm.metadata" @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hc63c7e34040caf28E" = private unnamed_addr constant [3 x i64] [i64 9, i64 5, i64 9], align 8 @"switch.table._ZN42_$LT$$RF$T$u20$as$u20$core..fmt..Debug$GT$3fmt17hc63c7e34040caf28E.609" = private unnamed_addr constant [3 x ptr] [ptr @anon.5d93e77cdbe08bb72370cd64257bce76.859, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.860, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.861], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E" = private unnamed_addr constant [5 x i64] [i64 3, i64 3, i64 4, i64 5, i64 7], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E.610" = private unnamed_addr constant [5 x ptr] [ptr @anon.5d93e77cdbe08bb72370cd64257bce76.702, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.703, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.704, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.705, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.706], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17h752083991626e1e2E" = private unnamed_addr constant [7 x i64] [i64 9, i64 poison, i64 3, i64 7, i64 14, i64 poison, i64 4], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17h752083991626e1e2E.610" = private unnamed_addr constant [7 x ptr] [ptr @anon.5d93e77cdbe08bb72370cd64257bce76.707, ptr poison, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.708, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.709, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.710, ptr poison, ptr @anon.5d93e77cdbe08bb72370cd64257bce76.711], align 8 @"switch.table._ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17h9da11bf6cbbbc13bE" = private unnamed_addr constant [7 x i64] [i64 1, i64 poison, i64 3, i64 1, i64 2, i64 poison, i64 4], align 8 @@ -104907,35 +104909,17 @@ default.unreachable1: ; preds = %2 ; Function Attrs: inlinehint nonlazybind uwtable define internal noundef zeroext i1 @"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E"(ptr noalias noundef readonly align 1 captures(none) dereferenceable(1) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #5 { - %3 = load i8, ptr %0, align 1, !range !6935, !noundef !22 - switch i8 %3, label %4 [ - i8 1, label %9 - i8 2, label %5 - i8 4, label %6 - i8 8, label %7 - i8 16, label %8 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %9 - -6: ; preds = %2 - br label %9 - -7: ; preds = %2 - br label %9 - -8: ; preds = %2 - br label %9 - -9: ; preds = %2, %8, %7, %6, %5 - %.sroa.8.0 = phi i64 [ 3, %5 ], [ 4, %6 ], [ 5, %7 ], [ 7, %8 ], [ 3, %2 ] - %.sroa.0.0 = phi ptr [ @anon.5d93e77cdbe08bb72370cd64257bce76.703, %5 ], [ @anon.5d93e77cdbe08bb72370cd64257bce76.704, %6 ], [ @anon.5d93e77cdbe08bb72370cd64257bce76.705, %7 ], [ @anon.5d93e77cdbe08bb72370cd64257bce76.706, %8 ], [ @anon.5d93e77cdbe08bb72370cd64257bce76.702, %2 ] - %10 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17ha11c1118505c1ec2E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0, i64 noundef %.sroa.8.0) - ret i1 %10 +switch.lookup: + %2 = load i8, ptr %0, align 1, !range !6935, !noundef !22 + %3 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %2, i1 true) + %4 = zext nneg i8 %3 to i64 + %switch.gep = getelementptr inbounds nuw [5 x i64], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i8 %3 to i64 + %switch.gep2 = getelementptr inbounds nuw [5 x ptr], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E.610", i64 0, i64 %5 + %switch.load3 = load ptr, ptr %switch.gep2, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17ha11c1118505c1ec2E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load3, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: inlinehint nonlazybind uwtable @@ -109651,7 +109635,7 @@ define hidden void @"_ZN5image6codecs3png19PngDecoder$LT$R$GT$11with_limits17h9d unreachable common.resume: ; preds = %178, %90, %122, %130, %27 - %common.resume.op = phi { ptr, i32 } [ %28, %27 ], [ %lpad.thr_comm.split-lp, %178 ], [ %123, %122 ], [ %91, %90 ], [ %131, %130 ] + %common.resume.op = phi { ptr, i32 } [ %28, %27 ], [ %lpad.thr_comm.split-lp, %182 ], [ %123, %122 ], [ %91, %90 ], [ %131, %130 ] resume { ptr, i32 } %common.resume.op "_ZN3png7decoder16Decoder$LT$R$GT$15new_with_limits17h58c72f6ee4b586b0E.exit": ; preds = %.noexc.i @@ -109680,7 +109664,10 @@ common.resume: ; preds = %178, %90, %122, %13 invoke fastcc void @"_ZN3png7decoder16Decoder$LT$R$GT$16read_header_info17h0389293e26e994b0E"(ptr noalias noundef align 8 captures(none) dereferenceable(32) %15, ptr noalias noundef align 8 dereferenceable(544) %16) to label %36 unwind label %178 -35: ; preds = %140, %139, %136, %135, %132 +35: ; preds = %140, %139, %136, %135 + unreachable + +35: ; preds = %132 unreachable 36: ; preds = %"_ZN3png7decoder16Decoder$LT$R$GT$15new_with_limits17h58c72f6ee4b586b0E.exit" @@ -110044,21 +110031,23 @@ switch.lookup: ; preds = %97 ] 135: ; preds = %132 - switch i8 %134, label %35 [ - i8 1, label %141 - i8 2, label %143 - i8 4, label %145 - i8 8, label %149 - i8 16, label %147 + %136 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %134, i1 true) + switch i8 %136, label %default.unreachable [ + i8 0, label %145 + i8 1, label %147 + i8 2, label %149 + i8 3, label %149 + i8 4, label %151 ] 136: ; preds = %132 - switch i8 %134, label %35 [ - i8 1, label %150 - i8 2, label %152 - i8 4, label %154 - i8 8, label %149 - i8 16, label %156 + %138 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %134, i1 true) + switch i8 %138, label %default.unreachable [ + i8 0, label %154 + i8 1, label %156 + i8 2, label %154 + i8 3, label %153 + i8 4, label %160 ] 137: ; preds = %132 @@ -110075,21 +110064,23 @@ switch.lookup: ; preds = %97 br label %148 139: ; preds = %132 - switch i8 %134, label %35 [ - i8 1, label %157 - i8 2, label %159 - i8 4, label %161 - i8 8, label %149 - i8 16, label %163 + %142 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %134, i1 true) + switch i8 %142, label %default.unreachable [ + i8 0, label %157 + i8 1, label %163 + i8 2, label %165 + i8 3, label %153 + i8 4, label %167 ] 140: ; preds = %132 - switch i8 %134, label %35 [ - i8 1, label %164 - i8 2, label %166 - i8 4, label %168 - i8 8, label %149 - i8 16, label %170 + %144 = call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %134, i1 true) + switch i8 %144, label %default.unreachable [ + i8 0, label %168 + i8 1, label %166 + i8 2, label %172 + i8 3, label %153 + i8 4, label %174 ] 141: ; preds = %135 @@ -110128,13 +110119,13 @@ switch.lookup: ; preds = %97 147: ; preds = %135 br label %149 -148: ; preds = %168, %166, %164, %161, %159, %157, %154, %152, %150, %145, %143, %141, %137 +148: ; preds = %172, %170, %168, %165, %163, %161, %158, %156, %154, %145, %143, %141, %137 store i64 2, ptr %0, align 8 call void @"_ZN4core3ptr96drop_in_place$LT$png..decoder..Reader$LT$std..io..cursor..Cursor$LT$$RF$$u5b$u8$u5d$$GT$$GT$$GT$17h6340e3df806308e3E"(ptr noalias noundef nonnull align 8 dereferenceable(688) %14) br label %.critedge 149: ; preds = %140, %139, %136, %135, %170, %163, %156, %147 - %.sroa.048.0 = phi i8 [ 4, %147 ], [ 6, %156 ], [ 5, %163 ], [ 7, %170 ], [ 0, %135 ], [ 2, %136 ], [ 1, %139 ], [ 3, %140 ] + %.sroa.048.0 = phi i8 [ 4, %151 ], [ 6, %160 ], [ 5, %167 ], [ 7, %174 ], [ 0, %135 ], [ 2, %137 ], [ 1, %141 ], [ %144, %143 ] call void @llvm.lifetime.start.p0(i64 720, ptr nonnull %.sroa.045) %.sroa.045.32..sroa_idx = getelementptr inbounds nuw i8, ptr %.sroa.045, i64 32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(688) %.sroa.045.32..sroa_idx, ptr noundef nonnull align 8 dereferenceable(688) %14, i64 688, i1 false) @@ -159376,6 +159367,9 @@ declare hidden void @"_ZN56_$LT$T$u20$as$u20$zvariant..type..DynamicDeserialize$ ; Function Attrs: nonlazybind uwtable declare hidden void @_ZN8zvariant10serialized4data4Data21deserialize_with_seed17hc11fb3e1bfc9eb5cE.llvm.16669866392210250976(ptr dead_on_unwind noalias noundef writable sret([64 x i8]) align 8 captures(none) dereferenceable(64), ptr noalias noundef readonly align 8 dereferenceable(40)) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #48 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umin.i64(i64, i64) #48 diff --git a/bench/zed-rs/optimized/8bnapxt4ilkd5y3egr7fzm1sv.ll b/bench/zed-rs/optimized/8bnapxt4ilkd5y3egr7fzm1sv.ll index 0b7670658a3..2109a1d33a6 100644 --- a/bench/zed-rs/optimized/8bnapxt4ilkd5y3egr7fzm1sv.ll +++ b/bench/zed-rs/optimized/8bnapxt4ilkd5y3egr7fzm1sv.ll @@ -245,6 +245,7 @@ target triple = "x86_64-unknown-linux-gnu" @_ZN2fs7watcher16INOTIFY_INSTANCE17h091453216459acdeE = external global <{ [72 x i8], [4 x i8], [4 x i8] }>, align 8 @anon.4687e20d734e48ad2818d82418c4edf5.110.llvm.495310588694779438 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @anon.4687e20d734e48ad2818d82418c4edf5.111.llvm.495310588694779438 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 +@switch.table._ZN8zvariant19framing_offset_size17FramingOffsetSize12write_offset17h7af96b41ab784441E = private unnamed_addr constant [4 x i64] [i64 1, i64 2, i64 4, i64 8], align 8 ; Function Attrs: nonlazybind uwtable define hidden void @"_ZN101_$LT$std..os..unix..net..addr..SocketAddr$u20$as$u20$std..os..net..linux_ext..addr..SocketAddrExt$GT$18from_abstract_name17h8b88a0f67e6f49d4E"(ptr dead_on_unwind noalias noundef writable sret([120 x i8]) align 8 captures(none) dereferenceable(120) %0, ptr noalias noundef nonnull readonly align 1 captures(none) %1, i64 noundef %2) unnamed_addr #0 personality ptr @rust_eh_personality { @@ -14657,11 +14658,12 @@ define hidden void @_ZN8tempfile7Builder11tempfile_in17h1081eee5ce1c9570E(ptr de ; Function Attrs: nonlazybind uwtable define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_offset17h41e69be469634e60E(ptr dead_on_unwind noalias noundef writable writeonly sret([64 x i8]) align 8 captures(none) dereferenceable(64) %0, i64 noundef %1, ptr noalias noundef align 8 captures(none) dereferenceable(144) %2, i64 noundef %3) unnamed_addr #0 personality ptr @rust_eh_personality { - switch i64 %1, label %5 [ - i64 1, label %6 - i64 2, label %38 - i64 4, label %70 - i64 8, label %102 + %5 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %1, i1 true) + switch i64 %5, label %6 [ + i64 0, label %7 + i64 1, label %39 + i64 2, label %71 + i64 3, label %103 ] 5: ; preds = %4 @@ -14684,47 +14686,47 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ %13 = tail call i64 @llvm.uadd.sat.i64(i64 %.promoted.i, i64 range(i64 1, 0) 1) %14 = load i64, ptr %12, align 8, !alias.scope !3001, !noalias !3004, !noundef !4 %15 = icmp ugt i64 %13, %14 - br i1 %15, label %16, label %23 - -16: ; preds = %6 - %17 = getelementptr inbounds nuw i8, ptr %12, i64 16 - %18 = load i64, ptr %17, align 8, !alias.scope !3001, !noalias !3004, !noundef !4 - %19 = sub i64 %13, %18 - %20 = sub i64 %14, %18 - %21 = icmp ugt i64 %19, %20 - br i1 %21, label %22, label %23 - -22: ; preds = %16 - tail call void @"_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h677e6985b41e6e35E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %18, i64 noundef %19), !noalias !3004 - br label %23 - -23: ; preds = %22, %16, %6 - %24 = getelementptr inbounds nuw i8, ptr %12, i64 16 - %25 = load i64, ptr %24, align 8, !alias.scope !3001, !noalias !3004, !noundef !4 - %26 = icmp ugt i64 %.promoted.i, %25 - br i1 %26, label %.lr.ph.preheader.i.i.i.i.i.us.i, label %_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i - -.lr.ph.preheader.i.i.i.i.i.us.i: ; preds = %23 - %27 = sub nuw i64 %.promoted.i, %25 - %28 = getelementptr inbounds nuw i8, ptr %12, i64 8 - %29 = load ptr, ptr %28, align 8, !alias.scope !3001, !noalias !3004, !nonnull !4, !noundef !4 - %30 = getelementptr inbounds i8, ptr %29, i64 %25 - tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %30, i8 0, i64 %27, i1 false), !alias.scope !3005, !noalias !3004 - store i64 %.promoted.i, ptr %24, align 8, !alias.scope !3001, !noalias !3004 + br i1 %15, label %16, label %24 + +22: ; preds = %6 + %18 = getelementptr inbounds nuw i8, ptr %12, i64 16 + %19 = load i64, ptr %18, align 8, !alias.scope !3001, !noalias !3004, !noundef !4 + %20 = sub i64 %14, %19 + %21 = sub i64 %15, %19 + %22 = icmp ugt i64 %20, %21 + br i1 %22, label %23, label %24 + +23: ; preds = %16 + tail call void @"_ZN5alloc7raw_vec19RawVec$LT$T$C$A$GT$7reserve21do_reserve_and_handle17h677e6985b41e6e35E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %12, i64 noundef %19, i64 noundef %20), !noalias !3004 + br label %.lr.ph.preheader.i.i.i.i.i.us.i + +.lr.ph.preheader.i.i.i.i.i.us.i: ; preds = %23, %17, %7 + %25 = getelementptr inbounds nuw i8, ptr %13, i64 15 + %26 = load i64, ptr %25, align 8, !alias.scope !3001, !noalias !3004, !noundef !4 + %27 = icmp ugt i64 %.promoted.i, %26 + br i1 %27, label %.lr.ph.preheader.i.i.i.i.i.us.i, label %_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i + +.lr.ph.preheader.i.i.i.i.i.us.i:; preds = %24 + %28 = sub nuw i64 %.promoted.i, %26 + %29 = getelementptr inbounds nuw i8, ptr %13, i64 8 + %30 = load ptr, ptr %29, align 8, !alias.scope !3001, !noalias !3004, !nonnull !4, !noundef !4 + %31 = getelementptr inbounds i8, ptr %30, i64 %26 + tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %31, i8 0, i64 %28, i1 false), !alias.scope !3005, !noalias !3004 + store i64 %.promoted.i, ptr %25, align 8, !alias.scope !3001, !noalias !3004 br label %_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i -_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i: ; preds = %.lr.ph.preheader.i.i.i.i.i.us.i, %23 +_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i: ; preds = %.lr.ph.preheader.i.i.i.i.i.us.i, %24 %31 = getelementptr inbounds nuw i8, ptr %12, i64 8 %.val9.i.i.i.us.i = load ptr, ptr %31, align 8, !alias.scope !3000, !noalias !3004, !nonnull !4, !noundef !4 %32 = getelementptr inbounds i8, ptr %.val9.i.i.i.us.i, i64 %.promoted.i store i8 %7, ptr %32, align 1, !noalias !3008 %33 = add i64 %.promoted.i, 1 - %34 = load i64, ptr %24, align 8, !alias.scope !3000, !noalias !3004, !noundef !4 + %34 = load i64, ptr %25, align 8, !alias.scope !3000, !noalias !3004, !noundef !4 %35 = icmp ugt i64 %33, %34 br i1 %35, label %36, label %_ZN3std2io5Write9write_all17hf3f7adf1dac055e3E.exit 36: ; preds = %_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i - store i64 %33, ptr %24, align 8, !alias.scope !3000, !noalias !3004 + store i64 %33, ptr %25, align 8, !alias.scope !3000, !noalias !3004 br label %_ZN3std2io5Write9write_all17hf3f7adf1dac055e3E.exit _ZN3std2io5Write9write_all17hf3f7adf1dac055e3E.exit: ; preds = %_ZN3std2io6cursor15reserve_and_pad17h576e8bd116882fc7E.exit.i.i.i.us.i, %36 @@ -14937,9 +14939,13 @@ _ZN3std2io5Write9write_all17hf3f7adf1dac055e3E.exit23: ; preds = %_ZN3std2io6cur ; Function Attrs: mustprogress nofree norecurse nosync nounwind nonlazybind willreturn memory(argmem: readwrite) uwtable define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_offset17h7af96b41ab784441E(ptr dead_on_unwind noalias noundef writable writeonly sret([64 x i8]) align 8 captures(none) dereferenceable(64) %0, i64 noundef %1, ptr noalias noundef align 8 captures(none) dereferenceable(144) %2, i64 noundef %3) unnamed_addr #7 personality ptr @rust_eh_personality { +switch.lookup: + %4 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %1, i1 true) %5 = getelementptr inbounds nuw i8, ptr %2, i64 128 %.promoted.i = load i64, ptr %5, align 8 - %6 = add i64 %.promoted.i, %1 + %switch.gep = getelementptr inbounds nuw [4 x i64], ptr @switch.table._ZN8zvariant19framing_offset_size17FramingOffsetSize12write_offset17h7af96b41ab784441E, i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %6 = add i64 %.promoted.i, %switch.load store i64 %6, ptr %5, align 8 store i64 14, ptr %0, align 8 ret void @@ -28547,6 +28553,9 @@ declare hidden void @"_ZN10async_task4task17Task$LT$T$C$M$GT$9poll_task17ha1124c ; Function Attrs: nonlazybind uwtable declare hidden void @"_ZN10async_task4task17Task$LT$T$C$M$GT$9poll_task17h8dd49703e2588d90E.llvm.495310588694779438"(ptr dead_on_unwind noalias noundef writable sret([72 x i8]) align 8 captures(none) dereferenceable(72), ptr noalias noundef align 8 dereferenceable(8), ptr noalias noundef align 8 dereferenceable(32)) unnamed_addr #0 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i64 @llvm.cttz.i64(i64, i1 immarg) #33 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare range(i8 -1, 2) i8 @llvm.ucmp.i8.i8(i8, i8) #33 diff --git a/bench/zed-rs/optimized/8n2fsvz9zbnw9ojg9jkj0503g.ll b/bench/zed-rs/optimized/8n2fsvz9zbnw9ojg9jkj0503g.ll index 3890d3a3fe6..c9ce635010c 100644 --- a/bench/zed-rs/optimized/8n2fsvz9zbnw9ojg9jkj0503g.ll +++ b/bench/zed-rs/optimized/8n2fsvz9zbnw9ojg9jkj0503g.ll @@ -105169,11 +105169,12 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ %7 = alloca [2 x i8], align 2 %8 = alloca [1 x i8], align 1 %9 = alloca [8 x i8], align 8 - switch i64 %1, label %10 [ - i64 1, label %11 - i64 2, label %14 - i64 4, label %17 - i64 8, label %20 + %10 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %1, i1 true) + switch i64 %10, label %11 [ + i64 0, label %12 + i64 1, label %15 + i64 2, label %18 + i64 3, label %21 ] 10: ; preds = %4 @@ -105211,7 +105212,7 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ br label %22 22: ; preds = %20, %17, %14, %11 - %.sroa.01.0 = phi ptr [ %13, %11 ], [ %16, %14 ], [ %19, %17 ], [ %21, %20 ] + %.sroa.01.0 = phi ptr [ %13, %12 ], [ %16, %15 ], [ %19, %18 ], [ %21, %21 ] %23 = icmp eq ptr %.sroa.01.0, null br i1 %23, label %24, label %25 @@ -105242,7 +105243,7 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ %33 = landingpad { ptr, i32 } cleanup invoke void @"_ZN4core3ptr71drop_in_place$LT$alloc..sync..ArcInner$LT$std..io..error..Error$GT$$GT$17ha41a405e8a44d3c9E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %5) #81 - to label %36 unwind label %34 + to label %37 unwind label %34 34: ; preds = %32 %35 = landingpad { ptr, i32 } @@ -105272,11 +105273,12 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ %7 = alloca [2 x i8], align 2 %8 = alloca [1 x i8], align 1 %9 = alloca [8 x i8], align 8 - switch i64 %1, label %10 [ - i64 1, label %11 - i64 2, label %14 - i64 4, label %17 - i64 8, label %20 + %10 = tail call range(i64 0, 65) i64 @llvm.cttz.i64(i64 %1, i1 true) + switch i64 %10, label %11 [ + i64 0, label %12 + i64 1, label %15 + i64 2, label %18 + i64 3, label %21 ] 10: ; preds = %4 @@ -105314,7 +105316,7 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ br label %22 22: ; preds = %20, %17, %14, %11 - %.sroa.01.0 = phi ptr [ %13, %11 ], [ %16, %14 ], [ %19, %17 ], [ %21, %20 ] + %.sroa.01.0 = phi ptr [ %13, %12 ], [ %16, %15 ], [ %19, %18 ], [ %21, %21 ] %23 = icmp eq ptr %.sroa.01.0, null br i1 %23, label %24, label %25 @@ -105345,7 +105347,7 @@ define hidden void @_ZN8zvariant19framing_offset_size17FramingOffsetSize12write_ %33 = landingpad { ptr, i32 } cleanup invoke void @"_ZN4core3ptr71drop_in_place$LT$alloc..sync..ArcInner$LT$std..io..error..Error$GT$$GT$17ha41a405e8a44d3c9E"(ptr noalias noundef nonnull align 8 dereferenceable(24) %5) #81 - to label %36 unwind label %34 + to label %37 unwind label %34 34: ; preds = %32 %35 = landingpad { ptr, i32 } @@ -167388,6 +167390,9 @@ declare hidden { i64, i64 } @_ZN4gpui6window13WindowContext18with_element_state1 ; Function Attrs: inlinehint nonlazybind uwtable declare hidden void @"_ZN67_$LT$gpui..elements..img..Img$u20$as$u20$gpui..element..Element$GT$14request_layout28_$u7b$$u7b$closure$u7d$$u7d$17hf9eae4f26affd669E.llvm.12018052726552770354"(ptr dead_on_unwind noalias noundef writable sret([40 x i8]) align 8 captures(none) dereferenceable(40), ptr noalias noundef align 8 captures(none) dereferenceable(24), ptr noalias noundef align 8 captures(none) dereferenceable(24), ptr noalias noundef align 8 dereferenceable(16)) unnamed_addr #1 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i64 @llvm.cttz.i64(i64, i1 immarg) #76 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.umax.i8(i8, i8) #76 diff --git a/bench/zed-rs/optimized/bpcj0xb6nmpne8ezqc5krm4m9.ll b/bench/zed-rs/optimized/bpcj0xb6nmpne8ezqc5krm4m9.ll index b8e6afd4fe9..17206a2f1fd 100644 --- a/bench/zed-rs/optimized/bpcj0xb6nmpne8ezqc5krm4m9.ll +++ b/bench/zed-rs/optimized/bpcj0xb6nmpne8ezqc5krm4m9.ll @@ -341,6 +341,8 @@ target triple = "x86_64-unknown-linux-gnu" @anon.a9719d92f7b476b29ada79e1ed6e790c.57.llvm.14581243670548862388 = external hidden unnamed_addr constant <{ ptr, [16 x i8] }>, align 8 @__rust_no_alloc_shim_is_unstable = external global i8 @"switch.table._ZN3png7decoder16Decoder$LT$R$GT$9read_info17hdeaf088ff00ab18cE" = private unnamed_addr constant [7 x i64] [i64 1, i64 poison, i64 3, i64 1, i64 2, i64 poison, i64 4], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E" = private unnamed_addr constant [5 x i64] [i64 3, i64 3, i64 4, i64 5, i64 7], align 8 +@"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E.308" = private unnamed_addr constant [5 x ptr] [ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.173, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.174, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.175, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.176, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.177], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17h752083991626e1e2E" = private unnamed_addr constant [7 x i64] [i64 9, i64 poison, i64 3, i64 7, i64 14, i64 poison, i64 4], align 8 @"switch.table._ZN59_$LT$png..common..ColorType$u20$as$u20$core..fmt..Debug$GT$3fmt17h752083991626e1e2E.308" = private unnamed_addr constant [7 x ptr] [ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.178, ptr poison, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.179, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.180, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.181, ptr poison, ptr @anon.85dc5b59c6df06fdb4f122d3ed669f58.182], align 8 @"switch.table._ZN59_$LT$png..common..DisposeOp$u20$as$u20$core..fmt..Debug$GT$3fmt17he8ac10bd34c058d6E" = private unnamed_addr constant [3 x i64] [i64 4, i64 10, i64 8], align 8 @@ -15232,35 +15234,17 @@ _ZN5alloc6string6String8push_str17hf8d74d98e42ef13fE.exit: ; preds = %3, %9 ; Function Attrs: inlinehint nonlazybind uwtable define internal noundef zeroext i1 @"_ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E"(ptr noalias noundef readonly align 1 captures(none) dereferenceable(1) %0, ptr noalias noundef align 8 dereferenceable(64) %1) unnamed_addr #4 { - %3 = load i8, ptr %0, align 1, !range !977, !noundef !7 - switch i8 %3, label %4 [ - i8 1, label %9 - i8 2, label %5 - i8 4, label %6 - i8 8, label %7 - i8 16, label %8 - ] - -4: ; preds = %2 - unreachable - -5: ; preds = %2 - br label %9 - -6: ; preds = %2 - br label %9 - -7: ; preds = %2 - br label %9 - -8: ; preds = %2 - br label %9 - -9: ; preds = %2, %8, %7, %6, %5 - %.sroa.8.0 = phi i64 [ 3, %5 ], [ 4, %6 ], [ 5, %7 ], [ 7, %8 ], [ 3, %2 ] - %.sroa.0.0 = phi ptr [ @anon.85dc5b59c6df06fdb4f122d3ed669f58.174, %5 ], [ @anon.85dc5b59c6df06fdb4f122d3ed669f58.175, %6 ], [ @anon.85dc5b59c6df06fdb4f122d3ed669f58.176, %7 ], [ @anon.85dc5b59c6df06fdb4f122d3ed669f58.177, %8 ], [ @anon.85dc5b59c6df06fdb4f122d3ed669f58.173, %2 ] - %10 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17ha11c1118505c1ec2E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %.sroa.0.0, i64 noundef %.sroa.8.0) - ret i1 %10 +switch.lookup: + %2 = load i8, ptr %0, align 1, !range !977, !noundef !7 + %3 = tail call range(i8 0, 9) i8 @llvm.cttz.i8(i8 %2, i1 true) + %4 = zext nneg i8 %3 to i64 + %switch.gep = getelementptr inbounds nuw [5 x i64], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E", i64 0, i64 %4 + %switch.load = load i64, ptr %switch.gep, align 8 + %5 = zext nneg i8 %3 to i64 + %switch.gep2 = getelementptr inbounds nuw [5 x ptr], ptr @"switch.table._ZN58_$LT$png..common..BitDepth$u20$as$u20$core..fmt..Debug$GT$3fmt17h4a2d49eea0ed4091E.308", i64 0, i64 %5 + %switch.load3 = load ptr, ptr %switch.gep2, align 8 + %6 = tail call noundef zeroext i1 @_ZN4core3fmt9Formatter9write_str17ha11c1118505c1ec2E(ptr noalias noundef nonnull align 8 dereferenceable(64) %1, ptr noalias noundef nonnull readonly align 1 %switch.load3, i64 noundef %switch.load) + ret i1 %6 } ; Function Attrs: inlinehint nonlazybind uwtable @@ -30871,6 +30855,9 @@ declare hidden void @"_ZN111_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$alloc..vec. ; Function Attrs: nonlazybind uwtable declare { ptr, ptr } @_ZN14language_model8provider7open_ai20count_open_ai_tokens17h925259e29b69a520E(ptr noalias noundef align 8 captures(none) dereferenceable(80), ptr noalias noundef align 8 captures(none) dereferenceable(72), ptr noalias noundef readonly align 8 dereferenceable(1176)) unnamed_addr #0 +; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) +declare i8 @llvm.cttz.i8(i8, i1 immarg) #48 + ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare range(i8 -1, 2) i8 @llvm.ucmp.i8.i64(i64, i64) #48 diff --git a/scripts/setup_pre_commit_patch.sh b/scripts/setup_pre_commit_patch.sh index c5409e09ef4..226a9ec41fe 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/145159 export COMPTIME_MODE=0 # Please rebase manually