New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 38087 - Power9: Assertion failure from llvm::PPCTargetLowering::DAGCombineBuildVector()
Summary: Power9: Assertion failure from llvm::PPCTargetLowering::DAGCombineBuildVector()
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Backend: PowerPC (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Nemanja Ivanovic
URL:
Keywords:
Depends on:
Blocks: release-7.0.0
  Show dependency tree
 
Reported: 2018-07-06 16:46 PDT by Tom Stellard
Modified: 2018-08-16 08:20 PDT (History)
6 users (show)

See Also:
Fixed By Commit(s): r339769 r339859


Attachments
Reduced test case (1.92 KB, text/plain)
2018-07-06 16:46 PDT, Tom Stellard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Stellard 2018-07-06 16:46:16 PDT
Created attachment 20535 [details]
Reduced test case

The attached test case causes an assertion failure when compiled with:

llc -march=ppc64 -mcpu=pwr9

But compiles fine with

llc -march=ppc64

Here is the backtrace from the assertion failure:

llc: /home/tstellar/llvm-project/llvm/include/llvm/ADT/SmallVector.h:150: reference llvm::SmallVectorTemplateCommon<int, void>::operator[](size_type) [T = int]: Assertion `idx < size()' failed.
Stack dump:
0.      Program arguments: ../llvm-build/bin/llc -march=ppc64 -mcpu=pwr9 
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@draw_llvm_vs_variant0'
#0 0x00007fc65dc1b514 PrintStackTraceSignalHandler(void*) (llvm-build/bin/../lib/libLLVM-7svn.so+0x935514)
#1 0x00007fc65dc19810 llvm::sys::RunSignalHandlers() (llvm-build/bin/../lib/libLLVM-7svn.so+0x933810)
#2 0x00007fc65dc1b6c2 SignalHandler(int) (llvm-build/bin/../lib/libLLVM-7svn.so+0x9356c2)
#3 0x00007fc65d0d9370 __restore_rt (/lib64/libpthread.so.0+0xf370)
#4 0x00007fc65c51e1d7 __GI_raise (/lib64/libc.so.6+0x351d7)
#5 0x00007fc65c51f8c8 __GI_abort (/lib64/libc.so.6+0x368c8)
#6 0x00007fc65c517146 __assert_fail_base (/lib64/libc.so.6+0x2e146)
#7 0x00007fc65c5171f2 (/lib64/libc.so.6+0x2e1f2)
#8 0x00007fc65f8455dc llvm::PPCTargetLowering::DAGCombineBuildVector(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (lvm-build/bin/../lib/libLLVM-7svn.so+0x255f5dc)
#9 0x00007fc65f8476c5 llvm::PPCTargetLowering::PerformDAGCombine(llvm::SDNode*, llvm::TargetLowering::DAGCombinerInfo&) const (llvm-build/bin/../lib/libLLVM-7svn.so+0x25616c5)
#10 0x00007fc65e111681 (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) (llvm-build/bin/../lib/libLLVM-7svn.so+0xe2b681)
#11 0x00007fc65e1103bf llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) (llvm-build/bin/../lib/libLLVM-7svn.so+0xe2a3bf)
#12 0x00007fc65e2ef5f5 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (llvm-build/bin/../lib/libLLVM-7svn.so+0x10095f5)
#13 0x00007fc65e2edb92 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (llvm-build/bin/../lib/libLLVM-7svn.so+0x1007b92)
#14 0x00007fc65e2e9d59 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (llvm-build/bin/../lib/libLLVM-7svn.so+0x1003d59)
#15 0x00007fc65f7e3412 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) (llvm-build/bin/../lib/libLLVM-7svn.so+0x24fd412)
#16 0x00007fc65df27834 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (llvm-build/bin/../lib/libLLVM-7svn.so+0xc41834)
#17 0x00007fc65dd4f217 llvm::FPPassManager::runOnFunction(llvm::Function&) (llvm-build/bin/../lib/libLLVM-7svn.so+0xa69217)
#18 0x00007fc65dd4f473 llvm::FPPassManager::runOnModule(llvm::Module&) (llvm-build/bin/../lib/libLLVM-7svn.so+0xa69473)
#19 0x00007fc65dd4f97b llvm::legacy::PassManagerImpl::run(llvm::Module&) (llvm-build/bin/../lib/libLLVM-7svn.so+0xa6997b)
#20 0x0000000000412a34 compileModule(char**, llvm::LLVMContext&) (../llvm-build/bin/llc+0x412a34)
#21 0x000000000041000d main (../llvm-build/bin/llc+0x41000d)
#22 0x00007fc65c50ab35 __libc_start_main (/lib64/libc.so.6+0x21b35)
#23 0x000000000040ee0a _start (../llvm-build/bin/llc+0x40ee0a)
Comment 1 Nemanja Ivanovic 2018-07-09 05:29:58 PDT
I'll have a look.
Comment 2 Nemanja Ivanovic 2018-07-09 09:27:40 PDT
Fix in https://reviews.llvm.org/D49080
Comment 3 Hans Wennborg 2018-08-16 03:14:13 PDT
(In reply to Nemanja Ivanovic from comment #2)
> Fix in https://reviews.llvm.org/D49080

That landed in r339769 and I merged it to 7.0 in r339859.