<!DOCTYPE html><html><head>
      <base href="https://bugs.freedesktop.org/">
    
<style type="text/css">body { font-family:'Consolas'; font-size:16px}</style>
</head>
<body><div><b><a class="bz_bug_link 
          bz_status_NEW " title="NEW - PHINode containing itself causes segfault in LLVM when compiling Blender OpenCL kernel with R600 backend" href="https://bugs.freedesktop.org/show_bug.cgi?id=84232#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW " title="NEW - PHINode containing itself causes segfault in LLVM when compiling Blender OpenCL kernel with R600 backend" href="https://bugs.freedesktop.org/show_bug.cgi?id=84232">bug 84232</a>
              from <span class="vcard"><a class="email" href="mailto:vitalif@yourcmc.ru" title="Vitaliy Filippov <vitalif@yourcmc.ru>"> <span class="fn">Vitaliy Filippov</span></a>
</span></b>
        </div><pre>Created <span class=""><a href="attachment.cgi?id=107527" name="attach_107527" title="Attempt to reduce testcase using bugpoint">attachment 107527</a> <a href="attachment.cgi?id=107527&action=edit" title="Attempt to reduce testcase using bugpoint">[details]</a></span>
Attempt to reduce testcase using bugpoint

Tried to reduce the case using bugpoint:

PATH=/usr/lib/llvm-3.5/bin/:$PATH bugpoint-3.5 kernel.ll --llc-safe --tool-args
-- -march=r600 -mcpu=oland

The result leads to other crash, maybe it's also a bug, but it's definitely
another bug:

llc-3.5 -march=r600 -mcpu=oland bugpoint-reduced-simplified.ll

Which leads to a segfault on a non-assert build and to the following message on
a release+asserts build:

Unhandled loop condition!
UNREACHABLE executed at
/var/home/vitali/setup/llvm-toolchain-3.5-3.5/lib/Target/R600/SIAnnotateControlFlow.cpp:259!

This is probably related to bugpoint replacing the branch conditions with
constants, which makes conditional branches effectively unconditional :) and
SIAnnotateControlFlow::handleLoopCondition also doesn't handle this case.

Looks like an easy to fix problem?<br></pre><div>-- </div><div>With best regards,</div><div>  Vitaliy Filippov</div></body></html>