[PATCH] D89693: [AArch64] Favor post-increments and implement TTI::getPreferredAddressingMode

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 08:46:31 PST 2021


SjoerdMeijer added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp:1287
+  InductionDescriptor IndDesc;
+  if (!L->getInductionDescriptor(*SE, IndDesc))
+    return TTI::AMK_None;
----------------
fhahn wrote:
> What if the loop has multiple induction phis and one of those has a large constant step or  unknown step? Should we instead iterate over all phis and check all induction phis (using `InductionDescriptor::isInductionPHI` to identify them)?
Yeah, I thought about that a bit. I don't think we are interested in all induction phis here. I think we are interested in what is called the `PrimaryInduction` in the loop vectoriser, i.e. the one that actually controls the loop. And this seems to match exactly with what `getInductionVariable()` promises to return, which is used by `getInductionDescriptor`. That's why this looked okay to me...


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

https://reviews.llvm.org/D89693



More information about the llvm-commits mailing list