Skip to content

Conversation

@chenyukang
Copy link
Member

@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2026

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2026
@chenyukang
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 19, 2026
Fix performance issue in liveness checking
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
Copy link
Member

@lqd lqd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. r=me with green perf

View changes since this review

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 19, 2026

☀️ Try build successful (CI)
Build commit: 3a8fd6c (3a8fd6ccca553ed0605e839cc9eac17a3aa80166, parent: d940e56841ddcc05671ead99290e35ff2e98369f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3a8fd6c): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 3.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 473.058s -> 474.35s (0.27%)
Artifact size: 383.29 MiB -> 383.32 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
@chenyukang
Copy link
Member Author

@bors r=lqd

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

📌 Commit 54f9a44 has been approved by lqd

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2026
@lqd
Copy link
Member

lqd commented Jan 20, 2026

It didn’t fix the issue you were trying to fix, right?

@chenyukang
Copy link
Member Author

It didn’t fix the issue you were trying to fix, right?

seems that PR #150955 don't have that big performance regression:
#150955 (comment)

@lqd
Copy link
Member

lqd commented Jan 20, 2026

It doesn't indeed.

@lqd
Copy link
Member

lqd commented Jan 20, 2026

In any case, this new code is in a good spot now (but it's also not clear that it was causing much in the previous place) so let's land it.

Comment on lines +1116 to +1119
// By convention, underscore-prefixed bindings are explicitly allowed to be unused.
if name.as_str().starts_with('_') {
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inside the loop, so this lookup can be done multiple times after this change, right? Could that be the issue?

For positive cases we can also just break, too.

Suggested change
// By convention, underscore-prefixed bindings are explicitly allowed to be unused.
if name.as_str().starts_with('_') {
continue;
}
// By convention, underscore-prefixed bindings are explicitly allowed to be unused.
if name.as_str().starts_with('_') {
break;
}

Copy link
Member

@lqd lqd Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that but the only way this would matter is if the benchmarks code emits unused warnings today, and we'd be thus benchmarking diagnostics?

Copy link
Contributor

@panstromek panstromek Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, right. I guess I'm just perplexed by the results. For code that never emitted these warnings, this PR should be strictly less work, because they never reach this branch anyway, but instead it's a regression. That doesn't make any sense to me. At least it should undo the previous regression in unicode-normalization, but those benchmarks didn't move above the treshold, or slightly regressed, if anything (I'm assuming unicode-normalization doesn't emit unused-assignemnts).

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 20, 2026
Fix performance issue in liveness checking

r? @ghost

from #150955 (comment)
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-aux failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
REPOSITORY                                   TAG       IMAGE ID       CREATED       SIZE
ghcr.io/dependabot/dependabot-updater-core   latest    63ba4a2ff346   12 days ago   775MB
=> Removing docker images...
Deleted Images:
untagged: ghcr.io/dependabot/dependabot-updater-core:latest
untagged: ghcr.io/dependabot/dependabot-updater-core@sha256:830c840ea4b8c27b6919bdd47c017030adeb538f226e1cdfd386490a622b9218
deleted: sha256:63ba4a2ff3467a98ac6c8610fece2cdc9893e2af6c18111e57618f8949749b82
deleted: sha256:77617fa265a7311b1c0502e01ff6157d25228d91f6cddc21d7901eb440d0adee
deleted: sha256:0bd8abdbb1f7c0453b4bc76cce6ecf0a3b9e4b5d0c8ceeb63652e91a63cab4a1
deleted: sha256:4e9913397e051a70593edc1662de159778ce1bf65132295639da0e119913b53f
deleted: sha256:3e54edb2fef4b1c1393a2928bfa1017c22cc578f5f3eef677580662e8d2e79ea
---
Initialized empty Git repository in /checkout/obj/build/ct/diesel/.git/
fatal: Could not parse object '3db7c17c5b069656ed22750e84d6498c8ab5b81d'.
From https://github.com/diesel-rs/diesel
 * branch            3db7c17c5b069656ed22750e84d6498c8ab5b81d -> FETCH_HEAD
HEAD is now at 3db7c17 Merge pull request #4917 from LucaCappelletti94/allow_tables_to_appear_in_same_query-modules
    Updating crates.io index
     Locking 261 packages to latest compatible versions
      Adding cargo_metadata v0.19.2 (available: v0.23.1)
      Adding darling v0.21.3 (available: v0.23.0)
      Adding generic-array v0.14.7 (available: v0.14.9)
      Adding getrandom v0.2.17 (available: v0.3.4)
      Adding libsqlite3-sys v0.35.0 (available: v0.36.0)
      Adding sqlite-wasm-vfs v0.1.1 (available: v0.2.0)
      Adding sqlparser v0.59.0 (available: v0.60.0)
---
test query_builder::query_id::tests::queries_with_different_types_have_different_ids ... ok
test query_builder::sql_query::tests::check_boxed_sql_query_is_send ... ok
test sqlite::connection::stmt::tests::check_out_of_bounds_bind_does_not_panic_on_drop ... ok
test sqlite::connection::tests::correctly_handle_empty_query ... ok
test sqlite::connection::row::tests::fun_with_row_iters ... ok
test sqlite::connection::tests::register_aggregate_function ... ok
test sqlite::connection::sqlite_value::tests::can_convert_all_values ... ok
test sqlite::connection::tests::register_aggregate_function_returns_finalize_default_on_empty_set ... ok
test sqlite::connection::tests::database_serializes_and_deserializes_successfully ... ok
test sqlite::connection::tests::register_multiarg_function ... ok
---
test diesel/src/expression_methods/global_expression_methods.rs - expression_methods::global_expression_methods::ExpressionMethods::not_between (line 422) ... ok
test diesel/src/expression_methods/global_expression_methods.rs - expression_methods::global_expression_methods::ExpressionMethods::ne_all (line 169) ... ok
test diesel/src/expression_methods/global_expression_methods.rs - expression_methods::global_expression_methods::NullableExpressionMethods::assume_not_null (line 644) ... ok
test diesel/src/expression_methods/global_expression_methods.rs - expression_methods::global_expression_methods::NullableExpressionMethods::nullable (line 599) - compile ... ok
test diesel/src/expression_methods/global_expression_methods.rs - expression_methods::global_expression_methods::NullableExpressionMethods::assume_not_null (line 671) ... ok
test diesel/src/expression_methods/global_expression_methods.rs - expression_methods::global_expression_methods::NullableExpressionMethods::assume_not_null (line 706) ... ok
test diesel/src/expression_methods/json_expression_methods.rs - expression_methods::json_expression_methods::AnyJsonExpressionMethods::retrieve_as_text (line 18) ... ok
test diesel/src/expression_methods/text_expression_methods.rs - expression_methods::text_expression_methods::TextExpressionMethods::like (line 74) ... ok
test diesel/src/expression_methods/text_expression_methods.rs - expression_methods::text_expression_methods::TextExpressionMethods::concat (line 14) ... ok
test diesel/src/expression_methods/text_expression_methods.rs - expression_methods::text_expression_methods::TextExpressionMethods::not_like (line 110) ... ok
test diesel/src/insertable.rs - insertable::Insertable::insert_into (line 41) ... ok
test diesel/src/lib.rs - helper_types::InnerJoinQuerySource (line 571) ... ok
---
test diesel/src/query_builder/functions.rs - query_builder::functions::replace_into (line 497) ... ok
test diesel/src/query_builder/functions.rs - query_builder::functions::update (line 25) ... ok
test diesel/src/query_builder/functions.rs - query_builder::functions::sql_query (line 551) ... ok
test diesel/src/query_builder/functions.rs - query_builder::functions::update (line 49) ... ok
test diesel/src/query_builder/has_query.rs - query_builder::has_query::HasQuery (line 56) ... ok
test diesel/src/query_builder/has_query.rs - query_builder::has_query::HasQuery (line 27) ... ok
test diesel/src/query_builder/insert_statement/mod.rs - query_builder::insert_statement::InsertStatement<T,U,Op>::returning (line 282) ... ok
test diesel/src/query_builder/insert_statement/mod.rs - query_builder::insert_statement::IncompleteInsertStatement<T,Op>::default_values (line 68) ... ok
test diesel/src/query_builder/mod.rs - query_builder::debug_query (line 394) ... ok
test diesel/src/query_builder/sql_query.rs - query_builder::sql_query::SqlQuery<Inner>::bind (line 47) ... ok
test diesel/src/query_builder/update_statement/mod.rs - query_builder::update_statement::UpdateStatement<T,U,V,NoReturningClause>::returning (line 256) ... ok
---
test diesel/src/sqlite/connection/mod.rs - sqlite::connection::SqliteConnection (line 96) - compile fail ... ok
test diesel/src/sqlite/connection/mod.rs - sqlite::connection::SqliteConnection::exclusive_transaction (line 354) ... ok
test diesel/src/sqlite/connection/mod.rs - sqlite::connection::SqliteConnection::immediate_transaction (line 325) ... ok
test diesel/src/sqlite/connection/mod.rs - sqlite::connection::SqliteConnection::register_collation (line 500) ... ok
test diesel/src/sqlite/expression/expression_methods.rs - sqlite::expression::expression_methods::SqliteAnyJsonExpressionMethods::retrieve_as_object_sqlite (line 107) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json (line 24) ... ok
test diesel/src/sqlite/expression/expression_methods.rs - sqlite::expression::expression_methods::SqliteExpressionMethods::is (line 27) ... ok
test diesel/src/sqlite/expression/expression_methods.rs - sqlite::expression::expression_methods::SqliteExpressionMethods::is_not (line 62) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_array_0 (line 1385) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_array_1 (line 1385) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_array_2 (line 1385) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_array_length (line 109) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_array_length_with_path (line 176) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_error_position (line 253) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_group_array (line 931) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_group_array (line 967) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_group_object (line 1203) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_group_object (line 1230) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_object_0 (line 1094) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_object_1 (line 1094) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_object_2 (line 1094) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_patch (line 1627) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_pretty (line 342) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_pretty_with_indentation (line 472) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_quote (line 872) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_remove_0 (line 1489) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_remove_1 (line 1489) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_remove_2 (line 1489) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_type (line 755) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_type_with_path (line 802) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_valid (line 633) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::json_valid_with_flags (line 693) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb (line 65) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_array_0 (line 1437) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_array_1 (line 1437) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_array_2 (line 1437) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_group_array (line 1010) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_group_array (line 1047) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_group_object (line 1296) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_object_0 (line 1146) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_group_object (line 1323) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_object_1 (line 1146) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_object_2 (line 1146) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_patch (line 1707) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_remove_0 (line 1563) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_remove_1 (line 1563) ... ok
test diesel/src/sqlite/expression/functions.rs - sqlite::expression::functions::jsonb_remove_2 (line 1563) ... ok
test diesel/src/upsert/on_conflict_extension.rs - upsert::on_conflict_extension::IncompleteOnConflict<Stmt,Target>::do_update (line 431) ... ok
test diesel/src/upsert/on_conflict_extension.rs - upsert::on_conflict_extension::IncompleteOnConflict<Stmt,Target>::do_update (line 383) ... ok
test diesel/src/upsert/on_conflict_extension.rs - upsert::on_conflict_extension::IncompleteOnConflict<Stmt,Target>::do_update (line 517) ... ok
test diesel/src/upsert/on_conflict_extension.rs - upsert::on_conflict_extension::IncompleteOnConflict<Stmt,Target>::do_update (line 557) ... ok
test diesel/src/upsert/on_conflict_extension.rs - upsert::on_conflict_extension::IncompleteOnConflict<Stmt,Target>::do_update (line 475) ... ok
---
    SUCCESS for generator 'f64 subnormal'. 4194305/4194305 passed in 78.034684544s
30/30 tests succeeded in 102.320950581s (30 passed, 0 failed, 0 stopped)
[TIMING:end] test::TestFloatParse { build_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu } -- 134.279
Build completed successfully in 0:55:58
# The build-std suite is off by default because it is uncommonly slow
# and memory-hungry.
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.12s
##[endgroup]
warning: failed to connect to jobserver from environment variable `MAKEFLAGS=" -j4 --jobserver-auth=3,4"`: cannot open file descriptor 3 from the jobserver environment variable value: Bad file descriptor (os error 9)
  |
---
failures:

---- oneshot::recv_timeout_before_send stdout ----

thread 'oneshot::recv_timeout_before_send' (272239) panicked at library/std/tests/sync/oneshot.rs:140:14:
expected Ok(99)
stack backtrace:
   0: std::panicking::panic_handler
             at /checkout/library/std/src/panicking.rs:689:5
   1: core::panicking::panic_fmt
             at /checkout/library/core/src/panicking.rs:80:14
   2: oneshot::recv_timeout_before_send
             at library/std/tests/sync/oneshot.rs:140:14
   3: oneshot::recv_timeout_before_send::{closure#0}
             at library/std/tests/sync/oneshot.rs:130:30
   4: <{closure@library/std/tests/sync/oneshot.rs:130:1: 144:2} as std::ops::FnOnce<()>>::call_once - shim
             at /checkout/library/core/src/ops/function.rs:250:5
   5: <fn() -> std::result::Result<(), std::string::String> as std::ops::FnOnce<()>>::call_once - shim(fn() -> std::result::Result<(), std::string::String>)
             at /checkout/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
---- oneshot::recv_timeout_before_send stdout end ----
---

error: test failed, to rerun pass `-p std --test sync`
Bootstrap failed while executing `miri --stage 2 library/std -- --skip fs:: --skip net:: --skip process:: --skip sys::`
Build completed unsuccessfully in 0:15:25
make: *** [Makefile:61: check-aux] Error 1
  local time: Tue Jan 20 20:44:06 UTC 2026
  network time: Tue, 20 Jan 2026 20:44:06 GMT
##[error]Process completed with exit code 2.
##[group]Run echo "disk usage:"
echo "disk usage:"

@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 20, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

💔 Test for 399f6ba failed: CI. Failed job:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants