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

Assertion `EVL->contains(L) && "LCSSA breach detected!"' failed. #58007

Closed
mikaelholmen opened this issue Sep 27, 2022 · 3 comments
Closed

Assertion `EVL->contains(L) && "LCSSA breach detected!"' failed. #58007

mikaelholmen opened this issue Sep 27, 2022 · 3 comments
Labels
llvm:crash llvm:SCEV Scalar Evolution

Comments

@mikaelholmen
Copy link
Collaborator

mikaelholmen commented Sep 27, 2022

llvm commit: ae42563
Reproduce with:llc -O1 bbi-74045.ll -o /dev/null
Result:

llc: ../lib/Transforms/Utils/LoopUtils.cpp:1439: int llvm::rewriteLoopExitValues(llvm::Loop *, llvm::LoopInfo *, llvm::TargetLibraryInfo *, llvm::ScalarEvolution *, const llvm::TargetTransformInfo *, llvm::SCEVExpander &, llvm::DominatorTree *, llvm::ReplaceExitVal, SmallVector<llvm::WeakTrackingVH, 16> &): Assertion `EVL->contains(L) && "LCSSA breach detected!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: build-all/bin/llc -O1 bbi-74045.ll -o /dev/null
1.	Running pass 'Function Pass Manager' on module 'bbi-74045.ll'.
2.	Running pass 'Loop Pass Manager' on function '@h'
3.	Running pass 'Loop Strength Reduction' on basic block '%for.cond2.i'
 #0 0x0000000002bfc9b3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/llc+0x2bfc9b3)
 #1 0x0000000002bfa6ce llvm::sys::RunSignalHandlers() (build-all/bin/llc+0x2bfa6ce)
 #2 0x0000000002bfcd36 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f40d62a1630 __restore_rt sigaction.c:0:0
 #4 0x00007f40d39e8387 raise (/lib64/libc.so.6+0x36387)
 #5 0x00007f40d39e9a78 abort (/lib64/libc.so.6+0x37a78)
 #6 0x00007f40d39e11a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #7 0x00007f40d39e1252 (/lib64/libc.so.6+0x2f252)
 #8 0x0000000002cc0c78 llvm::rewriteLoopExitValues(llvm::Loop*, llvm::LoopInfo*, llvm::TargetLibraryInfo*, llvm::ScalarEvolution*, llvm::TargetTransformInfo const*, llvm::SCEVExpander&, llvm::DominatorTree*, llvm::ReplaceExitVal, llvm::SmallVector<llvm::WeakTrackingVH, 16u>&) (build-all/bin/llc+0x2cc0c78)
 #9 0x00000000025d8fd2 ReduceLoopStrength(llvm::Loop*, llvm::IVUsers&, llvm::ScalarEvolution&, llvm::DominatorTree&, llvm::LoopInfo&, llvm::TargetTransformInfo const&, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::MemorySSA*) LoopStrengthReduce.cpp:0:0
#10 0x0000000002604d11 (anonymous namespace)::LoopStrengthReduce::runOnLoop(llvm::Loop*, llvm::LPPassManager&) LoopStrengthReduce.cpp:0:0
#11 0x0000000001bdc39b llvm::LPPassManager::runOnFunction(llvm::Function&) (build-all/bin/llc+0x1bdc39b)
#12 0x0000000002404f2f llvm::FPPassManager::runOnFunction(llvm::Function&) (build-all/bin/llc+0x2404f2f)
#13 0x000000000240b848 llvm::FPPassManager::runOnModule(llvm::Module&) (build-all/bin/llc+0x240b848)
#14 0x00000000024054f7 llvm::legacy::PassManagerImpl::run(llvm::Module&) (build-all/bin/llc+0x24054f7)
#15 0x00000000006d71ff main (build-all/bin/llc+0x6d71ff)
#16 0x00007f40d39d4555 __libc_start_main (/lib64/libc.so.6+0x22555)
#17 0x00000000006d2230 _start (build-all/bin/llc+0x6d2230)
Abort

bbi-74045.ll.gz

@mikaelholmen
Copy link
Collaborator Author

This starts to happen with 20d798b

Recommit "[SCEV] Look through single value PHIs." (take 3)

This reverts commit 1fbdbb559569641f6d509b569966901c8fb02b63.

All known issues surfaced by this patch should have been fixed now.

The fixes included fixing issues with SCEV expansion in LV and DA's
reliance on LCSSA phis.

Phab review here: https://reviews.llvm.org/D71539

@fhahn
Copy link
Contributor

fhahn commented Sep 27, 2022

Looks like SCEVExpander used for rewriting doesn't have PreserveLCSSA set when it should. Will push a fix soon.

@fhahn fhahn added llvm:crash llvm:SCEV Scalar Evolution and removed new issue labels Sep 27, 2022
@fhahn fhahn closed this as completed in 3abaa37 Sep 27, 2022
@mikaelholmen
Copy link
Collaborator Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:crash llvm:SCEV Scalar Evolution
Projects
None yet
Development

No branches or pull requests

2 participants