This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] Update P9 vector costs for insert/extract element
ClosedPublic

Authored by RolandF on Apr 2 2019, 3:45 PM.

Details

Summary

The PPC vector cost model values for insert/extract element reflect older processors that lacked vector insert/extract instructions and move-to/move-from VSR instructions. Update getVectorInstrCost to give appropriate values for when the newer instructions are present.

Diff Detail

Repository
rL LLVM

Event Timeline

RolandF created this revision.Apr 2 2019, 3:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2019, 3:45 PM
jsji added a comment.Apr 15 2019, 12:09 PM

Some comments related to testcases.

llvm/test/Analysis/CostModel/PowerPC/p9.ll
2 ↗(On Diff #193377)

Can we have another NFC patch to rename the check-prefixes to avoid confusion.

Now CHECK default to P7, while CHECK-P8 is for P8 LE, CHECK-P9 is for P9 BE, CHECK-LE is for P9 LE.

Maybe CHECK-P7, CHECK-P8LE, CHECK-P9BE, CHECK-P9LE would be better?

Also maybe use multiple prefixes to check common ones, so that we don't need too many duplicates.
eg: --check-prefixes=CHECK,CHECK-P7 for P7,
--check-prefixes=CHECK,CHECK-P8LE for P8 LE.

45 ↗(On Diff #193377)

Maybe it would be better to move all insert/extract to insert_extract.ll?

And also rename this file to something like vector_unit.ll other than p9.ll?

RKSimon added inline comments.
llvm/test/Analysis/CostModel/PowerPC/p9.ll
2 ↗(On Diff #193377)

Not sure if you're interested, but you can use llvm\utils\update_analyze_test_checks.py to automatically generate cost checks to reduce manual labour.

jsji added inline comments.Apr 16 2019, 10:56 AM
llvm/test/Analysis/CostModel/PowerPC/p9.ll
2 ↗(On Diff #193377)

Good suggestion, Thanks Simon!

nemanjai accepted this revision.Apr 22 2019, 6:58 AM

The logic LGTM. Please address the test case updates requested by Jinsong. I don't think this requires another revision though.

This revision is now accepted and ready to land.Apr 22 2019, 6:58 AM
This revision was automatically updated to reflect the committed changes.