[llvm] [LLVM][SCEV] udiv (mul nuw a, vscale), (mul nuw b, vscale) -> udiv a, b (PR #157836)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 1 04:25:06 PDT 2025


================
@@ -3598,6 +3598,12 @@ const SCEV *ScalarEvolution::getUDivExpr(const SCEV *LHS,
     }
   }
 
+  // udiv (mul nuw a, vscale), (mul nuw b, vscale) --> udiv a, b
----------------
paulwalker-arm wrote:

I plan to circle back, but am currently blocked by what I thought would be a trivial change to report vscale as being known positive that somehow causes loop-strength-reduce to generate worse code.

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


More information about the llvm-commits mailing list