<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Assertion failure in X86TargetLowering for vector-reduction add (llvm::EVT::getVectorNumElements() const: Assertion `isVector() && "Invalid vector type!"' failed.)"
   href="https://bugs.llvm.org/show_bug.cgi?id=38700">38700</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion failure in X86TargetLowering for vector-reduction add (llvm::EVT::getVectorNumElements() const: Assertion `isVector() && "Invalid vector type!"' failed.)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>bjorn.a.pettersson@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20769" name="attach_20769" title="test case generated by llvm-stress">attachment 20769</a> <a href="attachment.cgi?id=20769&action=edit" title="test case generated by llvm-stress">[details]</a></span>
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 <<a href="mailto:craig.topper@intel.com">craig.topper@intel.com</a>>
 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: <a href="https://reviews.llvm.org/D50868">https://reviews.llvm.org/D50868</a>

    git-svn-id: <a href="https://llvm.org/svn/llvm-project/llvm/trunk@340631">https://llvm.org/svn/llvm-project/llvm/trunk@340631</a>
91177308-0d34-0410-b5e6-96231b3b80d8

If I revert that commit I no longer get the assert.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>