<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Jun 20, 2016 at 2:42 PM Renato Golin <<a href="mailto:renato.golin@linaro.org">renato.golin@linaro.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 20 June 2016 at 21:50, Eric Christopher via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
> So, why are all of the processors given as SubtargetFeatures as well as<br>
> processors? This seems ... less than optimal. I.e. I can't come up with a<br>
> reason I'd want to say "llc -mattr=+vulcan" rather than llc -mcpu=vulcan.<br>
<br>
Those features are not only for llc -mattr, but they define what<br>
features a target will have and it's a convenient way to group things<br>
together without specifying Target.isCortexA53().<br>
<br></blockquote><div><br></div><div>OK... this in particular isn't a great reason (there's an actual good one below :)</div><div><br></div><div><div>The best thing is to define concats perhaps the way that the PPC backend does it. </div><div><br></div><div>Something like this for example:</div><div><br></div><div>def ProcessorFeatures {</div><div>  list<SubtargetFeature> Power7FeatureList =</div></div><div><br></div><div>I'd definitely much rather you take the core ISAs perhaps as features and then add extensions on top of that as additional subtarget features. Would probably be pretty clean as well.</div><div><span style="line-height:1.5"> </span><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Maybe it could be done in a different way, but this has been the way<br>
for a long time now, and AArch64 only copied from ARM. :)<br>
<br></blockquote><div><br></div><div>This is a good explanation though ;)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I don't think anyone does (or should) use it in -mattr anyway. Maybe<br>
mattr is another candidate for using the target parser...<br></blockquote><div><br></div><div><span style="line-height:1.5">Definitely shouldn't be used.</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">That said, one way I've seen these sorts of things being used is via ST->isCPUX() for TTI and a few other things which is fairly valid. We might need a better way of doing that, basically defining the name of the cpu as a subtarget feature is a bit wonky really.</span></div><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">-eric </span><br></div></div></div>