aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_vec4_live_variables.h
Commit message (Collapse)AuthorAgeFilesLines
* intel/compiler/vec4: Switch liveness analysis to IR analysis frameworkFrancisco Jerez2020-03-061-2/+9
| | | | | | | | | | | | This involves wrapping vec4_live_variables in a BRW_ANALYSIS object and hooking it up to invalidate_analysis() so it's properly invalidated. Seems like a lot of churn but it's fairly straightforward. The vec4_visitor invalidate_ and calculate_live_intervals() methods are no longer necessary after this change. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler/vec4: Add live interval validation passFrancisco Jerez2020-03-061-0/+3
| | | | | | | | | | | | This could be improved somewhat with additional validation of the calculated live in/out sets and by checking that the calculated live intervals are minimal (which isn't strictly necessary to guarantee the correctness of the program). This should be good enough though to catch accidental use of stale liveness results due to missing or incorrect analysis invalidation. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler: Pass single backend_shader argument to the ↵Francisco Jerez2020-03-061-1/+3
| | | | | | | | | | vec4_live_variables constructor The IR analysis framework requires the analysis result to be constructible with a single argument. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler: Restructure live intervals computation codeFrancisco Jerez2020-03-061-0/+1
| | | | | | | | | | | | This makes the structure of the vec4 live intervals calculation more similar to the FS back-end liveness analysis code. The non-CF-aware start/end computation is moved into the same pass that calculates the block-local def/use sets, which saves quite a bit of code, while the CF-aware start/end computation is moved into a separate compute_start_end() function as is done in the FS back-end. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler: Move all live interval analysis results into vec4_live_variablesFrancisco Jerez2020-03-061-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the following methods that are currently defined in vec4_visitor (even though they are side products of the liveness analysis computation) and are already implemented in brw_vec4_live_variables.cpp: > int var_range_start(unsigned v, unsigned n) const; > int var_range_end(unsigned v, unsigned n) const; > bool virtual_grf_interferes(int a, int b) const; > int *virtual_grf_start; > int *virtual_grf_end; It makes sense for them to be part of the vec4_live_variables object, because they have the same lifetime as other liveness analysis results and because this will allow some extra validation to happen wherever they are accessed in order to make sure that we only ever use up-to-date liveness analysis results. The naming of the virtual_grf_start/end arrays was rather misleading, they were indexed by variable rather than by vgrf, this renames them start/end to match the FS liveness analysis pass. The churn in the definition of var_range_start/end is just in order to avoid a collision between the start/end arrays and local variables declared with the same name. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler: Reverse inclusion dependency between ↵Francisco Jerez2020-03-061-1/+1
| | | | | | | | | | | | | brw_vec4_live_variables.h and brw_vec4.h brw_vec4.h (in particular vec4_visitor) is logically a user of the live variables analysis pass, not the other way around. brw_vec4_live_variables.h requires the definition of some VEC4 IR data structures to compile, but those can be obtained directly from brw_ir_vec4.h without including brw_vec4.h. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler: Nest definition of live variables block_data structuresFrancisco Jerez2020-03-061-27/+27
| | | | | | | | | | | | | | | | When this commit was originally written, these two structures had the exact same name. Subsequently in commit 12a8f2616a2f (intel/compiler: Fix C++ one definition rule violations) they were renamed. Original commit message: > These two structures have exactly the same name which prevents the two > files from being included at the same time and could cause serious > trouble in the future if it ever leads to a (silent) violation of the > C++ one definition rule. Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4012>
* intel/compiler: Fix C++ one definition rule violationsDanylo Piliaiev2019-10-281-2/+2
| | | | | | | | When building with "-flto" brw::block_data definitions were colliding. Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: consider subregister offset in live variablesJuan A. Suarez Romero2017-04-141-2/+2
| | | | | | | | | | | | | | | | | | Take into account offset values less than a full register (32 bytes) when getting the var from register. This is required when dealing with an operation that writes half of the register (like one d2x in IVB/BYT, which uses exec_size == 4). v2: - Take in account this offset < 32 in liveness analysis too (Curro) v3: - Change formula in var_from_reg() (Curro) - Remove useless changes (Curro) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* intel/compiler: consistently use ifndef guards over pragma onceEmil Velikov2017-03-221-0/+5
| | | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* i965: Move the back-end compiler to src/intel/compilerJason Ekstrand2017-03-131-0/+112
Mostly a dummy git mv with a couple of noticable parts: - With the earlier header cleanups, nothing in src/intel depends files from src/mesa/drivers/dri/i965/ - Both Autoconf and Android builds are addressed. Thanks to Mauro and Tapani for the fixups in the latter - brw_util.[ch] is not really compiler specific, so it's moved to i965. v2: - move brw_eu_defines.h instead of brw_defines.h - remove no-longer applicable includes - add missing vulkan/ prefix in the Android build (thanks Tapani) v3: - don't list brw_defines.h in src/intel/Makefile.sources (Jason) - rebase on top of the oa patches [Emil Velikov: commit message, various small fixes througout] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>