This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Fix warnings in foldCONCAT_VECTORS
ClosedPublic

Authored by david-arm on Jun 16 2020, 6:24 AM.

Details

Summary

Instead of asserting the number of elements is the same, we should be
comparing the element counts instead. In addition, when looking at
concats of extract_subvectors it's fine to use getVectorMinNumElements()
for scalable vectors.

I discovered these warnings when compiling the structured loads tests in
this file:

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

Diff Detail

Event Timeline

david-arm created this revision.Jun 16 2020, 6:24 AM
RKSimon added a subscriber: RKSimon.

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

These currently pass in trunk (with assertions enabled) - do you have additional test cases that fail that can you add?

Currently, getVectorNumElements() on a scalable vector prints a warning to stderr instead of asserting. This is a temporary state, while we fix enough of the code to get simple regression tests working without triggering the warning; we eventually plan to make this an assertion.

So the only consequence of this patch at the moment is reducing the number of warnings printed.

RKSimon accepted this revision.Jun 17 2020, 6:34 AM

Thanks for the explanation - LGTM

This revision is now accepted and ready to land.Jun 17 2020, 6:34 AM
This revision was automatically updated to reflect the committed changes.