diff options
| author | Bob Wilson <bob.wilson@apple.com> | 2009-04-08 17:55:28 +0000 |
|---|---|---|
| committer | Bob Wilson <bob.wilson@apple.com> | 2009-04-08 17:55:28 +0000 |
| commit | 866c174f79c9496f92b17c0663ba0bc5af44bd60 (patch) | |
| tree | d8e4cbe1e329d5e093ffa20787dda4052bdc7485 /llvm/lib/Target/ARM | |
| parent | b58a9058a25f99b69647359f918f11396d0cfafd (diff) | |
| download | bcm5719-llvm-866c174f79c9496f92b17c0663ba0bc5af44bd60.tar.gz bcm5719-llvm-866c174f79c9496f92b17c0663ba0bc5af44bd60.zip | |
Fix PR3795: Apply Dan's suggested fix for
ARMTargetLowering::isLegalAddressingMode.
llvm-svn: 68619
Diffstat (limited to 'llvm/lib/Target/ARM')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 79a75863487..d018796a4b4 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -1759,7 +1759,8 @@ static bool isLegalAddressImmediate(int64_t V, MVT VT, /// by AM is legal for this target, for a load/store of the specified type. bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, const Type *Ty) const { - if (!isLegalAddressImmediate(AM.BaseOffs, getValueType(Ty, true), Subtarget)) + MVT VT = getValueType(Ty, true); + if (!isLegalAddressImmediate(AM.BaseOffs, VT, Subtarget)) return false; // Can never fold addr of global into load/store. @@ -1778,8 +1779,11 @@ bool ARMTargetLowering::isLegalAddressingMode(const AddrMode &AM, if (AM.BaseOffs) return false; + if (!VT.isSimple()) + return false; + int Scale = AM.Scale; - switch (getValueType(Ty).getSimpleVT()) { + switch (VT.getSimpleVT()) { default: return false; case MVT::i1: case MVT::i8: |

