mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Implement global merge optimization for global variables.
This commit implements two command line switches -global-merge-on-external and -global-merge-aligned, and both of them are false by default, so this optimization is disabled by default for all targets. For ARM64, some back-end behaviors need to be tuned to get this optimization further enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208934 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -946,8 +946,11 @@ bool AsmPrinter::doFinalization(Module &M) {
|
||||
EmitVisibility(Name, Alias.getVisibility());
|
||||
|
||||
// Emit the directives as assignments aka .set:
|
||||
OutStreamer.EmitAssignment(Name,
|
||||
MCSymbolRefExpr::Create(Target, OutContext));
|
||||
const MCExpr *Expr = MCSymbolRefExpr::Create(Target, OutContext);
|
||||
if (uint64_t Offset = Alias.calculateOffset(*TM.getDataLayout()))
|
||||
Expr = MCBinaryExpr::CreateAdd(Expr,
|
||||
MCConstantExpr::Create(Offset, OutContext), OutContext);
|
||||
OutStreamer.EmitAssignment(Name, Expr);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user