Skip to content
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

[Mlir] --linalg-specialize-generic-ops crashes in Operation.h:399:37 #122258

Open
Emilyaxe opened this issue Jan 9, 2025 · 3 comments
Open

[Mlir] --linalg-specialize-generic-ops crashes in Operation.h:399:37 #122258

Emilyaxe opened this issue Jan 9, 2025 · 3 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] mlir:linalg

Comments

@Emilyaxe
Copy link

Emilyaxe commented Jan 9, 2025

git version: 56600c1

system: Ubuntu 18.04.6 LTS

reproduce with: mlir-opt a.mlir --linalg-specialize-generic-ops

a.mlir:

#map = affine_map<(d0, d1) -> (d0, d1)>
#map1 = affine_map<(d0, d1, d2) -> (d0, d2)>
#map2 = affine_map<(d0, d1, d2) -> (d1, d2)>
#map3 = affine_map<(d0, d1, d2) -> (d0, d1)>
module {
  func.func private @func2(%arg0: tensor<1x31x8xi32>) -> tensor<1x31x31xi32> {
    %c-2351_i32 = arith.constant -2351 : i32
    %c0_i32 = arith.constant 0 : i32
    %0 = tensor.empty() : tensor<31x8xi32>
    %1 = linalg.generic {indexing_maps = [#map], iterator_types = ["parallel", "parallel"]} outs(%0 : tensor<31x8xi32>) {
    ^bb0(%out: i32):
      linalg.yield %c-2351_i32 : i32
    } -> tensor<31x8xi32>
    %2 = tensor.empty() : tensor<31x31xi32>
    %3 = linalg.generic {indexing_maps = [#map], iterator_types = ["parallel", "parallel"]} outs(%2 : tensor<31x31xi32>) {
    ^bb0(%out: i32):
      linalg.yield %c0_i32 : i32
    } -> tensor<31x31xi32>
    %4 = linalg.generic {indexing_maps = [#map1, #map2, #map3], iterator_types = ["parallel", "parallel", "reduction"]} ins(%1, %1 : tensor<31x8xi32>, tensor<31x8xi32>) outs(%3 : tensor<31x31xi32>) {
    ^bb0(%in: i32, %in_0: i32, %out: i32):
      linalg.yield %out : i32
    } -> tensor<31x31xi32>
    %5 = tensor.empty() : tensor<31x31xi32>
    %6 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]} ins(%4 : tensor<31x31xi32>) outs(%5 : tensor<31x31xi32>) {
    ^bb0(%in: i32, %out: i32):
      linalg.yield %in : i32
    } -> tensor<31x31xi32>
    %expanded = tensor.expand_shape %6 [[0, 1], [2]] output_shape [1, 31, 31] : tensor<31x31xi32> into tensor<1x31x31xi32>
    return %expanded : tensor<1x31x31xi32>
  }
}

stack trace:

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /data/szy/MLIR/llvm-debug/llvm-project/build/bin/mlir-opt a.mlir --linalg-specialize-generic-ops
 #0 0x000056326dcbe799 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x000056326dcbec4b PrintStackTraceSignalHandler(void*) /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x000056326dcbce7f llvm::sys::RunSignalHandlers() /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Signals.cpp:105:5
 #3 0x000056326dcbf31e SignalHandler(int) /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f4168d7e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #5 0x000056326de1047c mlir::Operation::getNumResults() /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/Operation.h:399:37
 #6 0x000056326f0ef163 mlir::linalg::detail::isContractionBody(mlir::Block&, llvm::function_ref<bool (mlir::Operation*, mlir::Operation*)>, llvm::raw_ostream&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:284:36
 #7 0x000056326f0f010c bool isContractionBody<mlir::arith::MulFOp, mlir::arith::AddFOp, mlir::arith::MulIOp, mlir::arith::AddIOp, mlir::complex::MulOp, mlir::complex::AddOp, mlir::arith::AndIOp, mlir::arith::OrIOp>(mlir::Block&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:346:3
 #8 0x000056326f0eff78 mlir::linalg::detail::isContractionInterfaceImpl(mlir::Operation*, mlir::linalg::ContractionDimensions*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:493:7
 #9 0x000056326f0f0242 mlir::linalg::isaContractionOpInterface(mlir::linalg::LinalgOp) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:535:64
#10 0x000056326f4f29cf mlir::linalg::specializeGenericOp(mlir::RewriterBase&, mlir::linalg::GenericOp) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp:330:7
#11 0x000056326f4f8701 mlir::linalg::LinalgSpecializationPattern::returningMatchAndRewrite(mlir::linalg::GenericOp, mlir::PatternRewriter&) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:1484:12
#12 0x000056326f4f86ad mlir::linalg::LinalgSpecializationPattern::matchAndRewrite(mlir::linalg::GenericOp, mlir::PatternRewriter&) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:1489:12
#13 0x000056326ee125cb mlir::detail::OpOrInterfaceRewritePatternBase<mlir::linalg::GenericOp>::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/PatternMatch.h:331:12
#14 0x000056327787252f mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::$_0::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Rewrite/PatternApplicator.cpp:212:31
#15 0x00005632778723a5 void llvm::function_ref<void ()>::callback_fn<mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>)::$_0>(long) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#16 0x000056326dce2859 llvm::function_ref<void ()>::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#17 0x0000563277873bdb void mlir::MLIRContext::executeAction<mlir::ApplyPatternAction, mlir::Pattern const&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, mlir::Pattern const&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#18 0x0000563277870f4a mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<llvm::LogicalResult (mlir::Pattern const&)>) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Rewrite/PatternApplicator.cpp:233:9
#19 0x00005632736bbc08 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:615:17
#20 0x00005632736baf91 (anonymous namespace)::RegionPatternRewriteDriver::simplify(bool*) &&::$_2::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:874:30
#21 0x00005632736baf65 void llvm::function_ref<void ()>::callback_fn<(anonymous namespace)::RegionPatternRewriteDriver::simplify(bool*) &&::$_2>(long) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#22 0x000056326dce2859 llvm::function_ref<void ()>::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#23 0x00005632736ba68b void mlir::MLIRContext::executeAction<(anonymous namespace)::GreedyPatternRewriteIteration, long&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, long&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#24 0x00005632736b8ce6 (anonymous namespace)::RegionPatternRewriteDriver::simplify(bool*) && /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:887:3
#25 0x00005632736b89ff mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:919:47
#26 0x000056326decb795 mlir::applyPatternsAndFoldGreedily(mlir::Operation*, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h:159:9
#27 0x000056326f4f4fdb (anonymous namespace)::LinalgSpecializeGenericOpsPass::runOnOperation() /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp:352:14
#28 0x00005632735b63f4 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:0:17
#29 0x00005632735b6395 void llvm::function_ref<void ()>::callback_fn<mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1>(long) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#30 0x000056326dce2859 llvm::function_ref<void ()>::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#31 0x00005632735b913b void mlir::MLIRContext::executeAction<mlir::PassExecutionAction, mlir::Pass&>(llvm::function_ref<void ()>, llvm::ArrayRef<mlir::IRUnit>, mlir::Pass&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#32 0x00005632735b1f97 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:532:17
#33 0x00005632735b24b7 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:592:16
#34 0x00005632735b3e08 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:905:10
#35 0x00005632735b3d43 mlir::PassManager::run(mlir::Operation*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:885:60
#36 0x00005632735a5f95 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:474:17
#37 0x00005632735a5b86 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPoolInterface*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:542:12
#38 0x00005632735a594c mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::$_0::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:625:12
#39 0x00005632735a58e6 llvm::LogicalResult llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, 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::raw_ostream&) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
#40 0x00005632737224f2 llvm::function_ref<llvm::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::operator()(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
#41 0x0000563273721b05 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::raw_ostream&)>, llvm::raw_ostream&, llvm::StringRef, llvm::StringRef) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Support/ToolUtilities.cpp:27:12
#42 0x00005632735a2413 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:628:10
#43 0x00005632735a27b5 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:669:14
#44 0x00005632735a2988 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:685:10
#45 0x000056326dc47de3 main /data/szy/MLIR/llvm-debug/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:323:33
#46 0x00007f416839c083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#47 0x000056326dc479fe _start (/data/szy/MLIR/llvm-debug/llvm-project/build/bin/mlir-opt+0x26519fe)


@Emilyaxe Emilyaxe added crash Prefer [crash-on-valid] or [crash-on-invalid] mlir:linalg labels Jan 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/issue-subscribers-mlir-linalg

Author: None (Emilyaxe)

git version: 56600c1

system: Ubuntu 18.04.6 LTS

reproduce with: mlir-opt a.mlir --linalg-specialize-generic-ops

a.mlir:

#map = affine_map&lt;(d0, d1) -&gt; (d0, d1)&gt;
#map1 = affine_map&lt;(d0, d1, d2) -&gt; (d0, d2)&gt;
#map2 = affine_map&lt;(d0, d1, d2) -&gt; (d1, d2)&gt;
#map3 = affine_map&lt;(d0, d1, d2) -&gt; (d0, d1)&gt;
module {
  func.func private @<!-- -->func2(%arg0: tensor&lt;1x31x8xi32&gt;) -&gt; tensor&lt;1x31x31xi32&gt; {
    %c-2351_i32 = arith.constant -2351 : i32
    %c0_i32 = arith.constant 0 : i32
    %0 = tensor.empty() : tensor&lt;31x8xi32&gt;
    %1 = linalg.generic {indexing_maps = [#map], iterator_types = ["parallel", "parallel"]} outs(%0 : tensor&lt;31x8xi32&gt;) {
    ^bb0(%out: i32):
      linalg.yield %c-2351_i32 : i32
    } -&gt; tensor&lt;31x8xi32&gt;
    %2 = tensor.empty() : tensor&lt;31x31xi32&gt;
    %3 = linalg.generic {indexing_maps = [#map], iterator_types = ["parallel", "parallel"]} outs(%2 : tensor&lt;31x31xi32&gt;) {
    ^bb0(%out: i32):
      linalg.yield %c0_i32 : i32
    } -&gt; tensor&lt;31x31xi32&gt;
    %4 = linalg.generic {indexing_maps = [#map1, #map2, #map3], iterator_types = ["parallel", "parallel", "reduction"]} ins(%1, %1 : tensor&lt;31x8xi32&gt;, tensor&lt;31x8xi32&gt;) outs(%3 : tensor&lt;31x31xi32&gt;) {
    ^bb0(%in: i32, %in_0: i32, %out: i32):
      linalg.yield %out : i32
    } -&gt; tensor&lt;31x31xi32&gt;
    %5 = tensor.empty() : tensor&lt;31x31xi32&gt;
    %6 = linalg.generic {indexing_maps = [#map, #map], iterator_types = ["parallel", "parallel"]} ins(%4 : tensor&lt;31x31xi32&gt;) outs(%5 : tensor&lt;31x31xi32&gt;) {
    ^bb0(%in: i32, %out: i32):
      linalg.yield %in : i32
    } -&gt; tensor&lt;31x31xi32&gt;
    %expanded = tensor.expand_shape %6 [[0, 1], [2]] output_shape [1, 31, 31] : tensor&lt;31x31xi32&gt; into tensor&lt;1x31x31xi32&gt;
    return %expanded : tensor&lt;1x31x31xi32&gt;
  }
}

stack trace:

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.  Program arguments: /data/szy/MLIR/llvm-debug/llvm-project/build/bin/mlir-opt a.mlir --linalg-specialize-generic-ops
 #<!-- -->0 0x000056326dcbe799 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:11
 #<!-- -->1 0x000056326dcbec4b PrintStackTraceSignalHandler(void*) /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
 #<!-- -->2 0x000056326dcbce7f llvm::sys::RunSignalHandlers() /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Signals.cpp:105:5
 #<!-- -->3 0x000056326dcbf31e SignalHandler(int) /data/szy/MLIR/llvm-debug/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #<!-- -->4 0x00007f4168d7e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #<!-- -->5 0x000056326de1047c mlir::Operation::getNumResults() /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/Operation.h:399:37
 #<!-- -->6 0x000056326f0ef163 mlir::linalg::detail::isContractionBody(mlir::Block&amp;, llvm::function_ref&lt;bool (mlir::Operation*, mlir::Operation*)&gt;, llvm::raw_ostream&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:284:36
 #<!-- -->7 0x000056326f0f010c bool isContractionBody&lt;mlir::arith::MulFOp, mlir::arith::AddFOp, mlir::arith::MulIOp, mlir::arith::AddIOp, mlir::complex::MulOp, mlir::complex::AddOp, mlir::arith::AndIOp, mlir::arith::OrIOp&gt;(mlir::Block&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:346:3
 #<!-- -->8 0x000056326f0eff78 mlir::linalg::detail::isContractionInterfaceImpl(mlir::Operation*, mlir::linalg::ContractionDimensions*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:493:7
 #<!-- -->9 0x000056326f0f0242 mlir::linalg::isaContractionOpInterface(mlir::linalg::LinalgOp) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp:535:64
#<!-- -->10 0x000056326f4f29cf mlir::linalg::specializeGenericOp(mlir::RewriterBase&amp;, mlir::linalg::GenericOp) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp:330:7
#<!-- -->11 0x000056326f4f8701 mlir::linalg::LinalgSpecializationPattern::returningMatchAndRewrite(mlir::linalg::GenericOp, mlir::PatternRewriter&amp;) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:1484:12
#<!-- -->12 0x000056326f4f86ad mlir::linalg::LinalgSpecializationPattern::matchAndRewrite(mlir::linalg::GenericOp, mlir::PatternRewriter&amp;) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:1489:12
#<!-- -->13 0x000056326ee125cb mlir::detail::OpOrInterfaceRewritePatternBase&lt;mlir::linalg::GenericOp&gt;::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&amp;) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/PatternMatch.h:331:12
#<!-- -->14 0x000056327787252f mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&amp;, llvm::function_ref&lt;bool (mlir::Pattern const&amp;)&gt;, llvm::function_ref&lt;void (mlir::Pattern const&amp;)&gt;, llvm::function_ref&lt;llvm::LogicalResult (mlir::Pattern const&amp;)&gt;)::$_0::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Rewrite/PatternApplicator.cpp:212:31
#<!-- -->15 0x00005632778723a5 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&amp;, llvm::function_ref&lt;bool (mlir::Pattern const&amp;)&gt;, llvm::function_ref&lt;void (mlir::Pattern const&amp;)&gt;, llvm::function_ref&lt;llvm::LogicalResult (mlir::Pattern const&amp;)&gt;)::$_0&gt;(long) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#<!-- -->16 0x000056326dce2859 llvm::function_ref&lt;void ()&gt;::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#<!-- -->17 0x0000563277873bdb void mlir::MLIRContext::executeAction&lt;mlir::ApplyPatternAction, mlir::Pattern const&amp;&gt;(llvm::function_ref&lt;void ()&gt;, llvm::ArrayRef&lt;mlir::IRUnit&gt;, mlir::Pattern const&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#<!-- -->18 0x0000563277870f4a mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&amp;, llvm::function_ref&lt;bool (mlir::Pattern const&amp;)&gt;, llvm::function_ref&lt;void (mlir::Pattern const&amp;)&gt;, llvm::function_ref&lt;llvm::LogicalResult (mlir::Pattern const&amp;)&gt;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Rewrite/PatternApplicator.cpp:233:9
#<!-- -->19 0x00005632736bbc08 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:615:17
#<!-- -->20 0x00005632736baf91 (anonymous namespace)::RegionPatternRewriteDriver::simplify(bool*) &amp;&amp;::$_2::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:874:30
#<!-- -->21 0x00005632736baf65 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;(anonymous namespace)::RegionPatternRewriteDriver::simplify(bool*) &amp;&amp;::$_2&gt;(long) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#<!-- -->22 0x000056326dce2859 llvm::function_ref&lt;void ()&gt;::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#<!-- -->23 0x00005632736ba68b void mlir::MLIRContext::executeAction&lt;(anonymous namespace)::GreedyPatternRewriteIteration, long&amp;&gt;(llvm::function_ref&lt;void ()&gt;, llvm::ArrayRef&lt;mlir::IRUnit&gt;, long&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#<!-- -->24 0x00005632736b8ce6 (anonymous namespace)::RegionPatternRewriteDriver::simplify(bool*) &amp;&amp; /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:887:3
#<!-- -->25 0x00005632736b89ff mlir::applyPatternsAndFoldGreedily(mlir::Region&amp;, mlir::FrozenRewritePatternSet const&amp;, mlir::GreedyRewriteConfig, bool*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp:919:47
#<!-- -->26 0x000056326decb795 mlir::applyPatternsAndFoldGreedily(mlir::Operation*, mlir::FrozenRewritePatternSet const&amp;, mlir::GreedyRewriteConfig, bool*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h:159:9
#<!-- -->27 0x000056326f4f4fdb (anonymous namespace)::LinalgSpecializeGenericOpsPass::runOnOperation() /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Dialect/Linalg/Transforms/Specialize.cpp:352:14
#<!-- -->28 0x00005632735b63f4 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:0:17
#<!-- -->29 0x00005632735b6395 void llvm::function_ref&lt;void ()&gt;::callback_fn&lt;mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int)::$_1&gt;(long) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:5
#<!-- -->30 0x000056326dce2859 llvm::function_ref&lt;void ()&gt;::operator()() const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:5
#<!-- -->31 0x00005632735b913b void mlir::MLIRContext::executeAction&lt;mlir::PassExecutionAction, mlir::Pass&amp;&gt;(llvm::function_ref&lt;void ()&gt;, llvm::ArrayRef&lt;mlir::IRUnit&gt;, mlir::Pass&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/include/mlir/IR/MLIRContext.h:281:3
#<!-- -->32 0x00005632735b1f97 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:532:17
#<!-- -->33 0x00005632735b24b7 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&amp;, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:592:16
#<!-- -->34 0x00005632735b3e08 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:905:10
#<!-- -->35 0x00005632735b3d43 mlir::PassManager::run(mlir::Operation*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Pass/Pass.cpp:885:60
#<!-- -->36 0x00005632735a5f95 performActions(llvm::raw_ostream&amp;, std::shared_ptr&lt;llvm::SourceMgr&gt; const&amp;, mlir::MLIRContext*, mlir::MlirOptMainConfig const&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:474:17
#<!-- -->37 0x00005632735a5b86 processBuffer(llvm::raw_ostream&amp;, std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, mlir::MlirOptMainConfig const&amp;, mlir::DialectRegistry&amp;, llvm::ThreadPoolInterface*) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:542:12
#<!-- -->38 0x00005632735a594c mlir::MlirOptMain(llvm::raw_ostream&amp;, std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, mlir::DialectRegistry&amp;, mlir::MlirOptMainConfig const&amp;)::$_0::operator()(std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::raw_ostream&amp;) const /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:625:12
#<!-- -->39 0x00005632735a58e6 llvm::LogicalResult llvm::function_ref&lt;llvm::LogicalResult (std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::raw_ostream&amp;)&gt;::callback_fn&lt;mlir::MlirOptMain(llvm::raw_ostream&amp;, std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, mlir::DialectRegistry&amp;, mlir::MlirOptMainConfig const&amp;)::$_0&gt;(long, std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::raw_ostream&amp;) /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
#<!-- -->40 0x00005632737224f2 llvm::function_ref&lt;llvm::LogicalResult (std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::raw_ostream&amp;)&gt;::operator()(std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::raw_ostream&amp;) const /data/szy/MLIR/llvm-debug/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:69:12
#<!-- -->41 0x0000563273721b05 mlir::splitAndProcessBuffer(std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::function_ref&lt;llvm::LogicalResult (std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, llvm::raw_ostream&amp;)&gt;, llvm::raw_ostream&amp;, llvm::StringRef, llvm::StringRef) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Support/ToolUtilities.cpp:27:12
#<!-- -->42 0x00005632735a2413 mlir::MlirOptMain(llvm::raw_ostream&amp;, std::unique_ptr&lt;llvm::MemoryBuffer, std::default_delete&lt;llvm::MemoryBuffer&gt;&gt;, mlir::DialectRegistry&amp;, mlir::MlirOptMainConfig const&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:628:10
#<!-- -->43 0x00005632735a27b5 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:669:14
#<!-- -->44 0x00005632735a2988 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&amp;) /data/szy/MLIR/llvm-debug/llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp:685:10
#<!-- -->45 0x000056326dc47de3 main /data/szy/MLIR/llvm-debug/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:323:33
#<!-- -->46 0x00007f416839c083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#<!-- -->47 0x000056326dc479fe _start (/data/szy/MLIR/llvm-debug/llvm-project/build/bin/mlir-opt+0x26519fe)


@ayokunle321
Copy link

Hey @Emilyaxe! Kinda new to this but wanted to help out. From the ref, I see --linalg-specialize-generic-ops converts generic ops back to their named ops. I was wondering which named ops match the generic ops in this module?

@Emilyaxe
Copy link
Author

Hey @Emilyaxe! Kinda new to this but wanted to help out. From the ref, I see --linalg-specialize-generic-ops converts generic ops back to their named ops. I was wondering which named ops match the generic ops in this module?

Thank you for your interest; currently, I focus on testing MLIR. I'm sorry that I am unable to answer your question, but some other developers of linalg might provide help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] mlir:linalg
Projects
None yet
Development

No branches or pull requests

3 participants