<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 - opt -instsimplify fails with Assertion `(L.contains(UserI) || isa<PHINode>(UserI)) && "Uses outside the loop should be PHI nodes due to LCSSA!"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=44759">44759</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>opt -instsimplify fails with Assertion `(L.contains(UserI) || isa<PHINode>(UserI)) && "Uses outside the loop should be PHI nodes due to LCSSA!"' failed.
          </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>Loop Optimizer
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>mikael.holmen@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=23081" name="attach_23081" title="bbi-15499.ll reproducer">attachment 23081</a> <a href="attachment.cgi?id=23081&action=edit" title="bbi-15499.ll reproducer">[details]</a></span>
bbi-15499.ll reproducer

Reproduce with:
 opt -S -o - bbi-15499.ll -loop-instsimplify

Result:

opt: ../lib/Transforms/Scalar/LoopInstSimplify.cpp:132: bool
simplifyLoopInst(llvm::Loop &, llvm::DominatorTree &, llvm::LoopInfo &,
llvm::AssumptionCache &, const llvm::TargetLibraryInfo &,
llvm::MemorySSAUpdater *): Assertion `(L.contains(UserI) ||
isa<PHINode>(UserI)) && "Uses outside the loop should be PHI nodes due to
LCSSA!"' failed.
Stack dump:
0.      Program arguments: ../../master/llvm/build-all-builtins/bin/opt -S -o -
bbi-15499.ll -loop-instsimplify 
1.      Running pass 'Function Pass Manager' on module 'bbi-15499.ll'.
2.      Running pass 'Loop Pass Manager' on function '@f1'
3.      Running pass 'Simplify instructions in loops' on basic block
'%for.cond1'
 #0 0x0000000003f382b4 PrintStackTraceSignalHandler(void*)
(../../master/llvm/build-all-builtins/bin/opt+0x3f382b4)
 #1 0x0000000003f35e7e llvm::sys::RunSignalHandlers()
(../../master/llvm/build-all-builtins/bin/opt+0x3f35e7e)
 #2 0x0000000003f386bc SignalHandler(int)
(../../master/llvm/build-all-builtins/bin/opt+0x3f386bc)
 #3 0x00007fc852f48890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007fc8519f1e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007fc8519f3801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007fc8519e339a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007fc8519e3412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x0000000003ce9715 simplifyLoopInst(llvm::Loop&, llvm::DominatorTree&,
llvm::LoopInfo&, llvm::AssumptionCache&, llvm::TargetLibraryInfo const&,
llvm::MemorySSAUpdater*)
(../../master/llvm/build-all-builtins/bin/opt+0x3ce9715)
 #9 0x0000000003cea08e (anonymous
namespace)::LoopInstSimplifyLegacyPass::runOnLoop(llvm::Loop*,
llvm::LPPassManager&) (../../master/llvm/build-all-builtins/bin/opt+0x3cea08e)
#10 0x00000000031497fb llvm::LPPassManager::runOnFunction(llvm::Function&)
(../../master/llvm/build-all-builtins/bin/opt+0x31497fb)
#11 0x00000000037a8794 llvm::FPPassManager::runOnFunction(llvm::Function&)
(../../master/llvm/build-all-builtins/bin/opt+0x37a8794)
#12 0x00000000037a8a48 llvm::FPPassManager::runOnModule(llvm::Module&)
(../../master/llvm/build-all-builtins/bin/opt+0x37a8a48)
#13 0x00000000037a909d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(../../master/llvm/build-all-builtins/bin/opt+0x37a909d)
#14 0x000000000212da93 main
(../../master/llvm/build-all-builtins/bin/opt+0x212da93)
#15 0x00007fc8519d4b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#16 0x000000000211502a _start
(../../master/llvm/build-all-builtins/bin/opt+0x211502a)
Abort (core dumped)

The input contains an unreachable block that I assume is the cause of the
problem.

This seems rather old, I start seeing it in builds from May 2018.</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>