This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Optimize more redundant VSETVLIs
ClosedPublic

Authored by frasercrmck on Apr 1 2021, 7:41 AM.

Details

Summary

D99717 introduced some test cases which showed that the output of one
vsetvli into another would not be picked up by the RISCVCleanupVSETVLI
pass. This patch teaches the optimization about such a pattern. The
pattern is quite common when using the RVV vsetvli intrinsic to pass the
VL onto other intrinsics.

The second test case introduced by D99717 is left unoptimized by this
patch. It is a rarer case and will require us to rewire any uses of the
redundant vset[i]vli's output to the previous one's.

Diff Detail

Event Timeline

frasercrmck created this revision.Apr 1 2021, 7:41 AM
frasercrmck requested review of this revision.Apr 1 2021, 7:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 1 2021, 7:41 AM
This revision is now accepted and ready to land.Apr 1 2021, 2:21 PM
This revision was automatically updated to reflect the committed changes.