[llvm] [NVPTX] Lower LLVM masked vector stores to PTX using new sink symbol syntax (PR #159387)

Drew Kersnar via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 25 10:03:21 PDT 2025


================
@@ -810,9 +810,13 @@ class TargetTransformInfo {
   LLVM_ABI AddressingModeKind
   getPreferredAddressingMode(const Loop *L, ScalarEvolution *SE) const;
 
-  /// Return true if the target supports masked store.
+  /// Return true if the target supports masked store. A value of false for
+  /// IsMaskConstant indicates that the mask could either be variable or
+  /// constant. This is for targets that only support masked store with a
+  /// constant mask.
   LLVM_ABI bool isLegalMaskedStore(Type *DataType, Align Alignment,
-                                   unsigned AddressSpace) const;
+                                   unsigned AddressSpace,
+                                   bool IsMaskConstant = false) const;
----------------
dakersnar wrote:

@arsenm are you imagining an enum rather than a bool? Something like:

enum MaskType {
VariableOrConstantMask,
ConstantMask
}

This is effectively the same as the bool approach but possibly a bit clearer. Like the bool approach, this would allow:
- API use cases that do not know the constness of the mask to pass VariableOrConstantMask. 
- API use cases that can derive the constness of the mask will pass ConstantMask when applicable.
- Targets that do not care about the constness of the mask will just ignore the parameter.
- And architectures like NVPTX can only return true if the parameter is set to the more precise ConstantMask.

If this isn't what you had in mind, can you elaborate?

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


More information about the llvm-commits mailing list