-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[flang][acc] Add TODO for cache directive lowering #170608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-flang-fir-hlfir @llvm/pr-subscribers-openacc Author: Zhen Wang (wangzpgi) ChangesThe OpenACC cache directive is not yet fully implemented. Add a TODO to emit a clear "not yet implemented" error during lowering. Full diff: https://github.com/llvm/llvm-project/pull/170608.diff 3 Files Affected:
diff --git a/flang/lib/Lower/OpenACC.cpp b/flang/lib/Lower/OpenACC.cpp
index 69c3300ba4390..5a548f4fcf435 100644
--- a/flang/lib/Lower/OpenACC.cpp
+++ b/flang/lib/Lower/OpenACC.cpp
@@ -4787,6 +4787,8 @@ genACC(Fortran::lower::AbstractConverter &converter,
Fortran::semantics::SemanticsContext &semanticsContext,
const Fortran::parser::OpenACCCacheConstruct &cacheConstruct) {
fir::FirOpBuilder &builder = converter.getFirOpBuilder();
+ mlir::Location loc = converter.genLocation(cacheConstruct.source);
+ TODO(loc, "OpenACC cache directive");
auto loopOp = builder.getRegion().getParentOfType<mlir::acc::LoopOp>();
auto crtPos = builder.saveInsertionPoint();
if (loopOp) {
diff --git a/flang/test/Lower/OpenACC/Todo/acc-cache.f90 b/flang/test/Lower/OpenACC/Todo/acc-cache.f90
new file mode 100644
index 0000000000000..8b81e876ed2c9
--- /dev/null
+++ b/flang/test/Lower/OpenACC/Todo/acc-cache.f90
@@ -0,0 +1,15 @@
+! RUN: %not_todo_cmd bbc -fopenacc -emit-hlfir %s -o - 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: OpenACC cache directive
+
+subroutine test_cache()
+ integer, parameter :: n = 10
+ real, dimension(n) :: a, b
+ integer :: i
+
+ !$acc loop
+ do i = 1, n
+ !$acc cache(b)
+ a(i) = b(i)
+ end do
+end subroutine
diff --git a/flang/test/Lower/OpenACC/acc-loop.f90 b/flang/test/Lower/OpenACC/acc-loop.f90
index 6adf06ad9cd53..ed87cf76038b5 100644
--- a/flang/test/Lower/OpenACC/acc-loop.f90
+++ b/flang/test/Lower/OpenACC/acc-loop.f90
@@ -359,15 +359,6 @@ program acc_loop
! CHECK: acc.yield
! CHECK-NEXT: } attributes {inclusiveUpperbound = array<i1: true>, independent = [#acc.device_type<none>]}
- !$acc loop
- DO i = 1, n
- !$acc cache(b)
- a(i) = b(i)
- END DO
-
-! CHECK: %[[CACHE:.*]] = acc.cache varPtr(%{{.*}} : !fir.ref<!fir.array<10xf32>>) -> !fir.ref<!fir.array<10xf32>> {name = "b"}
-! CHECK: acc.loop {{.*}} cache(%[[CACHE]] : !fir.ref<!fir.array<10xf32>>)
-
!$acc loop
do 100 i=0, n
100 continue
|
| const Fortran::parser::OpenACCCacheConstruct &cacheConstruct) { | ||
| fir::FirOpBuilder &builder = converter.getFirOpBuilder(); | ||
| mlir::Location loc = converter.genLocation(cacheConstruct.source); | ||
| TODO(loc, "OpenACC cache directive"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we keep the code after the TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR was auto-merged before I saw your comment. I will clean up in a separate PR. Thanks.
The OpenACC cache directive is not yet fully implemented. Add a TODO to emit a clear "not yet implemented" error during lowering.
The OpenACC cache directive is not yet fully implemented. Add a TODO to emit a clear "not yet implemented" error during lowering.