Skip to content

Commit 8f07514

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

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed

Diff for: compiler/rustc_codegen_gcc/src/builder.rs

-10
Original file line numberDiff line numberDiff line change
@@ -1725,16 +1725,6 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
17251725
fn fptosi_sat(&mut self, val: RValue<'gcc>, dest_ty: Type<'gcc>) -> RValue<'gcc> {
17261726
self.fptoint_sat(true, val, dest_ty)
17271727
}
1728-
1729-
fn instrprof_increment(
1730-
&mut self,
1731-
_fn_name: RValue<'gcc>,
1732-
_hash: RValue<'gcc>,
1733-
_num_counters: RValue<'gcc>,
1734-
_index: RValue<'gcc>,
1735-
) {
1736-
unimplemented!();
1737-
}
17381728
}
17391729

17401730
impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {

Diff for: 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

Diff for: 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)