[PATCH] D61911: [GlobalOpt] Allow dead struct fields in SRA with non constant offset.

Christian Bruel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 07:07:33 PDT 2019


chrib added a comment.

I see. yes the fix is still there and I checked that this bug doesn't regresses.

The fix for the GEP check from the last comment is still there, but moved it around the GlovalValue first level to be candidate for SRA . This allow StructType fields to be scalarized apart.

as is 'a' and 'b' in

  struct Expr {
      int a[3][3];
      int b;
    };
  
    static struct Expr e;
  
    int
    foo(int i)
    {
      e.a[i][0] = 1;
      e.b = 2;
      return e.a[0][0];
    }

but multiple arrays non-constant accesses should be safe

In D61911#1557439 <https://reviews.llvm.org/D61911#1557439>, @xbolva00 wrote:

> Ah, sorry. I meant Eli’s link:
>  https://bugs.llvm.org/show_bug.cgi?id=38309





Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D61911/new/

https://reviews.llvm.org/D61911





More information about the llvm-commits mailing list