]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_query_system/src/query/plumbing.rs
Don't inline query_cache_hit to reduce code size of the query hot path.
[rust.git] / compiler / rustc_query_system / src / query / plumbing.rs
index ffc413d15f52b0528d7c294b554be089940df5fc..2fde3c6075b74a7c12709d4c2f085d24ab6fdf7f 100644 (file)
@@ -722,7 +722,9 @@ fn ensure_must_run<Q, Qcx>(qcx: Qcx, key: &Q::Key) -> (bool, Option<DepNode<Qcx:
         }
         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)
         }
     }