<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 - LowerConstantIntrinsics pass thinks address of global is constant"
href="https://bugs.llvm.org/show_bug.cgi?id=48472">48472</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>LowerConstantIntrinsics pass thinks address of global is constant
</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>Windows NT
</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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>john.brawn@arm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>If llc is given the following input:
@x = global i8 0, align 1
define i32 @example() {
entry:
%0 = call i1 @llvm.is.constant.i32(i32 ptrtoint (i8* @x to i32))
%1 = zext i1 %0 to i32
ret i32 %1
}
declare i1 @llvm.is.constant.i32(i32)
then LowerConstantIntrinsics will optimise this to "ret i32 1". It shouldn't be
doing this as the argument is an address of a global and LangRef says:
In particular, note that if the argument is a constant expression which
refers to a global (the address of which _is_ a constant, but not manifest
during the compile), then the intrinsic evaluates to false.</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>