https://github.com/bcardosolopes commented: Overall looks good. While here, can you please implement a folder for this operation? It should kick-in if both idx and input vector are constants. https://github.com/llvm/llvm-project/pull/138413