[PATCH] D16835: InstCombine: Restrict computeKnownBits() on everyValue to OptLevel > 2
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 2 20:35:51 PST 2016
hfinkel added a comment.
In http://reviews.llvm.org/D16835#342546, @majnemer wrote:
> In http://reviews.llvm.org/D16835#342512, @llvm-commits wrote:
> > Given that I don't have a single file in the whole llvm-testsuite where this transformation kicks in I wouldn't know how to start tuning it, so this patch simply pushes it to -O3 only.
> I'd rather us not do the expensive work at all instead of stick it under -O3. Sticking it behind a flag would mean that it gets tested less often. It doesn't seem to be pulling it's weight for it's cost...
In the bigger picture, we really need to rework our known-bits analysis to have a cache. It is really silly that it is so expensive; but it's completely understandable given that it starts from scratch each time. I'm fairly certain that giving computeKnownBits an internal cache would also solve this problem.
In any case, the motivating use cases for this almost all involve (range) metadata or @llvm.assume. Maybe we could be smarter about when we do this based on whether such things are actually present in the function?
More information about the llvm-commits