(original) (raw)


On Oct 14, 2014, at 11:31 AM, Nadav Rotem <nrotem@apple.com> wrote:


On Oct 14, 2014, at 11:21 AM, Andrew Trick <atrick@apple.com> wrote:

I actually agree with you in principle, but I would rather run the pass now (and avoid hacks downstream to essentially do CSE in the backend) than hold up progress on the hope of advanced on-demand CSE layers being added to the vectorizers. I don't know of anyone actually working on that, and so I'm somewhat concerned it will never materialize.

The SLP vectorizer already has a built-in CSE. The Loop vectorizer does not need a CSE AFAIK, but it does need InstCombine to cleanup the code that we generate for induction variables and scatter/gather.

The loop vectorizer also performs CSE internally. There is an interaction between CSE and instcombine (induction variables if I remember correctly) where you want to run CSE followed by instcombine - (maybe even followed by CSE again - not totally positive but I think this was the case) that we would not cleanup otherwise.