]> granicus.if.org Git - llvm/commit
GlobalOpt: do not promote globals used atomically to constants.
authorTim Northover <tnorthover@apple.com>
Tue, 14 May 2019 11:03:13 +0000 (11:03 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 14 May 2019 11:03:13 +0000 (11:03 +0000)
commit0f7b4d78118dcf0b341db0486cdfb9fdd77abf85
tree333d027501e347862c9642fde2ad933602440f5e
parent9a1a8c8d8ed2c11932f282c66cc0ddde6b21a2fd
GlobalOpt: do not promote globals used atomically to constants.

Some atomic loads are implemented as cmpxchg (particularly if large or
floating), and that usually requires write access to the memory involved
or it will segfault.

We can still propagate the constant value to users we understand though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360662 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/GlobalOpt.cpp
test/Transforms/GlobalOpt/atomic.ll