<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 - loop-versioning crashes: Assertion `DT.dominates(RHead, LHead) && "No dominance between recurrences used by one SCEV?"' failed."
   href="https://bugs.llvm.org/show_bug.cgi?id=43437">43437</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>loop-versioning crashes: Assertion `DT.dominates(RHead, LHead) && "No dominance between recurrences used by one SCEV?"' 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>Scalar Optimizations
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>cszide@163.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=22566" name="attach_22566" title="find_best_colors.bc">attachment 22566</a> <a href="attachment.cgi?id=22566&action=edit" title="find_best_colors.bc">[details]</a></span>
find_best_colors.bc

This bug is triggered by a function extracted from the jpeg_c program in cbench
benchmark.

$clang -v
clang version 10.0.0 (trunk 372743)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

$opt -gvn -sroa -loop-rotate -loop-unroll -simplifycfg -correlated-propagation
-hotcoldsplit -loop-versioning  find_best_colors.bc 
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.

opt:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/lib/Analysis/ScalarEvolution.cpp:707:
int CompareSCEVComplexity(llvm::EquivalenceClasses<const llvm::SCEV*>&,
llvm::EquivalenceClasses<const llvm::Value*>&, const llvm::LoopInfo*, const
llvm::SCEV*, const llvm::SCEV*, llvm::DominatorTree&, unsigned int): Assertion
`DT.dominates(RHead, LHead) && "No dominance between recurrences used by one
SCEV?"' failed.
Stack dump:
0.      Program arguments:
/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt -gvn -sroa
-loop-rotate -loop-unroll -simplifycfg -correlated-propagation -hotcoldsplit
-loop-versioning find_best_colors.bc 
1.      Running pass 'Function Pass Manager' on module 'find_best_colors.bc'.
2.      Running pass 'Loop Versioning' on function '@find_best_colors'
 #0 0x000055f39c08c32a llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x278232a)
 #1 0x000055f39c08a004 llvm::sys::RunSignalHandlers()
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2780004)
 #2 0x000055f39c08a142 SignalHandler(int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2780142)
 #3 0x00007fdc53f46890 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x12890)
 #4 0x00007fdc52bf8e97 raise
/build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007fdc52bfa801 abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007fdc52bea39a __assert_fail_base
/build/glibc-OTsEL5/glibc-2.27/assert/assert.c:89:0
 #7 0x00007fdc52bea412 (/lib/x86_64-linux-gnu/libc.so.6+0x30412)
 #8 0x000055f39b3f97fb
CompareSCEVComplexity(llvm::EquivalenceClasses<llvm::SCEV const*>&,
llvm::EquivalenceClasses<llvm::Value const*>&, llvm::LoopInfo const*,
llvm::SCEV const*, llvm::SCEV const*, llvm::DominatorTree&, unsigned int)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1aef7fb)
 #9 0x000055f39b404d7c GroupByComplexity(llvm::SmallVectorImpl<llvm::SCEV
const*>&, llvm::LoopInfo*, llvm::DominatorTree&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1afad7c)
#10 0x000055f39b4170d2
llvm::ScalarEvolution::getAddExpr(llvm::SmallVectorImpl<llvm::SCEV const*>&,
llvm::SCEV::NoWrapFlags, unsigned int) (.part.1507)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b0d0d2)
#11 0x000055f39b438283 ExposePointerBase(llvm::SCEV const*&, llvm::SCEV
const*&, llvm::ScalarEvolution&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b2e283)
#12 0x000055f39b44545a llvm::SCEVExpander::visitAddRecExpr(llvm::SCEVAddRecExpr
const*) (.part.530)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b3b45a)
#13 0x000055f39b43edc0 llvm::SCEVExpander::expand(llvm::SCEV const*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b34dc0)
#14 0x000055f39b43f30c llvm::SCEVExpander::expandCodeFor(llvm::SCEV const*,
llvm::Type*)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1b3530c)
#15 0x000055f39b33886b
expandBounds(llvm::RuntimePointerChecking::CheckingPtrGroup const*,
llvm::Loop*, llvm::Instruction*, llvm::SCEVExpander&, llvm::ScalarEvolution*,
llvm::RuntimePointerChecking const&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1a2e86b)
#16 0x000055f39b338d76
llvm::LoopAccessInfo::addRuntimeChecks(llvm::Instruction*,
llvm::SmallVectorImpl<std::pair<llvm::RuntimePointerChecking::CheckingPtrGroup
const*, llvm::RuntimePointerChecking::CheckingPtrGroup const*> > const&) const
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x1a2ed76)
#17 0x000055f39c14ed92
llvm::LoopVersioning::versionLoop(llvm::SmallVectorImpl<llvm::Instruction*>
const&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2844d92)
#18 0x000055f39c150700 (anonymous
namespace)::LoopVersioningPass::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x2846700)
#19 0x000055f39b9cad09 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c0d09)
#20 0x000055f39b9cae01 llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20c0e01)
#21 0x000055f39b9c9f61 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x20bff61)
#22 0x000055f39a19b6ff main
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x8916ff)
#23 0x00007fdc52bdbb97 __libc_start_main
/build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:344:0
#24 0x000055f39a21351a _start
(/home/jack-zhou/Documents/llvm/llvm_truck/llvm2/build10/bin/opt+0x90951a)
Aborted (core dumped)

Bugpoint failed to reproduce this bug.</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>