https://github.com/farzonl approved this pull request. LGTM. One nit to use `getNumElementsFlattened` and one clarification needed on why we don't need to check language mode for the zext case? https://github.com/llvm/llvm-project/pull/175245