[flang-commits] [flang] [mlir] [mlir][NFC] Mark type converter in `populate...` functions as `const` (PR #111250)

LLVM Continuous Integration via flang-commits flang-commits at lists.llvm.org
Sat Oct 5 12:36:22 PDT 2024


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `flang-aarch64-latest-gcc` running on `linaro-flang-aarch64-latest-gcc` while building `flang,mlir` at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/130/builds/4541

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 5 (build-unified-tree) failure: build (failure)
...
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:997:3:   required by substitution of ‘template<class T, class ... Args> std::enable_if_t<std::is_base_of<mlir::PDLPatternModule, T>::value> mlir::RewritePatternSet::addImpl(llvm::ArrayRef<llvm::StringRef>, Args&& ...) [with T = {anonymous}::ReassociatingReshapeOpConversion<mlir::memref::CollapseShapeOp>; Args = <missing>]’
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:850:17:   required from ‘mlir::RewritePatternSet& mlir::RewritePatternSet::add(ConstructorArg&&, ConstructorArgs&& ...) [with Ts = {{anonymous}::AllocaOpLowering, {anonymous}::AllocaScopeOpLowering, {anonymous}::AtomicRMWOpLowering, {anonymous}::AssumeAlignmentOpLowering, {anonymous}::ConvertExtractAlignedPointerAsIndex, {anonymous}::DimOpLowering, {anonymous}::ExtractStridedMetadataOpLowering, {anonymous}::GenericAtomicRMWOpLowering, {anonymous}::GlobalMemrefOpLowering, {anonymous}::GetGlobalMemrefOpLowering, {anonymous}::LoadOpLowering, {anonymous}::MemRefCastOpLowering, {anonymous}::MemRefCopyOpLowering, {anonymous}::MemorySpaceCastOpLowering, {anonymous}::MemRefReinterpretCastOpLowering, {anonymous}::MemRefReshapeOpLowering, {anonymous}::PrefetchOpLowering, {anonymous}::RankOpLowering, {anonymous}::ReassociatingReshapeOpConversion<mlir::memref::ExpandShapeOp>, {anonymous}::ReassociatingReshapeOpConversion<mlir::memref::CollapseShapeOp>, {anonymous}::StoreOpLowering, {anonymous}::SubViewOpLowering, {anonymous}::TransposeOpLowering, {anonymous}::ViewOpLowering}; ConstructorArg = const mlir::LLVMTypeConverter&; ConstructorArgs = {}; <template-parameter-1-4> = void]’
../llvm-project/mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp:1696:22:   required from here
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:255:16: warning: ‘virtual void mlir::RewritePattern::rewrite(mlir::Operation*, mlir::PatternRewriter&) const’ was hidden [-Woverloaded-virtual=]
  255 |   virtual void rewrite(Operation *op, PatternRewriter &rewriter) const;
      |                ^~~~~~~
../llvm-project/mlir/include/mlir/Conversion/LLVMCommon/Pattern.h:174:16: note:   by ‘mlir::ConvertOpToLLVMPattern<mlir::memref::CollapseShapeOp>::rewrite’
  174 |   virtual void rewrite(SourceOp op, OpAdaptor adaptor,
      |                ^~~~~~~
112.674 [3622/23/3594] Building CXX object tools/mlir/lib/Conversion/SPIRVToLLVM/CMakeFiles/obj.MLIRSPIRVToLLVM.dir/SPIRVToLLVM.cpp.o
FAILED: tools/mlir/lib/Conversion/SPIRVToLLVM/CMakeFiles/obj.MLIRSPIRVToLLVM.dir/SPIRVToLLVM.cpp.o 
/usr/local/bin/c++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/mlir/lib/Conversion/SPIRVToLLVM -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/mlir/lib/Conversion/SPIRVToLLVM -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/llvm/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/mlir/include -I/home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/build/tools/mlir/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wundef -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/mlir/lib/Conversion/SPIRVToLLVM/CMakeFiles/obj.MLIRSPIRVToLLVM.dir/SPIRVToLLVM.cpp.o -MF tools/mlir/lib/Conversion/SPIRVToLLVM/CMakeFiles/obj.MLIRSPIRVToLLVM.dir/SPIRVToLLVM.cpp.o.d -o tools/mlir/lib/Conversion/SPIRVToLLVM/CMakeFiles/obj.MLIRSPIRVToLLVM.dir/SPIRVToLLVM.cpp.o -c /home/tcwg-buildbot/worker/flang-aarch64-latest-gcc/llvm-project/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
In file included from ../llvm-project/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp:13:
../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h: In member function ‘const mlir::LLVMTypeConverter* mlir::SPIRVToLLVMConversion<SPIRVOp>::getTypeConverter() const’:
../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h:35:12: error: invalid ‘static_cast’ from type ‘const mlir::TypeConverter*’ to type ‘const mlir::LLVMTypeConverter*’
   35 |     return static_cast<const LLVMTypeConverter *>(
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   36 |         ConversionPattern::getTypeConverter());
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h:21:7: note: class type ‘const mlir::LLVMTypeConverter’ is incomplete
   21 | class LLVMTypeConverter;
      |       ^~~~~~~~~~~~~~~~~
In file included from ../llvm-project/mlir/include/mlir/Rewrite/FrozenRewritePatternSet.h:12,
                 from ../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:17,
                 from ../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h:16:
../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h: In instantiation of ‘class mlir::OpConversionPattern<mlir::spirv::AccessChainOp>’:
../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h:26:7:   required from ‘class mlir::SPIRVToLLVMConversion<mlir::spirv::AccessChainOp>’
../llvm-project/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp:311:35:   required from here
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:255:16: warning: ‘virtual void mlir::RewritePattern::rewrite(mlir::Operation*, mlir::PatternRewriter&) const’ was hidden [-Woverloaded-virtual=]
  255 |   virtual void rewrite(Operation *op, PatternRewriter &rewriter) const;
      |                ^~~~~~~
../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:552:16: note:   by ‘mlir::OpConversionPattern<mlir::spirv::AccessChainOp>::rewrite’
  552 |   virtual void rewrite(SourceOp op, OpAdaptor adaptor,
      |                ^~~~~~~
../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h: In instantiation of ‘class mlir::OpConversionPattern<mlir::spirv::AddressOfOp>’:
../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h:26:7:   required from ‘class mlir::SPIRVToLLVMConversion<mlir::spirv::AddressOfOp>’
../llvm-project/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp:342:33:   required from here
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:255:16: warning: ‘virtual void mlir::RewritePattern::rewrite(mlir::Operation*, mlir::PatternRewriter&) const’ was hidden [-Woverloaded-virtual=]
  255 |   virtual void rewrite(Operation *op, PatternRewriter &rewriter) const;
      |                ^~~~~~~
../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h:552:16: note:   by ‘mlir::OpConversionPattern<mlir::spirv::AddressOfOp>::rewrite’
  552 |   virtual void rewrite(SourceOp op, OpAdaptor adaptor,
      |                ^~~~~~~
../llvm-project/mlir/include/mlir/Transforms/DialectConversion.h: In instantiation of ‘class mlir::OpConversionPattern<mlir::spirv::BitFieldInsertOp>’:
../llvm-project/mlir/include/mlir/Conversion/SPIRVToLLVM/SPIRVToLLVM.h:26:7:   required from ‘class mlir::SPIRVToLLVMConversion<mlir::spirv::BitFieldInsertOp>’
../llvm-project/mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp:359:14:   required from here
../llvm-project/mlir/include/mlir/IR/PatternMatch.h:255:16: warning: ‘virtual void mlir::RewritePattern::rewrite(mlir::Operation*, mlir::PatternRewriter&) const’ was hidden [-Woverloaded-virtual=]
  255 |   virtual void rewrite(Operation *op, PatternRewriter &rewriter) const;
      |                ^~~~~~~

```

</details>

https://github.com/llvm/llvm-project/pull/111250


More information about the flang-commits mailing list