When this option is enabled, Polly will emit printf calls for each scalar load/and store which dump the scalar value loaded/stored at run time. This patch also refactors the RuntimeDebugBuilder to use variadic templates when generating CPU printfs. As result, it now becomes easier to print strings that consist of a set of arguments. Also, as a single printf call is emitted, it is more likely for such strings to be emitted atomically if executed multi-threaded. llvm-svn: 246941
24 lines
426 B
C
24 lines
426 B
C
#define N 10
|
|
void foo(float A[restrict], double B[restrict], char C[restrict],
|
|
int D[restrict], long E[restrict]) {
|
|
for (long i = 0; i < N; i++)
|
|
A[i] += B[i] + C[i] + D[i] + E[i];
|
|
}
|
|
|
|
int main() {
|
|
float A[N];
|
|
double B[N];
|
|
char C[N];
|
|
int D[N];
|
|
long E[N];
|
|
|
|
for (long i = 0; i < N; i++) {
|
|
__sync_synchronize();
|
|
A[i] = B[i] = C[i] = D[i] = E[i] = 42;
|
|
}
|
|
|
|
foo(A, B, C, D, E);
|
|
|
|
return A[8];
|
|
}
|