This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo@O2] Fix pr41175 Dead Store Elimination missing debug loc
ClosedPublic

Authored by Orlando on Apr 11 2019, 2:08 AM.

Details

Summary

Bug: https://bugs.llvm.org/show_bug.cgi?id=41175

In the bug test case the DSE pass is shortening the range of memory that a memset is working on. A getelementptr is generated so that the new starting address can be passed to memset. This instruction was not given a DebugLoc.

To fix the bug I copy the DebugLoc from the memset instruction.
I've added a test that checks this.

Diff Detail

Repository
rL LLVM

Event Timeline

Orlando created this revision.Apr 11 2019, 2:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 11 2019, 2:08 AM
aprantl accepted this revision.Apr 11 2019, 8:26 AM
aprantl added inline comments.
llvm/test/Transforms/DeadStoreElimination/memset-missing-debugloc.ll
5

is the !16 necessary? Hardcoded numbers are bound to break sooner or later.

6

CHECK-NEXT?

This revision is now accepted and ready to land.Apr 11 2019, 8:26 AM
Orlando updated this revision to Diff 194818.Apr 12 2019, 2:02 AM

I've made the suggested changes.

Please could someone commit this change for me? I do not have commit access.

Thanks,
Orlando

Orlando marked 2 inline comments as done.Apr 12 2019, 2:03 AM
jmorse added a subscriber: jmorse.Apr 12 2019, 2:06 AM

(I'll commit)

This revision was automatically updated to reflect the committed changes.