Page MenuHomePhabricator

[FastISel] Lower `llvm.dbg.value(undef, ...` correctly.
ClosedPublic

Authored by davide on Jan 16 2020, 2:09 PM.

Diff Detail

Event Timeline

davide created this revision.Jan 16 2020, 2:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2020, 2:09 PM
Herald added a subscriber: hiraditya. · View Herald Transcript

Thanks!

llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
1417

This comment is no longer correct. It may fits for the !V case, but dbg.value(undef)s are a feature and not a bug.

llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll
5

Can you drop the !34? It's not relevant anyway.

53

You could drop all these by just pointing every type to the DIFile directly.

davide marked 2 inline comments as done.Jan 16 2020, 2:55 PM
davide added inline comments.
llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll
5

Sure!

53

I really wish bugpoint was smart enough to do this transformation :)

davide updated this revision to Diff 238641.Jan 16 2020, 3:13 PM

Adrian's comments.

davide updated this revision to Diff 238644.Jan 16 2020, 3:15 PM
  • [FastIsel] Update comments to reflect reality.

@aprantl should be ready for another pass.

vsk added inline comments.Jan 16 2020, 3:20 PM
llvm/test/CodeGen/AArch64/fastisel-debugvalue-undef.ll
5

Shorter repro:

target triple = "arm64-apple-ios13.4.0"
define void @foo() !dbg !6 {
  ; CHECK: DBG_VALUE $noreg, $noreg, !"1", !DIExpression()
  call void @llvm.dbg.value(metadata i32* undef, metadata !9, metadata !DIExpression()), !dbg !11
  ret void, !dbg !12
}

declare void @llvm.dbg.value(metadata, metadata, metadata)

!llvm.dbg.cu = !{!0}
!llvm.debugify = !{!3, !4}
!llvm.module.flags = !{!5}

!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "t.ll", directory: "/")
!2 = !{}
!3 = !{i32 2}
!4 = !{i32 1}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)
!7 = !DISubroutineType(types: !2)
!8 = !{!9}
!9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10)
!10 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)
!11 = !DILocation(line: 1, column: 1, scope: !6)
!12 = !DILocation(line: 2, column: 1, scope: !6)
aprantl accepted this revision.Jan 16 2020, 3:25 PM

LGTM with Vedant's testcase!

This revision is now accepted and ready to land.Jan 16 2020, 3:25 PM
This revision was automatically updated to reflect the committed changes.