[PATCH] D109417: Cost model for VPMemory operations on PowerPC.

Roland Froese via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 13:14:27 PST 2021


RolandF added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp:1400
+
+    float AlignmentProb = (float)(Alignment.value() - 1) / Alignment.value();
+    float MisalignmentProb = 1.0 - AlignmentProb;
----------------
I like this approach better.  But I think the AlignmentProb calculation is incorrect.  This would calculate 0% aligned for align 1 and 7/8 aligned for align 8 instead of 50%.  If you want to key off alignment rather than number of elements then I think you want to do size / alignment to figure out the number of possible offsets and use that to calculate probability.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109417



More information about the llvm-commits mailing list