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

[SLP Vectorizer] Assertion `VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && "Simple vector VT not representable by simple integer vector VT!"' failed. #104048

Closed
patrick-rivos opened this issue Aug 14, 2024 · 8 comments

Comments

@patrick-rivos
Copy link
Contributor

Testcase:

; ModuleID = 'reduced.bc'
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128"
target triple = "riscv64-unknown-linux-gnu"

define void @b(ptr %c) #0 {
entry:
  %a.promoted = load i64, ptr null, align 8
  %0 = load i8, ptr %c, align 1, !range !0
  %loadedv = zext i8 %0 to i64
  %and = and i64 %a.promoted, %loadedv
  %arrayidx4.1 = getelementptr i8, ptr %c, i64 1
  %1 = load i8, ptr %arrayidx4.1, align 1, !range !0
  %loadedv.1 = zext i8 %1 to i64
  %and.1 = and i64 %and, %loadedv.1
  %arrayidx4.2 = getelementptr i8, ptr %c, i64 2
  %2 = load i8, ptr %arrayidx4.2, align 1, !range !0
  %loadedv.2 = zext i8 %2 to i64
  %and.2 = and i64 %and.1, %loadedv.2
  %arrayidx4.3 = getelementptr i8, ptr %c, i64 3
  %3 = load i8, ptr %arrayidx4.3, align 1, !range !0
  %loadedv.3 = zext i8 %3 to i64
  %and.3 = and i64 %and.2, %loadedv.3
  %arrayidx4.4 = getelementptr i8, ptr %c, i64 4
  %4 = load i8, ptr %arrayidx4.4, align 1, !range !0
  %loadedv.4 = zext i8 %4 to i64
  %and.4 = and i64 %and.3, %loadedv.4
  %arrayidx4.5 = getelementptr i8, ptr %c, i64 5
  %5 = load i8, ptr %arrayidx4.5, align 1, !range !0
  %loadedv.5 = zext i8 %5 to i64
  %and.5 = and i64 %and.4, %loadedv.5
  %arrayidx4.6 = getelementptr i8, ptr %c, i64 6
  %6 = load i8, ptr %arrayidx4.6, align 1, !range !0
  %loadedv.6 = zext i8 %6 to i64
  %and.6 = and i64 %and.5, %loadedv.6
  %arrayidx4.7 = getelementptr i8, ptr %c, i64 7
  %7 = load i8, ptr %arrayidx4.7, align 1, !range !0
  %loadedv.7 = zext i8 %7 to i64
  %and.7 = and i64 %and.6, %loadedv.7
  %loadedv.8 = zext i8 0 to i64
  %and.8 = and i64 %and.7, %loadedv.8
  %8 = load i8, ptr null, align 1
  %loadedv.9 = zext i8 %8 to i64
  %and.9 = and i64 %and.8, %loadedv.9
  %loadedv.10 = zext i8 0 to i64
  %and.10 = and i64 %and.9, %loadedv.10
  %loadedv.11 = zext i8 0 to i64
  %and.11 = and i64 %and.10, %loadedv.11
  %loadedv.12 = zext i8 0 to i64
  %and.12 = and i64 %and.11, %loadedv.12
  store i64 %and.12, ptr null, align 8
  ret void
}

attributes #0 = { "target-features"="+64bit,+d,+f,+relax,+v,+xtheadvdot,+zicsr,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-a,-b,-c,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-h,-m,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-zmmul,-ztso,-zvbb,-zvbc,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl4096b,-zvl512b,-zvl65536b,-zvl8192b" }

!0 = !{i8 0, i8 2}

Command/backtrace

> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt -passes slp-vectorizer reduced.ll -S
opt: /scratch/tc-testing/tc-compiler-fuzz-trunk/llvm/llvm/include/llvm/CodeGenTypes/MachineValueType.h:201: llvm::MVT llvm::MVT::changeVectorElementType(llvm::MVT) const: Assertion `VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && "Simple vector VT not representable by simple integer vector VT!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt -passes slp-vectorizer reduced.ll -S
1.      Running pass "function(slp-vectorizer)" on module "reduced.ll"
2.      Running pass "slp-vectorizer" on function "b"
 #0 0x00005b9f560d49a0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2f5a9a0)
 #1 0x00005b9f560d1dbf llvm::sys::RunSignalHandlers() (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2f57dbf)
 #2 0x00005b9f560d1f15 SignalHandler(int) Signals.cpp:0:0
 #3 0x00007db93f042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007db93f0969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #5 0x00007db93f0969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #6 0x00007db93f0969fc pthread_kill ./nptl/pthread_kill.c:89:10
 #7 0x00007db93f042476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007db93f0287f3 abort ./stdlib/abort.c:81:7
 #9 0x00007db93f02871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007db93f039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00005b9f537d5d35 llvm::MVT::changeVectorElementType(llvm::MVT) const (.isra.0) RISCVTargetTransformInfo.cpp:0:0
#12 0x00005b9f537dbc0a llvm::RISCVTTIImpl::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::TargetTransformInfo::CastContextHint, llvm::TargetTransformInfo::TargetCostKind, llvm::Instruction const*) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x661c0a)
#13 0x00005b9f557dbb00 llvm::TargetTransformInfo::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::TargetTransformInfo::CastContextHint, llvm::TargetTransformInfo::TargetCostKind, llvm::Instruction const*) const (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2661b00)
#14 0x00005b9f5514bc99 llvm::InstructionCost llvm::function_ref<llvm::InstructionCost (llvm::InstructionCost)>::callback_fn<llvm::slpvectorizer::BoUpSLP::getEntryCost(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, llvm::ArrayRef<llvm::Value*>, llvm::SmallPtrSetImpl<llvm::Value*>&)::'lambda7'(llvm::InstructionCost)>(long, llvm::InstructionCost) SLPVectorizer.cpp:0:0
#15 0x00005b9f551476d5 llvm::slpvectorizer::BoUpSLP::getEntryCost(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, llvm::ArrayRef<llvm::Value*>, llvm::SmallPtrSetImpl<llvm::Value*>&)::'lambda0'(llvm::function_ref<llvm::InstructionCost (unsigned int)>, llvm::function_ref<llvm::InstructionCost (llvm::InstructionCost)>)::operator()(llvm::function_ref<llvm::InstructionCost (unsigned int)>, llvm::function_ref<llvm::InstructionCost (llvm::InstructionCost)>) const SLPVectorizer.cpp:0:0
#16 0x00005b9f551816db llvm::slpvectorizer::BoUpSLP::getEntryCost(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, llvm::ArrayRef<llvm::Value*>, llvm::SmallPtrSetImpl<llvm::Value*>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x20076db)
#17 0x00005b9f55198a88 llvm::slpvectorizer::BoUpSLP::getTreeCost(llvm::ArrayRef<llvm::Value*>) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x201ea88)
#18 0x00005b9f551a0d90 llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2026d90)
#19 0x00005b9f551a3c4d llvm::SLPVectorizerPass::tryToVectorize(llvm::Instruction*, llvm::slpvectorizer::BoUpSLP&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2029c4d)
#20 0x00005b9f551a3e14 llvm::SLPVectorizerPass::tryToVectorize(llvm::ArrayRef<llvm::WeakTrackingVH>, llvm::slpvectorizer::BoUpSLP&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2029e14)
#21 0x00005b9f551a45d9 llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode*, llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo*) (.constprop.0) SLPVectorizer.cpp:0:0
#22 0x00005b9f551a8730 llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x202e730)
#23 0x00005b9f551aebb6 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (.part.0) SLPVectorizer.cpp:0:0
#24 0x00005b9f551af752 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2035752)
#25 0x00005b9f53f3fe86 llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0xdc5e86)
#26 0x00005b9f55eeb55f llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2d7155f)
#27 0x00005b9f53f42686 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0xdc8686)
#28 0x00005b9f55eea2db llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2d702db)
#29 0x00005b9f53f3e976 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0xdc4976)
#30 0x00005b9f55ee833d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2d6e33d)
#31 0x00005b9f53778506 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x5fe506)
#32 0x00005b9f5376a151 optMain (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x5f0151)
#33 0x00007db93f029d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#34 0x00007db93f029e40 call_init ./csu/../csu/libc-start.c:128:20
#35 0x00007db93f029e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#36 0x00005b9f53760485 _start (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x5e6485)
zsh: IOT instruction (core dumped)  /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt

Found via fuzzer

@llvmbot
Copy link
Member

llvmbot commented Aug 14, 2024

@llvm/issue-subscribers-backend-risc-v

Author: Patrick O'Neill (patrick-rivos)

Testcase: ```llvm ir ; ModuleID = 'reduced.bc' target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" target triple = "riscv64-unknown-linux-gnu"

define void @b(ptr %c) #0 {
entry:
%a.promoted = load i64, ptr null, align 8
%0 = load i8, ptr %c, align 1, !range !0
%loadedv = zext i8 %0 to i64
%and = and i64 %a.promoted, %loadedv
%arrayidx4.1 = getelementptr i8, ptr %c, i64 1
%1 = load i8, ptr %arrayidx4.1, align 1, !range !0
%loadedv.1 = zext i8 %1 to i64
%and.1 = and i64 %and, %loadedv.1
%arrayidx4.2 = getelementptr i8, ptr %c, i64 2
%2 = load i8, ptr %arrayidx4.2, align 1, !range !0
%loadedv.2 = zext i8 %2 to i64
%and.2 = and i64 %and.1, %loadedv.2
%arrayidx4.3 = getelementptr i8, ptr %c, i64 3
%3 = load i8, ptr %arrayidx4.3, align 1, !range !0
%loadedv.3 = zext i8 %3 to i64
%and.3 = and i64 %and.2, %loadedv.3
%arrayidx4.4 = getelementptr i8, ptr %c, i64 4
%4 = load i8, ptr %arrayidx4.4, align 1, !range !0
%loadedv.4 = zext i8 %4 to i64
%and.4 = and i64 %and.3, %loadedv.4
%arrayidx4.5 = getelementptr i8, ptr %c, i64 5
%5 = load i8, ptr %arrayidx4.5, align 1, !range !0
%loadedv.5 = zext i8 %5 to i64
%and.5 = and i64 %and.4, %loadedv.5
%arrayidx4.6 = getelementptr i8, ptr %c, i64 6
%6 = load i8, ptr %arrayidx4.6, align 1, !range !0
%loadedv.6 = zext i8 %6 to i64
%and.6 = and i64 %and.5, %loadedv.6
%arrayidx4.7 = getelementptr i8, ptr %c, i64 7
%7 = load i8, ptr %arrayidx4.7, align 1, !range !0
%loadedv.7 = zext i8 %7 to i64
%and.7 = and i64 %and.6, %loadedv.7
%loadedv.8 = zext i8 0 to i64
%and.8 = and i64 %and.7, %loadedv.8
%8 = load i8, ptr null, align 1
%loadedv.9 = zext i8 %8 to i64
%and.9 = and i64 %and.8, %loadedv.9
%loadedv.10 = zext i8 0 to i64
%and.10 = and i64 %and.9, %loadedv.10
%loadedv.11 = zext i8 0 to i64
%and.11 = and i64 %and.10, %loadedv.11
%loadedv.12 = zext i8 0 to i64
%and.12 = and i64 %and.11, %loadedv.12
store i64 %and.12, ptr null, align 8
ret void
}

attributes #0 = { "target-features"="+64bit,+d,+f,+relax,+v,+xtheadvdot,+zicsr,+zve32f,+zve32x,+zve64d,+zve64f,+zve64x,+zvl128b,+zvl32b,+zvl64b,-a,-b,-c,-e,-experimental-smmpm,-experimental-smnpm,-experimental-ssnpm,-experimental-sspm,-experimental-ssqosid,-experimental-supm,-experimental-zacas,-experimental-zalasr,-experimental-zicfilp,-experimental-zicfiss,-h,-m,-shcounterenw,-shgatpa,-shtvala,-shvsatpa,-shvstvala,-shvstvecd,-smaia,-smcdeleg,-smcsrind,-smepmp,-smstateen,-ssaia,-ssccfg,-ssccptr,-sscofpmf,-sscounterenw,-sscsrind,-ssstateen,-ssstrict,-sstc,-sstvala,-sstvecd,-ssu64xl,-svade,-svadu,-svbare,-svinval,-svnapot,-svpbmt,-xcvalu,-xcvbi,-xcvbitmanip,-xcvelw,-xcvmac,-xcvmem,-xcvsimd,-xsfcease,-xsfvcp,-xsfvfnrclipxfqf,-xsfvfwmaccqqq,-xsfvqmaccdod,-xsfvqmaccqoq,-xsifivecdiscarddlone,-xsifivecflushdlone,-xtheadba,-xtheadbb,-xtheadbs,-xtheadcmo,-xtheadcondmov,-xtheadfmemidx,-xtheadmac,-xtheadmemidx,-xtheadmempair,-xtheadsync,-xventanacondops,-xwchc,-za128rs,-za64rs,-zaamo,-zabha,-zalrsc,-zama16b,-zawrs,-zba,-zbb,-zbc,-zbkb,-zbkc,-zbkx,-zbs,-zca,-zcb,-zcd,-zce,-zcf,-zcmop,-zcmp,-zcmt,-zdinx,-zfa,-zfbfmin,-zfh,-zfhmin,-zfinx,-zhinx,-zhinxmin,-zic64b,-zicbom,-zicbop,-zicboz,-ziccamoa,-ziccif,-zicclsm,-ziccrse,-zicntr,-zicond,-zifencei,-zihintntl,-zihintpause,-zihpm,-zimop,-zk,-zkn,-zknd,-zkne,-zknh,-zkr,-zks,-zksed,-zksh,-zkt,-zmmul,-ztso,-zvbb,-zvbc,-zvfbfmin,-zvfbfwma,-zvfh,-zvfhmin,-zvkb,-zvkg,-zvkn,-zvknc,-zvkned,-zvkng,-zvknha,-zvknhb,-zvks,-zvksc,-zvksed,-zvksg,-zvksh,-zvkt,-zvl1024b,-zvl16384b,-zvl2048b,-zvl256b,-zvl32768b,-zvl4096b,-zvl512b,-zvl65536b,-zvl8192b" }

!0 = !{i8 0, i8 2}


Command/backtrace

> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt -passes slp-vectorizer reduced.ll -S
opt: /scratch/tc-testing/tc-compiler-fuzz-trunk/llvm/llvm/include/llvm/CodeGenTypes/MachineValueType.h:201: llvm::MVT llvm::MVT::changeVectorElementType(llvm::MVT) const: Assertion `VecTy.SimpleTy != MVT::INVALID_SIMPLE_VALUE_TYPE && "Simple vector VT not representable by simple integer vector VT!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt -passes slp-vectorizer reduced.ll -S

  1.  Running pass "function(slp-vectorizer)" on module "reduced.ll"
    
  2.  Running pass "slp-vectorizer" on function "b"
    

#0 0x00005b9f560d49a0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2f5a9a0)
#1 0x00005b9f560d1dbf llvm::sys::RunSignalHandlers() (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2f57dbf)
#2 0x00005b9f560d1f15 SignalHandler(int) Signals.cpp:0:0
#3 0x00007db93f042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007db93f0969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x00007db93f0969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x00007db93f0969fc pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x00007db93f042476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x00007db93f0287f3 abort ./stdlib/abort.c:81:7
#9 0x00007db93f02871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x00007db93f039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x00005b9f537d5d35 llvm::MVT::changeVectorElementType(llvm::MVT) const (.isra.0) RISCVTargetTransformInfo.cpp:0:0
#12 0x00005b9f537dbc0a llvm::RISCVTTIImpl::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::TargetTransformInfo::CastContextHint, llvm::TargetTransformInfo::TargetCostKind, llvm::Instruction const*) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x661c0a)
#13 0x00005b9f557dbb00 llvm::TargetTransformInfo::getCastInstrCost(unsigned int, llvm::Type*, llvm::Type*, llvm::TargetTransformInfo::CastContextHint, llvm::TargetTransformInfo::TargetCostKind, llvm::Instruction const*) const (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2661b00)
#14 0x00005b9f5514bc99 llvm::InstructionCost llvm::function_ref<llvm::InstructionCost (llvm::InstructionCost)>::callback_fn<llvm::slpvectorizer::BoUpSLP::getEntryCost(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, llvm::ArrayRef<llvm::Value*>, llvm::SmallPtrSetImpl<llvm::Value*>&)::'lambda7'(llvm::InstructionCost)>(long, llvm::InstructionCost) SLPVectorizer.cpp:0:0
#15 0x00005b9f551476d5 llvm::slpvectorizer::BoUpSLP::getEntryCost(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, llvm::ArrayRef<llvm::Value*>, llvm::SmallPtrSetImpl<llvm::Value*>&)::'lambda0'(llvm::function_ref<llvm::InstructionCost (unsigned int)>, llvm::function_ref<llvm::InstructionCost (llvm::InstructionCost)>)::operator()(llvm::function_ref<llvm::InstructionCost (unsigned int)>, llvm::function_ref<llvm::InstructionCost (llvm::InstructionCost)>) const SLPVectorizer.cpp:0:0
#16 0x00005b9f551816db llvm::slpvectorizer::BoUpSLP::getEntryCost(llvm::slpvectorizer::BoUpSLP::TreeEntry const*, llvm::ArrayRef<llvm::Value*>, llvm::SmallPtrSetImpl<llvm::Value*>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x20076db)
#17 0x00005b9f55198a88 llvm::slpvectorizer::BoUpSLP::getTreeCost(llvm::ArrayRef<llvm::Value*>) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x201ea88)
#18 0x00005b9f551a0d90 llvm::SLPVectorizerPass::tryToVectorizeList(llvm::ArrayRef<llvm::Value*>, llvm::slpvectorizer::BoUpSLP&, bool) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2026d90)
#19 0x00005b9f551a3c4d llvm::SLPVectorizerPass::tryToVectorize(llvm::Instruction*, llvm::slpvectorizer::BoUpSLP&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2029c4d)
#20 0x00005b9f551a3e14 llvm::SLPVectorizerPass::tryToVectorize(llvm::ArrayRef<llvm::WeakTrackingVH>, llvm::slpvectorizer::BoUpSLP&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2029e14)
#21 0x00005b9f551a45d9 llvm::SLPVectorizerPass::vectorizeRootInstruction(llvm::PHINode*, llvm::Instruction*, llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&, llvm::TargetTransformInfo*) (.constprop.0) SLPVectorizer.cpp:0:0
#22 0x00005b9f551a8730 llvm::SLPVectorizerPass::vectorizeChainsInBlock(llvm::BasicBlock*, llvm::slpvectorizer::BoUpSLP&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x202e730)
#23 0x00005b9f551aebb6 llvm::SLPVectorizerPass::runImpl(llvm::Function&, llvm::ScalarEvolution*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AAResults*, llvm::LoopInfo*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::DemandedBits*, llvm::OptimizationRemarkEmitter*) (.part.0) SLPVectorizer.cpp:0:0
#24 0x00005b9f551af752 llvm::SLPVectorizerPass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2035752)
#25 0x00005b9f53f3fe86 llvm::detail::PassModel<llvm::Function, llvm::SLPVectorizerPass, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0xdc5e86)
#26 0x00005b9f55eeb55f llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2d7155f)
#27 0x00005b9f53f42686 llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0xdc8686)
#28 0x00005b9f55eea2db llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2d702db)
#29 0x00005b9f53f3e976 llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0xdc4976)
#30 0x00005b9f55ee833d llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x2d6e33d)
#31 0x00005b9f53778506 llvm::runPassPipeline(llvm::StringRef, llvm::Module&, llvm::TargetMachine*, llvm::TargetLibraryInfoImpl*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::ToolOutputFile*, llvm::StringRef, llvm::ArrayRef<llvm::PassPlugin>, llvm::ArrayRef<std::function<void (llvm::PassBuilder&)>>, llvm::opt_tool::OutputKind, llvm::opt_tool::VerifierKind, bool, bool, bool, bool, bool, bool, bool) (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x5fe506)
#32 0x00005b9f5376a151 optMain (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x5f0151)
#33 0x00007db93f029d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#34 0x00007db93f029e40 call_init ./csu/../csu/libc-start.c:128:20
#35 0x00007db93f029e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#36 0x00005b9f53760485 _start (/scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt+0x5e6485)
zsh: IOT instruction (core dumped) /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/build-llvm-linux/bin/opt


Found via fuzzer
</details>

@topperc
Copy link
Collaborator

topperc commented Aug 14, 2024

CC: @arcbbb

@patrick-rivos
Copy link
Contributor Author

Ping. I have 153 instances of this assertion firing found by the fuzzer since filing this last week.

@alexey-bataev
Copy link
Member

It is lowering, not SLP vectorizer

@topperc
Copy link
Collaborator

topperc commented Aug 22, 2024

Specifically its in the cost model conversion of IR types to MVT for lookups.

CC: @arcbbb

@preames
Copy link
Collaborator

preames commented Aug 22, 2024

This looks likely to be fixed by #105723, can you confirm? If not, it's probably still my bug and I need a test case from which to find it. I'd missed this because of the SLP tag.

@hiraditya
Copy link
Collaborator

Seems like it works with top of trunk? https://godbolt.org/z/Edffxf634 please confirm.

@patrick-rivos
Copy link
Contributor Author

Confirmed fixed - Thanks!

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

7 participants