forked from tinygrad/tinygrad
* decompositions: fuse (x << n) + c to MULACC MUL→SHL converts x*(2^n) to x<<n before MULACC can fuse (x*c)+y. Add pattern to also fuse (x<<n)+c → MULACC(x, 2^n, c) for backends that support both MULACC and SHL. * test: add test_mulacc_shl for SHL->MULACC fusion * test: relax test_mulacc_unrolled to >= 4 SHL->MULACC fusion now also catches power-of-2 address calculations, increasing MULACC count from 4 to 6 on PTX. the test's intent is that each unrolled multiply is individually fused (not grouped), so >= 4 is the correct assertion. --------- Co-authored-by: Prithvish <[email protected]> Co-authored-by: Nicolas Pinto <[email protected]> Co-authored-by: Nicolas Pinto <[email protected]>