summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-04-27 08:14:15 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-04-27 08:14:15 +0000
commitd9990f061fcb91291816d383f39d71efe29cd58f (patch)
treef195199b5752cc4e5a075ba31fc461be762ab67f /llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
parente54018687d861b962cbee8724e9a3ed089a3bb0e (diff)
downloadbcm5719-llvm-d9990f061fcb91291816d383f39d71efe29cd58f.tar.gz
bcm5719-llvm-d9990f061fcb91291816d383f39d71efe29cd58f.zip
Special handling of LEApcrel and tLEApcrel.
llvm-svn: 36504
Diffstat (limited to 'llvm/lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMConstantIslandPass.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
index ae6afcee44d..e9ccf04fee0 100644
--- a/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
+++ b/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
@@ -377,6 +377,10 @@ void ARMConstantIslands::InitialFunctionScan(MachineFunction &Fn,
// Constant pool entries can reach anything.
if (I->getOpcode() == ARM::CONSTPOOL_ENTRY)
continue;
+ if (I->getOpcode() == ARM::tLEApcrel) {
+ Bits = 8; // Taking the address of a CP entry.
+ break;
+ }
assert(0 && "Unknown addressing mode for CP reference!");
case ARMII::AddrMode1: // AM1: 8 bits << 2
Bits = 8;
@@ -869,6 +873,13 @@ bool ARMConstantIslands::HandleConstantPoolUser(MachineFunction &Fn,
MachineBasicBlock *NewMBB;
// Compute this only once, it's expensive
unsigned UserOffset = GetOffsetOf(UserMI) + (isThumb ? 4 : 8);
+
+ // Special cases: LEApcrel and tLEApcrel are two instructions MI's. The
+ // actual user is the second instruction.
+ if (UserMI->getOpcode() == ARM::LEApcrel)
+ UserOffset += 4;
+ else if (UserMI->getOpcode() == ARM::tLEApcrel)
+ UserOffset += 2;
// See if the current entry is within range, or there is a clone of it
// in range.
OpenPOWER on IntegriCloud