1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/Transforms
Hiroshi Inoue 95d5529edc [SROA] enable splitting for non-whole-alloca loads and stores
Currently, SROA splits loads and stores only when they are accessing the whole alloca.
This patch relaxes this limitation to allow splitting a load/store if all other loads and stores to the alloca are disjoint to or fully included in the current load/store. If there is no other load or store that crosses the boundary of the current load/store, the current splitting implementation works as is.
The whole-alloca loads and stores meet this new condition and so they are still splittable.

Here is a simplified motivating example.

struct record {
    long long a;
    int b;
    int c;
};

int func(struct record r) {
    for (int i = 0; i < r.c; i++)
        r.b++;
    return r.b;
}

When updating r.b (or r.c as well), LLVM generates redundant instructions on some platforms (such as x86_64, ppc64); here, r.b and r.c are packed into one 64-bit GPR when the struct is passed as a method argument.

With this patch, the above example is compiled into only few instructions without loop.
Without the patch, unnecessary loop-carried dependency is introduced by SROA and the loop cannot be eliminated by the later optimizers.

Differential Revision: https://reviews.llvm.org/D32998

llvm-svn: 319407
2017-11-30 07:44:46 +00:00
..
Coroutines [coro] Make Spill a proper struct instead of deriving from pair. 2017-10-31 19:22:55 +00:00
Hello
InstCombine [InstCombine] use 'auto' with 'dyn_cast'; NFC 2017-11-27 18:19:32 +00:00
Instrumentation MSan: remove an unnecessary cast. NFC for userspace instrumenetation. 2017-11-23 15:06:51 +00:00
IPO - Removed unused lamba (IsReturnBlock) causing build bots to fail for r319398 2017-11-30 03:36:57 +00:00
ObjCARC [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-27 01:09:08 +00:00
Scalar [SROA] enable splitting for non-whole-alloca loads and stores 2017-11-30 07:44:46 +00:00
Utils EntryExitInstrumenter: set DebugLocs on the inserted call instructions (PR35412) 2017-11-28 18:44:26 +00:00
Vectorize Add MemorySSA as loop dependency, disabled by default [NFC]. 2017-11-21 15:45:46 +00:00
CMakeLists.txt
LLVMBuild.txt