Page MenuHomePhabricator

[Polly] Run GVN during the cleanup
ClosedPublic

Authored by gareevroman on Aug 31 2017, 9:20 AM.

Details

Summary

Currently, GVN can be necessary to eliminate redundant instructions in case of, for instance, GEMM and float type. This patch makes GVN be run during the cleanup.

Diff Detail

Repository
rL LLVM

Event Timeline

gareevroman created this revision.Aug 31 2017, 9:20 AM
This revision is now accepted and ready to land.Aug 31 2017, 10:26 AM
Meinersbur accepted this revision.Aug 31 2017, 5:04 PM

Any reason to use NewGVN instead of (old) GVN?

I thought I had already changed the cleanup pipeline to more resemble the standard pipeline. That might still be in my devel branch and forgot to upsteam that.

Any reason to use NewGVN instead of (old) GVN?

I thought that NewGVN uses a stronger algorithm. If you think the old one is more reliable, let's use it.

I thought I had already changed the cleanup pipeline to more resemble the standard pipeline. That might still be in my devel branch and forgot to upsteam that.

I think it'd be great to upstream that.

dberlin edited edge metadata.Aug 31 2017, 11:18 PM

Any reason to use NewGVN instead of (old) GVN?

I thought that NewGVN uses a stronger algorithm.

It does

If you think the old one is more reliable, let's use it.

FWIW: At this point, GVN has more wrong code/etc bugs against it than NewGVN.

Thanks Dani. Then we should certainly go for the new GVN.

Thanks Dani. Then we should certainly go for the new GVN.

To be fair - There are things GVN is still better at you should consider:

  1. I haven't moved non-constant load/store coercion to trunk. The vast majority of cases are where the value we pull out is constant, but it is a thing gvn does better ATM. It's pretty trivial to fix if it matters, it's just not made the priority list
  1. GVN catches the inverse of equalities for non-branch controlling icmps, NewGVN doesn't ATM. i have a patch coming to fix this.
  1. GVN does PRE, NewGVN does not.

(NewGVN is really an analysis, and i have a patch to make it so. It has a full redundancy eliminator run after the analysis, but i haven't gotten around to implementing a partial one).

Closed by commit rL312307: Run GVN during the cleanup (authored by romangareev). · Explain WhyAug 31 2017, 11:53 PM
This revision was automatically updated to reflect the committed changes.