[llvm] [VPlan] Add initial VPScalarEvolution, use to get trip count SCEV (NFC) (PR #94464)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 13:24:39 PDT 2024


================
@@ -45,6 +50,11 @@ inline bool isUniformAfterVectorization(const VPValue *VPV) {
 
 /// Return true if \p V is a header mask in \p Plan.
 bool isHeaderMask(const VPValue *V, VPlan &Plan);
+
+/// Return the SCEV expression for \p V. Returns SCEVCouldNotCompute if no
+/// SCEV expression could be constructed.
+const SCEV *getSCEVExprForVPValue(VPValue *V, ScalarEvolution &SE);
+
----------------
ayalz wrote:

This complements `getOrCreateVPValueForSCEVExpr()` above and should be placed next to it.
(Otherwise would have suffice to call it getSCEVFor() or getSCEV(), as it currently delegates to SE.getSCEV() or SCEVExpandRecioe.getSCEV(). Could even have `getOrCreateSCEVExprForVPValue()` more consistently, but getSCEV() may typically create them - in contrast to getExistingSCEV().)

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


More information about the llvm-commits mailing list