mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
GlobalOpt: Don't optimize thread_local for initializers
Folding a reference to a thread_local variable into another global variable's initializer is very problematic, there is no relocation that exists to represent such an access. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211762 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1980,9 +1980,10 @@ isSimpleEnoughValueToCommit(Constant *C,
|
||||
static bool isSimpleEnoughValueToCommitHelper(Constant *C,
|
||||
SmallPtrSet<Constant*, 8> &SimpleConstants,
|
||||
const DataLayout *DL) {
|
||||
// Simple global addresses are supported, do not allow dllimport globals.
|
||||
// Simple global addresses are supported, do not allow dllimport or
|
||||
// thread-local globals.
|
||||
if (auto *GV = dyn_cast<GlobalValue>(C))
|
||||
return !GV->hasDLLImportStorageClass();
|
||||
return !GV->hasDLLImportStorageClass() && !GV->isThreadLocal();
|
||||
|
||||
// Simple integer, undef, constant aggregate zero, etc are all supported.
|
||||
if (C->getNumOperands() == 0 || isa<BlockAddress>(C))
|
||||
|
Reference in New Issue
Block a user