davidchisnall wrote: This looks very much like code I wrote (sorry). Tagging @resistor to check that it still looks like code that does the right thing for us. https://github.com/llvm/llvm-project/pull/140017