intel/compiler: Don't emit calls to validate() in release build

While the fs_visitor::validate() implementation is empty in release
build, we still emit calls to it since it is defined in a separate
compilation unit than its callers.  To fix this, just expose an inline
empty function in the header for the release mode.

Fossil run time differences in TGL laptop (difference at 95.0% confidence):

```
Rise of The Tomb Rider (Native) [n=7]
        -0.482857 +/- 0.010932
        -1.60608% +/- 0.0363621%

Cyberpunk 2077 (DXVK) [n=7]
        -0.987143 +/- 0.0904516
        -0.82996% +/- 0.076049%

Batman Arkham City (DXVK) [n=7]
        -7.74857 +/- 0.329561
        -1.46298% +/- 0.0622231%
```

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25847>
This commit is contained in:
Caio Oliveira 2023-10-22 14:36:03 -07:00 committed by Marge Bot
parent 13cac671fd
commit b91ed68fa0
2 changed files with 8 additions and 2 deletions

View file

@ -256,7 +256,13 @@ public:
unsigned *out_pull_index);
bool lower_constant_loads();
virtual void invalidate_analysis(brw::analysis_dependency_class c);
#ifndef NDEBUG
void validate();
#else
void validate() {}
#endif
bool opt_algebraic();
bool opt_redundant_halt();
bool opt_cse();

View file

@ -86,10 +86,10 @@
} \
}
#ifndef NDEBUG
void
fs_visitor::validate()
{
#ifndef NDEBUG
foreach_block_and_inst (block, fs_inst, inst, cfg) {
switch (inst->opcode) {
case SHADER_OPCODE_SEND:
@ -193,5 +193,5 @@ fs_visitor::validate()
fsv_assert_eq(inst->dst.stride, 1);
}
}
#endif
}
#endif