[PATCH] D30364: AArch64 : Add PreferCSEL feature for Exynos-M3.

Evandro Menezes via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 2 13:11:24 PST 2017


Hi, James.

I think that the question here is if a Pat should be gated by a 
SubtargetFeature.  As Renato pointed out to me, Pat is also used by the 
assembler, so, when using one to optimize code, it also ends up 
optimizing assembly source code, which is not desirable.

Not that a Pat should never be used to result in better code, but if the 
the logic needs to be even slightly complex, perhaps it should be moved 
to TargetLowering, where not only is complex logic more legible in C++ 
than in TableGen, but it's also possible to access other resources more 
easily, such as the cost model, in order to make the best decision when 
lowering to the target.

Something along these lines could help us abusing SubtargetFeature after 
we decided to refrain from abusing isTarget().

Cheers,

-- 
Evandro Menezes

On 03/01/2017 02:24 AM, James Molloy via Phabricator wrote:
> jmolloy added a comment.
>
> Hi Renato,
>
>>    If it does, but the cost is bad (for whatever reason), this really really should be in the cost model...
> For my own understanding - how does the cost model impact the choices ISel makes? I didn't think it could. Or are you saying *in addition to* disabling the relevant Pat<>s with a feature, this should *also* be reflected in the cost model?
>
> James
>
>
> https://reviews.llvm.org/D30364
>
>
>
>
>



More information about the llvm-commits mailing list