<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 - Power9: Assertin failure from llvm::PPCTargetLowering::DAGCombineBuildVector()"
   href="https://bugs.llvm.org/show_bug.cgi?id=38087">38087</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Power9: Assertin failure from  llvm::PPCTargetLowering::DAGCombineBuildVector()
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Backend: PowerPC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>tstellar@redhat.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=20535" name="attach_20535" title="Reduced test case">attachment 20535</a> <a href="attachment.cgi?id=20535&action=edit" title="Reduced test case">[details]</a></span>
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)</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>