On Tue, Nov 26, 2024 at 1:59 AM Andrew MacLeod <amacl...@redhat.com> wrote: > > A lot of time was being spent processing inferred ranges during a cache > update. Requesting the range of an argument during processing of > inferred ranges was suppose to be cheap because they have already been > calculated during folding, and so should just be available. The problem > demonstrated here is GORI determined the SSA_NAMES being queried were > invariant, and therefore the cache normally didnt do any lookups or > calculations. > > The inferred range processing was calling entry_range, which didn't have > a check for invariance. That check usually happened earlier in the > lookup process, and it was therefore doing a full dom lookup and range > calculation. > > This patch simply adds the check to entry_range to check for invariance, > and if so, use the definition value rather than doing a cache fill, as > is done in other places. > > This drops the compile time of VRP in the testcase from: > > tree VRP : 23.84 ( 13%) 43M ( 4%) > tree Early VRP : 11.18 ( 6%) 12M ( 1%) > TOTAL : 181.97 1175M > > to > > tree VRP : 8.22 ( 5%) 43M ( 4%) > tree Early VRP : 3.68 ( 2%) 12M ( 1%) > TOTAL : 159.04 1175M > > Overall compile time spent in VRP of GCC source files improved by about > 0.7%. > > Bootstraps on build-x86_64-pc-linux-gnu with no regressions. OK?
OK. Richard. > Andrew