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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 24 15:05:18 PDT 2025


================
@@ -64,10 +65,18 @@ static bool tagInvariantLoads(Function &F) {
   bool Changed = false;
   for (auto &I : instructions(F)) {
     if (auto *LI = dyn_cast<LoadInst>(&I)) {
-      if (isInvariantLoad(LI, IsKernelFn)) {
+      if (isInvariantLoad(LI, LI->getPointerOperand(), IsKernelFn)) {
         markLoadsAsInvariant(LI);
         Changed = true;
       }
+      if (auto *II = dyn_cast<IntrinsicInst>(&I)) {
+        if (II->getIntrinsicID() == Intrinsic::masked_load) {
+          if (isInvariantLoad(II, II->getOperand(0), IsKernelFn)) {
----------------
Artem-B wrote:

The last two ifs can be collapsed into one. Also LLVM style is to drop `{}` around single-statement bodies.


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


More information about the llvm-commits mailing list