Convert fir operations which satisfy affine constraints to the affine
dialect.
This patch is part of the upstreaming effort from fir-dev branch.
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Co-authored-by: Rajan Walia <walrajan@gmail.com>
Co-authored-by: Sourabh Singh Tomar <SourabhSingh.Tomar@amd.com>
This way of translating to "affine" should break as soon as lhs or rhs is an induction variable and the other one is not a constant.
Same for other binary operations. I didn't see a test for this but I would hope something in affine will complain.