nir/opt_algebraic: remove broken fddx/fddy patterns
These patterns are broken in the following scenario:
%1 = f2fmp %0
%2 = fddx %1
%3 = ... // non quad uniform
if %3 {
%4 = f2f32 %2
...
}
Which would turn into
%3 = ...
if %3 {
%4 = fddx %0
...
}
Yet another example that shows why derivative instructions should be
be intrinsics, not alu.
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25014>
This commit is contained in:
@@ -3226,8 +3226,7 @@ for op in ['ffma', 'ffmaz']:
|
||||
# first eliminate temporary up-conversions such as in op1(f2fmp(f2f32(op2()))).
|
||||
#
|
||||
# Unary opcodes
|
||||
for op in ['fabs', 'fceil', 'fcos', 'fddx', 'fddx_coarse', 'fddx_fine', 'fddy',
|
||||
'fddy_coarse', 'fddy_fine', 'fexp2', 'ffloor', 'ffract', 'flog2', 'fneg',
|
||||
for op in ['fabs', 'fceil', 'fcos', 'fexp2', 'ffloor', 'ffract', 'flog2', 'fneg',
|
||||
'frcp', 'fround_even', 'frsq', 'fsat', 'fsign', 'fsin', 'fsqrt']:
|
||||
late_optimizations += [(('~f2f32', (op, ('f2fmp', a))), (op, a))]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user