intel/compiler: remove inexact algebraic optimizations from the backend
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 12 Feb 2019 11:43:30 +0000 (12:43 +0100)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 18 Apr 2019 09:05:18 +0000 (11:05 +0200)
commit64b93292ac19f9a74005108575e25fe7e47eee82
treea5cd8494a62e3cf473babc55c068d901b43c84a1
parentddd1706ab3710f25f51bbd6b14bb3af72ca046f6
intel/compiler: remove inexact algebraic optimizations from the backend

NIR already has these and correctly considers exact/inexact qualification,
whereas the backend doesn't and can apply the optimizations where it
shouldn't. This happened to be the case in a handful of Tomb Raider shaders,
where NIR would skip the optimizations because of a precise qualification
but the backend would then (incorrectly) apply them anyway.

Besides this, considering that we are not emitting much math in the backend
these days it is unlikely that these optimizations are useful in general. A
shader-db run confirms that MAD and LRP optimizations, for example, were only
being triggered in cases where NIR would skip them due to precise
requirements, so in the near future we might want to remove more of these,
but for now we just remove the ones that are not completely correct.

Suggested-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_fs.cpp