@@ -1654,80 +1654,43 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> {
1654
1654
///
1655
1655
/// [`CodeGenPGO::emitMCDCParameters`]:
1656
1656
/// https://github.com/rust-lang/llvm-project/blob/5399a24/clang/lib/CodeGen/CodeGenPGO.cpp#L1124
1657
+ #[ instrument( level = "debug" , skip( self ) ) ]
1657
1658
pub ( crate ) fn mcdc_parameters (
1658
1659
& mut self ,
1659
1660
fn_name : & ' ll Value ,
1660
1661
hash : & ' ll Value ,
1661
1662
bitmap_bits : & ' ll Value ,
1662
1663
) {
1663
- debug ! ( "mcdc_parameters() with args ({:?}, {:?}, {:?})" , fn_name, hash, bitmap_bits) ;
1664
-
1665
1664
assert ! (
1666
1665
crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1667
1666
"MCDC intrinsics require LLVM 19 or later"
1668
1667
) ;
1669
-
1670
- let llfn = unsafe { llvm:: LLVMRustGetInstrProfMCDCParametersIntrinsic ( self . cx ( ) . llmod ) } ;
1671
- let llty = self . cx . type_func (
1672
- & [ self . cx . type_ptr ( ) , self . cx . type_i64 ( ) , self . cx . type_i32 ( ) ] ,
1673
- self . cx . type_void ( ) ,
1674
- ) ;
1675
- let args = & [ fn_name, hash, bitmap_bits] ;
1676
- let args = self . check_call ( "call" , llty, llfn, args) ;
1677
-
1678
- unsafe {
1679
- let _ = llvm:: LLVMRustBuildCall (
1680
- self . llbuilder ,
1681
- llty,
1682
- llfn,
1683
- args. as_ptr ( ) as * const & llvm:: Value ,
1684
- args. len ( ) as c_uint ,
1685
- [ ] . as_ptr ( ) ,
1686
- 0 as c_uint ,
1687
- ) ;
1688
- }
1668
+ self . call_intrinsic ( "llvm.instrprof.mcdc.parameters" , & [ fn_name, hash, bitmap_bits] ) ;
1689
1669
}
1690
1670
1671
+ #[ instrument( level = "debug" , skip( self ) ) ]
1691
1672
pub ( crate ) fn mcdc_tvbitmap_update (
1692
1673
& mut self ,
1693
1674
fn_name : & ' ll Value ,
1694
1675
hash : & ' ll Value ,
1695
1676
bitmap_index : & ' ll Value ,
1696
1677
mcdc_temp : & ' ll Value ,
1697
1678
) {
1698
- debug ! (
1699
- "mcdc_tvbitmap_update() with args ({:?}, {:?}, {:?}, {:?})" ,
1700
- fn_name, hash, bitmap_index, mcdc_temp
1701
- ) ;
1702
1679
assert ! (
1703
1680
crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1704
1681
"MCDC intrinsics require LLVM 19 or later"
1705
1682
) ;
1706
-
1707
- let llfn =
1708
- unsafe { llvm:: LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic ( self . cx ( ) . llmod ) } ;
1709
- let llty = self . cx . type_func (
1710
- & [ self . cx . type_ptr ( ) , self . cx . type_i64 ( ) , self . cx . type_i32 ( ) , self . cx . type_ptr ( ) ] ,
1711
- self . cx . type_void ( ) ,
1712
- ) ;
1713
1683
let args = & [ fn_name, hash, bitmap_index, mcdc_temp] ;
1714
- let args = self . check_call ( "call" , llty, llfn, args) ;
1715
- unsafe {
1716
- let _ = llvm:: LLVMRustBuildCall (
1717
- self . llbuilder ,
1718
- llty,
1719
- llfn,
1720
- args. as_ptr ( ) as * const & llvm:: Value ,
1721
- args. len ( ) as c_uint ,
1722
- [ ] . as_ptr ( ) ,
1723
- 0 as c_uint ,
1724
- ) ;
1725
- }
1684
+ self . call_intrinsic ( "llvm.instrprof.mcdc.tvbitmap.update" , args) ;
1685
+ }
1686
+
1687
+ #[ instrument( level = "debug" , skip( self ) ) ]
1688
+ pub ( crate ) fn mcdc_condbitmap_reset ( & mut self , mcdc_temp : & ' ll Value ) {
1726
1689
self . store ( self . const_i32 ( 0 ) , mcdc_temp, self . tcx . data_layout . i32_align . abi ) ;
1727
1690
}
1728
1691
1692
+ #[ instrument( level = "debug" , skip( self ) ) ]
1729
1693
pub ( crate ) fn mcdc_condbitmap_update ( & mut self , cond_index : & ' ll Value , mcdc_temp : & ' ll Value ) {
1730
- debug ! ( "mcdc_condbitmap_update() with args ({:?}, {:?})" , cond_index, mcdc_temp) ;
1731
1694
assert ! (
1732
1695
crate :: llvm_util:: get_version( ) >= ( 19 , 0 , 0 ) ,
1733
1696
"MCDC intrinsics require LLVM 19 or later"
0 commit comments