<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 - Incorrect instcombine fold of control-flow to umul.with.overflow"
href="https://bugs.llvm.org/show_bug.cgi?id=45952">45952</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect instcombine fold of control-flow to umul.with.overflow
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Keywords</th>
<td>miscompilation
</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>nunoplopes@sapo.pt
</td>
</tr>
<tr>
<th>CC</th>
<td>lebedev.ri@gmail.com, llvm-bugs@lists.llvm.org, regehr@cs.utah.edu, spatel+llvm@rotateright.com
</td>
</tr></table>
<p>
<div>
<pre>Test: Transforms/PhaseOrdering/unsigned-multiply-overflow-check.ll
Summary: the original code below has a fast-path for %arg1=0 and returns 0 in
that case. The optimized code has no fast-path and so the result is tainted if
%arg=poison.
define i1 @will_not_overflow(i64 %arg, i64 %arg1) {
%t0 = icmp eq i64 %arg, 0
br i1 %t0, label %bb5, label %bb2
%bb2:
%t3 = udiv i64 -1, %arg
%t4 = icmp ult i64 %t3, %arg1
br label %bb5
%bb5:
%t6 = phi i1 [ 0, %bb ], [ %t4, %bb2 ]
ret i1 %t6
}
=>
define i1 @will_not_overflow(i64 %arg, i64 %arg1) {
%umul = umul_overflow {i64, i1, i56} %arg, %arg1
%umul.ov = extractvalue {i64, i1, i56} %umul, 1
ret i1 %umul.ov
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source
Example:
i64 %arg = #x0000000000000000 (0)
i64 %arg1 = poison
Source:
i1 %t0 = #x1 (1)
i64 %t3 = #xffffffffffffffff (18446744073709551615, -1)
i1 %t4 = poison
i1 %t6 = #x0 (0)
Target:
{i64, i1, i56} %umul = { poison, poison, poison }
i1 %umul.ov = poison
Source value: #x0 (0)
Target value: poison
<a href="https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=72296a443c683892&test=Transforms%2FPhaseOrdering%2Funsigned-multiply-overflow-check.ll">https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=72296a443c683892&test=Transforms%2FPhaseOrdering%2Funsigned-multiply-overflow-check.ll</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>