[PATCH] D89693: [AArch64] Favor post-increments

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 02:30:20 PST 2021


SjoerdMeijer added a comment.

I wanted to abandon this change in favour of D89693 <https://reviews.llvm.org/D89693>. The reason is that D89693 <https://reviews.llvm.org/D89693> works for unrolled loops, and this change doesn't. But D89693 <https://reviews.llvm.org/D89693> doesn't really work when things haven't been unrolled, so I think there's actually value in having them both, and I will progress that.

This means`shouldFavorPostInc()` would need to make a decision if it is working on unrolled loops or not, but the current interface doesn't allow that:

  /// \return True is LSR should make efforts to create/preserve post-inc
  /// addressing mode expressions.
  bool shouldFavorPostInc() const;
  /// Return true if LSR should make efforts to generate indexed addressing
  /// modes that operate across loop iterations.
  bool shouldFavorBackedgeIndex(const Loop *L) const;

I will first make `shouldFavorPostInc` consistent with `shouldFavorBackedgeIndex` to accept `Loop *L` as an argument, so that we can look at its induction variable and step size.
After that interface change, I will then continue here to implement that.


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

https://reviews.llvm.org/D89693



More information about the llvm-commits mailing list