Page MenuHomePhabricator

[PowerPC] Exploiting to use mtvsrdd instruction when save called-saved GPR register to VSR registers
Needs RevisionPublic

Authored by wuzish on May 28 2019, 8:21 PM.

Details

Summary

Make an exploiting to use mtvsrdd instruction when save called-saved GPR registers to VSR registers.
Because mtvsrdd can save two GPRs together at one time and make the space/time more efficient.

Diff Detail

Event Timeline

wuzish created this revision.May 28 2019, 8:21 PM
wuzish added a reviewer: jsji.May 28 2019, 8:22 PM
jsji added inline comments.Jun 10 2019, 2:49 PM
llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
2134

The comment are comparing to old implementation? This is unnecessary?

2142

No need to check hasP9Vector() here, we already early exit above when !Subtarget.hasP9Vector() in line 2107.

2152

Similar to above, we only enable spill to VSR for P9, so no need to check here.

2185

Can this be a lamda or function?

2190

Please add comments about the mapping from GPR to VSR?

2256

Do we want to save the two GPRs in the order of endian order? or maybe fixed litten endian?

2266

Never use assert(0...), that's what llvm_unreachable is for.

2430

Maybe the order here should be align with the restore order?

2440

Never use assert(0), that's what llvm_unreachable is for.

llvm/lib/Target/PowerPC/PPCFrameLowering.h
32

several GPRs? 1 or 2?

llvm/test/CodeGen/MIR/PowerPC/prolog_vec_spills.mir
16

Please add comments about checking points.

23

It looks weird to have x14 before x15, although they should be the same.

jsji requested changes to this revision.Jun 25 2019, 9:17 AM
This revision now requires changes to proceed.Jun 25 2019, 9:17 AM