1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

Pessmistically assume the .align 2 before the first constpool entry adds

two bytes padding.

llvm-svn: 33734
This commit is contained in:
Evan Cheng 2007-02-01 01:09:47 +00:00
parent 3d8d381600
commit 9f87fca49c

View File

@ -339,6 +339,13 @@ void ARMConstantIslands::InitialFunctionScan(MachineFunction &Fn,
break;
}
}
// In thumb mode, if this block is a constpool island, pessmisticly assume
// it needs to be padded by two byte so it's aligned on 4 byte boundary.
if (AFI->isThumbFunction() &&
MBB.begin()->getOpcode() == ARM::CONSTPOOL_ENTRY)
MBBSize += 2;
BBSizes.push_back(MBBSize);
}
}
@ -465,7 +472,10 @@ bool ARMConstantIslands::CPEIsInRange(MachineInstr *MI, MachineInstr *CPEMI,
unsigned MaxDisp) {
unsigned PCAdj = AFI->isThumbFunction() ? 4 : 8;
unsigned UserOffset = GetOffsetOf(MI) + PCAdj;
unsigned CPEOffset = GetOffsetOf(CPEMI);
// In thumb mode, pessmisticly assumes the .align 2 before the first CPE
// in the island adds two byte padding.
unsigned AlignAdj = AFI->isThumbFunction() ? 2 : 0;
unsigned CPEOffset = GetOffsetOf(CPEMI) + AlignAdj;
DEBUG(std::cerr << "User of CPE#" << CPEMI->getOperand(0).getImm()
<< " max delta=" << MaxDisp