<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 23, 2015 at 1:51 PM, Akira Hatanaka <span dir="ltr"><<a href="mailto:ahatanak@gmail.com" target="_blank">ahatanak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Tue, Jun 23, 2015 at 1:21 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><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 dir="ltr"><br><br><div class="gmail_quote"><span><div dir="ltr">On Tue, Jun 23, 2015 at 12:03 PM Akira Hatanaka <<a href="mailto:ahatanak@gmail.com" target="_blank">ahatanak@gmail.com</a>> wrote:<br></div><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 22, 2015 at 2:00 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><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 dir="ltr"><br><br><div class="gmail_quote"><span><div dir="ltr">On Mon, Jun 22, 2015 at 1:49 PM Akira Hatanaka <<a href="mailto:ahatanak@gmail.com" target="_blank">ahatanak@gmail.com</a>> wrote:<br></div><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">In <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10414-23191915&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n3fppnvOfR0oMESPRmcmK0iA3QRj3TRYLokEQIxmS5o&s=wZ7Qg93uIn9FKrrCr9-zB6I-Hi0gNjgHECvA14rcMEQ&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10414#191915</a>, @echristo wrote:<br>
<br>
> Another possibility is that this gets mapped as a normal command line option passed into cc1 and then it can just be a subtarget feature?<br>
<br>
<br>
Would it look something like this in the IR?<br>
<br>
"target-features"="+neon,+vfp3,arn-restrict-it=false"<br></blockquote><div><br></div></span><div>was thinking of more just:</div><div><br></div><div>"target-features"="+neon,+vfp3,-restrict-it"</div><div><br></div><div>Though if we're going for "restrict-it" blocks perhaps a better name that works well with +/-?</div><div><br></div><div>I've generally stayed away from turning command line options into features, but in the case of something that appears to turn on actual code generation features it seems like it might be reasonable.</div><span><font color="#888888"><div><br></div></font></span></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Since restrict-it is a tri-state, I think you'll have to define two new subtarget features in ARM.td (see the attached patch). I'm not sure how prefixing "restrict-it" by "-" is going to work.</div></div></div></div></blockquote><div><br></div></span><div>I think default is a red herring here a bit. It's either on or off right now, we might have to bake in some back end knowledge in the front end about when to apply it, but it should still work out yes?</div><span><div><br></div></span></div></div></blockquote><div><br></div></span><div>Yes, we'll have to know whether "restrict-it" or "no-restrict-it" was passed on command line and whether v8 is supported.</div><span><div><br></div></span></div></div></div></blockquote><div><br></div><div>As per your suggestion, I added one feature in ARM.td and then fixed getARMTargetFeatures in lib/Driver/Tools.cpp to push feature "+restrict-it" to the feature list based on the subarch.</div><div><br></div><div>It seems to me that we can add code-gen options to the IR as subtarget features in most cases, but it's not clear to me when to use function attributes and when to use subtarget features. Should we convert target-specific code-gen options into subtarget features whenever it is possible to do so, and  convert target-independent options into function attributes?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><div></div><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 dir="ltr"><div class="gmail_quote"><span><div></div><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>This approach can potentially create larger numbers of subtarget objects as two subtarget objects have to be created If one function has feature "restricted-it" and another has feature "no-restricted-it". If we take the approach in my original patch, we need only one subtarget object. Do you think that's going to be a problem?<br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div></div></div></div></blockquote><div><br></div></span><div>Irrespective of the above I'm not too worried about this. In general, people have a tendency to use the same command line options everywhere, especially for this sort of thing.</div><span><font color="#888888"><div><br></div></font></span></div></div></blockquote><div><br></div></span><div>I would think so too.</div><span><div><br></div><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 dir="ltr"><div class="gmail_quote"><span><font color="#888888"><div></div><div>-eric</div></font></span><span><div> </div><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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><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 dir="ltr"><div class="gmail_quote"><span><font color="#888888"><div></div><div>-eric</div></font></span><span><div> </div><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">
<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10414&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n3fppnvOfR0oMESPRmcmK0iA3QRj3TRYLokEQIxmS5o&s=1_Goj_y3qVhK1tupXdvQXfyTGBXgHbX5pyqs6HAks98&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10414</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=n3fppnvOfR0oMESPRmcmK0iA3QRj3TRYLokEQIxmS5o&s=c_FTdqcFhN_afQXPZlO8SYrZEIBY45hevC6x084TeCM&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</blockquote></span></div></div>
</blockquote></div></div></div></blockquote></span></div></div>
</blockquote></span></div><br></div></div>
</blockquote></div><br></div></div>