intel/compiler: Define more detailed analysis dependency classes
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 9 Mar 2016 08:32:13 +0000 (00:32 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 6 Mar 2020 18:20:37 +0000 (10:20 -0800)
commit65080dc8df00d006912ade2d69d4a06c3d4c5e0a
treee6c71ed164b7fc32edf3fc9312955c388fe06db2
parentd966a6b4c4684bc02647a8fdc69a6c88e5ed00c2
intel/compiler: Define more detailed analysis dependency classes

I've deliberately separated this from the general analysis pass
infrastructure in order to discuss it independently.  The dependency
classes defined here refer to state changes of several objects of the
program IR, and are fully orthogonal and expected to change less often
than the set of analysis passes present in the compiler back-end.

The objective is to avoid unnecessary coupling between optimization
and analysis passes in the back-end.  By doing things in this way the
set of flags to be passed to invalidate_analysis() can be determined
from knowledge of a single optimization pass and a small set of well
specified dependency classes alone -- IOW there is no need to audit
all analysis passes to find out which ones might be affected by
certain kind of program transformation performed by an optimization
pass, as well as the converse, there is no need to audit all
optimization passes when writing a new analysis pass to find out which
ones can potentially invalidate the result of the analysis.

The set of dependency classes defined here is rather conservative and
mainly based on the requirements of the few analysis passes already
part of the back-end.  I've also used them without difficulty with a
few additional analysis passes I've written but haven't yet sent for
review.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
src/intel/compiler/brw_ir_analysis.h