As far as I can tell there is no good reason why we are defining the comparator
before calling tryToVectorizeSequence() but running sort() inside
tryToVectorizeSequence().
So this patch simplifies the code by moving the call to sort() closer to its
comparator.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
14144 | Would be good to add the assert that the array is properly sorted, but I don't know how to do it without comparator here. |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
14144 | The general idea behind passing it as an argument was ensure that the incomming array is properly sorted, so we operate on potentially vectorizable lists instead of trying incompatible ones. So, it just allows do not forget about comparator for the new operations (e.g. math intrinsics calls). |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
14144 | Makes sense. I think we can use a common comparator function, let me see if it works. |
Would be good to add the assert that the array is properly sorted, but I don't know how to do it without comparator here.