This is an archive of the discontinued LLVM Phabricator instance.

[mlir][openacc][NFC] Use assembly format for acc.parallel
ClosedPublic

Authored by clementval on Apr 12 2023, 4:20 PM.

Details

Summary

Remove the custoom parser and printer for the acc.parallel
operation and use the assembly format directly.

Diff Detail

Event Timeline

clementval created this revision.Apr 12 2023, 4:20 PM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
clementval requested review of this revision.Apr 12 2023, 4:20 PM
razvanlupusoru accepted this revision.Apr 12 2023, 5:04 PM
This revision is now accepted and ready to land.Apr 12 2023, 5:04 PM
PeteSteinfeld requested changes to this revision.Apr 12 2023, 7:04 PM

When I try to build this, I get error messages. I'm using GCC 9.3.0. Here's an excerpt from my build file:

[6041/7357] Building CXX object tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o 
/home/sw/thirdparty/gcc/gcc-9.3.0/linux86-64/bin/g++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/local/home/psteinfeld/main/183/build/tools/flang/lib/Lower -I/local/home/psteinfeld/main/183/flang/lib/Lower -I/local/home/psteinfeld/main/183/flang/include -I/local/home/psteinfeld/main/183/build/tools/flang/include -I/local/home/psteinfeld/main/183/build/include -I/local/home/psteinfeld/main/183/llvm/include -isystem /local/home/psteinfeld/main/183/llvm/../mlir/include -isystem /local/home/psteinfeld/main/183/build/tools/mlir/include -isystem /local/home/psteinfeld/main/183/build/tools/clang/include -isystem /local/home/psteinfeld/main/183/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o -c /local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp: In function ‘mlir::acc::ParallelOp createParallelOp(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::SemanticsContext&, Fortran::lower::StatementContext&, const Fortran::parser::AccClauseList&)’:
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp:578:48: error: ‘getAsyncAttrName’ is not a member of ‘mlir::acc::ParallelOp’
  578 |     parallelOp->setAttr(mlir::acc::ParallelOp::getAsyncAttrName(),
      |                                                ^~~~~~~~~~~~~~~~
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp:581:48: error: ‘getWaitAttrName’ is not a member of ‘mlir::acc::ParallelOp’
  581 |     parallelOp->setAttr(mlir::acc::ParallelOp::getWaitAttrName(),
      |                                                ^~~~~~~~~~~~~~~
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp:584:48: error: ‘getSelfAttrName’ is not a member of ‘mlir::acc::ParallelOp’
This revision now requires changes to proceed.Apr 12 2023, 7:04 PM

Fix flang lowering

Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2023, 9:12 AM

When I try to build this, I get error messages. I'm using GCC 9.3.0. Here's an excerpt from my build file:

[6041/7357] Building CXX object tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o
FAILED: tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o 
/home/sw/thirdparty/gcc/gcc-9.3.0/linux86-64/bin/g++ -DFLANG_INCLUDE_TESTS=1 -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/local/home/psteinfeld/main/183/build/tools/flang/lib/Lower -I/local/home/psteinfeld/main/183/flang/lib/Lower -I/local/home/psteinfeld/main/183/flang/include -I/local/home/psteinfeld/main/183/build/tools/flang/include -I/local/home/psteinfeld/main/183/build/include -I/local/home/psteinfeld/main/183/llvm/include -isystem /local/home/psteinfeld/main/183/llvm/../mlir/include -isystem /local/home/psteinfeld/main/183/build/tools/mlir/include -isystem /local/home/psteinfeld/main/183/build/tools/clang/include -isystem /local/home/psteinfeld/main/183/llvm/../clang/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o -MF tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o.d -o tools/flang/lib/Lower/CMakeFiles/obj.FortranLower.dir/OpenACC.cpp.o -c /local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp: In function ‘mlir::acc::ParallelOp createParallelOp(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::SemanticsContext&, Fortran::lower::StatementContext&, const Fortran::parser::AccClauseList&)’:
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp:578:48: error: ‘getAsyncAttrName’ is not a member of ‘mlir::acc::ParallelOp’
  578 |     parallelOp->setAttr(mlir::acc::ParallelOp::getAsyncAttrName(),
      |                                                ^~~~~~~~~~~~~~~~
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp:581:48: error: ‘getWaitAttrName’ is not a member of ‘mlir::acc::ParallelOp’
  581 |     parallelOp->setAttr(mlir::acc::ParallelOp::getWaitAttrName(),
      |                                                ^~~~~~~~~~~~~~~
/local/home/psteinfeld/main/183/flang/lib/Lower/OpenACC.cpp:584:48: error: ‘getSelfAttrName’ is not a member of ‘mlir::acc::ParallelOp’

My bad. It should be fixed now.

PeteSteinfeld accepted this revision.Apr 13 2023, 10:08 AM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Apr 13 2023, 10:08 AM