This patch implements AVX2 gather lowering the same way we do for AVX-512. This way we can recognize when the mask is all ones and change the source to undef. I also copied the forcing the source to zero if it was undef and the mask is not all ones. Not sure how important that is for either avx2 or avx512.
Unfortunately, due to the way fast isel works we are unable to recognize the mask being all ones and instead ended up forcing the source to zero even though the mask is all ones.