[TLS]: Clamp the alignment of TLS global variables if required by the target
Adding a module flag 'MaxTLSAlign' describing the maximum alignment a global TLS variable can have. Optimizers are prevented from increasing the alignment of such variables beyond this threshold. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D140123
This commit is contained in:
@@ -947,6 +947,10 @@ void CodeGenModule::Release() {
|
||||
if (getCodeGenOpts().SkipRaxSetup)
|
||||
getModule().addModuleFlag(llvm::Module::Override, "SkipRaxSetup", 1);
|
||||
|
||||
if (getContext().getTargetInfo().getMaxTLSAlign())
|
||||
getModule().addModuleFlag(llvm::Module::Error, "MaxTLSAlign",
|
||||
getContext().getTargetInfo().getMaxTLSAlign());
|
||||
|
||||
getTargetCodeGenInfo().emitTargetMetadata(*this, MangledDeclNames);
|
||||
|
||||
EmitBackendOptionsMetadata(getCodeGenOpts());
|
||||
|
||||
Reference in New Issue
Block a user