[PATCH] [GC] improve testing around gc.relocate and catch a bug

Philip Reames listmail at philipreames.com
Wed Jan 7 12:01:54 PST 2015


In http://reviews.llvm.org/D6824#105194, @artagnon wrote:

> (After watching the LLVMDev talk): Did you mean that the result of the relocate is unused, and hence no code is generated? If I did `%a = gc.relocate(...)`, and then used `%a` in another `gc.statepoint` call, then a `mov` will be generated like in statepoint-stack-usage.ll? The `mov` is generated because it's assuming that the gc is relocating the base, and then returning a new derived with some offset (= the original derived - base) for use with the second `gc.statepoint`?


I'm having a hard time parsing your question.

Let me lay out a few facts; I think that together these address what you're getting at.

1. Once inserted, any use (even a trivial one) will cause the pointer to be saved in the stackmap.
2. For a derived pointer to be relocated, it's base pointer must be as well.  (If the derived pointer is a base pointer, this is trivial.)
3. The offset between a relocated derived pointer and it's relocated base must be the same as the offset between the original derived pointer and the original base.

W.r.t. this patch, is it ready for submission?  Or does the clarification above change something?  Once you consider it ready, let me know and I'll submit on your behalf.


http://reviews.llvm.org/D6824

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list