artagnon wrote: > Do you want to put together a patch for them? It is hard to see why the cast is always correct but some of the other changes look decent. Sure, I'll also try to simplify the algorithm. https://github.com/llvm/llvm-project/pull/92696