This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Hoist VSETVLI out of some scalable loops
ClosedPublic

Authored by reames on May 24 2022, 3:42 PM.

Details

Summary

This is a straight forward extension of the PRE transform introduced in D124869 to handle the VLMAX case.

The test changes here look quite positive. This surprised me until I realized that all the tests are using @llvm.vscale to figure out the VLMAX, not the llvm.riscv.vsetvlmax intrinsic. If they'd used the later, these would have been full redundancy cases and fully handled by the data flow. I'm not really sure if use of vscale here is representative or not. If it is, we should probably look at using VSETVLI to lower vscale rather than a raw read of vlenb and some math.

Diff Detail

Event Timeline

reames created this revision.May 24 2022, 3:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 24 2022, 3:42 PM
reames requested review of this revision.May 24 2022, 3:42 PM

The use of vscale came from the scalable vector autovectorizer. llvm.vscale is VLEN/RISCV::RVVBitsPerBlock. Which I guess is the right VLMAX for SEW=RISCV::RVVBitsPerBlock where RISCV::RVVBitPerBlock is 64.

This revision is now accepted and ready to land.May 24 2022, 7:09 PM
This revision was landed with ongoing or failed builds.May 25 2022, 8:10 AM
This revision was automatically updated to reflect the committed changes.