This is an archive of the discontinued LLVM Phabricator instance.

[ARM] remove cost-kind predicate for math op costs
ClosedPublic

Authored by spatel on Nov 3 2020, 9:09 AM.

Details

Summary

I'm not sure if this matches the suggestion from D90554, but it's based on the same idea that I am using for the basic model implementation and what I have partly already done for x86: throughput cost is number of instructions/uops, so size/blended costs are identical except in special cases (for example, fdiv or other always-known-expensive machine instructions).

That said, I have no clue about the accuracy of the ARM subtarget variations seen in the cost tests or whether the functional diffs are good or bad.

Diff Detail

Event Timeline

spatel created this revision.Nov 3 2020, 9:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 3 2020, 9:09 AM
spatel requested review of this revision.Nov 3 2020, 9:09 AM

The MVECostFactor should probably be 1 for codesize. I'm not 100% sure on Neon code, FunctionCallDivCost looks dubious, but I'm more worried about the MVE costs.

I was surprised to see this effect so much. I had it in my head that more things were using Recip costing.

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp
1245–1246

Can you change this to 1 under size.

spatel updated this revision to Diff 302636.Nov 3 2020, 11:23 AM
spatel marked an inline comment as done.

Patch updated:
Adjusted base cost for non-codesize cost of MVE instructions (let me know if the code comment is accurate or needs work).

dmgreen accepted this revision.Nov 3 2020, 1:02 PM

Thanks. LGTM

This revision is now accepted and ready to land.Nov 3 2020, 1:02 PM
This revision was automatically updated to reflect the committed changes.