[PATCH] D29631: SystemZTargetTransformInfo cost functions and some common code changes

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 15:27:32 PDT 2017


uweigand added inline comments.


================
Comment at: lib/Target/SystemZ/SystemZTargetTransformInfo.cpp:758
+    // Give a slight penalty for moving out of vector pipeline to FXU unit.
+    if (Index == 0 && Val->getScalarType()->isIntegerTy())
+      Cost += 1;
----------------
jonpa wrote:
> uweigand wrote:
> > Why just index == 0 ? Shouldn't the penalty apply to any element?
> While the extraction of any element still has a modeled cost of 1 per element, my idea with this is to penalize further the delay of the act of moving out of the vector pipeline. This would then not be per element, but rather for the whole vector register (thus added only once, at index 0). My assumption is that this happens at the point of scalarization, when all vector elements are extracted.
Why would this not be per element?   Moving from the vector to the integer pipeline always has the higher latency, for every element.  In the end any such extracton gets implemented using a VLVG* instruction, which simply is more expensive than other vector instructions ...  (Note that in the scheduler, the higher latency for VLVG* is already modeled correctly.)


https://reviews.llvm.org/D29631





More information about the llvm-commits mailing list