[PATCH] D65884: [ARM] MVE Tail Predication

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 01:08:33 PDT 2019


samparker marked an inline comment as done.
samparker added inline comments.


================
Comment at: lib/Target/ARM/MVETailPredication.cpp:364
+  // Search for Elems in the following SCEV:
+  // (1 + ((-VF + (VF * (((VF - 1) + %Elems) /u VF))<nuw>) /u VF))<nuw><nsw>
+  const SCEV *Elems = nullptr;
----------------
SjoerdMeijer wrote:
> samparker wrote:
> > SjoerdMeijer wrote:
> > > What we are doing here, is looking at generated code to get `%Elems`. But the vectorizer has generated this code, so somewhere this knowledge is present. The only question is, I guess, how easily accessible. Can we query SCEV or something else to avoid this pattern matching?
> > I've had a play with some other parts of SCEV, the helpers for delinearization, to see if it could answer the size of the array accessed by the loop. I can't seem to get this to work with the GEPs in the tests as they're not be represented by clean AddRecExprs. I presume it's not unreasonable for SCEV to not be that useful //after// vectorization..? It does looks like it could be used though, but I don't think I have the knowledge to do it safely! I'll add a TODO / FIXME.
> Alright, fair enough.
> Last question then, last crazy idea, could this information be attached to the loop as metadata?
That doesn't seem to be the way metadata is used. It would require it to be kept up-to-date by any transform, which is unreasonable. Loop properties are provided by analysis passes, so this could live in one of them... but it seems a bit niche and should probably be done in a better way :)


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

https://reviews.llvm.org/D65884





More information about the llvm-commits mailing list