<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 --- - [SCEV] Assertion `PN->getNumIncomingValues() == 2 && "Follows from having one latch!"' failed."
   href="https://llvm.org/bugs/show_bug.cgi?id=25369">25369</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SCEV] Assertion `PN->getNumIncomingValues() == 2 && "Follows from having one latch!"' 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>normal
          </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>tobias@grosser.es
          </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=15199" name="attach_15199" title="Test case">attachment 15199</a> <a href="attachment.cgi?id=15199&action=edit" title="Test case">[details]</a></span>
Test case

Since r249712 SCEV fails to compute backedge taken counts for loops with more
than one entering edge (to the loop header). This has been working before.

opt -scalar-evolution -analyze out.ll 
Printing analysis 'Scalar Evolution Analysis' for function 'hoge':
Classifying expressions for: @hoge
  %tmp = add i32 %tmp10, -1
  -->  (-1 + (2 * undef) + %tmp7 + %tmp6) U: full-set S: full-setopt:
/home/grosser/Projects/polly/git/lib/Analysis/ScalarEvolution.cpp:5757:
llvm::Constant
*llvm::ScalarEvolution::getConstantEvolutionLoopExitValue(llvm::PHINode *,
const llvm::APInt &, const llvm::Loop *): Assertion `PN->getNumIncomingValues()
== 2 && "Follows from having one latch!"' failed.
0  opt             0x0000000001869e4e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1  opt             0x000000000186af89
2  opt             0x00000000018699c3 llvm::sys::RunSignalHandlers() + 131
3  opt             0x000000000186b1e4
4  libpthread.so.0 0x00007fac6085dd10
5  libc.so.6       0x00007fac5ff96267 gsignal + 55
6  libc.so.6       0x00007fac5ff97eca abort + 362
7  libc.so.6       0x00007fac5ff8f03d
8  libc.so.6       0x00007fac5ff8f0f2
9  opt             0x0000000000c9d979
llvm::ScalarEvolution::getConstantEvolutionLoopExitValue(llvm::PHINode*,
llvm::APInt const&, llvm::Loop const*) + 601
10 opt             0x0000000000c9e612
llvm::ScalarEvolution::computeSCEVAtScope(llvm::SCEV const*, llvm::Loop const*)
+ 466
11 opt             0x0000000000c99a69
llvm::ScalarEvolution::getSCEVAtScope(llvm::SCEV const*, llvm::Loop const*) +
921
12 opt             0x0000000000c9ed19
llvm::ScalarEvolution::computeSCEVAtScope(llvm::SCEV const*, llvm::Loop const*)
+ 2265
13 opt             0x0000000000c99a69
llvm::ScalarEvolution::getSCEVAtScope(llvm::SCEV const*, llvm::Loop const*) +
921
14 opt             0x0000000000ca5d75
llvm::ScalarEvolution::print(llvm::raw_ostream&) const + 597
15 opt             0x0000000000ca79d0
llvm::ScalarEvolutionWrapperPass::print(llvm::raw_ostream&, llvm::Module
const*) const + 48
16 opt             0x000000000078d574
17 opt             0x0000000001304ebf
llvm::FPPassManager::runOnFunction(llvm::Function&) + 399
18 opt             0x00000000013051d5
llvm::FPPassManager::runOnModule(llvm::Module&) + 117
19 opt             0x000000000130596a
20 opt             0x0000000001305496
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 342
21 opt             0x0000000001305e81
llvm::legacy::PassManager::run(llvm::Module&) + 33
22 opt             0x0000000000799670 main + 7984
23 libc.so.6       0x00007fac5ff81a40 __libc_start_main + 240
24 opt             0x0000000000774e49 _start + 41</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>