Skip to content

Commit fabe4d4

Browse files
committed
Combine condition to check for TLS variables in the conditions for globals that are not constant or do not have initializers
1 parent 5be6092 commit fabe4d4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

llvm/lib/Target/PowerPC/PPCMergeStringPool.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ void PPCMergeStringPool::collectCandidateConstants(Module &M) {
170170
LLVM_DEBUG(dbgs() << "hasInitializer() " << Global.hasInitializer()
171171
<< "\n");
172172

173-
// We can only pool constants.
174-
if (!Global.isConstant() || !Global.hasInitializer())
173+
// We can only pool non-thread-local constants.
174+
if (!Global.isConstant() || !Global.hasInitializer() ||
175+
Global.isThreadLocal())
175176
continue;
176177

177178
// If a global constant has a section we do not try to pool it because
@@ -215,11 +216,6 @@ void PPCMergeStringPool::collectCandidateConstants(Module &M) {
215216
Global.getLinkage() != GlobalValue::InternalLinkage)
216217
continue;
217218

218-
// Do not pool thread-local constants, as the pooled strings can contain
219-
// non-thread-local constants, and these should not be mixed together.
220-
if (Global.isThreadLocal())
221-
continue;
222-
223219
LLVM_DEBUG(dbgs() << "Constant data of Global: ");
224220
LLVM_DEBUG(ConstData->dump());
225221
LLVM_DEBUG(dbgs() << "\n\n");

0 commit comments

Comments
 (0)