[llvm] [LV] Add `-force-target-supports-masked-memory-ops` option (PR #184325)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 4 03:07:46 PST 2026


huntergr-arm wrote:

> I love the idea, but maybe this should be an attribute/metadata instead? Imagine I have a pass `X`, I'd probably want to have `LoopVectorize[/VPlan]/X.ll` that contains test cases for both cases that support masked operations and don't. I think having per-function granularity would be more useful as that would allow us to keep tests grouped together.
> 
> What do others think?
> 
> Update: and for gathers/scatters we'd want to have a control that would determine which cost is better (even if called "prefer gather over predication"), again, probably wanting to test both scenarios in the same file but different functions.

I think there's pluses to both approaches -- with a flag, you can add another RUN line to compare the different output for the same function. So I support adding the feature as-is, but maybe we could add target-independent metadata for it as well in a separate PR if there's enough demand for it. (I guess the same could be said of other features that already have flags, like scalable vector support or maximizing vector bandwidth -- they can be expressed in metadata for targets that have those features, but not in generic code)

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


More information about the llvm-commits mailing list