This is an archive of the discontinued LLVM Phabricator instance.

PlaceSafepoints: use IRBuilder helpers
ClosedPublic

Authored by artagnon on Feb 9 2015, 1:49 PM.

Details

Summary

Use the IRBuilder helpers for gc.statepoint and gc.result, instead of
coding the construction by hand. Note that the gc.statepoint IRBuilder
handles only CallInst, not InvokeInst; retain that part of hand-coding.

Diff Detail

Repository
rL LLVM

Event Timeline

artagnon updated this revision to Diff 19610.Feb 9 2015, 1:49 PM
artagnon retitled this revision from to PlaceSafepoints: use IRBuilder helpers.
artagnon updated this object.
artagnon edited the test plan for this revision. (Show Details)
artagnon added a reviewer: reames.
artagnon added a subscriber: Unknown Object (MLST).
reames edited edge metadata.Feb 9 2015, 2:54 PM

The relocate part of this change LGTM w/one change: The old code took the name of the replaced call for the result. This is useful for keeping the IR readable. Please add a test for this as well.

The statepoint parts I would prefer to delay a week or so. I'm waiting on a coworker to land the invoke specific tests and I want that to happen before adjusting the codepath in question.

The relocate part of this change LGTM w/one change: The old code took the name of the replaced call for the result. This is useful for keeping the IR readable. Please add a test for this as well.

It's not what you'd naively expect, because the replaceAllUsesWith is called after the new instruction is inserted into the tree: therefore, you get %foo1 where %foo was the name of the original call. Would you like me to retain (and test) this bogus expectation, or should I retain the empty string, and attempt the name splicing in another patch (doing it the way I did it in the early CGP patch)?

reames added a comment.Feb 9 2015, 3:31 PM

The relocate part of this change LGTM w/one change: The old code took the name of the replaced call for the result. This is useful for keeping the IR readable. Please add a test for this as well.

It's not what you'd naively expect, because the replaceAllUsesWith is called after the new instruction is inserted into the tree: therefore, you get %foo1 where %foo was the name of the original call. Would you like me to retain (and test) this bogus expectation, or should I retain the empty string, and attempt the name splicing in another patch (doing it the way I did it in the early CGP patch)?

Feel free to take either approach. No preference. takeName might be the easiest approach, but entirely up to you. You do not need to preserve the exact mangling behaviour.

http://reviews.llvm.org/D7535 (the invoke tests) should land in the morning. Once that's in, feel free to submit this. No further review needed.

This revision was automatically updated to reflect the committed changes.