Page MenuHomePhabricator

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

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



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

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.


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.


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.

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

jsji added inline comments.Apr 16 2019, 10:56 AM

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.