[llvm-dev] [RFC] Simple GVN hoist

Momchil Velikov via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 15 10:04:44 PDT 2021


On Wed, Sep 15, 2021 at 5:17 PM Sjoerd Meijer <Sjoerd.Meijer at arm.com> wrote:
> The SLP vectoriser will fail to vectorise this because it wasn't taught to emit runtime alias analysis checks.

It likely needs more than that - manually hoisting all the loads and
adding `restrict` still does not vectorise at `-O3`:
https://gcc.godbolt.org/z/z3KjaYv9d

> Philip seems happy with this being part of GVN, and I don't have strong opinions, but GVNHoist seems like the natural place for this. An alternative strategy could thus be to integrate this into GVNHoist, enable it by default but only your simple gvn hoist algorithm (and disable the rest). That would perhaps then be a first step to address Philip's unhappiness with GVNHoist and restructure and improve it step by step.

I'm afraid I have to disagree - GVNHoist already does all the hoisting
we need, in that sense the mini-GVNhoist is not something to
integrate, but a simpler alternative.

If we put the issue of dealing with masked loads and stores in
vectorisers aside, I see these approaches:
* improve on the mini-GNVhoist as part of GVN (current proposal)
* bring GVNHoist up to snuff
* create a NewGVNHoist on top of NewGVN


More information about the llvm-dev mailing list