[llvm-branch-commits] [llvm-branch] r93573 - /llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMConstantIslandPass.cpp
Jim Grosbach
grosbach at apple.com
Fri Jan 15 15:15:19 PST 2010
Author: grosbach
Date: Fri Jan 15 17:15:18 2010
New Revision: 93573
URL: http://llvm.org/viewvc/llvm-project?rev=93573&view=rev
Log:
merge missing patch from a while back. 89443.
Modified:
llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMConstantIslandPass.cpp
Modified: llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMConstantIslandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=93573&r1=93572&r2=93573&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/ARM/ARMConstantIslandPass.cpp Fri Jan 15 17:15:18 2010
@@ -221,45 +221,10 @@
unsigned GetOffsetOf(MachineInstr *MI) const;
void dumpBBs();
void verify(MachineFunction &MF);
- void verifySizes(MachineFunction &MF);
};
char ARMConstantIslands::ID = 0;
}
-// verifySizes - Recalculate BB sizes from scratch and validate that the result
-// matches the values we've been using.
-void ARMConstantIslands::verifySizes(MachineFunction &MF) {
- unsigned Offset = 0;
- for (MachineFunction::iterator MBBI = MF.begin(), E = MF.end();
- MBBI != E; ++MBBI) {
- MachineBasicBlock &MBB = *MBBI;
- unsigned MBBSize = 0;
- for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
- I != E; ++I) {
- // Add instruction size to MBBSize.
- MBBSize += TII->GetInstSizeInBytes(I);
- }
- // In thumb mode, if this block is a constpool island, we may need padding
- // so it's aligned on 4 byte boundary.
- if (isThumb &&
- !MBB.empty() &&
- MBB.begin()->getOpcode() == ARM::CONSTPOOL_ENTRY &&
- ((Offset%4) != 0 || HasInlineAsm))
- MBBSize += 2;
- Offset += MBBSize;
-
- DEBUG(errs() << "block #" << MBB.getNumber() << ": "
- << MBBSize << " bytes (expecting " << BBSizes[MBB.getNumber()]
- << (MBB.begin()->getOpcode() == ARM::CONSTPOOL_ENTRY ?
- " CONSTANTPOOL" : "") << ")\n");
-#ifndef NDEBUG
- if (MBBSize != BBSizes[MBB.getNumber()])
- MBB.dump();
-#endif
- assert (MBBSize == BBSizes[MBB.getNumber()] && "block size mismatch!");
- }
-}
-
/// verify - check BBOffsets, BBSizes, alignment of islands
void ARMConstantIslands::verify(MachineFunction &MF) {
assert(BBOffsets.size() == BBSizes.size());
@@ -395,7 +360,6 @@
// After a while, this might be made debug-only, but it is not expensive.
verify(MF);
- verifySizes(MF);
// If LR has been forced spilled and no far jumps (i.e. BL) has been issued.
// Undo the spill / restore of LR if possible.
More information about the llvm-branch-commits
mailing list