[PATCH] D147336: [IVDescriptors] Add pointer InductionDescriptors with non-constant strides (try 2)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 09:32:24 PDT 2023


reames added a comment.

@dmgreen I'd really appreciate any input you can share on the performance swing you observed.

Thinking through this, I've got a couple of potential theories, but it would help to know which (if any) is correct.

Option 1 - The codegen for the scalar and vector expansions is fairly poor.  With solely constants, the expressions would get constant folded down so much it doesn't really matter, but for non-constants we're leaving a lot for the backend to cleanup.  This is an easy fix, but probably the least likely issue.

Option 2 - There's something missing cost model wise for arbitrary gathers or something is matching a strided access too broadly in target code.  I haven't looked into this at all yet.  This is probably the most likely.

Option 3 - This is simply exposing more cases where LAA/LV can speculate on the stride of a non-constant step IV.  (We already do this for integer forms.)  From what I've seen in cases I'm looking at, the speculation and versioning that stride=1 at runtime can be commonly unprofitable.  I'd planned on tackling that, but given it already kicks in so widely on scalar IVs, I hadn't thought enabling pointer IVs would make it critical.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147336



More information about the llvm-commits mailing list