mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 21:15:18 +03:00
Rollup merge of #52171 - bharrisau:fsub-count, r=estebank
Correct some codegen stats counter inconsistencies I noticed some possible typos/inconsistencies in the codegen counters. For example, `fsub` was getting counted as an integer `sub`, whereas `fadd` was counted as an add. And `addincoming` was only being counted on the initial call. https://github.com/rust-lang/rust/blob/dbd10f81758381339f98994b8d31814cf5e98707/src/librustc_codegen_llvm/builder.rs#L831-L841 Only remaining inconsistencies I can see are things like `fadd_fast` are counted as `fadd`. But the vector versions like `vector_reduce_fmax_fast` are counted as `vector.reduce.fmax_fast` not as their 'base' versions (`vector_reduce_fmax` is counted as `vector.reduce.fmax`).
This commit is contained in:
@@ -277,7 +277,7 @@ pub fn sub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
|
||||
}
|
||||
|
||||
pub fn nswsub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
|
||||
self.count_insn("nwsub");
|
||||
self.count_insn("nswsub");
|
||||
unsafe {
|
||||
llvm::LLVMBuildNSWSub(self.llbuilder, lhs, rhs, noname())
|
||||
}
|
||||
@@ -291,14 +291,14 @@ pub fn nuwsub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
|
||||
}
|
||||
|
||||
pub fn fsub(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
|
||||
self.count_insn("sub");
|
||||
self.count_insn("fsub");
|
||||
unsafe {
|
||||
llvm::LLVMBuildFSub(self.llbuilder, lhs, rhs, noname())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fsub_fast(&self, lhs: ValueRef, rhs: ValueRef) -> ValueRef {
|
||||
self.count_insn("sub");
|
||||
self.count_insn("fsub");
|
||||
unsafe {
|
||||
let instr = llvm::LLVMBuildFSub(self.llbuilder, lhs, rhs, noname());
|
||||
llvm::LLVMRustSetHasUnsafeAlgebra(instr);
|
||||
@@ -1315,6 +1315,7 @@ pub fn add_case(&self, s: ValueRef, on_val: ValueRef, dest: BasicBlockRef) {
|
||||
}
|
||||
|
||||
pub fn add_incoming_to_phi(&self, phi: ValueRef, val: ValueRef, bb: BasicBlockRef) {
|
||||
self.count_insn("addincoming");
|
||||
unsafe {
|
||||
llvm::LLVMAddIncoming(phi, &val, &bb, 1 as c_uint);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user