https://bugs.llvm.org/show_bug.cgi?id=49932
Bug ID: 49932
Summary: ConstantMerge drops thread_local from global
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Interprocedural Optimizations
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
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
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs