https://github.com/aemerson commented: Can you add the equivalent for GlobalISel too? It re-uses all of this code so it should be similar to the SDAG version you have here. https://github.com/llvm/llvm-project/pull/139736