[llvm-bugs] [Bug 38700] New: Assertion failure in X86TargetLowering for vector-reduction add (llvm::EVT::getVectorNumElements() const: Assertion `isVector() && "Invalid vector type!"' failed.)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 25 09:25:03 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38700

            Bug ID: 38700
           Summary: Assertion failure in X86TargetLowering for
                    vector-reduction add
                    (llvm::EVT::getVectorNumElements() const: Assertion
                    `isVector() && "Invalid vector type!"' failed.)
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bjorn.a.pettersson at ericsson.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 20769
  --> https://bugs.llvm.org/attachment.cgi?id=20769&action=edit
test case generated by llvm-stress

When running
  llc -march=x86-64 -mcpu=corei7 -o /dev/null reduction.ll
using the attached test case I get

llc: ../include/llvm/CodeGen/ValueTypes.h:274: unsigned int
llvm::EVT::getVectorNumElements() const: Assertion `isVector() && "Invalid
vector type!"' failed.
Stack dump:
0.      Program arguments: ./build-all/bin/llc -march=x86-64 -mcpu=corei7 -o
/dev/null reduction.ll 
1.      Running pass 'Function Pass Manager' on module 'reduction.ll'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@autogen_SD22840'
#0 0x0000000002054464 PrintStackTraceSignalHandler(void*)
(./build-all/bin/llc+0x2054464)
#1 0x0000000002052530 llvm::sys::RunSignalHandlers()
(./build-all/bin/llc+0x2052530)
#2 0x00000000020547c8 SignalHandler(int) (./build-all/bin/llc+0x20547c8)
#3 0x0000003fb500f7e0 __restore_rt (/lib64/libpthread.so.0+0x3fb500f7e0)
#4 0x0000003fb4832495 __GI_raise (/lib64/libc.so.6+0x3fb4832495)
#5 0x0000003fb4833c75 __GI_abort (/lib64/libc.so.6+0x3fb4833c75)
#6 0x0000003fb482b60e __assert_fail_base (/lib64/libc.so.6+0x3fb482b60e)
#7 0x0000003fb482b6d0 __GI___assert_perror_fail (/lib64/libc.so.6+0x3fb482b6d0)
#8 0x00000000012dec66 combineAdd(llvm::SDNode*, llvm::SelectionDAG&,
llvm::X86Subtarget const&) (./build-all/bin/llc+0x12dec66)
#9 0x00000000012bb4a9 llvm::X86TargetLowering::PerformDAGCombine(llvm::SDNode*,
llvm::TargetLowering::DAGCombinerInfo&) const (./build-all/bin/llc+0x12bb4a9)
#10 0x0000000001d8da42 (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*) (./build-all/bin/llc+0x1d8da42)
#11 0x0000000001d8d198 llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*, llvm::CodeGenOpt::Level) (./build-all/bin/llc+0x1d8d198)
#12 0x0000000001f1013a llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(./build-all/bin/llc+0x1f1013a)
#13 0x0000000001f0e023
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(./build-all/bin/llc+0x1f0e023)
#14 0x0000000001f0a37c
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(./build-all/bin/llc+0x1f0a37c)
#15 0x000000000121c201 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(./build-all/bin/llc+0x121c201)
#16 0x000000000175fa09
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(./build-all/bin/llc+0x175fa09)
#17 0x0000000001a8d643 llvm::FPPassManager::runOnFunction(llvm::Function&)
(./build-all/bin/llc+0x1a8d643)
#18 0x0000000001a8d858 llvm::FPPassManager::runOnModule(llvm::Module&)
(./build-all/bin/llc+0x1a8d858)
#19 0x0000000001a8dd0d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(./build-all/bin/llc+0x1a8dd0d)
#20 0x000000000070a981 compileModule(char**, llvm::LLVMContext&)
(./build-all/bin/llc+0x70a981)
#21 0x0000000000708190 main (./build-all/bin/llc+0x708190)
#22 0x0000003fb481ed1d __libc_start_main (/lib64/libc.so.6+0x3fb481ed1d)
#23 0x000000000070628d _start (./build-all/bin/llc+0x70628d)
Abort (core dumped)

This problem seems to have been introduced by:

 commit 118d1ceeb868d9277615c69b551ee19b9d3802d2
 Author: Craig Topper <craig.topper at intel.com>
 Date:   Fri Aug 24 18:05:04 2018 +0000

    [X86] Teach combineLoopMAddPattern to handle cases where there is no loop
and the add has two multiply inputs

    Differential Revision: https://reviews.llvm.org/D50868

    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340631
91177308-0d34-0410-b5e6-96231b3b80d8

If I revert that commit I no longer get the assert.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180825/2c33154e/attachment-0001.html>


More information about the llvm-bugs mailing list