[llvm] [NVPTX] Lower LLVM masked vector loads and stores to PTX (PR #159387)

Princeton Ferro via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 21 11:28:17 PDT 2025


================
@@ -3214,16 +3213,14 @@ convertMLOADToLoadWithUsedBytesMask(MemSDNode *N, SelectionDAG &DAG) {
   uint32_t ElementSizeInBytes = ElementSizeInBits / 8;
   uint32_t ElementMask = (1u << ElementSizeInBytes) - 1u;
 
-  for (unsigned I :
-       llvm::reverse(llvm::seq<unsigned>(0, ResVT.getVectorNumElements()))) {
-    assert(isa<ConstantSDNode>(Mask.getOperand(I)) &&
-           "Mask elements must be constants");
-    // We technically only want to do this shift for every iteration *but* the
-    // first, but in the first iteration NewMask is 0, so this shift is a
-    // no-op.
+  for (SDValue Op : llvm::reverse(Mask->ops())) {
----------------
Prince781 wrote:

I think you may drop the `llvm::`

```suggestion
  for (SDValue Op : reverse(Mask->ops())) {
```

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


More information about the llvm-commits mailing list