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] Inliner Segfaults #52887

Closed
wsmoses opened this issue Dec 27, 2021 · 2 comments
Closed

[MLIR] Inliner Segfaults #52887

wsmoses opened this issue Dec 27, 2021 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior mlir:core MLIR Core Infrastructure

Comments

@wsmoses
Copy link
Member

wsmoses commented Dec 27, 2021

Input:

module  {
  func @_ZZN2at6native21smooth_l1_kernel_cudaEvENKUlvE_clEv(%arg0: !llvm.ptr<struct<(i8)>>) {
    %c0_i32 = arith.constant 0 : i32
    %0 = memref.alloca() : memref<1x1xi16>
    %1 = memref.cast %0 : memref<1x1xi16> to memref<?x1xi16>
    %2 = arith.sitofp %c0_i32 : i32 to f32
    call @_ZN3c104HalfC1Ef(%1, %2) : (memref<?x1xi16>, f32) -> ()
    return
  }
  func @_ZZZN2at6native21smooth_l1_kernel_cudaEvENKUlvE_clEvENKUlN3c104HalfES3_E_clES3_S3_(%arg0: !llvm.ptr<struct<(i8)>>, %arg1: memref<?x1xi16>, %arg2: memref<?x1xi16>, %arg3: memref<?x1xi16>) {
    call @_ZN3c10miERKNS_4HalfES2_(%arg1, %arg2, %arg3) : (memref<?x1xi16>, memref<?x1xi16>, memref<?x1xi16>) -> ()
    return
  }
  func @_ZN3c104HalfC1Ef(%arg0: memref<?x1xi16>, %arg1: f32) {
    %0 = call @_ZN3c106detail25fp16_ieee_from_fp32_valueEf(%arg1) : (f32) -> i16
    return
  }
  func private @fabs(f64) -> f64
  func private @_ZNK3c104HalfcvfEv(%arg0: memref<?x1xi16>) -> f32 {
    %c0 = arith.constant 0 : index
    %0 = memref.load %arg0[%c0, %c0] : memref<?x1xi16>
    %1 = call @_ZN3c106detail23fp16_ieee_to_fp32_valueEt(%0) : (i16) -> f32
    return %1 : f32
  }
  func private @_ZN3c10miERKNS_4HalfES2_(%arg0: memref<?x1xi16>, %arg1: memref<?x1xi16>, %arg2: memref<?x1xi16>) {
    %0 = memref.alloca() : memref<1x1xi16>
    %1 = memref.cast %0 : memref<1x1xi16> to memref<?x1xi16>
    %2 = call @_ZNK3c104HalfcvfEv(%arg0) : (memref<?x1xi16>) -> f32
    call @_ZN3c104HalfC1Ef(%1, %2) : (memref<?x1xi16>, f32) -> ()
    return
  }
  func @_ZN3c106detail25fp16_ieee_from_fp32_valueEf(%arg0: f32) -> i16 {
    %c1_i16 = arith.constant 1 : i16
    %0 = call @fabsf(%arg0) : (f32) -> f32
    return %c1_i16 : i16
  }
  func @_ZN3c106detail23fp16_ieee_to_fp32_valueEt(%arg0: i16) -> f32 {
    %c1_i32 = arith.constant 1 : i32
    %0 = call @_ZN3c106detail14fp32_from_bitsEj(%c1_i32) : (i32) -> f32
    return %0 : f32
  }
  func private @fabsf(f32) -> f32
  func @_ZN3c106detail14fp32_from_bitsEj(%arg0: i32) -> f32 {
    %cst = arith.constant 0.000000e+00 : f32
    return %cst : f32
  }
}

Steps to reproduce and backtrace:

$ ~/git/Polygeist/mlir-build/bin/mlir-opt det2.mlir -inline
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /home/wmoses/git/Polygeist/mlir-build/bin/mlir-opt det2.mlir -inline
 #0 0x0000556e5e4d3f46 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/wmoses/git/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:0
 #1 0x0000556e5e4d3ffd PrintStackTraceSignalHandler(void*) /home/wmoses/git/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:0
 #2 0x0000556e5e4d1cac llvm::sys::RunSignalHandlers() /home/wmoses/git/Polygeist/llvm-project/llvm/lib/Support/Signals.cpp:96:0
 #3 0x0000556e5e4d38c7 SignalHandler(int) /home/wmoses/git/Polygeist/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:0
 #4 0x00007f6f09c22980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #5 0x0000556e604fa7ee mlir::Region::getParentRegion() /home/wmoses/git/Polygeist/llvm-project/mlir/lib/IR/Region.cpp:47:0
 #6 0x0000556e604fa855 mlir::Region::isProperAncestor(mlir::Region*) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/IR/Region.cpp:55:0
 #7 0x0000556e5e5fcc8b mlir::Region::isAncestor(mlir::Region*) /home/wmoses/git/Polygeist/llvm-project/mlir/include/mlir/IR/Region.h:217:0
 #8 0x0000556e6028492f shouldInline((anonymous namespace)::ResolvedCall&) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Transforms/Inliner.cpp:422:0
 #9 0x0000556e60284b4d inlineCallsInSCC((anonymous namespace)::Inliner&, (anonymous namespace)::CGUseList&, (anonymous namespace)::CallGraphSCC&) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Transforms/Inliner.cpp:461:0
#10 0x0000556e602855f5 (anonymous namespace)::InlinerPass::inlineSCC((anonymous namespace)::Inliner&, (anonymous namespace)::CGUseList&, (anonymous namespace)::CallGraphSCC&, mlir::MLIRContext*) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Transforms/Inliner.cpp:633:0
#11 0x0000556e60285309 (anonymous namespace)::InlinerPass::runOnOperation()::'lambda'((anonymous namespace)::CallGraphSCC&)::operator()((anonymous namespace)::CallGraphSCC&) const /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Transforms/Inliner.cpp:615:0
#12 0x0000556e60287921 mlir::LogicalResult llvm::function_ref<mlir::LogicalResult ((anonymous namespace)::CallGraphSCC&)>::callback_fn<(anonymous namespace)::InlinerPass::runOnOperation()::'lambda'((anonymous namespace)::CallGraphSCC&)>(long, (anonymous namespace)::CallGraphSCC&) /home/wmoses/git/Polygeist/llvm-project/llvm/include/llvm/ADT/STLExtras.h:234:0
#13 0x0000556e60286871 llvm::function_ref<mlir::LogicalResult ((anonymous namespace)::CallGraphSCC&)>::operator()((anonymous namespace)::CallGraphSCC&) const /home/wmoses/git/Polygeist/llvm-project/llvm/include/llvm/ADT/STLExtras.h:256:0
#14 0x0000556e602840c2 runTransformOnCGSCCs(mlir::CallGraph const&, llvm::function_ref<mlir::LogicalResult ((anonymous namespace)::CallGraphSCC&)>) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Transforms/Inliner.cpp:296:0
#15 0x0000556e602854c8 (anonymous namespace)::InlinerPass::runOnOperation() /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Transforms/Inliner.cpp:615:0
#16 0x0000556e60225129 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:393:0
#17 0x0000556e602253fb mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::unique_ptr<mlir::Pass, std::default_delete<mlir::Pass> >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:452:0
#18 0x0000556e60226af0 mlir::PassManager::runPasses(mlir::Operation*, mlir::AnalysisManager) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:697:0
#19 0x0000556e60226938 mlir::PassManager::run(mlir::Operation*) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Pass/Pass.cpp:676:0
#20 0x0000556e601d2919 performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Support/MlirOptMain.cpp:80:0
#21 0x0000556e601d2c69 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool&, llvm::function_ref<void (mlir::MLIRContext&)>) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Support/MlirOptMain.cpp:123:0
#22 0x0000556e601d3055 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool, llvm::function_ref<void (mlir::MLIRContext&)>) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Support/MlirOptMain.cpp:166:0
#23 0x0000556e601d32d8 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer> >, mlir::PassPipelineCLParser const&, mlir::DialectRegistry&, bool, bool, bool, bool, bool, llvm::function_ref<void (mlir::MLIRContext&)>) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Support/MlirOptMain.cpp:186:0
#24 0x0000556e601d3fa6 mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool, llvm::function_ref<void (mlir::MLIRContext&)>) /home/wmoses/git/Polygeist/llvm-project/mlir/lib/Support/MlirOptMain.cpp:289:0
#25 0x0000556e5e46d413 main /home/wmoses/git/Polygeist/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:216:0
#26 0x00007f6f08ababf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#27 0x0000556e5e46d0da _start (/home/wmoses/git/Polygeist/mlir-build/bin/mlir-opt+0x43a0da)
Segmentation fault (core dumped)

cc @ftynse

@wsmoses wsmoses added mlir:core MLIR Core Infrastructure bug Indicates an unexpected problem or unintended behavior labels Dec 27, 2021
@ftynse
Copy link
Member

ftynse commented Jan 5, 2022

==3668454==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c000008fc0 at pc 0x5602508c1aa5 bp 0x7ffd027dadc0 sp 0x7ffd027dadb8
READ of size 8 at 0x60c000008fc0 thread T0
    #0 0x5602508c1aa4 in isRegistered third_party/llvm/llvm-project/mlir/include/mlir/IR/OperationSupport.h:128:38
    #1 0x5602508c1aa4 in mlir::OperationName::hasTrait(mlir::TypeID) const third_party/llvm/llvm-project/mlir/include/mlir/IR/OperationSupport.h:141:12
    #2 0x560255e1fb68 in hasTrait<mlir::OpTrait::IsTerminator> third_party/llvm/llvm-project/mlir/include/mlir/IR/OperationSupport.h:138:12
    #3 0x560255e1fb68 in hasTrait<mlir::OpTrait::IsTerminator> third_party/llvm/llvm-project/mlir/include/mlir/IR/Operation.h:471:17
    #4 0x560255e1fb68 in shouldInline third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:417:26
    #5 0x560255e1fb68 in inlineCallsInSCC third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:461:21
    #6 0x560255e1fb68 in inlineSCC third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:633:16
    #7 0x560255e1fb68 in operator() third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:614:12
    #8 0x560255e1fb68 in callback_fn<(lambda at third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:613:51)> third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:232:12
    #9 0x560255e1fb68 in operator() third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:255:12
    #10 0x560255e1fb68 in runTransformOnCGSCCs third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:296:16
    #11 0x560255e1fb68 in (anonymous namespace)::InlinerPass::runOnOperation() third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:613:26
    #12 0x560256cec759 in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:392:11
    #13 0x560256ced9c2 in mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::__u::unique_ptr<mlir::Pass, std::__u::default_delete<mlir::Pass> >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:452:16
    #14 0x560256cf2acf in runPasses third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:696:10
    #15 0x560256cf2acf in mlir::PassManager::run(mlir::Operation*) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:676:60
    #16 0x560250a6b982 in performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:80:17
    #17 0x560250a684eb in processBuffer(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer> >, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool&) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:119:12
    #18 0x560250a67d38 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer> >, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:159:10
    #19 0x560250a69fec in MlirOptMain third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:179:10
    #20 0x560250a69fec in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:283:14
    #21 0x56025088ad83 in main third_party/llvm/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:217:7
    #22 0x7fcb71cce8d2 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x628d2)
    #23 0x5602507c5d29 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

0x60c000008fc0 is located 64 bytes inside of 128-byte region [0x60c000008f80,0x60c000009000)
freed by thread T0 here:
    #0 0x56025086cf82 in free third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:111:3
    #1 0x56025873b707 in destroy third_party/llvm/llvm-project/mlir/lib/IR/Operation.cpp:177:3
    #2 0x56025873b707 in deleteNode third_party/llvm/llvm-project/mlir/lib/IR/Operation.cpp:377:7
    #3 0x56025873b707 in llvm::iplist_impl<llvm::simple_ilist<mlir::Operation>, llvm::ilist_traits<mlir::Operation> >::erase(llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, false, false, void>, false, false>) third_party/llvm/llvm-project/llvm/include/llvm/ADT/ilist.h:268:5
    #4 0x560258724bd8 in erase third_party/llvm/llvm-project/llvm/include/llvm/ADT/ilist.h:272:39
    #5 0x560258724bd8 in mlir::Operation::erase() third_party/llvm/llvm-project/mlir/lib/IR/Operation.cpp:426:29
    #6 0x560255e20b22 in erase third_party/llvm/llvm-project/mlir/include/mlir/IR/OpDefinition.h:130:25
    #7 0x560255e20b22 in inlineCallsInSCC third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:491:10
    #8 0x560255e20b22 in inlineSCC third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:633:16
    #9 0x560255e20b22 in operator() third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:614:12
    #10 0x560255e20b22 in callback_fn<(lambda at third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:613:51)> third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:232:12
    #11 0x560255e20b22 in operator() third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:255:12
    #12 0x560255e20b22 in runTransformOnCGSCCs third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:296:16
    #13 0x560255e20b22 in (anonymous namespace)::InlinerPass::runOnOperation() third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:613:26
    #14 0x560256cec759 in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:392:11
    #15 0x560256ced9c2 in mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::__u::unique_ptr<mlir::Pass, std::__u::default_delete<mlir::Pass> >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:452:16
    #16 0x560256cf2acf in runPasses third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:696:10
    #17 0x560256cf2acf in mlir::PassManager::run(mlir::Operation*) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:676:60
    #18 0x560250a6b982 in performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:80:17
    #19 0x560250a684eb in processBuffer(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer> >, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool&) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:119:12
    #20 0x560250a67d38 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer> >, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:159:10
    #21 0x560250a69fec in MlirOptMain third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:179:10
    #22 0x560250a69fec in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:283:14
    #23 0x56025088ad83 in main third_party/llvm/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:217:7
    #24 0x7fcb71cce8d2 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x628d2)
    #25 0x5602507c5d29 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

previously allocated by thread T0 here:
    #0 0x56025086d1fd in malloc third_party/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:129:3
    #1 0x560258721195 in mlir::Operation::create(mlir::Location, mlir::OperationName, mlir::TypeRange, mlir::ValueRange, mlir::DictionaryAttr, mlir::BlockRange, unsigned int) third_party/llvm/llvm-project/mlir/lib/IR/Operation.cpp:87:46
    #2 0x56025872668e in mlir::Operation::cloneWithoutRegions(mlir::BlockAndValueMapping&) third_party/llvm/llvm-project/mlir/lib/IR/Operation.cpp:544:17
    #3 0x560258726f6c in mlir::Operation::clone(mlir::BlockAndValueMapping&) third_party/llvm/llvm-project/mlir/lib/IR/Operation.cpp:565:17
    #4 0x560258753afe in mlir::Region::cloneInto(mlir::Region*, llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Block, false, false, void>, false, false>, mlir::BlockAndValueMapping&) third_party/llvm/llvm-project/mlir/lib/IR/Region.cpp:99:30
    #5 0x56025614b6a7 in inlineRegionImpl(mlir::InlinerInterface&, mlir::Region*, mlir::Block*, llvm::ilist_iterator<llvm::ilist_detail::node_options<mlir::Operation, false, false, void>, false, false>, mlir::BlockAndValueMapping&, mlir::ValueRange, mlir::TypeRange, llvm::Optional<mlir::Location>, bool, mlir::Operation*) third_party/llvm/llvm-project/mlir/lib/Transforms/Utils/InliningUtils.cpp:177:10
    #6 0x56025614e320 in mlir::inlineCall(mlir::InlinerInterface&, mlir::CallOpInterface, mlir::CallableOpInterface, mlir::Region*, bool) third_party/llvm/llvm-project/mlir/lib/Transforms/Utils/InliningUtils.cpp:412:14
    #7 0x560255e203a9 in inlineCallsInSCC third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:477:34
    #8 0x560255e203a9 in inlineSCC third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:633:16
    #9 0x560255e203a9 in operator() third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:614:12
    #10 0x560255e203a9 in callback_fn<(lambda at third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:613:51)> third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:232:12
    #11 0x560255e203a9 in operator() third_party/llvm/llvm-project/llvm/include/llvm/ADT/STLExtras.h:255:12
    #12 0x560255e203a9 in runTransformOnCGSCCs third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:296:16
    #13 0x560255e203a9 in (anonymous namespace)::InlinerPass::runOnOperation() third_party/llvm/llvm-project/mlir/lib/Transforms/Inliner.cpp:613:26
    #14 0x560256cec759 in mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:392:11
    #15 0x560256ced9c2 in mlir::detail::OpToOpPassAdaptor::runPipeline(llvm::iterator_range<llvm::pointee_iterator<std::__u::unique_ptr<mlir::Pass, std::__u::default_delete<mlir::Pass> >*, mlir::Pass> >, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:452:16
    #16 0x560256cf2acf in runPasses third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:696:10
    #17 0x560256cf2acf in mlir::PassManager::run(mlir::Operation*) third_party/llvm/llvm-project/mlir/lib/Pass/Pass.cpp:676:60
    #18 0x560250a6b982 in performActions(llvm::raw_ostream&, bool, bool, llvm::SourceMgr&, mlir::MLIRContext*, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:80:17
    #19 0x560250a684eb in processBuffer(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer> >, bool, bool, bool, bool, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, llvm::ThreadPool&) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:119:12
    #20 0x560250a67d38 in mlir::MlirOptMain(llvm::raw_ostream&, std::__u::unique_ptr<llvm::MemoryBuffer, std::__u::default_delete<llvm::MemoryBuffer> >, llvm::function_ref<mlir::LogicalResult (mlir::PassManager&)>, mlir::DialectRegistry&, bool, bool, bool, bool, bool) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:159:10
    #21 0x560250a69fec in MlirOptMain third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:179:10
    #22 0x560250a69fec in mlir::MlirOptMain(int, char**, llvm::StringRef, mlir::DialectRegistry&, bool) third_party/llvm/llvm-project/mlir/lib/Support/MlirOptMain.cpp:283:14
    #23 0x56025088ad83 in main third_party/llvm/llvm-project/mlir/tools/mlir-opt/mlir-opt.cpp:217:7
    #24 0x7fcb71cce8d2 in __libc_start_main (/usr/grte/v5/lib64/libc.so.6+0x628d2)
    #25 0x5602507c5d29 in _start /usr/grte/v5/debug-src/src/csu/../sysdeps/x86_64/start.S:120

@ftynse
Copy link
Member

ftynse commented Jan 7, 2022

Here's a more minimal example

func @A() {
  call @B() : () -> ()
  return
}

func @B() {
  call @E() : () -> ()
  return
}

func @C() {
  call @D() : () -> ()
  return
}

func private @D() {
  call @B() : () -> ()
  return
}

func @E() {
  call @fabsf() : () -> ()
  return
}

func private @fabsf()
~                           

@ftynse ftynse closed this as completed in 2f672e2 Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior mlir:core MLIR Core Infrastructure
Projects
None yet
Development

No branches or pull requests

2 participants