diff options
author | Bryan Garza <1396101+bryangarza@users.noreply.github.com> | 2022-12-20 00:51:17 +0000 |
---|---|---|
committer | Bryan Garza <1396101+bryangarza@users.noreply.github.com> | 2023-01-23 23:56:22 +0000 |
commit | 360db516ccf358bd4b35c483ae44634a74c66c0b (patch) | |
tree | b93ee5a07bbfa3db492ba3baaa26f645b4252121 /compiler/rustc_codegen_ssa/src/mir/statement.rs | |
parent | c8e6a9e8b6251bbc8276cb78cabe1998deecbed7 (diff) | |
download | rust-360db516ccf358bd4b35c483ae44634a74c66c0b.tar.gz |
Create stable metric to measure long computation in Const Eval
This patch adds a `MirPass` that tracks the number of back-edges and
function calls in the CFG, adds a new MIR instruction to increment a
counter every time they are encountered during Const Eval, and emit a
warning if a configured limit is breached.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/mir/statement.rs')
-rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/statement.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/statement.rs b/compiler/rustc_codegen_ssa/src/mir/statement.rs index 19452c8cdc8..60fbceb344d 100644 --- a/compiler/rustc_codegen_ssa/src/mir/statement.rs +++ b/compiler/rustc_codegen_ssa/src/mir/statement.rs @@ -91,6 +91,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { mir::StatementKind::FakeRead(..) | mir::StatementKind::Retag { .. } | mir::StatementKind::AscribeUserType(..) + | mir::StatementKind::ConstEvalCounter | mir::StatementKind::Nop => {} } } |