]> gcc.gnu.org Git - gcc.git/commit
tree-optimization/104912 - ensure cost model is checked first
authorRichard Biener <rguenther@suse.de>
Mon, 21 Mar 2022 13:08:25 +0000 (14:08 +0100)
committerRichard Biener <rguenther@suse.de>
Wed, 13 Apr 2022 07:53:53 +0000 (09:53 +0200)
commitac8340ee4d1e65f3fd41c547b16895875f4aefa7
treefcd8df21440936680989839b0c74d9c2cab813c7
parentccb5e638370cd228032d5a8c0ca343c46caaa4b4
tree-optimization/104912 - ensure cost model is checked first

The following makes sure that when we build the versioning condition
for vectorization including the cost model check, we check for the
cost model and branch over other versioning checks.  That is what
the cost modeling assumes, since the cost model check is the only
one accounted for in the scalar outside cost.  Currently we emit
all checks as straight-line code combined with bitwise ops which
can result in surprising ordering of checks in the final assembly.

Since loop_version accepts only a single versioning condition
the splitting is done after the fact.

The result is a 1.5% speedup of 416.gamess on x86_64 when compiling
with -Ofast and tuning for generic or skylake.  That's not enough
to recover from the slowdown when vectorizing but it now cuts off
the expensive alias versioning test.

2022-03-21  Richard Biener  <rguenther@suse.de>

PR tree-optimization/104912
* tree-vect-loop-manip.cc (vect_loop_versioning): Split
the cost model check to a separate BB to make sure it is
checked first and not combined with other version checks.
gcc/tree-vect-loop-manip.cc
This page took 0.065995 seconds and 5 git commands to generate.