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

opt -loop-vectorizer fails with Assertion `Ingredient2Recipe[I] != nullptr && "Ingredient doesn't have a recipe"' failed. #43979

Closed
mikaelholmen opened this issue Jan 23, 2020 · 4 comments
Labels
bugzilla Issues migrated from bugzilla loopoptim

Comments

@mikaelholmen
Copy link
Collaborator

Bugzilla Link 44634
Resolution FIXED
Resolved on Jan 29, 2020 13:06
Version trunk
OS Linux
Blocks #43900
Attachments bbi-37904.ll reproducer
CC @fhahn,@zmodem
Fixed by commit(s) a911fef

Extended Description

opt -loop-vectorize -S -o - bbi-37904.ll

hits an assertion

opt: ../lib/Transforms/Vectorize/VPRecipeBuilder.h:91: llvm::VPRecipeBase *llvm::VPRecipeBuilder::getRecipe(llvm::Instruction *): Assertion `Ingredient2Recipe[I] != nullptr && "Ingredient doesn't have a recipe"' failed.
Stack dump:
0. Program arguments: build-all-builtins/bin/opt -loop-vectorize -S -o - bbi-37904.ll

  1.  Running pass 'Function Pass Manager' on module 'bbi-37904.ll'.
    
  2.  Running pass 'Loop Vectorization' on function '@g'
    

#​0 0x0000000003e7dcf4 PrintStackTraceSignalHandler(void*) (build-all-builtins/bin/opt+0x3e7dcf4)
#​1 0x0000000003e7b8be llvm::sys::RunSignalHandlers() (build-all-builtins/bin/opt+0x3e7b8be)
#​2 0x0000000003e7e0fc SignalHandler(int) (build-all-builtins/bin/opt+0x3e7e0fc)
#​3 0x00007fce53a1a890 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
#​4 0x00007fce524c3e97 raise /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
#​5 0x00007fce524c5801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
#​6 0x00007fce524b539a __assert_fail_base /build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
#​7 0x00007fce524b5412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
#​8 0x0000000003fcad96 llvm::VPRecipeBuilder::getRecipe(llvm::Instruction*) (build-all-builtins/bin/opt+0x3fcad96)
#​9 0x0000000003fc9483 llvm::LoopVectorizationPlanner::buildVPlanWithVPRecipes(llvm::VFRange&, llvm::SmallPtrSetImplllvm::Value*&, llvm::SmallPtrSetImplllvm::Instruction*&) (build-all-builtins/bin/opt+0x3fc9483)
#​10 0x0000000003fc36af llvm::LoopVectorizationPlanner::buildVPlansWithVPRecipes(unsigned int, unsigned int) (build-all-builtins/bin/opt+0x3fc36af)
#​11 0x0000000003fc2f02 llvm::LoopVectorizationPlanner::plan(unsigned int) (build-all-builtins/bin/opt+0x3fc2f02)
#​12 0x0000000003fcdb56 llvm::LoopVectorizePass::processLoop(llvm::Loop*) (build-all-builtins/bin/opt+0x3fcdb56)
#​13 0x0000000003fd0b64 llvm::LoopVectorizePass::runImpl(llvm::Function&, llvm::ScalarEvolution&, llvm::LoopInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::BlockFrequencyInfo&, llvm::TargetLibraryInfo*, llvm::DemandedBits&, llvm::AAResults&, llvm::AssumptionCache&, std::function<llvm::LoopAccessInfo const& (llvm::Loop&)>&, llvm::OptimizationRemarkEmitter&, llvm::ProfileSummaryInfo*) (build-all-builtins/bin/opt+0x3fd0b64)
#​14 0x0000000003fd5588 (anonymous namespace)::LoopVectorize::runOnFunction(llvm::Function&) (build-all-builtins/bin/opt+0x3fd5588)
#​15 0x00000000036fefd3 llvm::FPPassManager::runOnFunction(llvm::Function&) (build-all-builtins/bin/opt+0x36fefd3)
#​16 0x00000000036ff2b8 llvm::FPPassManager::runOnModule(llvm::Module&) (build-all-builtins/bin/opt+0x36ff2b8)
#​17 0x00000000036ff91d llvm::legacy::PassManagerImpl::run(llvm::Module&) (build-all-builtins/bin/opt+0x36ff91d)
#​18 0x0000000002095a93 main (build-all-builtins/bin/opt+0x2095a93)
#​19 0x00007fce524a6b97 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#​20 0x000000000207d02a _start (build-all-builtins/bin/opt+0x207d02a)
Abort (core dumped)

It starts failing with commit 9d24933:

Recommit f0c2a5a "[LV] Generalize conditions for sinking instrs for first order recurrences."
@fhahn
Copy link
Contributor

fhahn commented Jan 26, 2020

Proposed fix https://reviews.llvm.org/D73423

@mikaelholmen
Copy link
Collaborator Author

Proposed fix https://reviews.llvm.org/D73423

Nice!

I've verified that the crash I saw goes away with the fix, and I haven't seen any new failures with the (limited) testing I've done so far.

@fhahn
Copy link
Contributor

fhahn commented Jan 28, 2020

Fixed in https://reviews.llvm.org/rGa911fef3dd79

I think it would be good to pick this for 10.0, if possible.

@zmodem
Copy link
Collaborator

zmodem commented Jan 29, 2020

Fixed in https://reviews.llvm.org/rGa911fef3dd79

I think it would be good to pick this for 10.0, if possible.

Cherry-picked in b0536b5

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla loopoptim
Projects
None yet
Development

No branches or pull requests

3 participants