[PATCH] D73602: [SVE] Add support for lowering GEPs involving scalable vectors.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 14:07:26 PST 2020


efriedma added a comment.

> Could you please describe in a comment in the tests the math behind operations like the following?

I'm not sure what you mean by "the math".  A scalar GEP produces a scalar result, a vector GEP produces a vector result.  A scalar operand to a vector GEP is splatted.  I'm not sure what useful explanation I could add; I could add a comment "This is a vector GEP", but I'm not sure that's helpful; the result type is already explicitly written in the "ret" instruction.

> Could you please tests expressions like the following?

Sure.

> You tests the cases for <vscale x 2 x i64>. Could you please test more configurations of <vscale x N x Ty>, at least covering all cases in which sizeof( N x Ty) == 16?

For vector GEPs, all the math always has to happen in N x i64 (since pointers are 64 bits wide).  So if N>2, we have to run type legalization, and that probably explodes in unrelated ways, so I don't really want to do that. I can add more tests for scalar GEPs over vector pointee types; that shouldn't require more patterns, I think.

> To make it work, I had to add handling of getelementpr when adding a constant int

What's the difference between the DAG produced by your patch, vs. my patch alone?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73602





More information about the llvm-commits mailing list