efriedma-quic wrote: Oh, sorry, I skimmed bits of the patch; I see you're still doing the expansion during isel. So the benefit of having C++ code to compute the sequence length is mostly so you can query it before isel? I guess that makes sense. https://github.com/llvm/llvm-project/pull/185526