[PATCH] D36559: [ARM] Clarify legal addressing modes for ARM and Thumb2. NFC
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 16:39:01 PDT 2017
efriedma created this revision.
Herald added subscribers: kristof.beyls, javed.absar, aemerson.
The existing code is very clever, but not clear, which seems like the wrong tradeoff here.
Repository:
rL LLVM
https://reviews.llvm.org/D36559
Files:
lib/Target/ARM/ARMISelLowering.cpp
Index: lib/Target/ARM/ARMISelLowering.cpp
===================================================================
--- lib/Target/ARM/ARMISelLowering.cpp
+++ lib/Target/ARM/ARMISelLowering.cpp
@@ -12357,8 +12357,13 @@
Scale = Scale & ~1;
return Scale == 2 || Scale == 4 || Scale == 8;
case MVT::i64:
+ // FIXME: What are we trying to model here? ldrd doesn't have an r + r
+ // version in Thumb mode.
// r + r
- if (((unsigned)AM.HasBaseReg + Scale) <= 2)
+ if (Scale == 1)
+ return true;
+ // r * 2 (this can be lowered to r + r).
+ if (!AM.HasBaseReg && Scale == 2)
return true;
return false;
case MVT::isVoid:
@@ -12416,8 +12421,11 @@
return isPowerOf2_32(Scale & ~1);
case MVT::i16:
case MVT::i64:
- // r + r
- if (((unsigned)AM.HasBaseReg + Scale) <= 2)
+ // r +/- r
+ if (Scale == 1 || (AM.HasBaseReg && Scale == -1))
+ return true;
+ // r * 2 (this can be lowered to r + r).
+ if (!AM.HasBaseReg && Scale == 2)
return true;
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36559.110500.patch
Type: text/x-patch
Size: 1068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170809/ba124fb1/attachment.bin>
More information about the llvm-commits
mailing list