[PATCH] D23396: [Assumptions] Make collecting ephemeral values not quadratic in the number of assume intrinsics.
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 16 20:24:04 PDT 2016
chandlerc added a comment.
In https://reviews.llvm.org/D23396#517618, @dberris wrote:
> How hard would it be to amortize the removal from the queue grows to a certain size? I ask because at some point the cost of copying around chunks of memory when a vector grows might outweigh the cost of just regularly trimming the queue if there are visited/stale entries at the beginning to the "current head" iterator.
I suspect this would hard to make worthwhile...
Because the growth is amortized already, the copies are too. So you're not going to see something *really* hot here no matter what. The real risk is that this uses gobs and gobs of memory.
But it still seems like a very low risk. This is strictly bounded on the number of instructions in a function. I think we are always going to be OK creating a vector with that many pointers in it (and even the visited set of those pointers) in terms of memory usage, so I'm not sure there is really an effective way to make this substantially cheaper.
If you have a concrete suggestion though, I'm happy to look at it. We have lots of worklists like this in LLVM.
https://reviews.llvm.org/D23396
More information about the llvm-commits
mailing list