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 `Found && "Could not find matching value for source GVN"' failed. with opt -passes='require<ir-similarity>' #53537

Closed
mikaelholmen opened this issue Feb 2, 2022 · 2 comments

Comments

@mikaelholmen
Copy link
Collaborator

llvm commit: 281d29b
Reproduce with:
opt -passes='require' -o /dev/null bbi-65410.ll
bbi-65410.ll.gz

Result:
opt: ../lib/Analysis/IRSimilarityIdentifier.cpp:998: void llvm::IRSimilarity::IRSimilarityCandidate::createCanonicalRelationFrom(llvm::IRSimilarity::IRSimilarityCandidate &, DenseMap<unsigned int, DenseSet > &, DenseMap<unsigned int, DenseSet > &): Assertion `Found && "Could not find matching value for source GVN"' 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/opt -passes=require -o /dev/null bbi-65410.ll
#0 0x0000000002cd0483 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build-all/bin/opt+0x2cd0483)
#1 0x0000000002cce0fe llvm::sys::RunSignalHandlers() (build-all/bin/opt+0x2cce0fe)
#2 0x0000000002cd0806 SignalHandler(int) Signals.cpp:0:0
#3 0x00007f558d4e3630 __restore_rt sigaction.c:0:0
#4 0x00007f558ac16387 raise (/lib64/libc.so.6+0x36387)
#5 0x00007f558ac17a78 abort (/lib64/libc.so.6+0x37a78)
#6 0x00007f558ac0f1a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
#7 0x00007f558ac0f252 (/lib64/libc.so.6+0x2f252)
#8 0x0000000001b59cba llvm::IRSimilarity::IRSimilarityCandidate::createCanonicalRelationFrom(llvm::IRSimilarity::IRSimilarityCandidate&, llvm::DenseMap<unsigned int, llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int, void> >, llvm::DenseMapInfo<unsigned int, void>, llvm::detail::DenseMapPair<unsigned int, llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int, void> > > >&, llvm::DenseMap<unsigned int, llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int, void> >, llvm::DenseMapInfo<unsigned int, void>, llvm::detail::DenseMapPair<unsigned int, llvm::DenseSet<unsigned int, llvm::DenseMapInfo<unsigned int, void> > > >&) (build-all/bin/opt+0x1b59cba)
#9 0x0000000001b5abe1 llvm::IRSimilarity::IRSimilarityIdentifier::findCandidates(std::vector<llvm::IRSimilarity::IRInstructionData*, std::allocatorllvm::IRSimilarity::IRInstructionData* >&, std::vector<unsigned int, std::allocator >&) (build-all/bin/opt+0x1b5abe1)
#10 0x0000000001b5b9ca llvm::IRSimilarity::IRSimilarityIdentifier::findSimilarity(llvm::Module&) (build-all/bin/opt+0x1b5b9ca)
#11 0x0000000001b5bf6a llvm::IRSimilarityAnalysis::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (build-all/bin/opt+0x1b5bf6a)
#12 0x0000000002fda230 llvm::detail::AnalysisPassModel<llvm::Module, llvm::IRSimilarityAnalysis, llvm::PreservedAnalyses, llvm::AnalysisManagerllvm::Module::Invalidator>::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) crtstuff.c:0:0
#13 0x000000000241ee6e llvm::AnalysisManagerllvm::Module::getResultImpl(llvm::AnalysisKey*, llvm::Module&) (build-all/bin/opt+0x241ee6e)
#14 0x0000000002fe6d18 llvm::RequireAnalysisPass<llvm::IRSimilarityAnalysis, llvm::Module, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) crtstuff.c:0:0
#15 0x0000000002fe6b5d llvm::detail::PassModel<llvm::Module, llvm::RequireAnalysisPass<llvm::IRSimilarityAnalysis, llvm::Module, llvm::AnalysisManagerllvm::Module >, llvm::PreservedAnalyses, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) crtstuff.c:0:0
#16 0x000000000241c6e8 llvm::PassManager<llvm::Module, llvm::AnalysisManagerllvm::Module >::run(llvm::Module&, llvm::AnalysisManagerllvm::Module&) (build-all/bin/opt+0x241c6e8)
#17 0x00000000007a3662 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRefllvm::StringRef, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool) (build-all/bin/opt+0x7a3662)
#18 0x00000000007b6234 main (build-all/bin/opt+0x7b6234)
#19 0x00007f558ac02555 __libc_start_main (/lib64/libc.so.6+0x22555)
#20 0x000000000079eaec _start (build-all/bin/opt+0x79eaec)

This starts happening with 3785c1d:
[IRSim][IROutliner] Allowing Intrinsic Calls to be Used in Similarity Matching and Outlined Regions

Commented here:
https://reviews.llvm.org/D109450#3283855

@AndrewLitteken
Copy link
Contributor

Fix here: https://reviews.llvm.org/D118807

@mikaelholmen
Copy link
Collaborator Author

Thanks!

mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
… calls without commutativity

Created to fix: llvm/llvm-project#53537

Some intrinsics functions are considered commutative since they are performing operations like addition or multiplication. Some of these have extra parameters to provide extra information that are not part of the operation itself and are not commutative. This makes sure that if an instruction that is an intrinsic takes the non commutative path to handle this case.

Reviewer: paquette

Closes Issue #53537

Differential Revision: https://reviews.llvm.org/D118807
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