[PATCH] D147720: [LV] Use the known trip count when costing non-tail folded VFs

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 06:46:35 PDT 2023


david-arm added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5368
+    auto RTCostA =
+        A.Width.getFixedValue()
+            ? (CostA * divideCeil(MaxTripCount, A.Width.getFixedValue()))
----------------
Hi @dmgreen, perhaps I've missed something here but it looks like there is a divide-by-zero in the code?

If `A.Width.getFixedValue()` is non-zero then we calculate `(CostA * divideCeil(MaxTripCount, A.Width.getFixedValue()))`, and if it is zero then we do `(CostA * (MaxTripCount / A.Width.getFixedValue()) + ...`




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147720/new/

https://reviews.llvm.org/D147720



More information about the llvm-commits mailing list