<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 --- - Assertion "Exit block should only have on predecessor" failed. in LoopVersioning."
   href="https://llvm.org/bugs/show_bug.cgi?id=31290">31290</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion "Exit block should only have on predecessor" failed. in LoopVersioning.
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Transformation Utilities
          </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=17722" name="attach_17722" title="Reproducer: opt -S -march=x86 -loop-distribute -o /dev/null loopversioning.ll">attachment 17722</a> <a href="attachment.cgi?id=17722&action=edit" title="Reproducer: opt -S -march=x86 -loop-distribute -o /dev/null loopversioning.ll">[details]</a></span>
Reproducer: opt -S -march=x86 -loop-distribute -o /dev/null loopversioning.ll

Stack dump:
$ ./build-all/bin/opt -S -march=x86 -loop-distribute -o /dev/null
loopversioning.ll
opt: ../lib/Transforms/Utils/LoopVersioning.cpp:153: void
llvm::LoopVersioning::addPHINodes(const SmallVectorImpl<llvm::Instruction *>
&): Assertion `PN->getNumOperands() == 1 && "Exit block should only have on
predecessor"' failed.
#0 0x0000000001a343b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(./build-all/bin/opt+0x1a343b8)
#1 0x0000000001a34f56 SignalHandler(int) (./build-all/bin/opt+0x1a34f56)
#2 0x00007ff707b23330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#3 0x00007ff706716c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007ff70671a028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007ff70670fbf6 __assert_fail_base
/build/eglibc-oGUzwX/eglibc-2.19/assert/assert.c:92:0
#6 0x00007ff70670fca2 (/lib/x86_64-linux-gnu/libc.so.6+0x2fca2)
#7 0x0000000001aafd3a
llvm::LoopVersioning::addPHINodes(llvm::SmallVectorImpl<llvm::Instruction*>
const&) (./build-all/bin/opt+0x1aafd3a)
#8 0x0000000001aaf7f4
llvm::LoopVersioning::versionLoop(llvm::SmallVectorImpl<llvm::Instruction*>
const&) (./build-all/bin/opt+0x1aaf7f4)
#9 0x00000000018c00d9 (anonymous
namespace)::LoopDistributeForLoop::processLoop(std::function<llvm::LoopAccessInfo
const& (llvm::Loop&)>&) (./build-all/bin/opt+0x18c00d9)
#10 0x00000000018bcf7c (anonymous namespace)::runImpl(llvm::Function&,
llvm::LoopInfo*, llvm::DominatorTree*, llvm::ScalarEvolution*,
llvm::OptimizationRemarkEmitter*, std::function<llvm::LoopAccessInfo const&
(llvm::Loop&)>&, bool) (./build-all/bin/opt+0x18bcf7c)
#11 0x00000000018bd769 (anonymous
namespace)::LoopDistributeLegacy::runOnFunction(llvm::Function&)
(./build-all/bin/opt+0x18bd769)
#12 0x00000000015db6f8 llvm::FPPassManager::runOnFunction(llvm::Function&)
(./build-all/bin/opt+0x15db6f8)
#13 0x00000000015db938 llvm::FPPassManager::runOnModule(llvm::Module&)
(./build-all/bin/opt+0x15db938)
#14 0x00000000015dbe15 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(./build-all/bin/opt+0x15dbe15)
#15 0x00000000006b69dc main (./build-all/bin/opt+0x6b69dc)
#16 0x00007ff706701f45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#17 0x00000000006a8e9f _start (./build-all/bin/opt+0x6a8e9f)
Stack dump:
0.      Program arguments: ./build-all/bin/opt -S -march=x86 -loop-distribute
-o /dev/null loopversioning.ll 
1.      Running pass 'Function Pass Manager' on module 'loopversioning.ll'.
2.      Running pass 'Loop Distribution' on function '@gazonk'
Aborted (core dumped)</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>