[PATCH] D81856: [SVE] Fix bad FixedVectorType cast in simplifyDivRem

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 12:41:12 PDT 2020


spatel accepted this revision.
spatel added a comment.

In D81856#2096429 <https://reviews.llvm.org/D81856#2096429>, @ctetreau wrote:

> > I'm confused - if the test is already there, but it doesn't change with this patch, then what does the failure/bug look like?
>
> The issue that this patch is solving is that this code calls getNumElements through a base VectorType pointer, which is going to be removed soon. getAggregateElement() will only return a value for a scalable vector constant if it is zeroinitializer or undef. Both of these cases are handled before the lines changed by this patch. The test I listed above hits this code path. What currently happens is getAggregateElement returns nullptr for each of 0 .. VTy->getElementCount().Min, and then the block exits. Essentially, this is NFC.


OK, thanks for explaining. LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81856





More information about the llvm-commits mailing list