
The 'cache' construct is lowered as marking the acc.loop in ACC MLIR. This results in any variable references that are not inside of the acc.loop being invalid. This patch adds a warning to that effect, and ensures that the variable references won't be added to the AST during parsing so we don't try to lower them. This results in loss of instantiation-diagnostics for these, however that seems like an acceptable consequence to ignoring it.
13 lines
354 B
C++
13 lines
354 B
C++
// RUN: %clang_cc1 -fopenacc -ast-print %s -o - | FileCheck %s
|
|
|
|
void foo() {
|
|
int Array[5];
|
|
#pragma acc loop
|
|
for(int i = 0; i < 5; ++i) {
|
|
// CHECK: #pragma acc cache(readonly: Array[1], Array[1:2])
|
|
#pragma acc cache(readonly:Array[1], Array[1:2])
|
|
// CHECK: #pragma acc cache(Array[1], Array[1:2])
|
|
#pragma acc cache(Array[1], Array[1:2])
|
|
}
|
|
}
|