diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index bac3dc91045556..8f606b706677a0 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -1122,6 +1122,10 @@ bool TargetPassConfig::addISelPasses() { if (YkShadowStack) { addPass(createYkShadowStackPass()); } + + if (TM->useEmulatedTLS()){ + addPass(createLowerEmuTLSPass()); + } // We insert the yk control point pass as late as possible. It has to run // before instruction selection (or the machine IR won't reflect our // patching), but after other passes which mutate the IR (e.g.