This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix lowering of BUILD_VECTORs as VID sequences
ClosedPublic

Authored by frasercrmck on Apr 14 2022, 5:31 AM.

Details

Summary

This patch fixes a bug when lowering BUILD_VECTOR via VID sequences.
After adding support for fractional steps in D106533, elements with zero
steps may be skipped if no step has yet been computed. This allowed
certain sequences to slip through the cracks, being identified as VID
sequences when in fact they are not.

The fix for this is to perform a second loop over the BUILD_VECTOR to
validate the entire sequence once the step has been computed. This isn't
the most efficient, but on balance the code is more readable and
maintainable than doing back-validation during the first loop.

Fixes the tests introduced in D123785.

Diff Detail

Event Timeline

frasercrmck created this revision.Apr 14 2022, 5:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 5:31 AM
frasercrmck requested review of this revision.Apr 14 2022, 5:31 AM
This revision is now accepted and ready to land.Apr 18 2022, 1:17 PM
This revision was landed with ongoing or failed builds.Apr 18 2022, 11:55 PM
This revision was automatically updated to reflect the committed changes.