This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Update the computeKnownBitsForTargetNode for RISCVISD::READ_VLENB to consider Zve/Zvl.
ClosedPublic

Authored by craig.topper on Jan 30 2022, 11:55 PM.

Details

Summary

We had previously hardcoded this to assume that vector registers
are 128 bits. This was true when only V existed, but after Zve
extensions were added this became incorrect.

This patch adjusts it to support 128, 64, or 32 bit vectors depending
on Zvl. The 128-bit limit is artificial, but we don't have any test
coverage showing that we larger values so I was being conservative.

None of our lit tests depend on this code today due to the custom
lowering of ISD::VSCALE that inserts the appropriate left or right
shift to convert from VLENB to VSCALE. That code was added after
this code in computeKnownBitsForTargetNode.

Diff Detail

Event Timeline

craig.topper created this revision.Jan 30 2022, 11:55 PM
craig.topper requested review of this revision.Jan 30 2022, 11:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 30 2022, 11:55 PM
This revision is now accepted and ready to land.Jan 31 2022, 8:47 AM
This revision was landed with ongoing or failed builds.Jan 31 2022, 9:13 AM
This revision was automatically updated to reflect the committed changes.