This is an archive of the discontinued LLVM Phabricator instance.

Merge debug info when hoist then-else code to if.
ClosedPublic

Authored by danielcdh on Aug 15 2017, 6:06 PM.

Details

Summary

When we move then-else code to if, we need to merge its debug info, otherwise the hoisted instruction may have inaccurate debug info attached.

Event Timeline

danielcdh created this revision.Aug 15 2017, 6:06 PM
aprantl accepted this revision.Aug 15 2017, 6:26 PM

LGTM with an improved testcase.

test/Transforms/SimplifyCFG/min_dbginfo.ll
5

This test also passes when opt is symlinked to /bin/— can you add a positive check, too?

This revision is now accepted and ready to land.Aug 15 2017, 6:26 PM
aprantl added inline comments.Aug 15 2017, 6:27 PM
test/Transforms/SimplifyCFG/min_dbginfo.ll
5

I meant to say ... to /bin/true.

danielcdh updated this revision to Diff 111295.Aug 15 2017, 6:56 PM
danielcdh marked 2 inline comments as done.

add positive test

danielcdh closed this revision.Aug 15 2017, 6:56 PM