This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Implement fewerElementsVector for shifts
ClosedPublic

Authored by arsenm on Jan 30 2019, 2:48 PM.

Details

Summary

Introduce a new function which handles instructions with multiple type
indices, but have the same number of vector elements.

Also legalize v2s16 shifts when applicable.

Diff Detail

Event Timeline

arsenm created this revision.Jan 30 2019, 2:48 PM
aemerson added inline comments.Feb 1 2019, 4:04 PM
include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
161

type type

lib/CodeGen/GlobalISel/LegalizerHelper.cpp
1761

I'm finding it difficult to tell exactly what this function is trying to do. Can we have some comments throughout to explain what each phase is trying to achieve, with a small example if it's not clear enough from prose.

1795

We can return 0 here to fall back instead of dying.

arsenm marked 2 inline comments as done.Feb 5 2019, 9:16 AM
arsenm added inline comments.
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
1795

Is it OK I fa failed legalization created dead instructions?

arsenm marked an inline comment as done.Feb 5 2019, 9:50 AM
arsenm added inline comments.
lib/CodeGen/GlobalISel/LegalizerHelper.cpp
1795

This should also consistently fail along with getNarrowTypeBreakDown, previously checked

arsenm updated this revision to Diff 185338.Feb 5 2019, 9:51 AM

Try to add better comments and rename function

aemerson accepted this revision.Feb 6 2019, 3:20 PM

Thanks, it looks better now.

lib/CodeGen/GlobalISel/LegalizerHelper.cpp
1795

If legalization fails then the resulting MF is usually invalid and deleted anyway.

This revision is now accepted and ready to land.Feb 6 2019, 3:20 PM
arsenm closed this revision.Feb 7 2019, 9:37 AM

r353432