Skip to content

[Test] Added test for CSE RAUW change. #41467

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

Merged
merged 1 commit into from
Feb 19, 2022

Conversation

nate-chandler
Copy link
Contributor

Added a reduced case of the issue that was addressed by #41450 . When the RAUW utility handles reborrows properly, the check lines of this case can be adjusted accordingly.

Added a reduced case of the issue that was addressed by
swiftlang#41450 .  When the RAUW utility
handles reborrows properly, the check lines of this case can be adjusted
accordingly.
@nate-chandler nate-chandler requested a review from atrick February 18, 2022 23:47
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

@nate-chandler
Copy link
Contributor Author

Without that patch, this test results in

Assertion failed: (!isAliveAtBeginOfBlock(getFunction()->getEntryBlock()) && "Can't compute frontier for def which does not dominate all uses"), function computeLifetime, file /path/to/source/root/swift/lib/SILOptimizer/Utils/ValueLifetime.cpp, line 126.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.
Stack dump:
0.	Program arguments: /path/to/build/root/swift-macosx-x86_64/bin/sil-opt -enable-lexical-lifetimes -enable-copy-propagation -sil-inline-generics -enable-sil-verify-all --cse main.sil
1.	While evaluating request ExecuteSILPipelineRequest(Run pipelines { Pass List Pipeline } on SIL for main)
2.	While running pass #0 SILFunctionTransform "CSE" on SILFunction "@dont_rauw_guaranteed_with_nondominated_reborrow".
 main.sil|13| 13
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  sil-opt                  0x0000000107d2e1b7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 39
1  sil-opt                  0x0000000107d2d295 llvm::sys::RunSignalHandlers() + 85
2  sil-opt                  0x0000000107d2e7e0 SignalHandler(int) + 272
3  libsystem_platform.dylib 0x00007ff80cd78e2d _sigtramp + 29
4  libsystem_platform.dylib 0x00007ff7bede4c58 _sigtramp + 18446744072401370696
5  libsystem_c.dylib        0x00007ff80ccafd10 abort + 123
6  libsystem_c.dylib        0x00007ff80ccaf0be err + 0
7  sil-opt                  0x0000000102b79507 swift::ValueLifetimeAnalysis::computeLifetime(llvm::function_ref<bool (swift::SILBasicBlock*)>, llvm::function_ref<void (swift::SILInstruction*)>, llvm::function_ref<void (swift::SILBasicBlock*, swift::SILBasicBlock*)>) + 167
8  sil-opt                  0x0000000102b79a64 swift::ValueLifetimeAnalysis::computeLifetimeBoundary(swift::ValueLifetimeBoundary&) + 148
9  sil-opt                  0x0000000102b97229 swift::BeginBorrowInst* (anonymous namespace)::OwnershipLifetimeExtender::borrowCopyOverGuaranteedUsers<swift::TransformRange<llvm::ArrayRef<swift::Operand*>, std::__1::function<swift::SILInstruction* (swift::Operand*)> > >(swift::SILValue, llvm::ilist_iterator<llvm::ilist_detail::node_options<swift::SILInstruction, true, false, void>, false, false>, swift::TransformRange<llvm::ArrayRef<swift::Operand*>, std::__1::function<swift::SILInstruction* (swift::Operand*)> >) + 649
10 sil-opt                  0x0000000102b7ee96 swift::BeginBorrowInst* (anonymous namespace)::OwnershipLifetimeExtender::borrowCopyOverGuaranteedUses<llvm::ArrayRef<swift::Operand*> >(swift::SILValue, llvm::ilist_iterator<llvm::ilist_detail::node_options<swift::SILInstruction, true, false, void>, false, false>, llvm::ArrayRef<swift::Operand*>) + 150
11 sil-opt                  0x0000000102b86810 (anonymous namespace)::OwnershipLifetimeExtender::borrowOverValue(swift::SILValue, swift::SILValue) + 480
12 sil-opt                  0x0000000102b7fda8 (anonymous namespace)::OwnershipRAUWPrepare::prepareReplacement(swift::SILValue) + 632
13 sil-opt                  0x0000000102b7fa9f swift::OwnershipRAUWHelper::prepareReplacement(swift::SILValue) + 703
14 sil-opt                  0x0000000102b7ff13 swift::OwnershipRAUWHelper::perform(swift::SILValue) + 67
15 sil-opt                  0x000000010272e833 swift::CSE::processNode(llvm::DomTreeNodeBase<swift::SILBasicBlock>*) + 2067
16 sil-opt                  0x000000010272dd1e swift::CSE::processFunction(swift::SILFunction&, swift::DominanceInfo*) + 382
17 sil-opt                  0x000000010275cec3 (anonymous namespace)::SILCSE::run() + 467
18 sil-opt                  0x00000001025676b6 swift::SILPassManager::runPassOnFunction(unsigned int, swift::SILFunction*) + 1830
19 sil-opt                  0x0000000102568c1a swift::SILPassManager::runFunctionPasses(unsigned int, unsigned int) + 1034
20 sil-opt                  0x000000010256ceab swift::SILPassManager::execute() + 571
21 sil-opt                  0x00000001025657db swift::SILPassManager::executePassPipelinePlan(swift::SILPassPipelinePlan const&) + 427
22 sil-opt                  0x00000001025655b5 swift::ExecuteSILPipelineRequest::evaluate(swift::Evaluator&, swift::SILPipelineExecutionDescriptor) const + 101
23 sil-opt                  0x00000001025bfa1a std::__1::tuple<> swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::callDerived<0ul>(swift::Evaluator&, std::__1::integer_sequence<unsigned long, 0ul>) const + 138
24 sil-opt                  0x00000001025bf940 swift::SimpleRequest<swift::ExecuteSILPipelineRequest, std::__1::tuple<> (swift::SILPipelineExecutionDescriptor), (swift::RequestFlags)1>::evaluateRequest(swift::ExecuteSILPipelineRequest const&, swift::Evaluator&) + 32
25 sil-opt                  0x000000010258900d llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::getResultUncached<swift::ExecuteSILPipelineRequest>(swift::ExecuteSILPipelineRequest const&) + 317
26 sil-opt                  0x0000000102565a2b llvm::Expected<swift::ExecuteSILPipelineRequest::OutputType> swift::Evaluator::operator()<swift::ExecuteSILPipelineRequest, (void*)0>(swift::ExecuteSILPipelineRequest const&) + 43
27 sil-opt                  0x00000001025658be swift::executePassPipelinePlan(swift::SILModule*, swift::SILPassPipelinePlan const&, bool, swift::irgen::IRGenModule*) + 142
28 sil-opt                  0x000000010113c4c1 runCommandLineSelectedPasses(swift::SILModule*, swift::irgen::IRGenModule*) + 145
29 sil-opt                  0x000000010113a68a main + 5770
30 dyld                     0x0000000124ac84fe start + 462

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test macos platform

@nate-chandler nate-chandler merged commit b571eb3 into swiftlang:main Feb 19, 2022
@atrick
Copy link
Contributor

atrick commented Feb 25, 2022

Thanks

@nate-chandler nate-chandler deleted the test/20220218/1 branch July 5, 2023 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants