This patch is admittedly a bit of a hack, but it's a useful hack.
SelectionDAG likes to build scaled scatter/gather nodes. RISCV doesn't support scaling, so we have a combine which unfolds this. However, the newly unfolded scaling inherits the memory ops debug location, not the debug location of the original GEP (which no longer exists). As a result, DAG schedule tends to mix the scaling with any e.g. interleaved scatter/gathers. This is bad because the addressing is often in a different data width than the scatter/gather and thus requires a bunch of extra vsetvli toggles.
We probably should prevent SelectionDAGBuilder from forming these at all, and I intend to play with that a bit to see if it's straight forward. However, this is an improvement on the current codegen at minimal cost, so I think we should take the workaround for the moment.