<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><br></div><div>On Feb 7, 2013, at 6:22 AM, Renato Golin <<a href="mailto:renato.golin@linaro.org">renato.golin@linaro.org</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div>On 7 February 2013 05:55, Nadav Rotem <span dir="ltr"><<a href="mailto:nrotem@apple.com" target="_blank">nrotem@apple.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>I am not sure that its worth modeling this because it only affects the latency and not the throughput of the machine. </div>
</div></blockquote><div><br></div><div style="">It seems like penalizing the insertion into a D-subregister is getting out of hand. This is likely to occur when dealing with relative numbers (like instruction costs), so I'm not particularly excited about this patch, either. I'm also not unhappy, so if there is a tangible benefit, by all means...</div></div></div></div></blockquote><div><br></div><div>I agree with you, it is unfortunate. However, I am trying to model an idiosyncrasy of the processor that has a big implication on performance. It is very expensive on swift if you happen to load into a S register, or D sub lane. Two such instructions are not pipelined but sequentialized.</div><div><div> </div><div> // Penalize inserting into an D-subregister.</div><div>  if (ST->isSwift() &&</div><div>      Opcode == Instruction::InsertElement &&</div><div>      ValTy->isVectorTy() &&</div><div>      ValTy->getScalarSizeInBits() <= 32)</div><div>    return 3;</div></div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div style=""><br></div><div style="">Some specific questions:</div><div><br></div><div><div>+      if (Stride > 0)</div><div>+        return Cost;</div><div><br></div><div>Can the stride ever be zero?</div></div></div></div></div></blockquote><div><br></div><div><br></div><div>Stride has the value of the isConsecutivePtr method:</div><div><br></div><div>  /// 0 - Stride is unknown or non consecutive.</div><div>  /// 1 - Address is consecutive.</div><div>  /// -1 - Address is consecutive, and decreasing.</div><div>  int isConsecutivePtr(Value *Ptr);</div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div><br></div><div>
<div>-    return 2;</div><div>+    return 3;</div><div><br></div><div>This seems arbitrary (I know it's not but), would be good to have them exposed as function calls, for instance, getAddressComputationCost() + whatever.</div>
</div></div><div><br></div></div></div></div></blockquote><div><br></div><div>This code comes from:</div><div><br></div><div><div>unsigned ARMTTI::getVectorInstrCost(unsigned Opcode, Type *ValTy,</div><div>                                    unsigned Index) const {</div><div>  // Penalize inserting into an D-subregister.</div><div>  if (ST->isSwift() &&</div><div>      Opcode == Instruction::InsertElement &&</div><div>      ValTy->isVectorTy() &&</div><div>      ValTy->getScalarSizeInBits() <= 32)</div><div>    return 3;</div><div><br></div><div>  return TargetTransformInfo::getVectorInstrCost(Opcode, ValTy, Index);</div><div>}</div></div><div><br></div><div>I don't think we need a function call for the value 3 here. It is a value just like any other that is returned by TTI.</div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div style="">cheers,</div><div style="">--renato</div></div></div></div>
</blockquote></body></html>