[llvm] [LV] Add vplan folds for urem(X, PowerOf2) -> and(X, PowerOf2 - 1) (PR #212198)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 02:38:58 PDT 2026


================
@@ -1366,6 +1366,15 @@ static void simplifyRecipe(VPSingleDefRecipe *Def) {
   }
 
   const APInt *APC;
+  // TODO: Enable optimizations in the vector preheader in a follow-up PR.
+  // This check currently means we only simplify before region dissolution.
+  VPBasicBlock *Preheader = Plan->getVectorPreheader();
----------------
lukel97 wrote:

I'm guessing the slowdown is because we're checking for the vector preheader which involves a DFS. But this should go away after the follow-up right?

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


More information about the llvm-commits mailing list