diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-06 01:43:02 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-06 01:43:02 +0000 |
commit | 2e05db2fa06e90298b428c91e9a4c8c1e367a7b9 (patch) | |
tree | 208103200c9258e721c828eaf2158a7ece72cbe8 /llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | |
parent | 10e1252269af295f0f16333e0f3f88aab37d2ebe (diff) | |
download | bcm5719-llvm-2e05db2fa06e90298b428c91e9a4c8c1e367a7b9.tar.gz bcm5719-llvm-2e05db2fa06e90298b428c91e9a4c8c1e367a7b9.zip |
Align ARM constant pool islands via their basic block.
Previously, all ARM::CONSTPOOL_ENTRY instructions had a hardwired
alignment of 4 bytes emitted by ARMAsmPrinter. Now the same alignment
is set on the basic block.
This is in preparation of supporting ARM constant pool islands with
different alignments.
llvm-svn: 145890
Diffstat (limited to 'llvm/lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMConstantIslandPass.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp index fedbbad56fa..017e9082065 100644 --- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -398,6 +398,9 @@ void ARMConstantIslands::DoInitialPlacement(MachineFunction &MF, MachineBasicBlock *BB = MF.CreateMachineBasicBlock(); MF.push_back(BB); + // Mark the basic block as 4-byte aligned as required by the const-pool. + BB->setAlignment(2); + // Add all of the constants from the constant pool to the end block, use an // identity mapping of CPI's to CPE's. const std::vector<MachineConstantPoolEntry> &CPs = @@ -1311,6 +1314,9 @@ bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &MF, CPEntries[CPI].push_back(CPEntry(U.CPEMI, ID, 1)); ++NumCPEs; + // Mark the basic block as 4-byte aligned as required by the const-pool entry. + NewIsland->setAlignment(2); + BBOffsets[NewIsland->getNumber()] = BBOffsets[NewMBB->getNumber()]; // Compensate for .align 2 in thumb mode. if (isThumb && (BBOffsets[NewIsland->getNumber()]%4 != 0 || HasInlineAsm)) |