This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Implement narrowScalar for shift main type
ClosedPublic

Authored by arsenm on Jan 31 2019, 5:47 PM.

Details

Summary

This is pretty much directly ported from SelectionDAG. Doesn't include
the shift by non-constant but known bits version, since there isn't a
globalisel version of computeKnownBits yet.

This shows a disadvantage of targets not specifically which type
should be used for the shift amount. If type 0 is legalized before
type 1, the operations on the shift amount type use the wider type
(which are also less likely to legalize). This can be avoided by
targets specifying legalization actions on type 1 earlier than for
type 0.

Diff Detail

Event Timeline

arsenm created this revision.Jan 31 2019, 5:47 PM
aemerson added inline comments.Feb 6 2019, 3:08 PM
include/llvm/CodeGen/GlobalISel/LegalizerHelper.h
178

Typo s/Shif/Shift

lib/CodeGen/GlobalISel/LegalizerHelper.cpp
2370

Maybe if (DstEltSize % 2 != 0) is clearer?

2461

These can now be replaced with the new Lo->getReg(0) helper.

aemerson accepted this revision.Feb 6 2019, 3:09 PM
This revision is now accepted and ready to land.Feb 6 2019, 3:09 PM
arsenm closed this revision.Feb 7 2019, 11:38 AM
arsenm marked 3 inline comments as done.

r353455