This is an archive of the discontinued LLVM Phabricator instance.

[CostModel] Unify getCastInstrCost
ClosedPublic

Authored by samparker on May 13 2020, 4:13 AM.

Details

Summary

As a step towards removing getInstructionCost in D79483. Add the remaining cast instruction opcodes to the base implementation of getUserCost and directly return the result. This allows getInstructionThroughput to return getUserCost for the casts. This has required changes to PPC and SystemZ because they implement getUserCost and/or getCastInstrCost with adjustments for vector operations.

Diff Detail

Event Timeline

samparker created this revision.May 13 2020, 4:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2020, 4:13 AM
samparker retitled this revision from [CostModel] Unify getCastInstrCost to [NFCI][CostModel] Unify getCastInstrCost.May 20 2020, 6:35 AM

ping.

dfukalov accepted this revision.May 21 2020, 2:33 AM
This revision is now accepted and ready to land.May 21 2020, 2:33 AM
samparker retitled this revision from [NFCI][CostModel] Unify getCastInstrCost to [CostModel] Unify getCastInstrCost.May 26 2020, 3:33 AM

I made a change before committing, so that all the backends that calculate the cost will do an adjustment for non-throughput costs. So, hopefully most backends won't be affected by this change other than finding free fp/int conversions.

This revision was automatically updated to reflect the committed changes.