From bfadc3a9b9cb4bbfacddf6e73adff23a3557852b Mon Sep 17 00:00:00 2001 From: Zalathar Date: Tue, 30 Apr 2024 23:36:08 +1000 Subject: coverage: `CoverageIdsInfo::mcdc_bitmap_bytes` is never needed This code for recalculating `mcdc_bitmap_bytes` doesn't provide any benefit, because its result won't have changed from the value in `FunctionCoverageInfo` that was computed during the MIR instrumentation pass. --- compiler/rustc_middle/src/mir/query.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/mir/query.rs b/compiler/rustc_middle/src/mir/query.rs index 9a7af6135e4..9d70231be3b 100644 --- a/compiler/rustc_middle/src/mir/query.rs +++ b/compiler/rustc_middle/src/mir/query.rs @@ -362,8 +362,4 @@ pub struct CoverageIdsInfo { /// InstrumentCoverage MIR pass, if the highest-numbered counter increments /// were removed by MIR optimizations. pub max_counter_id: mir::coverage::CounterId, - - /// Coverage codegen for mcdc needs to know the size of the global bitmap so that it can - /// set the `bytemap-bytes` argument of the `llvm.instrprof.mcdc.tvbitmap.update` intrinsic. - pub mcdc_bitmap_bytes: u32, } -- cgit 1.4.1-3-g733a5 From c81be68fb49cf5798fe44cedd56cb91bdc61d011 Mon Sep 17 00:00:00 2001 From: Zalathar Date: Wed, 1 May 2024 11:19:52 +1000 Subject: coverage: Remove confusing comments from `CoverageKind` These comments appear to be inspired by the similar comments on `CounterIncrement` and `ExpressionUsed`. But those comments refer to specific simplification steps performed during coverage codegen, and there is no corresponding step for the MC/DC coverage statements. If these statements do not survive optimization, they will simply not participate in code generation, just like any other statement. --- compiler/rustc_middle/src/mir/coverage.rs | 6 ------ 1 file changed, 6 deletions(-) (limited to 'compiler/rustc_middle/src') diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs index 477303e2434..7f9a5a366d7 100644 --- a/compiler/rustc_middle/src/mir/coverage.rs +++ b/compiler/rustc_middle/src/mir/coverage.rs @@ -129,17 +129,11 @@ pub enum CoverageKind { /// Marks the point in MIR control flow represented by a evaluated condition. /// /// This is eventually lowered to `llvm.instrprof.mcdc.condbitmap.update` in LLVM IR. - /// - /// If this statement does not survive MIR optimizations, the condition would never be - /// taken as evaluated. CondBitmapUpdate { id: ConditionId, value: bool, decision_depth: u16 }, /// Marks the point in MIR control flow represented by a evaluated decision. /// /// This is eventually lowered to `llvm.instrprof.mcdc.tvbitmap.update` in LLVM IR. - /// - /// If this statement does not survive MIR optimizations, the decision would never be - /// taken as evaluated. TestVectorBitmapUpdate { bitmap_idx: u32, decision_depth: u16 }, } -- cgit 1.4.1-3-g733a5