[SCF] Clean up ForOpTensorCastFolder and harden it against nop tensor casts
The code was inserting a new cast, discarding it, then inserting it again. The self-cast issue is the root of #62135 because it would end up dropping the loop and inserting an invalid cast to itself. As far as I can tell tensor.cast with the same src and dst types is not invalid but it can't really be tested in isolation as it's immediately folded. Fixes #62135 Differential Revision: https://reviews.llvm.org/D148714
Loading
Please sign in to comment