[PATCH] D98122: [rs4gc] don't duplicate existing values which are provably base pointers

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 6 11:31:08 PST 2021


reames created this revision.
reames added reviewers: skatkov, dantrushin, anna.
Herald added subscribers: hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a project: LLVM.

RS4GC needs to rewrite the IR to ensure that every relocated pointer has an associated base pointer.  The existing code isn't particularly smart about avoiding duplication of existing IR when it turns out the original pointer we were asked to materialize a base pointer for is itself a base pointer.

This patch adds a stage to the algorithm which prunes nodes proven (with a simple forward dataflow fixed point) to be base pointers from the list of nodes considered for duplication.  This does require changing some of the later invariants slightly, that's probably the riskiest part of the change.

Note: The version posted is slightly WIP.  I need to confirm I can back out the recent deopt value change, and add more targeted testing of cornercases in the new inference.  I'm posting it now to get feedback in the context of the ongoing discussion on D97837 <https://reviews.llvm.org/D97837>.  Planning to rebase with mentioned changes Monday.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98122

Files:
  llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
  llvm/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
  llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
  llvm/test/Transforms/RewriteStatepointsForGC/base-vector-inseltpoison.ll
  llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll
  llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit-inseltpoison.ll
  llvm/test/Transforms/RewriteStatepointsForGC/live-vector-nosplit.ll
  llvm/test/Transforms/RewriteStatepointsForGC/rematerialize-derived-pointers.ll
  llvm/test/Transforms/RewriteStatepointsForGC/scalar-base-vector.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98122.328792.patch
Type: text/x-patch
Size: 39555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210306/58312dca/attachment.bin>


More information about the llvm-commits mailing list