<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 - ConstantMerge drops thread_local from global"
href="https://bugs.llvm.org/show_bug.cgi?id=49932">49932</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ConstantMerge drops thread_local from global
</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>Interprocedural Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>amanieu@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Note that in the example below the address of @tls_var is significant (it is
not unnamed_addr): it should be different on every thread when the function is
called.
$ cat test.ll
@tls_var = private thread_local constant i32 222, align 4
@const = private unnamed_addr constant i32 222, align 4
define void @main() {
start:
call void @external(i32* @const, i32* @tls_var)
ret void
}
declare void @external(i32*, i32*)
$ opt -O3 -S test.ll
; ModuleID = 'test.ll'
source_filename = "test.ll"
@const = private constant i32 222, align 4
define void @main() local_unnamed_addr {
start:
tail call void @external(i32* nonnull @const, i32* nonnull @const)
ret void
}
declare void @external(i32*, i32*) local_unnamed_addr</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>