This is an archive of the discontinued LLVM Phabricator instance.

[VE] Update shift operation instructions
ClosedPublic

Authored by kaz7 on Apr 19 2020, 8:35 PM.

Details

Summary

Changing all mnemonic to match assembly instructions to simplify mnemonic
naming rules. This time update all shift operation instructions. This also
corrects instruction's operation kinds.

Diff Detail

Event Timeline

kaz7 created this revision.Apr 19 2020, 8:35 PM

LGTM for the most part. One comment inline.

llvm/lib/Target/VE/VEInstrInfo.td
1083

Couldn't we just use LLVM's expansion legalizer for sext_inreg instead of specifying a pattern here? If not, then this comment should be removed.

kaz7 marked an inline comment as done.Apr 20 2020, 8:08 PM
kaz7 added inline comments.
llvm/lib/Target/VE/VEInstrInfo.td
1083

Thank you for comments. Using LLVM's expansion legalizer generates not optimized instructions sometimes. For example, %2 = trunc i64 %0 to i8 becomes following instructions:

adds.w.sx %s0, %s0, (0)1
sla.w.sx %s0, %s0, 24
sra.w.sx %s0, %s0, 24

instead of instructions generated by current patterns:

sll %s0, %s0, 56
sra.l %s0, %s0, 56

It may be possible to expand them based on 64 bit registers using default legalizer, but I'm not sure how to do that.

simoll accepted this revision.Apr 22 2020, 12:08 AM

Thx!

This revision is now accepted and ready to land.Apr 22 2020, 12:08 AM
This revision was automatically updated to reflect the committed changes.