[all-commits] [llvm/llvm-project] 3c246e: True fixpoint algorithm in RS4GC (#75826)

Petr Maj via All-commits all-commits at lists.llvm.org
Mon Jan 22 06:10:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3c246efd04210af56ab6ce960b98283ec5bc7c30
      https://github.com/llvm/llvm-project/commit/3c246efd04210af56ab6ce960b98283ec5bc7c30
  Author: Petr Maj <53400784+zduka at users.noreply.github.com>
  Date:   2024-01-22 (Mon, 22 Jan 2024)

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

  Log Message:
  -----------
  True fixpoint algorithm in RS4GC (#75826)

Fixes a problem where the explicit marking of various instructions as
conflicts did not propagate to their users. An example of this:

```
%getelementptr = getelementptr i8, <2 x ptr addrspace(1)> zeroinitializer, <2 x i64> <i64 888, i64 908>
%shufflevector = shufflevector <2 x ptr addrspace(1)> %getelementptr, <2 x ptr addrspace(1)> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%shufflevector1 = shufflevector <2 x ptr addrspace(1)> %getelementptr, <2 x ptr addrspace(1)> zeroinitializer, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%select = select i1 false, <4 x ptr addrspace(1)> %shufflevector1, <4 x ptr addrspace(1)> %shufflevector
```

Here the vector shuffles will get single base (gep) during the fixpoint
and therefore the select will get a known base (gep). We later mark the
shuffles as conflicts, but this does not change the base of select. This
gets caught by an assert where the select's type will differ from its
(wrong) base later on.

The solution in the MR is to move the explicit conflict marking into the
fixpoint phase.

---------

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




More information about the All-commits mailing list