diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-04-27 08:14:15 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-04-27 08:14:15 +0000 |
commit | 768c9f725bda048b3406b6289beb586ff6e933df (patch) | |
tree | ca3935dba41bfea1b56e81592db5e269b2f7d02d /lib/Target/ARM/ARMConstantIslandPass.cpp | |
parent | eec041a037a5dffadbc27af1d0e714e76079f06d (diff) | |
download | llvm-768c9f725bda048b3406b6289beb586ff6e933df.tar.gz llvm-768c9f725bda048b3406b6289beb586ff6e933df.tar.bz2 llvm-768c9f725bda048b3406b6289beb586ff6e933df.tar.xz |
Special handling of LEApcrel and tLEApcrel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMConstantIslandPass.cpp')
-rw-r--r-- | lib/Target/ARM/ARMConstantIslandPass.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index ae6afcee44..e9ccf04fee 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/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. |