Alan Zhao 613344a7f9
[GVN] Restore the NumGVNInstr metric (#182380)
The NumGVNInstr metric counts the number of instructions deleted by the
GVN pass. #131753 changed where the instructions were deleted in the
pass, but that PR did not update the NumGVNInstr metric whenever
instructions were deleted. This PR fixes that bug by updating
NumGVNInstr whenever `removeInstruction(...)` is called.
2026-02-20 00:25:01 +00:00

16 lines
375 B
LLVM

; REQUIRES: asserts
; RUN: opt < %s -stats -passes=gvn -disable-output 2>&1 | FileCheck %s
define i32 @main() {
block1:
%z1 = bitcast i32 0 to i32
br label %block2
block2:
%z2 = bitcast i32 0 to i32
ret i32 %z2
}
; CHECK-DAG: 1 gvn - Number of blocks merged
; CHECK-DAG: 2 gvn - Number of instructions deleted
; CHECK-DAG: 2 gvn - Number of instructions simplified