<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 - [m32][debug] "Wrong topological sorting" in ScheduleDAG.cpp after r324359"
href="https://bugs.llvm.org/show_bug.cgi?id=36274">36274</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[m32][debug] "Wrong topological sorting" in ScheduleDAG.cpp after r324359
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ilia.taraban@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This test fails at ScheduleDAG.cpp with "Wrong topological sorting" after
r324359 using debug build:
================= nice.c ==============
void foo (unsigned long);
unsigned int g = 0;
unsigned long long a [13] [2];
int main ()
{
unsigned long m = g;
unsigned long i = 0;
for (i = 0; i <= 12; i++)
a[i][0]++;
foo(m);
return 0;
}
=======================================
<span class="quote">>>> clang -v</span >
clang version 7.0.0 (trunk 324464)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
<span class="quote">>>> clang -c -m32 -O3 nice.c</span >
clang-7.0: .../llvm/lib/CodeGen/ScheduleDAG.cpp:518: void
llvm::ScheduleDAGTopologicalSort::InitDAGTopologicalSorting(): Assertion
`Node2Index[SU.NodeNum] > Node2Index[PD.getSUnit()->NodeNum] && "Wrong
topological sorting"' failed.
This is small ll reproducer for llc:
================= fine.ll =============
target triple = "i386-unknown-linux-gnu"
@g = external local_unnamed_addr global i32, align 4
@a = external local_unnamed_addr global [13 x [2 x i64]], align 8
; Function Attrs: nounwind
define void @main() local_unnamed_addr #0 {
entry:
%0 = load i32, i32* @g, align 4
%1 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 0, i32 0), align 8
%inc = add i64 %1, 1
store i64 %inc, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 0, i32 0), align 8
%2 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 1, i32 0), align 8
%inc.1 = add i64 %2, 1
store i64 %inc.1, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 1, i32 0), align 8
%3 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 2, i32 0), align 8
%inc.2 = add i64 %3, 1
store i64 %inc.2, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 2, i32 0), align 8
%4 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 3, i32 0), align 8
%inc.3 = add i64 %4, 1
store i64 %inc.3, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 3, i32 0), align 8
%5 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 4, i32 0), align 8
%inc.4 = add i64 %5, 1
store i64 %inc.4, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 4, i32 0), align 8
%6 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 5, i32 0), align 8
%inc.5 = add i64 %6, 1
store i64 %inc.5, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 5, i32 0), align 8
%7 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 6, i32 0), align 8
%inc.6 = add i64 %7, 1
store i64 %inc.6, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 6, i32 0), align 8
%8 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 7, i32 0), align 8
%inc.7 = add i64 %8, 1
store i64 %inc.7, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 7, i32 0), align 8
%9 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 8, i32 0), align 8
%inc.8 = add i64 %9, 1
store i64 %inc.8, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 8, i32 0), align 8
%10 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 9, i32 0), align 8
%inc.9 = add i64 %10, 1
store i64 %inc.9, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 9, i32 0), align 8
%11 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 10, i32 0), align 8
%inc.10 = add i64 %11, 1
store i64 %inc.10, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 10, i32 0), align 8
%12 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 11, i32 0), align 8
%inc.11 = add i64 %12, 1
store i64 %inc.11, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 11, i32 0), align 8
%13 = load i64, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 12, i32 0), align 8
%inc.12 = add i64 %13, 1
store i64 %inc.12, i64* getelementptr inbounds ([13 x [2 x i64]], [13 x [2 x
i64]]* @a, i32 0, i32 12, i32 0), align 8
ret void
}
attributes #0 = { nounwind }
=======================================
<span class="quote">>>> llc fine.ll</span >
llc: .../llvm/lib/CodeGen/ScheduleDAG.cpp:518: void
llvm::ScheduleDAGTopologicalSort::InitDAGTopologicalSorting(): Assertion
`Node2Index[SU.NodeNum] > Node2Index[PD.getSUnit()->NodeNum] && "Wrong
topological sorting"' failed.
This assertion starts to appear after r324359:
------------------------------------------------------------------------
r324359 | niravd | 2018-02-06 17:14:29 +0100 (Tue, 06 Feb 2018) | 16 lines
[DAG, X86] Improve Dependency analysis when doing multi-node
Instruction Selection
Cleanup cycle/validity checks in ISel (IsLegalToFold,
HandleMergeInputChains) and X86 (isFusableLoadOpStore). Now do a full
search for cycles / dependencies pruning the search when topological
property of NodeId allows.
As part of this propogate the NodeId-based cutoffs to narrow
hasPreprocessorHelper searches.
Reviewers: craig.topper, bogner
Subscribers: llvm-commits, hiraditya
Differential Revision: <a href="https://reviews.llvm.org/D41293">https://reviews.llvm.org/D41293</a>
------------------------------------------------------------------------</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>