mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Add a fast path to EvaluateSymbolicAdd. This avoids computing symbol addresses
which then avoids running EnsureValid. This cuts the assembly time of the testcase in PR8711 from 2:50 minutes to 1 minute. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120697 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
37a0b54fb5
commit
76507f14ed
@ -294,12 +294,20 @@ static bool EvaluateSymbolicAdd(const MCAsmLayout *Layout, bool InSet,
|
||||
if (Layout && A && B) {
|
||||
const MCSymbol &SA = A->getSymbol();
|
||||
const MCSymbol &SB = B->getSymbol();
|
||||
const MCObjectFormat &F =
|
||||
Layout->getAssembler().getBackend().getObjectFormat();
|
||||
const MCAssembler &Asm = Layout->getAssembler();
|
||||
const MCObjectFormat &F = Asm.getBackend().getObjectFormat();
|
||||
if (SA.isDefined() && SB.isDefined() && F.isAbsolute(InSet, SA, SB)) {
|
||||
const MCAssembler &Asm = Layout->getAssembler();
|
||||
MCSymbolData &AD = Asm.getSymbolData(A->getSymbol());
|
||||
MCSymbolData &BD = Asm.getSymbolData(B->getSymbol());
|
||||
|
||||
if (AD.getFragment() == BD.getFragment()) {
|
||||
Res = MCValue::get(+ AD.getOffset()
|
||||
- BD.getOffset()
|
||||
+ LHS.getConstant()
|
||||
+ RHS_Cst);
|
||||
return true;
|
||||
}
|
||||
|
||||
Res = MCValue::get(+ Layout->getSymbolAddress(&AD)
|
||||
- Layout->getSymbolAddress(&BD)
|
||||
+ LHS.getConstant()
|
||||
|
Loading…
Reference in New Issue
Block a user