[all-commits] [llvm/llvm-project] 5cabf4: [rs4gc] don't duplicate existing values which are ...

Philip Reames via All-commits all-commits at lists.llvm.org
Tue Mar 16 12:51:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5cabf472cb3c434bbf03889623c09b14f5c62f26
      https://github.com/llvm/llvm-project/commit/5cabf472cb3c434bbf03889623c09b14f5c62f26
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-03-16 (Tue, 16 Mar 2021)

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

  Log Message:
  -----------
  [rs4gc] don't duplicate existing values which are provably base pointers

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.

Differential Revision: D98122




More information about the All-commits mailing list