[COMMITTED] tree-optimization/106280 - Check if transitives need to be registered.

Andrew MacLeod amacleod@redhat.com
Mon Jul 18 20:02:32 GMT 2022

Regardless of whether this is enough of an improvement for the PR, it 
should be done.

Whenever a relation is registered with the oracle, it walks the 
dominator tree trying to apply any transitives it can find.

FIrst, it should check whether the operands are already in any relation. 
If neither operand is in a relation, we can conclude there cannot be any 
transitives. this is a simple bitmask check.

The second thing this patch does is adjust the set_relation routine to 
return NULL if the relation being applied already exists.  ie, we don't 
need to set the relation or do any additionalwork if the relation is 
already true. This will also prevent additional calls to the register 

This provides some marginal improvements across the board, and 
noticeable improvements in the testcase.

Bootstrapped on    x86_64-pc-linux-gnu with no regressions. Pushed.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 280.patch
Type: text/x-patch
Size: 2093 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20220718/c091952b/attachment.bin>

More information about the Gcc-patches mailing list