diff options
author | Tobias Grosser <tobias@grosser.es> | 2016-12-02 08:10:56 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2016-12-02 08:10:56 +0000 |
commit | bedef00e2c1d54f8afb75d42636cebcbe193702d (patch) | |
tree | 76325522fa6e5a611c3b18aff94263a4a3f993d1 /clang/lib/Frontend/InitHeaderSearch.cpp | |
parent | 6bdcb1f0e91afec5e67c5d3cfb5da97c66fe3704 (diff) | |
download | llvm-bedef00e2c1d54f8afb75d42636cebcbe193702d.zip llvm-bedef00e2c1d54f8afb75d42636cebcbe193702d.tar.gz llvm-bedef00e2c1d54f8afb75d42636cebcbe193702d.tar.bz2 |
[ScopInfo] Fold constant coefficients in array dimensions to the right
This allows us to delinearize code such as the one below, where the array
sizes are A[][2 * n] as there are n times two elements in the innermost
dimension. Alternatively, we could try to generate another dimension for the
struct in the innermost dimension, but as the struct has constant size,
recovering this dimension is easy.
struct com {
double Real;
double Img;
};
void foo(long n, struct com A[][n]) {
for (long i = 0; i < 100; i++)
for (long j = 0; j < 1000; j++)
A[i][j].Real += A[i][j].Img;
}
int main() {
struct com A[100][1000];
foo(1000, A);
llvm-svn: 288489
Diffstat (limited to 'clang/lib/Frontend/InitHeaderSearch.cpp')
0 files changed, 0 insertions, 0 deletions