Skip to content

Draft: nir/opt_algebraic: Combine ishl and iadd to imad

What does this MR do and why?

nir/opt_algebraic: Combine ishl and iadd to imad

There are some OpenCL kernels that produce this pattern:

    32     %3 = load_const (0x00000002)
    32     %4 = ishl %2.y, %3 (0x2)
    32     %5 = iadd %2.x, %4

This can be transformed to:

    %5 = imad %2.y, 4, %2.x

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>

Merge request reports