[llvm] [indvars] Missing variables at Og: (PR #69920)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 11:00:46 PDT 2023


================
@@ -0,0 +1,87 @@
+; RUN: opt -passes=indvars -S -o - < %s | FileCheck %s
+
+; Missing local variable 'Index' after loop 'Induction Variable Elimination'.
+; When adding a breakpoint at line 11, LLDB does not have information on
+; the variable. But it has info on 'Var' and 'End'.
+
+;  1	__attribute__((optnone)) int nop(int Param) {
+;  2	  return 0;
+;  3	}
+;  4
+;  5	void bar() {
+;  6    int End = 777;
+;  7	  int Index = 27;
+;  8	  char Var = 1;
+;  9	  for (; Index < End; ++Index)
+; 10	    ;
+; 11	  nop(Index);
+; 12	}
+; 13
+; 14	int main () {
+; 15	  bar();
+; 16	}
+
+; CHECK: for.cond: {{.*}}
+; CHECK:   call void @llvm.dbg.value(metadata i32 %Index.{{[0-9]+}}, metadata ![[DBG:[0-9]+]], {{.*}}
+; CHECK:   call void @llvm.dbg.value(metadata i32 %inc, metadata ![[DBG:[0-9]+]], {{.*}}
+; CHECK: for.end: {{.*}}
+; CHECK:   call void @llvm.dbg.value(metadata i32 777, metadata ![[DBG:[0-9]+]], {{.*}}
+; CHECK-DAG: ![[DBG]] = !DILocalVariable(name: "Index"{{.*}})
+
+define dso_local void @_Z3barv() local_unnamed_addr #2 !dbg !18 {
+entry:
+  call void @llvm.dbg.value(metadata i32 777, metadata !21, metadata !DIExpression()), !dbg !22
----------------
felipepiovezan wrote:

Is this and the third intrinsic relevant for the test? (i.e. the intrinsics that *don't* target `!23 = Index`

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


More information about the llvm-commits mailing list