This is an archive of the discontinued LLVM Phabricator instance.

[VE] VEC_BROADCAST, lowering and isel
ClosedPublic

Authored by simoll on Nov 17 2020, 10:34 AM.

Details

Summary

This defines the vec_broadcast SDNode along with lowering and isel code.
We also remove unused type mappings for the vector register classes (all vector MVTs that are not used in the ISA go).

We will implement support for short vectors later by intercepting nodes with illegal vector EVTs before LLVM has had a chance to widen them.

Diff Detail

Event Timeline

simoll created this revision.Nov 17 2020, 10:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2020, 10:34 AM
simoll requested review of this revision.Nov 17 2020, 10:34 AM
kaz7 added inline comments.Nov 18 2020, 3:31 AM
llvm/lib/Target/VE/VEISelLowering.cpp
1394

Doesn't NumEls work instead of EC?

llvm/lib/Target/VE/VEInstrPatternsVec.td
37

You can use simm7 or simm7fp here to generate VBRDil directly.

llvm/test/CodeGen/VE/Vector/vec_broadcast.ll
3

Better to add more test like using not only integer variables but also integer/float immediate values and few more test which is not working atm but may work in the future, e.g. 128 length vector and char 256 length vector.

simoll updated this revision to Diff 306099.Nov 18 2020, 7:04 AM
simoll marked an inline comment as done.
  • Added immediate patterns and tests
  • Addressed comments
simoll updated this revision to Diff 306111.Nov 18 2020, 8:01 AM
simoll marked 2 inline comments as done.
  • Add isel and tests for vbrd-with-immediate.
  • Added <128 x i16>, <256 x i16>, <128 x i32> broadcast tests to show promotion, widening and scalarization.
simoll edited the summary of this revision. (Show Details)Nov 18 2020, 8:02 AM
kaz7 added a comment.Nov 18 2020, 3:09 PM

Thank you for updates.

llvm/lib/Target/VE/VEInstrPatternsVec.td
38

You can make similar VBRDil pattern for 64 bits immediate values here. I think it worth to do since we often uses vbrd 0 or vbrd 1.

simoll updated this revision to Diff 306329.Nov 19 2020, 12:37 AM

Added i64,f64 immediate patterns and tests

kaz7 accepted this revision.Nov 19 2020, 12:39 AM

Thanks. LGTM.

This revision is now accepted and ready to land.Nov 19 2020, 12:39 AM
This revision was landed with ongoing or failed builds.Nov 19 2020, 12:45 AM
This revision was automatically updated to reflect the committed changes.