[Mlir-commits] [mlir] [mlir][linalg] Fix UBSan division-by-zero in PackOp folding (PR #186271)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Mar 25 06:02:13 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 7717 tests passed
* 603 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### MLIR
<details>
<summary>MLIR.Dialect/Linalg/canonicalize.mlir</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir -canonicalize="test-convergence" -split-input-file | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir -canonicalize=test-convergence -split-input-file
# .---command stderr------------
# | /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/optional:479: _Tp &std::_Optional_base_impl<long, std::_Optional_base<long>>::_M_get() [_Tp = long, _Dp = std::_Optional_base<long>]: Assertion 'this->_M_is_engaged()' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir -canonicalize=test-convergence -split-input-file
# |  #0 0x0000000007e50cc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
# |  #1 0x0000000007e4db21 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
# |  #2 0x0000000007e51ae1 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
# |  #3 0x000078b531b75330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
# |  #4 0x000078b531bceb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
# |  #5 0x000078b531b7527e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
# |  #6 0x000078b531b588ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
# |  #7 0x000078b531e4f90d (/lib/x86_64-linux-gnu/libstdc++.so.6+0xdf90d)
# |  #8 0x000000000f42815c operator[] /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:248:7
# |  #9 0x000000000f42815c mlir::linalg::PackOp::requirePaddingValue(llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<mlir::OpFoldResult>) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:0:0
# | #10 0x000000000f40f825 mlir::linalg::PackOp::verify() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:5574:7
# | #11 0x000000000f6fb0ef mlir::Op<mlir::linalg::PackOp, mlir::OpTrait::ZeroRegions, mlir::OpTrait::VariadicResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::AtLeastNOperands<2u>::Impl, mlir::OpTrait::AttrSizedOperandSegments, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::OpAsmOpInterface::Trait, mlir::DestinationStyleOpInterface::Trait, mlir::linalg::RelayoutOpInterface::Trait, mlir::ConditionallySpeculatable::Trait, mlir::MemoryEffectOpInterface::Trait, mlir::ReifyRankedShapedTypeOpInterface::Trait>::verifyInvariants(mlir::Operation*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/OpDefinition.h:0:39
# | #12 0x000000000f6f8c7e asInt /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:41:5
# | #13 0x000000000f6f8c7e operator long /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:45:48
# | #14 0x000000000f6f8c7e getPointer /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:94:58
# | #15 0x000000000f6f8c7e ~UniqueFunctionBase /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:274:32
# | #16 0x000000000f6f8c7e mlir::RegisteredOperationName::Model<mlir::linalg::PackOp>::verifyInvariants(mlir::Operation*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/OperationSupport.h:555:7
# | #17 0x0000000010e53bab verifyOnEntrance /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:232:22
# | #18 0x0000000010e53bab operator()<mlir::Operation> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:353:45
# | #19 0x0000000010e53bab operator()<(lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:353:13)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:333:16
# | #20 0x0000000010e53bab verifyOperation /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:352:16
# | #21 0x0000000010e53bab (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:81:14
# | #22 0x0000000010e53990 operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:282:9
# | #23 0x0000000010e53990 operator()<mlir::Operation *&> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:120:12
# | #24 0x0000000010e53990 failableParallelForEach<mlir::Operation **, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:119:54)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:46:18
# | #25 0x0000000010e53990 parallelForEach<mlir::Operation **, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:281:60)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:119:9
# | #26 0x0000000010e53990 parallelForEach<llvm::SmallVector<mlir::Operation *, 6U> &, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:281:60)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:131:3
# | #27 0x0000000010e53990 verifyOnExit /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:281:3
# | #28 0x0000000010e53990 operator()<mlir::Operation> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:344:53
# | #29 0x0000000010e53990 operator()<(lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:344:21)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:333:16
# | #30 0x0000000010e53990 verifyOperation /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:344:15
# | #31 0x0000000010e53990 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:81:14
# | #32 0x0000000010e52b16 mlir::verify(mlir::Operation*, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:483:1
# | #33 0x000000001085ac7f finalize /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/AsmParser/Parser.cpp:969:45
# | #34 0x000000001085ac7f parse /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/AsmParser/Parser.cpp:2914:20
# | #35 0x000000001085ac7f mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/AsmParser/Parser.cpp:2968:41
# | #36 0x000000000f7106d3 mlir::parseSourceFile(std::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Parser/Parser.cpp:65:1
# | #37 0x0000000007e62efe parseSourceFile<mlir::ModuleOp, const std::shared_ptr<llvm::SourceMgr> &> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Parser/Parser.h:158:7
# | #38 0x0000000007e62efe parseSourceFile<mlir::ModuleOp> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Parser/Parser.h:188:10
# | #39 0x0000000007e62efe mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Tools/ParseUtilities.h:31:12
# | #40 0x0000000007e61b9a stop /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Support/Timing.h:218:9
# | #41 0x0000000007e61b9a stop /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Support/Timing.h:301:11
# | #42 0x0000000007e61b9a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:528:16
# | #43 0x0000000007e61918 processBuffer /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:681:12
# | #44 0x0000000007e61918 operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:779:12
# | #45 0x0000000007e61918 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
# | #46 0x0000000010e65724 operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
# | #47 0x0000000010e65724 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:94:13
# | #48 0x0000000010e653bf interleave<const llvm::StringRef *, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:81:23), (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:2301:49), void> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:0:0
# | #49 0x0000000010e653bf interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:81:23), llvm::raw_ostream, llvm::StringRef> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:2301:3
# | #50 0x0000000010e653bf mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:97:3
# | #51 0x0000000007e56da6 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:784:26
# | #52 0x0000000007e570d5 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:830:14
# | #53 0x0000000007e5734b mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:846:10
# | #54 0x0000000007d948a9 main /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:343:33
# | #55 0x000078b531b5a1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
# | #56 0x000078b531b5a28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
# | #57 0x0000000007d943e5 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt+0x7d943e5)
# `-----------------------------
# error: command failed with exit status: -6
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir
# .---command stderr------------
# | /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir:1860:17: error: CHECK-LABEL: expected string not found in input
# | // CHECK-LABEL: func.func @fold_cast_pack_dynamic_tile_size
# |                 ^
# | <stdin>:902:40: note: scanning from here
# |  func.func @negative_infer_unpack_shape(%arg0: tensor<32x7x?x16x1xf32>, %arg1: index) -> tensor<?x32x100xf32> {
# |                                        ^
# | <stdin>:911:2: note: possible intended match here
# |  func.func @unpack_pack(%arg0: tensor<128x128xf32>) -> tensor<128x128xf32> {
# |  ^
# | 
# | Input file: <stdin>
# | Check file: /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/canonicalize.mlir
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |               .
# |               .
# |               .
# |             897:  } 
# |             898: } 
# |             899:  
# |             900: // ----- 
# |             901: module { 
# |             902:  func.func @negative_infer_unpack_shape(%arg0: tensor<32x7x?x16x1xf32>, %arg1: index) -> tensor<?x32x100xf32> { 
# | label:1860'0                                            X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             903:  %0 = tensor.empty(%arg1) : tensor<?x32x100xf32> 
# | label:1860'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             904:  %unpack = linalg.unpack %arg0 outer_dims_perm = [1, 2, 0] inner_dims_pos = [2, 0] inner_tiles = [16, 1] into %0 : tensor<32x7x?x16x1xf32> -> tensor<?x32x100xf32> 
# | label:1860'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             905:  return %unpack : tensor<?x32x100xf32> 
# | label:1860'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             906:  } 
# | label:1860'0     ~~~
# |             907: } 
# | label:1860'0     ~~
# |             908:  
# | label:1860'0     ~
# |             909: // ----- 
# | label:1860'0     ~~~~~~~~~
# |             910: module { 
# | label:1860'0     ~~~~~~~~~
# |             911:  func.func @unpack_pack(%arg0: tensor<128x128xf32>) -> tensor<128x128xf32> { 
# | label:1860'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | label:1860'1      ?                                                                            possible intended match
# |             912:  return %arg0 : tensor<128x128xf32> 
# | label:1860'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             913:  } 
# | label:1860'0     ~~~
# |             914: } 
# | label:1860'0     ~~
# |             915:  
# | label:1860'0     ~
# |             916: // ----- 
# | label:1860'0     ~~~~~~~~~
# |               .
# |               .
# |               .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>MLIR.Dialect/Linalg/invalid.mlir</summary>

```
Exit Code: -6

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/invalid.mlir -split-input-file -verify-diagnostics
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/invalid.mlir -split-input-file -verify-diagnostics
# .---command stdout------------
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | module {
# | }
# | 
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# | // -----
# `-----------------------------
# .---command stderr------------
# | /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/optional:479: _Tp &std::_Optional_base_impl<long, std::_Optional_base<long>>::_M_get() [_Tp = long, _Dp = std::_Optional_base<long>]: Assertion 'this->_M_is_engaged()' failed.
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
# | Stack dump:
# | 0.	Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/test/Dialect/Linalg/invalid.mlir -split-input-file -verify-diagnostics
# |  #0 0x0000000007e50cc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
# |  #1 0x0000000007e4db21 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
# |  #2 0x0000000007e51ae1 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
# |  #3 0x000078984ae9e330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
# |  #4 0x000078984aef7b2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
# |  #5 0x000078984ae9e27e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
# |  #6 0x000078984ae818ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
# |  #7 0x000078984b17890d (/lib/x86_64-linux-gnu/libstdc++.so.6+0xdf90d)
# |  #8 0x000000000f42815c operator[] /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/ArrayRef.h:248:7
# |  #9 0x000000000f42815c mlir::linalg::PackOp::requirePaddingValue(llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<long>, llvm::ArrayRef<mlir::OpFoldResult>) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:0:0
# | #10 0x000000000f40f825 mlir::linalg::PackOp::verify() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:5574:7
# | #11 0x000000000f6fb0ef mlir::Op<mlir::linalg::PackOp, mlir::OpTrait::ZeroRegions, mlir::OpTrait::VariadicResults, mlir::OpTrait::ZeroSuccessors, mlir::OpTrait::AtLeastNOperands<2u>::Impl, mlir::OpTrait::AttrSizedOperandSegments, mlir::OpTrait::OpInvariants, mlir::BytecodeOpInterface::Trait, mlir::OpAsmOpInterface::Trait, mlir::DestinationStyleOpInterface::Trait, mlir::linalg::RelayoutOpInterface::Trait, mlir::ConditionallySpeculatable::Trait, mlir::MemoryEffectOpInterface::Trait, mlir::ReifyRankedShapedTypeOpInterface::Trait>::verifyInvariants(mlir::Operation*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/OpDefinition.h:0:39
# | #12 0x000000000f6f8c7e asInt /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:41:5
# | #13 0x000000000f6f8c7e operator long /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:45:48
# | #14 0x000000000f6f8c7e getPointer /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/PointerIntPair.h:94:58
# | #15 0x000000000f6f8c7e ~UniqueFunctionBase /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/FunctionExtras.h:274:32
# | #16 0x000000000f6f8c7e mlir::RegisteredOperationName::Model<mlir::linalg::PackOp>::verifyInvariants(mlir::Operation*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/OperationSupport.h:555:7
# | #17 0x0000000010e53bab verifyOnEntrance /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:232:22
# | #18 0x0000000010e53bab operator()<mlir::Operation> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:353:45
# | #19 0x0000000010e53bab operator()<(lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:353:13)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:333:16
# | #20 0x0000000010e53bab verifyOperation /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:352:16
# | #21 0x0000000010e53bab (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:81:14
# | #22 0x0000000010e53990 operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:282:9
# | #23 0x0000000010e53990 operator()<mlir::Operation *&> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:120:12
# | #24 0x0000000010e53990 failableParallelForEach<mlir::Operation **, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:119:54)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:46:18
# | #25 0x0000000010e53990 parallelForEach<mlir::Operation **, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:281:60)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:119:9
# | #26 0x0000000010e53990 parallelForEach<llvm::SmallVector<mlir::Operation *, 6U> &, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:281:60)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/IR/Threading.h:131:3
# | #27 0x0000000010e53990 verifyOnExit /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:281:3
# | #28 0x0000000010e53990 operator()<mlir::Operation> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:344:53
# | #29 0x0000000010e53990 operator()<(lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:344:21)> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:333:16
# | #30 0x0000000010e53990 verifyOperation /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:344:15
# | #31 0x0000000010e53990 (anonymous namespace)::OperationVerifier::verifyOpAndDominance(mlir::Operation&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:81:14
# | #32 0x0000000010e52b16 mlir::verify(mlir::Operation*, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/IR/Verifier.cpp:483:1
# | #33 0x000000001085ac7f finalize /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/AsmParser/Parser.cpp:969:45
# | #34 0x000000001085ac7f parse /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/AsmParser/Parser.cpp:2914:20
# | #35 0x000000001085ac7f mlir::parseAsmSourceFile(llvm::SourceMgr const&, mlir::Block*, mlir::ParserConfig const&, mlir::AsmParserState*, mlir::AsmParserCodeCompleteContext*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/AsmParser/Parser.cpp:2968:41
# | #36 0x000000000f7106d3 mlir::parseSourceFile(std::shared_ptr<llvm::SourceMgr> const&, mlir::Block*, mlir::ParserConfig const&, mlir::LocationAttr*) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Parser/Parser.cpp:65:1
# | #37 0x0000000007e62efe parseSourceFile<mlir::ModuleOp, const std::shared_ptr<llvm::SourceMgr> &> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Parser/Parser.h:158:7
# | #38 0x0000000007e62efe parseSourceFile<mlir::ModuleOp> /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Parser/Parser.h:188:10
# | #39 0x0000000007e62efe mlir::parseSourceFileForTool(std::shared_ptr<llvm::SourceMgr> const&, mlir::ParserConfig const&, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Tools/ParseUtilities.h:31:12
# | #40 0x0000000007e61b9a stop /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Support/Timing.h:218:9
# | #41 0x0000000007e61b9a stop /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/include/mlir/Support/Timing.h:301:11
# | #42 0x0000000007e61b9a performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:528:16
# | #43 0x0000000007e617ae processBuffer /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:0:9
# | #44 0x0000000007e617ae operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:779:12
# | #45 0x0000000007e617ae llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
# | #46 0x0000000010e65724 operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
# | #47 0x0000000010e65724 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef)::$_0::operator()(llvm::StringRef) const /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:94:13
# | #48 0x0000000010e653bf interleave<const llvm::StringRef *, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:81:23), (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:2301:49), void> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:0:0
# | #49 0x0000000010e653bf interleave<llvm::SmallVector<llvm::StringRef, 8U>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:81:23), llvm::raw_ostream, llvm::StringRef> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:2301:3
# | #50 0x0000000010e653bf mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::MemoryBufferRef const&, llvm::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Support/ToolUtilities.cpp:97:3
# | #51 0x0000000007e56da6 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:784:26
# | #52 0x0000000007e570d5 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:830:14
# | #53 0x0000000007e5734b mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:846:10
# | #54 0x0000000007d948a9 main /home/gha/actions-runner/_work/llvm-project/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:343:33
# | #55 0x000078984ae831ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
# | #56 0x000078984ae8328b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
# | #57 0x0000000007d943e5 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/mlir-opt+0x7d943e5)
# `-----------------------------
# error: command failed with exit status: -6

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the Mlir-commits mailing list