lebedev.ri added a comment. Costmodel is wrong: if there are gaps, you need to load the vector of original values, and insert the non-gap elements into it. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104750/new/ https://reviews.llvm.org/D104750