Page MenuHomePhabricator

[DeadArgumentElim] Set pointer to DISubprogram before calling RAUW. NFC
ClosedPublic

Authored by djtodoro on Feb 1 2018, 6:56 AM.

Details

Summary

It is better to update pointer of the DISuprogram before we call RAUW for still live arguments of the function, because with D42541 in RAUW we compare DISubprograms rather than functions itself.

Diff Detail

Repository
rL LLVM

Event Timeline

djtodoro created this revision.Feb 1 2018, 6:56 AM
aprantl accepted this revision.Feb 1 2018, 8:36 AM

The change LGTM, but now I wonder why this didn't break any tests. Are we missing coverage here?

This revision is now accepted and ready to land.Feb 1 2018, 8:36 AM

@aprantl All test cases pass. That is why RAUW has redundant check (getLocalFunctionMetadata for From and To). Maybe in some cases LLVM PASS just did not get the place where actually it updates the pointer to the DISubprogram (or it was pointer to the function before D42541) and if it is null at that particular point that does not mean that it clobbers dbg info (because it would be != than other metadata at the time).

mattd added a subscriber: mattd.Feb 1 2018, 10:56 AM

@djtodoro thanks, this change looks nice, it makes the code easier to read too!
Just a suggestion, could we just set the Subprogram earlier where we set all of the
more basic properties of the function, when NF is created around line 819, or is
that too soon?

@mattd Thanks! I don't see any obstacle to do that, it sounds good to me to set it even earlier.
@aprantl what do you think?

Works for me.

djtodoro updated this revision to Diff 132812.Feb 5 2018, 7:58 AM
djtodoro retitled this revision from [DeadArgumentElimination] Update pointer to the DISubprogram before calling RAUW. NFC to [DeadArgumentElim] Set pointer to DISubprogram before calling RAUW. NFC.Feb 6 2018, 3:09 AM
This revision was automatically updated to reflect the committed changes.