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] BubbleUpBitCastForStridedSliceInsert::matchAndRewrite crashes with Assertion Failure "!empty()" #60214

Closed
Colloportus0 opened this issue Jan 22, 2023 · 3 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] mlir:vectorops

Comments

@Colloportus0
Copy link

Colloportus0 commented Jan 22, 2023

MLIR built at commit a0dab4950
Reproduced with:

mlir-opt --test-vector-to-vector-lowering temp.mlir

temp.mlir:

func.func @func(%arg0: vector<f32>) -> vector<i32> {
  %0 = vector.bitcast %arg0 : vector<f32> to vector<i32>
  return %0 : vector<i32>
}

trace:

Assertion failed: (!empty()), function back, file ArrayRef.h, line 173.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: mlir-opt --test-vector-to-vector-lowering temp.mlir
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mlir-opt                 0x00000001008106b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  mlir-opt                 0x000000010080f720 llvm::sys::RunSignalHandlers() + 112
2  mlir-opt                 0x0000000100810d50 SignalHandler(int) + 344
3  libsystem_platform.dylib 0x00000001aad414c4 _sigtramp + 56
4  libsystem_pthread.dylib  0x00000001aad29ee0 pthread_kill + 288
5  libsystem_c.dylib        0x00000001aac64340 abort + 168
6  libsystem_c.dylib        0x00000001aac63754 err + 0
7  mlir-opt                 0x00000001024f4a18 BubbleUpBitCastForStridedSliceInsert::matchAndRewrite(mlir::vector::BitCastOp, mlir::PatternRewriter&) const (.cold.4) + 0
8  mlir-opt                 0x00000001018d3304 BubbleUpBitCastForStridedSliceInsert::matchAndRewrite(mlir::vector::BitCastOp, mlir::PatternRewriter&) const + 1496
9  mlir-opt                 0x000000010212bb9c mlir::PatternApplicator::matchAndRewrite(mlir::Operation*, mlir::PatternRewriter&, llvm::function_ref<bool (mlir::Pattern const&)>, llvm::function_ref<void (mlir::Pattern const&)>, llvm::function_ref<mlir::LogicalResult (mlir::Pattern const&)>) + 1420
10 mlir-opt                 0x0000000101edb918 mlir::applyPatternsAndFoldGreedily(llvm::MutableArrayRef<mlir::Region>, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig) + 3976
11 mlir-opt                 0x0000000101e5c330 (anonymous namespace)::TestVectorToVectorLowering::runOnOperation() + 696
12 mlir-opt                 0x0000000101e8c428 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 428
13 mlir-opt                 0x0000000101e8c958 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
14 mlir-opt                 0x0000000101e909dc mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14::operator()(mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo&) const + 176
15 mlir-opt                 0x0000000101e90858 mlir::LogicalResult mlir::failableParallelForEach<std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&>(mlir::MLIRContext*, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, std::__1::__wrap_iter<mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::OpPMInfo*>, mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool)::$_14&) + 360
16 mlir-opt                 0x0000000101e8d620 mlir::detail::OpToOpPassAdaptor::runOnOperationAsyncImpl(bool) + 1396
17 mlir-opt                 0x0000000101e8c558 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) + 732
18 mlir-opt                 0x0000000101e8c958 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) + 320
19 mlir-opt                 0x0000000101e8e2d4 mlir::PassManager::run(mlir::Operation*) + 1148
20 mlir-opt                 0x0000000101e87698 performActions(llvm::raw_ostream&, bool, bool, std::__1::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, bool, bool) + 504
21 mlir-opt                 0x0000000101e87268 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool)::$_0>(long, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) + 704
22 mlir-opt                 0x0000000101ef1f5c mlir::splitAndProcessBuffer(std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) + 656
23 mlir-opt                 0x0000000101e85690 mlir::MlirOptMain(llvm::raw_ostream&, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, bool, bool) + 216
24 mlir-opt                 0x0000000101e85b84 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) + 1208
25 mlir-opt                 0x00000001006b2ae4 main + 108
26 dyld                     0x0000000105715088 start + 516
@EugeneZelenko EugeneZelenko added mlir crash Prefer [crash-on-valid] or [crash-on-invalid] and removed new issue labels Jan 22, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 22, 2023

@llvm/issue-subscribers-mlir

@python3kgae
Copy link
Contributor

Create PR https://reviews.llvm.org/D142319

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 23, 2023

@llvm/issue-subscribers-mlir-vectorops

CarlosAlbertoEnciso pushed a commit to SNSystems/llvm-debuginfo-analyzer that referenced this issue Jan 30, 2023
InsertStridedSliceOp will not get 0-D vector result, so just skip 0-D vector in BubbleUpBitCastForStridedSliceInsert.
Fixes #60214  llvm/llvm-project#60214

Differential Revision: https://reviews.llvm.org/D142319
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:vectorops
Projects
None yet
Development

No branches or pull requests

4 participants