[PATCH] D27518: Moving isComplex decision to TTI
Michael Kuperstein via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 9 13:38:11 PST 2016
mkuper added a comment.
In https://reviews.llvm.org/D27518#618646, @Ayal wrote:
> In https://reviews.llvm.org/D27518#616355, @mkuper wrote:
>
> > I have some comments on the patch, but on a higher level, I'm not sure this is the right way to do this.
> > The only place that'll call this new TTI hook will be isLikelyComplexAddressComputation(), and the only thing we do with the result of isLikelyComplexAddressComputation() is feed it into a different TTI hook - TTI.getAddressComputationCost().
> >
> > Perhaps we can enhance getAddressComputationCost() instead of adding another hook?
>
>
> Yes we can, by passing it the (possibly Optional<>) APStrideVal instead of the current boolean "IsComplexComputation", and folding the "how expensive are certain stride values" logic from isLikelyComplexAddressComputation() down to getAddressComputationCost().
Yes, I think that would be a better design. (Disagreement is welcome. :-) )
> In any case this logic should best be target dependent, right?
I think so - I'm not familiar with addressing modes of other targets, but I think it makes a lot of sense for the logic to be target dependent.
https://reviews.llvm.org/D27518
More information about the llvm-commits
mailing list