<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 --- - Assertion failure in ScalarEvolution::getBackedgeTakenInfo"
href="https://llvm.org/bugs/show_bug.cgi?id=26207">26207</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Assertion failure in ScalarEvolution::getBackedgeTakenInfo
</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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mattias.v.eriksson@ericsson.com
</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=15661" name="attach_15661" title="reduced input file">attachment 15661</a> <a href="attachment.cgi?id=15661&action=edit" title="reduced input file">[details]</a></span>
reduced input file
I am getting a crash in "indvars":
opt -S -indvars bugpoint-reduced-simplified.ll
Attempt to use a SCEVCouldNotCompute object!
UNREACHABLE executed at ../lib/Analysis/ScalarEvolution.cpp:9287!
0 opt 0x000000000190453e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1 opt 0x0000000001904949
2 opt 0x0000000001903253 llvm::sys::RunSignalHandlers() + 131
3 opt 0x0000000001904d8f
4 libpthread.so.0 0x00007effc7f64340
5 libc.so.6 0x00007effc718ccc9 gsignal + 57
6 libc.so.6 0x00007effc71900d8 abort + 328
7 opt 0x0000000001895e16
8 opt 0x0000000000c3678d
llvm::ScalarEvolution::computeLoopDisposition(llvm::SCEV const*, llvm::Loop
const*) + 1085
9 opt 0x0000000000c3622f
llvm::ScalarEvolution::getLoopDisposition(llvm::SCEV const*, llvm::Loop const*)
+ 239
10 opt 0x0000000000c178b5
llvm::ScalarEvolution::isLoopInvariant(llvm::SCEV const*, llvm::Loop const*) +
37
11 opt 0x0000000000c24dd9
llvm::ScalarEvolution::getBackedgeTakenInfo(llvm::Loop const*) + 377
12 opt 0x0000000000c2523f
llvm::ScalarEvolution::getBackedgeTakenCount(llvm::Loop const*) + 47
13 opt 0x00000000016c6534
14 opt 0x0000000000ba7122
llvm::LPPassManager::runOnFunction(llvm::Function&) + 1138
15 opt 0x000000000134d260
llvm::FPPassManager::runOnFunction(llvm::Function&) + 416
16 opt 0x000000000134d595
llvm::FPPassManager::runOnModule(llvm::Module&) + 117
17 opt 0x000000000134dd81
18 opt 0x000000000134d87b
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 347
19 opt 0x000000000134e2c1
llvm::legacy::PassManager::run(llvm::Module&) + 33
20 opt 0x00000000007de450 main + 8576
21 libc.so.6 0x00007effc7177ec5 __libc_start_main + 245
22 opt 0x00000000007b8a48
Stack dump:
0. Program arguments: build/bin/opt -S -indvars
bugpoint-reduced-simplified.ll
1. Running pass 'Function Pass Manager' on module
'bugpoint-reduced-simplified.ll'.
2. Running pass 'Loop Pass Manager' on function '@main'
3. Running pass 'Induction Variable Simplification' on basic block
'%bb1.i'
Aborted
input file:
; ModuleID = 'bugpoint-reduced-simplified.bc'
target triple = "x86_64-unknown-linux-gnu"
define void @main() {
br label %bb2
bb2: ; preds = %bb1.i, %bb2, %0
%_tmp44.i = icmp slt i16 undef, 2
br i1 %_tmp44.i, label %bb1.i, label %bb2
bb1.i: ; preds = %bb1.i, %bb2
%_tmp25.i = phi i16 [ undef, %bb2 ], [ %_tmp6.i, %bb1.i ]
%_tmp6.i = add nsw i16 %_tmp25.i, 1
%_tmp10.i = icmp sge i16 %_tmp6.i, 2
%exitcond.i = icmp eq i16 %_tmp6.i, 2
%or.cond = and i1 %_tmp10.i, %exitcond.i
br i1 %or.cond, label %bb2, label %bb1.i
}
This check in ScalarEvolution.cpp looks suspicious:
if (Result.getExact(this) != getCouldNotCompute()) {
assert(isLoopInvariant(Result.getExact(this), L) &&
isLoopInvariant(Result.getMax(this), L) &&
"Computed backedge-taken count isn't loop invariant for loop!");
++NumTripCountsComputed;
}
The assertion is guarded for the getExact() case, but not for the getMax()
case. It is Result.getMax() that returns the SCEVCouldNotCompute here.</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>