[llvm] Add a pass to collect dropped variable statistics (PR #102233)
Adrian Prantl via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 12 08:54:36 PDT 2024
================
@@ -0,0 +1,30 @@
+; RUN: opt -dropped-variable-stats %s -passes='adce' -S | FileCheck %s
+
+; CHECK: Pass Level, Pass Name, Num of Dropped Variables, Func or Module Name
+; CHECK-NEXT: Function, ADCEPass, 1, _Z3bari
+
+; RUN: opt -dropped-variable-stats %s -passes='verify' -S | FileCheck %s --check-prefix=NOT-DROPPED
+; NOT-DROPPED: Pass Level, Pass Name, Num of Dropped Variables, Func or Module Name
+; NOT-DROPPED-NOT: Function, ADCEPass, 1, _Z3bari
+
+; ModuleID = '/tmp/dropped.cpp'
+define noundef range(i32 -2147483646, -2147483648) i32 @_Z3bari(i32 noundef %y) local_unnamed_addr #1 !dbg !19 {
+ #dbg_value(i32 %y, !15, !DIExpression(), !23)
+ %add = add nsw i32 %y, 2,!dbg !25
+ ret i32 %add,!dbg !26
+}
----------------
adrian-prantl wrote:
You're missing tests for the inline case and/or a lexical scope with a dbg_value that has all of its (childrens') instructions eliminated.
https://github.com/llvm/llvm-project/pull/102233
More information about the llvm-commits
mailing list