[PATCH] D32712: [ConstantRange] Reduce the number of allocations in ConstantRange::makeGuaranteedNoWrapRegion

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 11:05:57 PDT 2017


craig.topper added a comment.

This was based on reviewing the output of callgrind on one file and seeing what places create a lot of wider than 64-bit APInts. I can try to collect a larger data set of real numbers.

Thinking about this more, I wonder if this is even the right interface for the question some of the callers are trying to determine.

Several of the callers call this and then check if the nowrap range fully contains another range. But the makeGuaranteedNoWrap register sometimes makes compromises where it has to decide pick two different possible ranges to return by deciding which choice is larger. You can see this in the two places in where we compute d1 and d2 in my last patch. But its possible the range the caller wants to check is contained inside the smaller choice, but not the larger choice. Should we instead have a method to ask if the addition of two ranges won't cause overflow directly without having to create a possibly compromised nowrap region?


https://reviews.llvm.org/D32712





More information about the llvm-commits mailing list