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

Roland Froese via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 29 14:51:29 PST 2021


RolandF added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp:1398
+    // will flush a full pipeline about half the time.
+    // The cost when this happens is about 80 cycles.
+    return P9PipelineFlushEstimate / 2;
----------------
bmahjour wrote:
> RolandF wrote:
> > I don't follow this reasoning.  Maybe 64-bit data is aligned half the time, but how is that true for char data for instance?
> Does this sound better?
> ```
> return P9PipelineFlushEstimate / ((Alignment/8) + 1);
> ```
> It would also be an equivalent of saying:
> ```
> return ((Alignment == 8) ? P9PipelineFlushEstimate / 2 : P9PipelineFlushEstimate);
> ```
> unless we cast the values to float in that formula. Any other suggestion?
I think that it makes sense to use float.  Something like

Misaligned = (NumElements - 1) / NumElements
Result = Misaligned * P9PipelineFlushEstimate + (1 - Misaligned) * Cost

The present calculation I think implies that the aligned cost is zero.


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