[llvm] [LV] Drop the mask of a predicated store masked by the header mask. (PR #201676)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 7 11:23:40 PDT 2026


================
@@ -1478,6 +1478,25 @@ static void simplifyRecipe(VPSingleDefRecipe *Def) {
       PredPHI->replaceAllUsesWith(Op);
   }
 
+  // Drop the mask of a predicated store masked by the header mask (which is
+  // guaranteed to be true at least for the first lane) and both the stored
+  // value and the address are uniform across VF and UF.
+  if (auto *RepR = dyn_cast<VPReplicateRecipe>(Def);
+      RepR && RepR->isPredicated() && RepR->getOpcode() == Instruction::Store &&
+      all_of(
+          drop_end(RepR->operands()),
+          [](VPValue *Op) { return vputils::isUniformAcrossVFsAndUFs(Op); }) &&
----------------
fhahn wrote:

done thanks

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


More information about the llvm-commits mailing list