OSDN Git Service

[SLP][NFC] PR45269 getVectorElementSize() is slow
authorDinar Temirbulatov <dtemirbulatov@gmail.com>
Thu, 21 May 2020 15:00:20 +0000 (17:00 +0200)
committerDinar Temirbulatov <dtemirbulatov@gmail.com>
Thu, 21 May 2020 15:26:50 +0000 (17:26 +0200)
commitdf3b95bc0ae0f9de0a54db897ed37ffb6ba44226
tree06851f133c102eaa5115abed64593196a0be0224
parent20c0527af7449d7c22261f9bc88b0ee391bdbad8
[SLP][NFC] PR45269 getVectorElementSize() is slow

The algorithm inside getVectorElementSize() is almost O(x^2) complexity and
when, for example, we compile MultiSource/Applications/ClamAV/shared_sha256.c
with 1k instructions inside sha256_transform() function that resulted in almost
~800k iterations. The following change improves the algorithm with the map to
a liner complexity.

Differential Revision: https://reviews.llvm.org/D80241
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp