[llvm] [LV] Introduce isLegalMaskedLoadOrStore (NFC) (PR #195242)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 02:53:07 PDT 2026


================
@@ -650,15 +650,9 @@ class VFSelectionContext {
   /// of FP operations.
   bool useOrderedReductions(const RecurrenceDescriptor &RdxDesc) const;
 
-  /// Returns true if the target machine supports masked store operation
-  /// for the given \p DataType and kind of access to \p Ptr.
-  bool isLegalMaskedStore(Type *DataType, Value *Ptr, Align Alignment,
-                          unsigned AddressSpace) const;
-
-  /// Returns true if the target machine supports masked load operation
-  /// for the given \p DataType and kind of access to \p Ptr.
-  bool isLegalMaskedLoad(Type *DataType, Value *Ptr, Align Alignment,
-                         unsigned AddressSpace) const;
+  /// Returns true if the target machine can represent \p I as a masked load
+  /// or store.
+  bool isLegalMaskedLoadOrStore(Instruction *I, ElementCount VF) const;
----------------
gbossu wrote:

I think I have a slight preference for passing an `Instruction`, passing a `Value` somehow reads to me as "this is the loaded/stored value". No strong opinion from my side though.

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


More information about the llvm-commits mailing list