<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - assert in LoopVersioning "Exit block should only have on predecessor" (triggered by the pass LoopLoadElimination)"
   href="https://llvm.org/bugs/show_bug.cgi?id=27023">27023</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>assert in LoopVersioning "Exit block should only have on predecessor" (triggered by the pass LoopLoadElimination)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>Keywords</th>
          <td>compile-fail
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>opt
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>karl-johan.karlsson@ericsson.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=16067" name="attach_16067" title="Bugpoint reduced testcase">attachment 16067</a> <a href="attachment.cgi?id=16067&action=edit" title="Bugpoint reduced testcase">[details]</a></span>
Bugpoint reduced testcase

Running opt passes "-licm -loop-load-elim" with the attached file end up with
an assert in LoopVersioning:

<pre>
<code>
$ opt ./bugpoint-reduced-simplified.ll -S -licm -loop-load-elim -o /dev/null
opt: ../lib/Transforms/Utils/LoopVersioning.cpp:137: void
llvm::LoopVersioning::addPHINodes(const SmallVectorImpl<llvm::Instruction *>
&): Assertion `PN->getNumOperands() == 1 && "Exit block should only have on
predecessor"' failed.
#0 0x00000000016be7f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x16be7f8)
#1 0x00000000016bcfc6 llvm::sys::RunSignalHandlers()
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x16bcfc6)
#2 0x00000000016bf32a SignalHandler(int)
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x16bf32a)
#3 0x00007fe83e23a340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x00007fe83d462cc9 gsignal
/build/eglibc-3GlaMS/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fe83d4660d8 abort
/build/eglibc-3GlaMS/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007fe83d45bb86 __assert_fail_base
/build/eglibc-3GlaMS/eglibc-2.19/assert/assert.c:92:0
#7 0x00007fe83d45bc32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x0000000001719e3b
llvm::LoopVersioning::addPHINodes(llvm::SmallVectorImpl<llvm::Instruction*>
const&) (/repo/uabkaka/llvmmaster/build-all/bin/opt+0x1719e3b)
#9 0x00000000017199ff
llvm::LoopVersioning::versionLoop(llvm::SmallVectorImpl<llvm::Instruction*>
const&) (/repo/uabkaka/llvmmaster/build-all/bin/opt+0x17199ff)
#10 0x000000000157015d (anonymous
namespace)::LoopLoadElimination::runOnFunction(llvm::Function&)
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x157015d)
#11 0x00000000012ea1c8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x12ea1c8)
#12 0x00000000012ea40b llvm::FPPassManager::runOnModule(llvm::Module&)
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x12ea40b)
#13 0x00000000012ea8c5 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x12ea8c5)
#14 0x000000000062ff1e main
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x62ff1e)
#15 0x00007fe83d44dec5 __libc_start_main
/build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321:0
#16 0x000000000061c18c _start
(/repo/uabkaka/llvmmaster/build-all/bin/opt+0x61c18c)
Stack dump:
0.      Program arguments: opt ./bugpoint-reduced-simplified.ll -S -licm
-loop-load-elim -o /dev/null 
1.      Running pass 'Function Pass Manager' on module
'./bugpoint-reduced-simplified.ll'.
2.      Running pass 'Loop Load Elimination' on function '@fill'
Aborted (core dumped)
</code>
</pre></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>