Page MenuHomePhabricator

[DebugInfo] Inline for without DebugLocation
ClosedPublic

Authored by gramanas on Jun 4 2018, 8:08 AM.

Details

Summary

This test is a strip down version of a function inside the
amalgamated sqlite source. When converted to IR clang produces
a phi instruction without debug location.

It is a continuation of D47097 focusing on a different problem
of similar structure.

This was found while investigating instructions with missing DebugLoc
after running SROA on the amalgamated sqlite source, in an attempt to
try and preserve as much debug information as possible during the
early stage passes.

Diff Detail

Repository
rL LLVM

Event Timeline

gramanas created this revision.Jun 4 2018, 8:08 AM
aprantl added inline comments.Jun 4 2018, 8:54 AM
test/CodeGen/debug-info-inline-for.c
2 ↗(On Diff #149772)

Please add a comment explaining what is being tested here.

gramanas updated this revision to Diff 149996.Jun 5 2018, 9:00 AM

Add comment explaining the test

gramanas marked an inline comment as done.Jun 5 2018, 9:00 AM
aprantl added inline comments.Jun 5 2018, 10:03 AM
test/CodeGen/debug-info-inline-for.c
13 ↗(On Diff #149996)

Shouldn't you also check *which* location is attached to it?

gramanas updated this revision to Diff 150036.Jun 5 2018, 1:47 PM
gramanas marked an inline comment as done.

Add artificial debug location to the phi instruction

test/CodeGen/debug-info-inline-for.c
13 ↗(On Diff #149996)

I wasn't sure if this should be an artificial location or not so I left it like that for the time being. It's been updated to reflect the latest changes now.

vsk accepted this revision.Jun 5 2018, 1:59 PM

As is the case with D47097, this helps preserve more scope information after SROA. LGTM. Thanks!

This revision is now accepted and ready to land.Jun 5 2018, 1:59 PM
gramanas updated this revision to Diff 150135.Jun 6 2018, 7:50 AM

make code more readable

ping! should I commit this?

ping! should I commit this?

@vsk accepted it, so yes go ahead.

This revision was automatically updated to reflect the committed changes.