This is an archive of the discontinued LLVM Phabricator instance.

[MemDep] DBG intrinsics don't impact abort limit for call site dependence analysis
ClosedPublic

Authored by uabelho on Oct 23 2017, 6:40 AM.

Details

Summary

Memory dependence analysis no longer counts DbgInfoIntrinsics towards the
limit where to abort the analysis. Before, a bunch of calls to dbg.value
could affect the generated code, meaning that with -g we could generate
different code than without.

Diff Detail

Repository
rL LLVM

Event Timeline

uabelho created this revision.Oct 23 2017, 6:40 AM
efriedma added inline comments.Oct 23 2017, 1:06 PM
test/Transforms/DeadStoreElimination/mda-with-dbg-values.ll
44 ↗(On Diff #119841)

Did you hand-edit this debug info? It's missing pieces I would normally expect (specifically, the function doesn't have any debug info), so I'm not sure it's really valid. I'd prefer if you would just use debug info generated by clang so it's likely correct.

uabelho added inline comments.Oct 23 2017, 10:32 PM
test/Transforms/DeadStoreElimination/mda-with-dbg-values.ll
44 ↗(On Diff #119841)

Yes, I've hand edited it. Originally I found this with my out-of-tree frontend/backend and the example was huge. Then I've hand reduced it as much as I could without having opt complain about the input, since I thought that the only important thing with respect to the bugfix was that the single dbg.value affected the output.

uabelho updated this revision to Diff 120003.Oct 24 2017, 12:30 AM

Rebased and updated the testcase with fresh output from clang.

I did hand edit the output a little bit this time too though and replaced a dbg.declare
before the store, with a dbg.value after it, so that the bug would still trigger.

test/Transforms/DeadStoreElimination/mda-with-dbg-values.ll
44 ↗(On Diff #119841)

Do you prefer the updated version?

This revision is now accepted and ready to land.Oct 24 2017, 11:36 AM
This revision was automatically updated to reflect the committed changes.