[XLA:GPU] Add a generic trip count analysis based on HloEvaluator
This simply brute-forces the trip count by evaluating the trip count repeatedly. This is a simple extension of the code in while_loop_simplifier. Make while_loop_simplifier use it. The GPU backend has a WhileTransformer, which tries to pattern match loops with a constant trip count. This has stopped working a long time ago. Just replace it with the common trip count finder. The longer-term goal is to move the transformation before fusion and copy insertion so it's less fragile. The tests that cover this are while_transformer's tests at the moment. PiperOrigin-RevId: 207901341
Loading
Please sign in to comment