[llvm-dev] Structure transformations (splitting/peeling, field reordering) in LLVM

Roman Lebedev via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 14 02:27:46 PST 2021


FWIW, SROA can do alloca splitting, and GlobalOpt can to global
constant splitting.
The problem with doing that on a larger scale, i.e. on the whole structure,
is basically identical to the problem of Struct-of-Arrays <-> Array-of-Structs,
i.e. you need to be sure to really get every single instance, i.e. you
basically need LTO.

That being said i'm currently tracking towards allowing SROA in presence of
pointer escapes through calls, and, more interestingly, performing
alloca splitting
in presence of variable GEP's.

Roman

On Tue, Dec 14, 2021 at 1:18 PM chuanqi.xcq via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> Hi,
>
>    AFAIK, there is SROA pass in LLVM to split structure. But I don't remember there are pass to reorder fields.
>
> Thanks,
> Chuanqi
>
> ------------------------------------------------------------------
> From:llvm-dev <llvm-dev at lists.llvm.org>
> Send Time:2021年12月14日(星期二) 16:47
> To:llvm-dev <llvm-dev at lists.llvm.org>
> Subject:[llvm-dev] Structure transformations (splitting/peeling, field reordering) in LLVM
>
> Hello!
> I want to implement data layout optimizations, such as structure splitting/peeling, field reordering, etc. I know that such optimizations have not been implemented in LLVM (despite several research works in this field). But maybe somebody knows, whether at least transformations themselves (I mean splitting/peeling/reordering) are implemented in LLVM? I feel that some time ago I saw somewhere these transformations were implemented, maybe in some experimental part of LLVM, but now I can't find it despite my best efforts.
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list