This is an archive of the discontinued LLVM Phabricator instance.

[TTI][AArch64] getMemoryOpCost for ptr types
ClosedPublic

Authored by SjoerdMeijer on Dec 16 2022, 1:29 AM.

Details

Summary

Opaque ptr types have a size in bits of 0. The legalised type is an i64 or vector of i64s, which do have size. Because of this difference in size, target hook getMemoryOpCost modelled stores of ptr types as extending/truncating load/stores. Now we just check for opaque ptr types and return the legalised cost. This makes stores of pointers cheaper, and as a result we now SLP vectorise the changed test case.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Dec 16 2022, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2022, 1:29 AM
SjoerdMeijer requested review of this revision.Dec 16 2022, 1:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 16 2022, 1:29 AM
dmgreen accepted this revision.Dec 16 2022, 6:56 AM

It could use the datalayout to get a better size, but this sounds OK to me. LGTM

This revision is now accepted and ready to land.Dec 16 2022, 6:56 AM

Thanks Dave. I am going to look more into this area (for different cases), so will take that into account.

This revision was landed with ongoing or failed builds.Dec 16 2022, 7:38 AM
This revision was automatically updated to reflect the committed changes.