Skip to content

Commit

Permalink
Correct some codegen stats counters
Browse files Browse the repository at this point in the history
  • Loading branch information
bharrisau committed Jul 9, 2018
1 parent a80a610 commit aac0d91
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/librustc_codegen_llvm/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}

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())
}
Expand All @@ -291,14 +291,14 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}

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);
Expand Down Expand Up @@ -1315,6 +1315,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}

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);
}
Expand Down

0 comments on commit aac0d91

Please sign in to comment.