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.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
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.
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.