[PATCH] D68414: [SROA] Enhance AggLoadStoreRewriter to rewrite integer load/store if it covers multi fields in original aggregate

Guozhi Wei via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 3 15:55:51 PDT 2020


Carrot marked an inline comment as done.
Carrot added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/SROA.cpp:4142-4143
+///
+///     S1   ------
+///     S2      ------
+///
----------------
lebedev.ri wrote:
> Ignorant question: is it guaranteed that there isn't a situation like this:
> ```
> ///     S1   ------
> ///     S2      ------
> ///     S3     ------
> ```
> I.e., there is no other slice S3 overlapping S2, with different overlap characteristic? 
Although I think it is extremely unlikely in real world applications, one can easily write such code in a  synthetic test case. Function @test3 in basictest.ll demonstrates this situation, actually it is more crazily overlapped. With this patch more alloca space and related load/store instructions are eliminated.


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

https://reviews.llvm.org/D68414





More information about the llvm-commits mailing list