[llvm-commits] [llvm] r68619 - /llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Bob Wilson bob.wilson at apple.com
Wed Apr 8 10:55:28 PDT 2009


Author: bwilson
Date: Wed Apr  8 12:55:28 2009
New Revision: 68619

URL: http://llvm.org/viewvc/llvm-project?rev=68619&view=rev
Log:
Fix PR3795: Apply Dan's suggested fix for
ARMTargetLowering::isLegalAddressingMode.

Modified:
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=68619&r1=68618&r2=68619&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Wed Apr  8 12:55:28 2009
@@ -1759,7 +1759,8 @@
 /// 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 @@
     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:





More information about the llvm-commits mailing list