[all-commits] [llvm/llvm-project] a13582: Improvements to RS4GC BDV Algorithm (#69795)

Petr Maj via All-commits all-commits at lists.llvm.org
Thu Nov 2 17:19:53 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a1358225c5b791fa9d901e74fb09606189c0e6af
      https://github.com/llvm/llvm-project/commit/a1358225c5b791fa9d901e74fb09606189c0e6af
  Author: Petr Maj <53400784+zduka at users.noreply.github.com>
  Date:   2023-11-02 (Thu, 02 Nov 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    M llvm/test/Transforms/RewriteStatepointsForGC/base-vector.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/constants.ll
    A llvm/test/Transforms/RewriteStatepointsForGC/insert-extract.ll
    M llvm/test/Transforms/RewriteStatepointsForGC/vector-bitcast.ll

  Log Message:
  -----------
  Improvements to RS4GC BDV Algorithm (#69795)

Previously, after the algorithm fixpointed, the state was manually
patched by emitting BDVs for EE instructions earlier, while marking some
(but not all) vector and vector<->scalar instructions as conflict. This
causes issues as not all instructions that required BDVs had them
emitted and due to after-fixpoint patching, the extra BDVs did not
propagate to their users.

This change fixes both by rewriting the logic for BDV insertion &
patching. Instead of inserting the BDV for EE earlier, it merely marks
every EE instruction as a conflict. The two phase insertion algorithm
(first insert empty instructions and patch the BDVState, then actually
connect the BDV instructions to their input bases) then ensures correct
propagation to all its users. Furthermore the shufflevector instruction
as well as all instances of IE instruction are conservatively marked as
conflicts as well, fixing the second problem.

This change does not fix the handling of constant values and vectors in
the BDV. 

---------

Co-authored-by: Petr Maj <pmaj at azul.com>




More information about the All-commits mailing list