[llvm-commits] [llvm] r39743 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Dale Johannesen
dalej at apple.com
Wed Jul 11 11:32:38 PDT 2007
Author: johannes
Date: Wed Jul 11 13:32:38 2007
New Revision: 39743
URL: http://llvm.org/viewvc/llvm-project?rev=39743&view=rev
Log:
Fix hang compiling TimberWolf (allow for islands
of size other than 4).
Modified:
llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=39743&r1=39742&r2=39743&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Wed Jul 11 13:32:38 2007
@@ -161,7 +161,7 @@
MachineInstr *CPEMI, unsigned Disp,
bool DoDump);
bool WaterIsInRange(unsigned UserOffset, MachineBasicBlock *Water,
- unsigned Disp);
+ CPUser &U);
bool OffsetIsInRange(unsigned UserOffset, unsigned TrialOffset,
unsigned Disp, bool NegativeOK);
bool BBIsInRange(MachineInstr *MI, MachineBasicBlock *BB, unsigned Disp);
@@ -199,8 +199,8 @@
/// print block size and offset information - debugging
void ARMConstantIslands::dumpBBs() {
for (unsigned J = 0, E = BBOffsets.size(); J !=E; ++J) {
- DOUT << "block" << J << " offset" << BBOffsets[J] <<
- " size" << BBSizes[J] << "\n";
+ DOUT << "block " << J << " offset " << BBOffsets[J] <<
+ " size " << BBSizes[J] << "\n";
}
}
@@ -668,8 +668,9 @@
/// Water (a basic block) will be in range for the specific MI.
bool ARMConstantIslands::WaterIsInRange(unsigned UserOffset,
- MachineBasicBlock* Water, unsigned MaxDisp)
+ MachineBasicBlock* Water, CPUser &U)
{
+ unsigned MaxDisp = U.MaxDisp;
MachineFunction::iterator I = next(MachineFunction::iterator(Water));
unsigned CPEOffset = BBOffsets[Water->getNumber()] +
BBSizes[Water->getNumber()];
@@ -678,7 +679,7 @@
// the offset of the instruction. (Currently applies only to ARM, so
// no alignment compensation attempted here.)
if (CPEOffset < UserOffset)
- UserOffset += 4;
+ UserOffset += U.CPEMI->getOperand(2).getImm();
return OffsetIsInRange (UserOffset, CPEOffset, MaxDisp, !isThumb);
}
@@ -869,7 +870,7 @@
for (std::vector<MachineBasicBlock*>::iterator IP = prior(WaterList.end()),
B = WaterList.begin();; --IP) {
MachineBasicBlock* WaterBB = *IP;
- if (WaterIsInRange(UserOffset, WaterBB, U.MaxDisp)) {
+ if (WaterIsInRange(UserOffset, WaterBB, U)) {
if (isThumb &&
(BBOffsets[WaterBB->getNumber()] +
BBSizes[WaterBB->getNumber()])%4 != 0) {
More information about the llvm-commits
mailing list