[all-commits] [llvm/llvm-project] 99f93d: [rs4gc] avoid insert base computation instructions...

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Mar 5 09:58:45 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99f93dd3a502568441da3db04ddf0655a2e38c24
      https://github.com/llvm/llvm-project/commit/99f93dd3a502568441da3db04ddf0655a2e38c24
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2021-03-05 (Fri, 05 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    M llvm/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/scalar-base-vector.ll

  Log Message:
  -----------
  [rs4gc] avoid insert base computation instructions for deopt uses

If we have a value live over a call which is used for deopt at the call, we know that the value must be a base pointer. We can avoid potentially inserting IR to materialize a base for this value.

In it's current form, this is mostly a compile time optimization.   Building the base pointer graph (and then optimizing it away again) is a relatively expensive operation.  We also sometimes end up with better codegen in practice - due to failures in optimizing away the inserted base pointer propogation - but those are optimization bugs we're fixing concurrently.

The alternative to this would be to extend the base pointer inference with the ability to generally reuse multiple-base input instructions (phis and selects).  That's somewhat invasive and complicated, so we're defering it a bit longer.

Differential Revision: https://reviews.llvm.org/D97885




More information about the All-commits mailing list