This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Fix up warnings in visitEXTRACT_SUBVECTOR
ClosedPublic

Authored by david-arm on Jun 26 2020, 6:20 AM.

Details

Summary

It's perfectly valid to do certain DAG combines where we extract
subvectors from a concat vector when we have scalable vector types.
However, we can do this in a way that avoids generating compiler
warnings by replacing calls to getVectorNumElements() with
getVectorMinNumElements(). Due to the way subvector extracts are
designed to work with scalable vector types this is ok.

This eliminates some warnings from existing tests in this file:

llvm/test/CodeGen/AArch64/sve-intrinsics-loads.ll

Diff Detail

Event Timeline

david-arm created this revision.Jun 26 2020, 6:20 AM

Please note that I tried my best to find tests that exposed the change in behaviour where I added the fixed length vector check, but to no avail! I put that extra check in anyway as I think the optimisation makes no sense for scalable vector types. All we're doing here is removing an infrequently used (I looked for fixed length vector types hitting this path and there weren't many) optimisation for scalable vector types, so I think so long as no existing tests break it should be ok.

This revision is now accepted and ready to land.Jul 1 2020, 4:16 AM
This revision was automatically updated to reflect the committed changes.