[PATCH] D143895: [AArch64] Fix incorrect `isLegalAddressingMode`

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 07:12:57 PDT 2023


chill added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3186
   if (!isAlwaysFoldable(TTI, LSRUse::Address, AccessTy, /*BaseGV=*/nullptr,
-                        IncOffset, /*HasBaseReg=*/false))
+                        IncOffset, /*HasBaseReg=*/true))
     return false;
----------------
dmgreen wrote:
> Can you give more details why this is changed to HasBaseReg? It seems that isAlwaysFoldable already sets ScaledReg to 1 or -1, so this now tests for BaseReg + 1/-1*ScaledReg + IncOffset?
Right, it's incorrect.
However, I'd rather see if I can fix it by changing `isAlwaysFoldable`, that invents a scale existence without any external input.

To be continued ...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143895/new/

https://reviews.llvm.org/D143895



More information about the llvm-commits mailing list