This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Implement getArithmeticReductionCost
ClosedPublic

Authored by mssimpso on Mar 14 2018, 12:40 PM.

Details

Summary

This patch provides an implementation of getArithmeticReductionCost for AArch64. We can specialize the cost of add reductions since they are computed using the 'addv' instruction.

Diff Detail

Repository
rL LLVM

Event Timeline

mssimpso created this revision.Mar 14 2018, 12:40 PM

Do you intend to consider AArch64TTIImpl::getMinMaxRdxCost() too?

Do you intend to consider AArch64TTIImpl::getMinMaxRdxCost() too?

Yes, I'm planning to implement getMinMaxRdxCost in a follow-on patch.

samparker accepted this revision.Mar 15 2018, 2:23 AM

I'm happy to see this! LGTM with just one small comment, no need to re-review. Thanks!

lib/Target/AArch64/AArch64TargetTransformInfo.cpp
911 ↗(On Diff #138438)

You could perform the IsPairwise check at the beginning of the function to exit early.

This revision is now accepted and ready to land.Mar 15 2018, 2:23 AM

I'm happy to see this! LGTM with just one small comment, no need to re-review. Thanks!

Thanks, Sam!

lib/Target/AArch64/AArch64TargetTransformInfo.cpp
911 ↗(On Diff #138438)

Yes, will do!

This revision was automatically updated to reflect the committed changes.