OSDN Git Service

[LIR] Add support for structs and hand unrolled loops
authorHaicheng Wu <haicheng@codeaurora.org>
Sat, 23 Jan 2016 06:52:41 +0000 (06:52 +0000)
committerHaicheng Wu <haicheng@codeaurora.org>
Sat, 23 Jan 2016 06:52:41 +0000 (06:52 +0000)
commit98b6bad4c86bc2273807981e81f0141e66df66c6
treea685370d6c1254cf9ae2ea022fc36c80e049853b
parent578afd47d551d2a2daef4a62f5dcd5fde1b7653c
[LIR] Add support for structs and hand unrolled loops

Now LIR can turn following codes into memset:

typedef struct foo {
  int a;
  int b;
} foo_t;

void bar(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; ++i) {
    f[i].a = 0;
    f[i].b = 0;
  }
}

void test(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; i += 2) {
    f[i] = 0;
    f[i+1] = 0;
  }
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258620 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/LoopAccessAnalysis.h
lib/Analysis/LoopAccessAnalysis.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/LoopIdiom/struct.ll [new file with mode: 0644]
test/Transforms/LoopIdiom/struct_pattern.ll [new file with mode: 0644]
test/Transforms/LoopIdiom/unroll.ll [new file with mode: 0644]