[llvm] [LV] Add test showing lack of gather/scatter can prevent if-convert (PR #195042)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 08:02:43 PDT 2026


david-arm wrote:

Thanks for splitting this out! However, I wonder if it's better to

1. Have a NFC patch to unify the existing isLegalMaskedStore and isLegalMaskedLoad functions into a single isLegalMaskedLoadOrStore, which is then called from isScalarWithPredication.
2. Create a separate NFC patch to add the new force-target-supports-gather-scatter-ops flag with an associated test similar to tail-folding-masked-mem-opts.ll for gathers (like you've done here).
3. Leave the remaining changes regarding `isConsecutivePtr`, etc. to https://github.com/llvm/llvm-project/pull/194579 where it can be reviewed in context.

I personally feel there is value in splitting up the PRs in this way as both 1 and 2 do seem genuinely useful on their own independent of PR #194579. Patch 1 leaves the code tidier than before, moving common code into a single function. Patch 2 has value by itself as a means to write target-independent tests that don't have gather/scatter support. That means they aren't tied to any discussion around changes to `isConsecutivePtr`.

https://github.com/llvm/llvm-project/pull/195042


More information about the llvm-commits mailing list