Skip to content

Commit d2aff18

Browse files
Revert "TLS loads opimization (hoist)" (llvm#114740)
This reverts commit c310143. Based on the discussions in llvm#112772, this pass is not needed after the introduction of `llvm.threadlocal.address` intrinsic. Fixes llvm#112771.
1 parent 5f34281 commit d2aff18

23 files changed

+0
-1112
lines changed

llvm/docs/LangRef.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,11 +2498,6 @@ For example:
24982498
function with a tail call. The prototype of a thunk should not be used for
24992499
optimization purposes. The caller is expected to cast the thunk prototype to
25002500
match the thunk target prototype.
2501-
2502-
``"tls-load-hoist"``
2503-
This attribute indicates that the function will try to reduce redundant
2504-
tls address calculation by hoisting tls variable.
2505-
25062501
``uwtable[(sync|async)]``
25072502
This attribute indicates that the ABI being targeted requires that
25082503
an unwind table entry be produced for this function even if we can

llvm/include/llvm/InitializePasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ void initializeTailDuplicateLegacyPass(PassRegistry &);
304304
void initializeTargetLibraryInfoWrapperPassPass(PassRegistry &);
305305
void initializeTargetPassConfigPass(PassRegistry &);
306306
void initializeTargetTransformInfoWrapperPassPass(PassRegistry &);
307-
void initializeTLSVariableHoistLegacyPassPass(PassRegistry &);
308307
void initializeTwoAddressInstructionLegacyPassPass(PassRegistry &);
309308
void initializeTypeBasedAAWrapperPassPass(PassRegistry &);
310309
void initializeTypePromotionLegacyPass(PassRegistry &);

llvm/include/llvm/LinkAllPasses.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ struct ForcePassLinking {
113113
(void)llvm::createSROAPass();
114114
(void)llvm::createSingleLoopExtractorPass();
115115
(void)llvm::createTailCallEliminationPass();
116-
(void)llvm::createTLSVariableHoistPass();
117116
(void)llvm::createConstantHoistingPass();
118117
(void)llvm::createCodeGenPrepareLegacyPass();
119118
(void)llvm::createPostInlineEntryExitInstrumenterPass();

llvm/include/llvm/Transforms/Scalar.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ Pass *createMergeICmpsLegacyPass();
151151
FunctionPass *createInferAddressSpacesPass(unsigned AddressSpace = ~0u);
152152
extern char &InferAddressSpacesID;
153153

154-
//===----------------------------------------------------------------------===//
155-
//
156-
// TLSVariableHoist - This pass reduce duplicated TLS address call.
157-
//
158-
FunctionPass *createTLSVariableHoistPass();
159-
160154
//===----------------------------------------------------------------------===//
161155
//
162156
// PartiallyInlineLibCalls - Tries to inline the fast path of library

llvm/include/llvm/Transforms/Scalar/TLSVariableHoist.h

Lines changed: 0 additions & 131 deletions
This file was deleted.

llvm/lib/CodeGen/TargetPassConfig.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,9 +881,6 @@ void TargetPassConfig::addIRPasses() {
881881
if (!DisableExpandReductions)
882882
addPass(createExpandReductionsPass());
883883

884-
if (getOptLevel() != CodeGenOptLevel::None)
885-
addPass(createTLSVariableHoistPass());
886-
887884
// Convert conditional moves to conditional jumps when profitable.
888885
if (getOptLevel() != CodeGenOptLevel::None && !DisableSelectOptimize)
889886
addPass(createSelectOptimizePass());

llvm/lib/Passes/PassBuilder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@
292292
#include "llvm/Transforms/Scalar/SpeculativeExecution.h"
293293
#include "llvm/Transforms/Scalar/StraightLineStrengthReduce.h"
294294
#include "llvm/Transforms/Scalar/StructurizeCFG.h"
295-
#include "llvm/Transforms/Scalar/TLSVariableHoist.h"
296295
#include "llvm/Transforms/Scalar/TailRecursionElimination.h"
297296
#include "llvm/Transforms/Scalar/WarnMissedTransforms.h"
298297
#include "llvm/Transforms/Utils/AddDiscriminators.h"

llvm/lib/Passes/PassRegistry.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ FUNCTION_PASS("slsr", StraightLineStrengthReducePass())
471471
FUNCTION_PASS("stack-protector", StackProtectorPass(TM))
472472
FUNCTION_PASS("strip-gc-relocates", StripGCRelocates())
473473
FUNCTION_PASS("tailcallelim", TailCallElimPass())
474-
FUNCTION_PASS("tlshoist", TLSVariableHoistPass())
475474
FUNCTION_PASS("transform-warning", WarnMissedTransformationsPass())
476475
FUNCTION_PASS("trigger-crash-function", TriggerCrashFunctionPass())
477476
FUNCTION_PASS("trigger-verifier-error", TriggerVerifierErrorPass())

llvm/lib/Transforms/Scalar/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ add_llvm_component_library(LLVMScalarOpts
7878
StraightLineStrengthReduce.cpp
7979
StructurizeCFG.cpp
8080
TailRecursionElimination.cpp
81-
TLSVariableHoist.cpp
8281
WarnMissedTransforms.cpp
8382

8483
ADDITIONAL_HEADER_DIRS

llvm/lib/Transforms/Scalar/Scalar.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
4444
initializeStructurizeCFGLegacyPassPass(Registry);
4545
initializeSinkingLegacyPassPass(Registry);
4646
initializeTailCallElimPass(Registry);
47-
initializeTLSVariableHoistLegacyPassPass(Registry);
4847
initializeSeparateConstOffsetFromGEPLegacyPassPass(Registry);
4948
initializeSpeculativeExecutionLegacyPassPass(Registry);
5049
initializeStraightLineStrengthReduceLegacyPassPass(Registry);

0 commit comments

Comments
 (0)