This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add getCFInstrCost, treat branches as free for throughput.
ClosedPublic

Authored by fhahn on Jun 29 2020, 3:56 AM.

Details

Summary

D79164/2596da31740f changed getCFInstrCost to return 1 per default.
AArch64 did not have its own implementation, hence the throughput cost
of CFI instructions is overestimated. On most cores, most branches should
be predicated and essentially free throughput wise.

This restores a 9% performance regression on a SPEC2006 benchmark on
AArch64 with -O3 LTO & PGO.

This patch effectively restores pre 2596da31740f behavior for AArch64
and undoes the AArch64 test changes of the patch.

Diff Detail

Event Timeline

fhahn created this revision.Jun 29 2020, 3:56 AM
samparker accepted this revision.Jun 29 2020, 4:25 AM

LGTM - and sorry for causing trouble.

This revision is now accepted and ready to land.Jun 29 2020, 4:25 AM
This revision was automatically updated to reflect the committed changes.