[llvm] [BasicBlockUtils] Remove redundant llvm.dbg instructions after blocks to reduce compile time (PR #89069)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 03:44:41 PDT 2024


================
@@ -0,0 +1,45 @@
+; RUN: opt < %s -S -passes=loop-unroll | FileCheck %s
+
+define i64 @d(i1 %tobool.not, i32 %add, i64 %conv23) {
+entry:
+  br label %for.body
+
+for.body:                                         ; preds = %for.body, %entry
+  ; There should be only one "llvm.dbg.vale" after loop unrolling
+  ; CHECK: tail call void @llvm.dbg.value(metadata i32 0, metadata !13, metadata !DIExpression()), !dbg !17
----------------
fhahn wrote:

Better to just check for `call void @llvm.dbg.value`, as otherwise the test would be unnecessary brittle, e.g. needing updating if the metadata numbering slightly changes

https://github.com/llvm/llvm-project/pull/89069


More information about the llvm-commits mailing list