Issue 203217
Summary [mlir] Assertion `(!unrollFactors.empty() && (unrollFactors.size() <= numLoops)) && "Expected non-empty unroll factors of size <= to the number of loops"' failed
Labels mlir
Assignees
Reporter Anonymous7i0em3yd
    git version: aec0da1e9455356a32ec797430794025628b4210

system: `Ubuntu 18.04.6 LTS`

reproduce with: `mlir-opt -test-parallel-loop-unrolling a.mlir`

a.mlir:  

```mlir
module {
  func.func @parallel_loop(%arg0: index, %arg1: index, %arg2: index, %arg3: index, %arg4: index) {
 scf.parallel (%arg5) = (%arg0) to (%arg1) step (%arg2) {
      scf.reduce 
 }
    return
  }
}

```

stack trace:

```
mlir-opt: /data/szy/MLIR/llvm-release/llvm-project/mlir/lib/Dialect/SCF/Utils/Utils.cpp:1655: FailureOr<scf::ParallelOp> mlir::parallelLoopUnrollByFactors(scf::ParallelOp, ArrayRef<uint64_t>, RewriterBase &, function_ref<void (unsigned int, Operation *, OpBuilder)>, IRMapping *): Assertion `(!unrollFactors.empty() && (unrollFactors.size() <= numLoops)) && "Expected non-empty unroll factors of size <= to the number of loops"' 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: /data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt -test-parallel-loop-unrolling 3.mlir
 #0 0x00005566c4784658 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fda658)
 #1 0x00005566c47814f1 llvm::sys::RunSignalHandlers() (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fd74f1)
 #2 0x00005566c4785776 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
 #3 0x00007f75376d8420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007f7536d1500b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x00007f7536cf4859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
 #6 0x00007f7536cf4729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
 #7 0x00007f7536cf4729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
 #8 0x00007f7536d05fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
 #9 0x00005566cb644c7a mlir::parallelLoopUnrollByFactors(mlir::scf::ParallelOp, llvm::ArrayRef<unsigned long>, mlir::RewriterBase&, llvm::function_ref<void (unsigned int, mlir::Operation*, mlir::OpBuilder)>, mlir::IRMapping*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x8e9ac7a)
#10 0x00005566c4881874 (anonymous namespace)::TestParallelLoopUnrollingPass::runOnOperation() TestParallelLoopUnrolling.cpp:0:0
#11 0x00005566cd0b0f42 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa906f42)
#12 0x00005566cd0b1d84 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa907d84)
#13 0x00005566cd0b8c9a mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90ec9a)
#14 0x00005566cd0b85cf mlir::PassManager::run(mlir::Operation*) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xa90e5cf)
#15 0x00005566c483656b performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#16 0x00005566c48357a6 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&) MlirOptMain.cpp:0:0
#17 0x00005566cd405815 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) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0xac5b815)
#18 0x00005566c482b3a6 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x20813a6)
#19 0x00005566c482b785 mlir::MlirOptMain(int, char**, llvm::StringRef, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2081785)
#20 0x00005566c482bae5 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&) (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x2081ae5)
#21 0x00005566c476a0e2 main (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fc00e2)
#22 0x00007f7536cf6083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#23 0x00005566c4769c1e _start (/data/szy/MLIR/llvm-release/llvm-project/build/bin/mlir-opt+0x1fbfc1e)
Aborted (core dumped)
```

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to