[PATCH] D30638: [SLP] Fixed non-determenistic behavior in Loop Vectorizer.

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 10:54:39 PST 2017


mkuper added a comment.

In https://reviews.llvm.org/D30638#694112, @aaboud wrote:

> Notice that we will still need to iterate on the ordered set with a "while(!empty())" because we are removing entries from the Set while iterating on it.


Oy. That's not good. Removal from SetVector (except with pop_back) is linear-time... :-\

I'm not a fan of the original patch either, though - both because it keeps the same data twice, in two different members. The best idea I can think off of the top of my head, is having the member be an ordered container, then making a copy into a regular set in areDepsSafe(), and then iterating over the ordered container, but working with the set, like your patch does.
But that's also pretty ugly. Better ideas are welcome.


https://reviews.llvm.org/D30638





More information about the llvm-commits mailing list