[PATCH] D48578: use a MapVector for pass manage LastUser

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 19:08:18 PDT 2018


chandlerc requested changes to this revision.
chandlerc added a comment.
This revision now requires changes to proceed.

I really don't think this is the right approach.

First, this is fundamentally a more expensive data structure than DenseMap. I'm honestly surprised that *any* query pattern is actually faster with it, but I can understand why your particular one happens to be faster. But it does make every other code path a bit slower. It doesn't really seem like the right tradeoff for all of LLVM, especially given that this doesn't even help *that* much.

If you want to fix this, you should fix the bad algorithm in `setLastUser`. We already have an inverse map, so there should be some way that simply doesn't iterate over the entire thing in this way.

But honestly, I'm not sure its worth spending a lot of time tuning this. If you see lots of overhead due to these kinds of pass management infrastructure, I would *strongly* suggest working on moving to the new pass manager. It fundamentally doesn't have these pitfalls. So far no one has stepped forward to work on making this happen for the code generator, but it really does need to happen...


Repository:
  rL LLVM

https://reviews.llvm.org/D48578





More information about the llvm-commits mailing list