[PATCH] D36467: [ARM, FIX] ARMTargetLowering::isLegalAddressingMode can accept illegal addressing modes for Thumb1 target

Evgeny Astigeevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 04:34:28 PDT 2017


eastig added inline comments.


================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:12400
+  if (Subtarget->isThumb1Only()) {
+    return (AM.Scale == 1);
+  }
----------------
efriedma wrote:
> Maybe `((unsigned)AM.HasBaseReg + Scale) <= 2`, like we use in other places?  It doesn't come up often, but it's easy to support.
This will accept negative scales: (unsigned)true + (unsigned)-1 == 0
Thumb1 addressing modes do not support negative scales. I'll put this in the comment.


https://reviews.llvm.org/D36467





More information about the llvm-commits mailing list