[llvm] [LV] Vectorize predicated loop-invariant loads via masked load + broadcast (PR #200361)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 06:55:53 PDT 2026


================
@@ -3847,6 +3847,116 @@ void VPlanTransforms::hoistPredicatedLoads(VPlan &Plan,
   }
 }
 
+static cl::opt<bool> EnableMaskedInvariantLoad(
+    "enable-masked-invariant-load", cl::init(false), cl::ReallyHidden,
+    cl::desc("Rewrite predicated loads from loop-invariant addresses as a "
+             "single-lane masked load + broadcast"));
----------------
artagnon wrote:

Best not to gate it, I think -- we already have a cost computation, so it should always be profitable, and hence a strict improvement?

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


More information about the llvm-commits mailing list