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

[flang] HLFIR forall tests trigger assertion failures on macOS #70805

Closed
luporl opened this issue Oct 31, 2023 · 1 comment
Closed

[flang] HLFIR forall tests trigger assertion failures on macOS #70805

luporl opened this issue Oct 31, 2023 · 1 comment

Comments

@luporl
Copy link
Contributor

luporl commented Oct 31, 2023

Both HLFIR/forall-index.fir and Lower/HLFIR/forall.f90 tests cause bbc to abort execution after an assertion failure:
Assertion failed: (op->use_empty() && "expected 'op' to have no uses"), function eraseOp, file PatternMatch.cpp, line 307.

Below is the output of Lower/HLFIR/forall.f90 failure:

FAIL: Flang :: Lower/HLFIR/forall.f90 (1 of 1)
******************** TEST 'Flang :: Lower/HLFIR/forall.f90' FAILED ********************
Exit Code: 2

Command Output (stderr):
--
RUN: at line 2: bbc --hlfir -o - /Users/leandro.lupori/git/flang-luporl/llvm-project/flang/test/Lower/HLFIR/forall.f90 | /Users/leandro.lupori/git/flang-luporl/buildr/bin/FileCheck /Users/leandro.lupori/git/flang-luporl/llvm-project/flang/test/Lower/HLFIR/forall.f90
+ bbc --hlfir -o - /Users/leandro.lupori/git/flang-luporl/llvm-project/flang/test/Lower/HLFIR/forall.f90
+ /Users/leandro.lupori/git/flang-luporl/buildr/bin/FileCheck /Users/leandro.lupori/git/flang-luporl/llvm-project/flang/test/Lower/HLFIR/forall.f90
Assertion failed: (op->use_empty() && "expected 'op' to have no uses"), function eraseOp, file PatternMatch.cpp, line 307.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: bbc --hlfir -o - /Users/leandro.lupori/git/flang-luporl/llvm-project/flang/test/Lower/HLFIR/forall.f90
 #0 0x0000000102cbba54 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101f9fa54)
 #1 0x0000000102cb9bf8 llvm::sys::RunSignalHandlers() (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101f9dbf8)
 #2 0x0000000102cbc104 SignalHandler(int) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101fa0104)
 #3 0x0000000184439a24 (/usr/lib/system/libsystem_platform.dylib+0x180465a24)
 #4 0x000000018440acc0 (/usr/lib/system/libsystem_pthread.dylib+0x180436cc0)
 #5 0x000000018431aa50 (/usr/lib/system/libsystem_c.dylib+0x180346a50)
 #6 0x0000000184319d6c (/usr/lib/system/libsystem_c.dylib+0x180345d6c)
 #7 0x0000000102f43a6c mlir::RewriterBase::eraseBlock(mlir::Block*) (.cold.1) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x102227a6c)
 #8 0x0000000102ba82c4 mlir::RewriterBase::eraseOp(mlir::Operation*) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101e8c2c4)
 #9 0x0000000100fa3fb8 hlfir::ForallIndexOp::canonicalize(hlfir::ForallIndexOp, mlir::PatternRewriter&) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x100287fb8)
#10 0x0000000102a60970 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<mlir::LogicalResult (mlir::Pattern const&)>)::$_2>(long) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d44970)
#11 0x0000000102a5dccc 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&)>) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d41ccc)
#12 0x0000000102a2da38 (anonymous namespace)::GreedyPatternRewriteDriver::processWorklist() (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d11a38)
#13 0x0000000102a2aa68 mlir::applyPatternsAndFoldGreedily(mlir::Region&, mlir::FrozenRewritePatternSet const&, mlir::GreedyRewriteConfig, bool*) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d0ea68)
#14 0x00000001029fad14 (anonymous namespace)::Canonicalizer::runOnOperation() (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101cded14)
#15 0x0000000102a872c8 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d6b2c8)
#16 0x0000000102a87928 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d6b928)
#17 0x0000000102a89958 mlir::PassManager::run(mlir::Operation*) (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x101d6d958)
#18 0x0000000100d229dc main (/Users/leandro.lupori/git/flang-luporl/buildr/bin/bbc+0x1000069dc)
#19 0x0000000184091058
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /Users/leandro.lupori/git/flang-luporl/buildr/bin/FileCheck /Users/leandro.lupori/git/flang-luporl/llvm-project/flang/test/Lower/HLFIR/forall.f90

--

********************
********************
Failed Tests (1):
  Flang :: Lower/HLFIR/forall.f90
@luporl luporl added the flang Flang issues not falling into any other category label Oct 31, 2023
@EugeneZelenko EugeneZelenko added test-suite flang:fir-hlfir and removed flang Flang issues not falling into any other category labels Oct 31, 2023
@jeanPerier jeanPerier self-assigned this Nov 9, 2023
luporl added a commit to luporl/llvm-project that referenced this issue Nov 14, 2023
Adjust some of the tests run by check-flang to make them pass on MacOS,
either by skipping unsupported tests or by adapting the test for correct
execution on MacOS.

For now ctofortran.f90 test is marked as unsupported, but it can be
adapted to run on MacOS once support for -isysroot flag is added to
flang.

Issues llvm#70805 and llvm#70807 are tracking the failing tests that remain, as
these reveal real problems with flang.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this issue Nov 20, 2023
Adjust some of the tests run by check-flang to make them pass on MacOS,
either by skipping unsupported tests or by adapting the test for correct
execution on MacOS.

For now ctofortran.f90 test is marked as unsupported, but it can be
adapted to run on MacOS once support for -isysroot flag is added to
flang.

Issues llvm#70805 and llvm#70807 are tracking the failing tests that remain, as
these reveal real problems with flang.
@luporl
Copy link
Contributor Author

luporl commented Mar 11, 2024

Recently HLFIR forall tests stopped failing on my machine. Some recent commit must have fixed them.

@luporl luporl closed this as completed Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants