rust/library
Tyler Mandry 29a946203a
Rollup merge of #75545 - eddyb:instant-sub-branchless, r=sfackler
std/sys/unix/time: make it easier for LLVM to optimize `Instant` subtraction.

This PR is the minimal change necessary to get LLVM to optimize `if self.t.tv_nsec >= other.t.tv_nsec` to branchless instructions (at least on x86_64), inspired by @m-ou-se's own attempts at optimizing `Instant` subtraction.

I stumbled over this by looking at the total number of instructions executed by `rustc -Z self-profile`, and found that after disabling ASLR, the largest source of non-determinism remaining was from this `if` taking one branch or the other, depending on the values involved.

The reason this code is even called so many times to make a difference, is that `measureme` (the `-Z self-profile` implementation) currently uses `Instant::elapsed` for its event timestamps (of which there can be millions).

I doubt it's critical to land this, although perhaps it could slightly improve some forms of benchmarking.
2020-08-14 20:07:16 -07:00
..
alloc Rollup merge of #75531 - ssomers:btree_tests_migration, r=Mark-Simulacrum 2020-08-14 14:47:04 -07:00
backtrace@4083a90168 std: Switch from libbacktrace to gimli 2020-07-28 16:34:01 -07:00
core Rollup merge of #75214 - chansuke:fix-intra-doc-links, r=jyn514 2020-08-14 14:46:47 -07:00
panic_abort
panic_unwind Add back unwinding support for Sony PSP 2020-08-08 02:14:40 -04:00
proc_macro Stabilize Ident::new_raw 2020-08-03 17:23:31 -04:00
profiler_builtins
rtstartup
rustc-std-workspace-alloc
rustc-std-workspace-core
rustc-std-workspace-std
std Rollup merge of #75545 - eddyb:instant-sub-branchless, r=sfackler 2020-08-14 20:07:16 -07:00
stdarch@78891cdf29 fix broken git commit in stdarch 2020-08-03 15:52:30 +08:00
term
test Rollup merge of #75270 - matthiaskrgr:clippy_aug_1, r=Dylan-DPC 2020-08-08 11:36:12 +09:00
unwind Add back unwinding support for Sony PSP 2020-08-08 02:14:40 -04:00