ARM: allow constpool entry to be moved to the user's block in all cases.

Normally entries can only move to a lower address, but when that wasn't viable,
the user's block was considered anyway. Unfortunately, it went via
createNewWater which wasn't designed to handle the case where there's already
an island after the block.

Unfortunately, the test we have is slow and fragile, and I couldn't reduce it
to anything sane even with the @llvm.arm.space intrinsic. The test change here
is recreating the previous one after the change.

rdar://problem/18545506

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221905 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover
2014-11-13 17:58:53 +00:00
parent 064da63fcb
commit 8bca5de6a9
2 changed files with 26 additions and 384 deletions

View File

@@ -1207,7 +1207,8 @@ bool ARMConstantIslands::findAvailableWater(CPUser &U, unsigned UserOffset,
unsigned Growth;
if (isWaterInRange(UserOffset, WaterBB, U, Growth) &&
(WaterBB->getNumber() < U.HighWaterMark->getNumber() ||
NewWaterList.count(WaterBB)) && Growth < BestGrowth) {
NewWaterList.count(WaterBB) || WaterBB == U.MI->getParent()) &&
Growth < BestGrowth) {
// This is the least amount of required padding seen so far.
BestGrowth = Growth;
WaterIter = IP;
@@ -1361,6 +1362,11 @@ void ARMConstantIslands::createNewWater(unsigned CPUserIndex,
if (CC != ARMCC::AL)
MI = LastIT;
}
// We really must not split an IT block.
DEBUG(unsigned PredReg;
assert(!isThumb || getITInstrPredicate(MI, PredReg) == ARMCC::AL));
NewMBB = splitBlockBeforeInstr(MI);
}