This is an archive of the discontinued LLVM Phabricator instance.

[LV] Replace symbolic strides with constants in LV
AbandonedPublic

Authored by peixin on Apr 1 2023, 7:25 AM.

Details

Summary

The SCEV checks can replace the symbolic strides with constants. The
replacement in vector region relies on GVN pass, but it is run before
LV pass, so we need to replace it in LV pass.

Diff Detail

Event Timeline

peixin created this revision.Apr 1 2023, 7:25 AM
peixin requested review of this revision.Apr 1 2023, 7:25 AM
peixin updated this revision to Diff 510322.Apr 2 2023, 1:47 AM

Fix failed tests with ARM and RISCV backends. Replace the strides with const values in vector region, which is expected with this patch.

peixin updated this revision to Diff 510335.Apr 2 2023, 4:33 AM
reames added a comment.Apr 6 2023, 5:41 PM

This seems like it's duplicating information already available in PredicatedScalarEvolution.

You can see my D147750 for one example where PSE solves a related problem. I suspect we should probably be phrasing this one in terms of constant folding and instsimplify where the constants might come from PSE. Maybe this doesn't work out, but I'd suggest trying that before adding additional complexity here.

peixin updated this revision to Diff 511983.Apr 9 2023, 4:19 AM
peixin retitled this revision from [LV] Replace symbolic stride with const in LV to [LV] Replace symbolic strides with constants in LV.
peixin edited the summary of this revision. (Show Details)

Simplify the implementation.

Take the replacement in vector preheader, too.

peixin abandoned this revision.Jun 18 2023, 6:42 PM