This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix lowering issue with character temp
ClosedPublic

Authored by clementval on Jun 29 2022, 7:52 AM.

Details

Summary
  • Add verifiers that determine if an Op requires type parameters or not and checks that the correct number of parameters is specified.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Jun 29 2022, 7:52 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 29 2022, 7:52 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Jun 29 2022, 7:52 AM

Restore runline and unsupported system

PeteSteinfeld accepted this revision.Jun 29 2022, 9:09 AM

I get a build error for this change. Here's what I see in the log file:

[5929/6618] Building CXX object tools/flang/lib/Optimizer/Dialect/CMakeFiles/obj.FIRDialect.dir/FIROps.cpp.o
FAILED: tools/flang/lib/Optimizer/Dialect/CMakeFiles/obj.FIRDialect.dir/FIROps.cpp.o 
/home/sw/thirdparty/gcc/gcc-9.3.0/linux86-64/bin/g++ -DFLANG_LITTLE_ENDIAN=1 -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/local/home/psteinfeld/main/temp/build/tools/flang/lib/Optimizer/Dialect -I/local/home/psteinfeld/main/temp/flang/lib/Optimizer/Dialect -I/local/home/psteinfeld/main/temp/flang/include -I/local/home/psteinfeld/main/temp/build/tools/flang/include -I/local/home/psteinfeld/main/temp/build/include -I/local/home/psteinfeld/main/temp/llvm/include -isystem /local/home/psteinfeld/main/temp/llvm/../mlir/include -isystem /local/home/psteinfeld/main/temp/build/tools/mlir/include -isystem /local/home/psteinfeld/main/temp/build/tools/clang/include -isystem /local/home/psteinfeld/main/temp/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 -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Werror -Wno-deprecated-copy -fno-strict-aliasing -fno-semantic-interposition -O3 -DNDEBUG  -fno-exceptions -fno-rtti -UNDEBUG -std=c++17 -MD -MT tools/flang/lib/Optimizer/Dialect/CMakeFiles/obj.FIRDialect.dir/FIROps.cpp.o -MF tools/flang/lib/Optimizer/Dialect/CMakeFiles/obj.FIRDialect.dir/FIROps.cpp.o.d -o tools/flang/lib/Optimizer/Dialect/CMakeFiles/obj.FIRDialect.dir/FIROps.cpp.o -c /local/home/psteinfeld/main/temp/flang/lib/Optimizer/Dialect/FIROps.cpp
/local/home/psteinfeld/main/temp/flang/lib/Optimizer/Dialect/FIROps.cpp: In static member function ‘static mlir::ParseResult fir::CoordinateOp::parse(mlir::OpAsmParser&, mlir::OperationState&)’:
/local/home/psteinfeld/main/temp/flang/lib/Optimizer/Dialect/FIROps.cpp:952:58: error: ignoring returned value of type ‘mlir::ParseResult’, declared with attribute nodiscard [-Werror=unused-result]
  952 |   parser.addTypesToList(funcTy.getResults(), result.types);
      |                                                          ^
In file included from /local/home/psteinfeld/main/temp/mlir/include/mlir/Dialect/Arithmetic/IR/Arithmetic.h:13,
                 from /local/home/psteinfeld/main/temp/flang/include/flang/Optimizer/Dialect/FIROps.h:13,
                 from /local/home/psteinfeld/main/temp/flang/lib/Optimizer/Dialect/FIROps.cpp:13:
/local/home/psteinfeld/main/temp/mlir/include/mlir/IR/OpImplementation.h:1002:15: note: in call to ‘mlir::ParseResult mlir::AsmParser::addTypesToList(llvm::ArrayRef<mlir::Type>, llvm::SmallVectorImpl<mlir::Type>&)’, declared here
 1002 |   ParseResult addTypesToList(ArrayRef<Type> types,
      |               ^~~~~~~~~~~~~~
In file included from /local/home/psteinfeld/main/temp/mlir/include/mlir/IR/StorageUniquerSupport.h:17,
                 from /local/home/psteinfeld/main/temp/mlir/include/mlir/IR/AttributeSupport.h:17,
                 from /local/home/psteinfeld/main/temp/mlir/include/mlir/IR/Attributes.h:12,
                 from /local/home/psteinfeld/main/temp/mlir/include/mlir/IR/BuiltinAttributeInterfaces.h:13,
                 from /local/home/psteinfeld/main/temp/mlir/include/mlir/IR/BuiltinAttributes.h:12,
                 from /local/home/psteinfeld/main/temp/flang/include/flang/Optimizer/Dialect/FIRType.h:16,
                 from /local/home/psteinfeld/main/temp/flang/include/flang/Optimizer/Dialect/FIROps.h:12,
                 from /local/home/psteinfeld/main/temp/flang/lib/Optimizer/Dialect/FIROps.cpp:13:
/local/home/psteinfeld/main/temp/mlir/include/mlir/Support/LogicalResult.h:112:22: note: ‘mlir::ParseResult’ declared here
  112 | class LLVM_NODISCARD ParseResult : public LogicalResult {
      |                      ^~~~~~~~~~~
cc1plus: all warnings being treated as errors
[5930/6618] Building CXX object tools/mlir/lib/Dialect/LLVMIR/CMakeFiles/obj.MLIRLLVMDialect.dir/IR/LLVMDialect.cpp.o
This revision is now accepted and ready to land.Jun 29 2022, 9:09 AM
PeteSteinfeld requested changes to this revision.Jun 29 2022, 9:10 AM

In my previous comments, I mean to request changes!

This revision now requires changes to proceed.Jun 29 2022, 9:10 AM

Fix warnings

In my previous comments, I mean to request changes!

Should be fixed.

Restore run lines for tests

PeteSteinfeld accepted this revision.Jun 29 2022, 9:43 AM

Thanks, Valentin!

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Jun 29 2022, 9:43 AM
This revision was automatically updated to reflect the committed changes.