<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 - it is not, in general, safe to speculatively execute a shift"
href="https://bugs.llvm.org/show_bug.cgi?id=40768">40768</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>it is not, in general, safe to speculatively execute a shift
</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>regehr@cs.utah.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The optimization below takes a function that is defined when argument %0 is
negative and turns it into a function that returns poison when argument %0 is
negative.
Many of the UB problems that we see in LLVM require us to answer difficult
semantic questions before they can be resolved, but this one doesn't seem like
that. Rather, it's a straightforward example of something that an LLVM pass
just cannot do.
*** IR Dump Before Simplify the CFG ***
; Function Attrs: nounwind uwtable
define internal fastcc i32 @f(i32) unnamed_addr #0 {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
; <label>:3: ; preds = %1
%4 = lshr i32 127, %0
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %7
; <label>:6: ; preds = %3, %1
br label %7
; <label>:7: ; preds = %3, %6
%8 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %8
}
*** IR Dump After Simplify the CFG ***
; Function Attrs: nounwind uwtable
define internal fastcc i32 @f(i32) unnamed_addr #0 {
%2 = icmp slt i32 %0, 0
%3 = lshr i32 127, %0
%4 = icmp slt i32 %3, 1
%5 = or i1 %2, %4
%6 = select i1 %5, i32 1, i32 0
ret i32 %6
}</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>