<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 - Assertion `HeaderDefBlock && "no definition in header of carrying loop"' failed in SyncDependenceAnalysis"
   href="https://bugs.llvm.org/show_bug.cgi?id=42706">42706</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `HeaderDefBlock && "no definition in header of carrying loop"' failed in SyncDependenceAnalysis
          </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>Global Analyses
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>jay.foad@gmail.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=22266" name="attach_22266" title="test case">attachment 22266</a> <a href="attachment.cgi?id=22266&action=edit" title="test case">[details]</a></span>
test case

With the attached test case I get:

$ ~/llvm-debug/bin/opt -S -use-gpu-divergence-analysis -divergence stripped.ll
opt:
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/SyncDependenceAnalysis.cpp:312:
std::unique_ptr<ConstBlockSet>
llvm::DivergencePropagator::computeJoinPoints(const llvm::BasicBlock &,
SuccessorIterable, const llvm::Loop *, const llvm::BasicBlock *)
[SuccessorIterable = llvm::iterator_range<llvm::SuccIterator<const
llvm::Instruction, const llvm::BasicBlock> >]: Assertion `HeaderDefBlock && "no
definition in header of carrying loop"' failed.
Stack dump:
0.      Program arguments: /home/jayfoad2/llvm-debug/bin/opt -S
-use-gpu-divergence-analysis -divergence stripped.ll 
1.      Running pass 'Function Pass Manager' on module 'stripped.ll'.
2.      Running pass 'Legacy Divergence Analysis' on function
'@llpc.shader.CS.main'
 #0 0x0000000005fa0889 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:533:11
 #1 0x0000000005fa0a39 PrintStackTraceSignalHandler(void*)
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:594:1
 #2 0x0000000005f9f276 llvm::sys::RunSignalHandlers()
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Signals.cpp:67:5
 #3 0x0000000005fa112b SignalHandler(int)
/home/jayfoad2/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:385:1
 #4 0x00007fca691cc890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #5 0x00007fca67e92e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #6 0x00007fca67e94801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #7 0x00007fca67e8439a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #8 0x00007fca67e84412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #9 0x0000000004e3db75 std::unique_ptr<llvm::SmallPtrSet<llvm::BasicBlock
const*, 4u>, std::default_delete<llvm::SmallPtrSet<llvm::BasicBlock const*, 4u>
<span class="quote">> ></span >
llvm::DivergencePropagator::computeJoinPoints<llvm::iterator_range<llvm::SuccIterator<llvm::Instruction
const, llvm::BasicBlock const> > >(llvm::BasicBlock const&,
llvm::iterator_range<llvm::SuccIterator<llvm::Instruction const,
llvm::BasicBlock const> >, llvm::Loop const*, llvm::BasicBlock const*)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/SyncDependenceAnalysis.cpp:0:7
#10 0x0000000004e3c5e4
llvm::SyncDependenceAnalysis::join_blocks(llvm::Instruction const&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/SyncDependenceAnalysis.cpp:381:32
#11 0x0000000004c1abf3
llvm::DivergenceAnalysis::propagateBranchDivergence(llvm::Instruction const&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/DivergenceAnalysis.cpp:311:36
#12 0x0000000004c1b106 llvm::DivergenceAnalysis::compute()
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/DivergenceAnalysis.cpp:386:9
#13 0x0000000004c1b54b
llvm::GPUDivergenceAnalysis::GPUDivergenceAnalysis(llvm::Function&,
llvm::DominatorTree const&, llvm::PostDominatorTree const&, llvm::LoopInfo
const&, llvm::TargetTransformInfo const&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/DivergenceAnalysis.cpp:446:1
#14 0x0000000004c162c5
std::enable_if<!(std::is_array<llvm::GPUDivergenceAnalysis>::value),
std::unique_ptr<llvm::GPUDivergenceAnalysis,
std::default_delete<llvm::GPUDivergenceAnalysis> > >::type
llvm::make_unique<llvm::GPUDivergenceAnalysis, llvm::Function&,
llvm::DominatorTree&, llvm::PostDominatorTree&, llvm::LoopInfo&,
llvm::TargetTransformInfo&>(llvm::Function&, llvm::DominatorTree&,
llvm::PostDominatorTree&, llvm::LoopInfo&, llvm::TargetTransformInfo&)
/home/jayfoad2/git/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1406:10
#15 0x0000000004c14b15
llvm::LegacyDivergenceAnalysis::runOnFunction(llvm::Function&)
/home/jayfoad2/git/llvm-project/llvm/lib/Analysis/LegacyDivergenceAnalysis.cpp:331:13
#16 0x00000000055c114c llvm::FPPassManager::runOnFunction(llvm::Function&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1648:23
#17 0x00000000055c15a2 llvm::FPPassManager::runOnModule(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1685:16
#18 0x00000000055c1d34 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1750:23
#19 0x00000000055c1848 llvm::legacy::PassManagerImpl::run(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1863:16
#20 0x00000000055c22c1 llvm::legacy::PassManager::run(llvm::Module&)
/home/jayfoad2/git/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1894:3
#21 0x0000000003209671 main
/home/jayfoad2/git/llvm-project/llvm/tools/opt/opt.cpp:893:3
#22 0x00007fca67e75b97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#23 0x00000000031c502a _start (/home/jayfoad2/llvm-debug/bin/opt+0x31c502a)
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>