Add int64 dtype support for RangeFor boundaries
Author: jim19930609Created Jul 4, 2022Updated May 9, 2026
Labelsfeature request
Taichi implicitly casts RangeFor boundaries to ti.i32, which is an unnecessary limitation and causes confusion when users explicitly specifies ti.i64 as RangeFor boundaries (https://github.com/taichi-dev/taichi/issues/5217).

Ideally, backend's dtype limitation should not bother the frontend design. Unfortunately, we did forbiddened higher precision dtypes in certain cases due to concerns regarding the backends (RangeFor boundaries, ti.atan type conversion, etc..)
We should add a "dtype demotion" pass for each specific backend, and remove all these dtype conversions from the frontend.
Source: taichi-dev/taichi