Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DebugInfo][CodeGenPrepare] Debug value loss caused by deleting the and instruction #139219

Copy link
Copy link
Open
@Apochens

Description

@Apochens
Issue body actions

CodeGenPrepare pass deletes the and instruction without salvaging the debug value: https://godbolt.org/z/3d5f7v3oG

AndI->eraseFromParent();

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...)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.