[PATCH] D73555: [SVE] Fix bug in simplification of scalable vector instructions

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 3 13:33:32 PST 2020


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


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:169
                                    APInt &DemandedLHS, APInt &DemandedRHS) {
+  // The length of scalable vectors is unknown at compile time, thus we
+  // cannot check their values
----------------
RKSimon wrote:
> ctetreau wrote:
> > RKSimon wrote:
> > > ctetreau wrote:
> > > > @RKSimon This is the new code added. It modifies your recent patch, so I figured you'd like to review it.
> > > Would it be viable to set all DemandedLHS/DemandedRHS instead so we can still handle all element cases?
> > The problem is that for scalable vectors, we don't know how many elements there are. For a scalable vector, getVectorNumElements() returns the minimum number of elements there can be. If we have <vscale x 4 x i32>, it will return 4, which is the number of elements that would be in the vector if vscale = 1. But the value of vscale isn't known until runtime, so this doesn't really help us.
> OK, it's a shame we can't do anything in this case. No more comments.
Scalable shufflevector is still kind of a work in progress. There's an RFC up (http://lists.llvm.org/pipermail/llvm-dev/2020-January/138762.html) to expand it, so hopefully this can be revisited after that.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73555





More information about the llvm-commits mailing list