Power9 has instructions to implement the semantics of SIGN_EXTEND_INREG for vector type. Mark it as legal and add the match pattern.
Details
- Reviewers
nemanjai jsji hfinkel shchenz - Group Reviewers
Restricted Project - Commits
- rGa4cc895aee3b: [PowerPC] Implement the vector extend sign instruction pattern match Power9 has…
Diff Detail
Event Timeline
llvm/test/CodeGen/PowerPC/vector-extend-sign.ll | ||
---|---|---|
3 | I think it would be better to separate the run lines so it is not over 80 characters. |
llvm/test/CodeGen/PowerPC/vector-extend-sign.ll | ||
---|---|---|
3 | Done. |
llvm/lib/Target/PowerPC/PPCInstrVSX.td | ||
---|---|---|
4305 | I don't really see a reason to put this into PPCInstrVSX.td. Seems like PPCInstrAltivec.td would be a more appropriate place for it. |
llvm/lib/Target/PowerPC/PPCInstrVSX.td | ||
---|---|---|
4305 | Hmm, make sense. It is interesting that, we put the match pattern from build_vector to VEXTSB2D here too ... |
LGTM considering patterns added for SIGN_EXTENDED_INREG also follow its atomic semantics.
Thanks for this exploitation. LGTM too.
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
---|---|---|
933 | Do we need these lines? The default action is Legal. If this is necessary, then maybe we need another NFC patch to add operation action for ISD::SIGN_EXTEND_INREG for type {i8, i16, i32} to make actions for ISD::SIGN_EXTEND_INREG be consistent? Up to you to change it or not. |
llvm/lib/Target/PowerPC/PPCISelLowering.cpp | ||
---|---|---|
933 | Explicit specify it to legal didn't hurt anything, I think. And we have another patch to specify the default action for SIGN_EXTEND_INREG as Expand for vector type. |
Do we need these lines? The default action is Legal. If this is necessary, then maybe we need another NFC patch to add operation action for ISD::SIGN_EXTEND_INREG for type {i8, i16, i32} to make actions for ISD::SIGN_EXTEND_INREG be consistent? Up to you to change it or not.