Skip to content

Commit 381729c

Browse files
committed
coverage: SSA doesn't need to know about instrprof_increment
1 parent b3d6585 commit 381729c

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

compiler/rustc_codegen_llvm/src/builder.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -1165,17 +1165,6 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
11651165
self.call_lifetime_intrinsic("llvm.lifetime.end.p0i8", ptr, size);
11661166
}
11671167

1168-
#[instrument(level = "debug", skip(self))]
1169-
fn instrprof_increment(
1170-
&mut self,
1171-
fn_name: &'ll Value,
1172-
hash: &'ll Value,
1173-
num_counters: &'ll Value,
1174-
index: &'ll Value,
1175-
) {
1176-
self.call_intrinsic("llvm.instrprof.increment", &[fn_name, hash, num_counters, index]);
1177-
}
1178-
11791168
fn call(
11801169
&mut self,
11811170
llty: &'ll Type,
@@ -1645,6 +1634,18 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
16451634
kcfi_bundle
16461635
}
16471636

1637+
/// Emits a call to `llvm.instrprof.increment`. Used by coverage instrumentation.
1638+
#[instrument(level = "debug", skip(self))]
1639+
pub(crate) fn instrprof_increment(
1640+
&mut self,
1641+
fn_name: &'ll Value,
1642+
hash: &'ll Value,
1643+
num_counters: &'ll Value,
1644+
index: &'ll Value,
1645+
) {
1646+
self.call_intrinsic("llvm.instrprof.increment", &[fn_name, hash, num_counters, index]);
1647+
}
1648+
16481649
/// Emits a call to `llvm.instrprof.mcdc.parameters`.
16491650
///
16501651
/// This doesn't produce any code directly, but is used as input by

compiler/rustc_codegen_ssa/src/traits/builder.rs

-8
Original file line numberDiff line numberDiff line change
@@ -437,14 +437,6 @@ pub trait BuilderMethods<'a, 'tcx>:
437437
/// Called for `StorageDead`
438438
fn lifetime_end(&mut self, ptr: Self::Value, size: Size);
439439

440-
fn instrprof_increment(
441-
&mut self,
442-
fn_name: Self::Value,
443-
hash: Self::Value,
444-
num_counters: Self::Value,
445-
index: Self::Value,
446-
);
447-
448440
fn call(
449441
&mut self,
450442
llty: Self::Type,

0 commit comments

Comments
 (0)