[PATCH] D96772: [LSR] Cleanup of getPreferredAddresingMode. NFC.

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 09:08:52 PST 2021


SjoerdMeijer added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:3814
+  bool FavorPreIndexed = EnableBackedgeIndexing &&
+      AMK == TTI::AMK_PreIndexed;
+  if (FavorPreIndexed && LU.Kind == LSRUse::Address) {
----------------
> Should the EnableBackedgeIndexing option override what the target defines? Or could it be removed, or replaced?

Good point. I think in general an option takes precedence, but that's not really happening here.

I think haIving an option for this would be good (I noticed it would at least be convenient for testing), which accepts values that match the values this hook returns: preindexed, postindexed, and none. I was thinking of doing that as a follow up of this NFC, so that would mean generalising and renaming this `EnableBackedgeIndexing` if that sounds like a good idea (so leave this as a NFC).


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

https://reviews.llvm.org/D96772



More information about the llvm-commits mailing list