The majority of the cost appears to be forming the indices vector. Differential Revision: https://reviews.llvm.org/D127141