From e60ccfc6a9e91a7b26f368c9fee40bd22831450f Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Tue, 31 Jan 2023 18:15:42 +0100 Subject: Don't inline query_cache_hit to reduce code size of the query hot path. --- compiler/rustc_query_system/src/query/plumbing.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_query_system') diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index ffc413d15f5..2fde3c6075b 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -722,7 +722,9 @@ where } Some((_, dep_node_index)) => { dep_graph.read_index(dep_node_index); - qcx.dep_context().profiler().query_cache_hit(dep_node_index.into()); + if std::intrinsics::unlikely(qcx.dep_context().profiler().enabled()) { + qcx.dep_context().profiler().query_cache_hit(dep_node_index.into()); + } (false, None) } } -- cgit 1.4.1-3-g733a5