<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 15, 2014, at 4:57 PM, Filipe Cabecinhas <<a href="mailto:filcab+llvm.phabricator@gmail.com">filcab+llvm.phabricator@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Hi Nadav,<div><br></div><div>I'm not very familiar with the cost model part, but I couldn't find proper places that I have to change:</div><div>I'm assuming you're talking about getCmpSelInstrCost() in X86TargetTransformInfo, is this right?</div></div></blockquote><div><br></div>Yes.</div><div><br><blockquote type="cite"><div dir="ltr">
<div><br></div><div>If so, the function only seems to get the types of the instruction's condition and result, not the proper arguments.</div><div>If we don't get the arguments, we can't be sure if this will be a cheap select.</div></div></blockquote><div><br></div><div>Yes. Another problem that we have is that we don’t know if the arguments are constant or not. There is a tradeoff here between having a small implementation that does not duplicate the entire codegen and between the accuracy of the cost model. </div><br><blockquote type="cite"><div dir="ltr">
<div><br></div><div>Even with that, the BaseTargetTransformInfo only cares about nodes set to Expand. All other nodes' cost (Legal, Custom, Promote) are the type legalization cost + 1 (BasicTargetTransformInfo.cpp:445).</div>
<div>X86TargetTransformInfo.cpp:576 has the X86 specialization, but this one just adds what's on the cost table to the type legalization. I don't think it's really needed to add cost table entries just to, in the end, have the same behaviour as we now have.</div></div></blockquote><div><br></div><div>Okay, in that case we don’t need to change anything.   </div><br><blockquote type="cite"><div dir="ltr">
<div><br></div><div>I also added a test for the costs to lower a vselect, since we had none. But I can commit it without the table changes.</div></div></blockquote><div><br></div><div>Sounds good. Thank you for working on this and for improving our vselect code generation. </div><br><blockquote type="cite"><div dir="ltr"><div>What do you think? I have the tables ready to commit anyway, but I don't think we need to.<br>
</div><div><br></div><div> Filipe</div><div><br></div><div><br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 14, 2014 at 2:49 PM, Nadav Rotem <span dir="ltr"><<a href="mailto:nrotem@apple.com" target="_blank">nrotem@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">Excellent. Please update the cost model as well.<br>
<br>
Thanks :)<br>
<br>
</div><a href="http://reviews.llvm.org/D3752" target="_blank">http://reviews.llvm.org/D3752</a><br>
<br>
<br>
</blockquote></div><br></div>
</blockquote></div><br></body></html>