Open
Description
CodeGenPrepare pass deletes the and
instruction without salvaging the debug value: https://godbolt.org/z/3d5f7v3oG
llvm-project/llvm/lib/CodeGen/CodeGenPrepare.cpp
Line 2274 in fa2a6d6
IR before CodeGenPrepare:
entry:
%and = and i32 %a, 4, !dbg !13
#dbg_value(i32 %and, !9, !DIExpression(), !13)
br i1 %c, label %bb0, label %bb2, !dbg !14
IR after CodeGenPrepare:
entry:
#dbg_value(i32 poison, !9, !DIExpression(), !11)
br i1 %c, label %bb0, label %bb2, !dbg !12
I'd like to give a PR to fix it.
cc @OCHyams, could you please give me an example of how regression tests check the debug info in CodeGen? (I'm not very familiar with CodeGen...)