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

Christian BRUEL via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 07:00:58 PDT 2019


On 6/25/19 3:52 PM, Dávid Bolvanský via Phabricator wrote:
> xbolva00 added a comment.
>
> Ah, sorry. I meant Eli’s link:
> https://bugs.llvm.org/show_bug.cgi?id=38309

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

Cheers,

Christian


>
>
> 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