This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Combine g_extract with g_merge_values
ClosedPublic

Authored by arsenm on Feb 3 2019, 7:22 AM.

Details

Summary

Try to use the underlying source registers.

This enables legalization in more cases where some irregular
operations are widened and others narrowed.

This seems to make the test_combines_2 AArch64 test worse, since the
MERGE_VALUES has multiple uses. Since this should be required for
legalization, a hasOneUse check is probably inappropriate (or maybe
should only be used if the merge is legal?).

Diff Detail

Event Timeline

arsenm created this revision.Feb 3 2019, 7:22 AM
aemerson accepted this revision.Feb 4 2019, 3:18 PM

It's not quite true that these combines are required for legalization, but to clean up instructions required to satisfy the type requirements. Operations left over should still be legalized in some way so as to not cause a selection failure later, even if the codegen is poor quality.

Anyway, this is something that was on my todo list anyway, the aarch64 test regression looks ok. We don't want a hasOneUse case because sometimes we can have multiple extracts which we definitely want to replace with copies if we can.

This revision is now accepted and ready to land.Feb 4 2019, 3:18 PM
arsenm closed this revision.Feb 4 2019, 3:42 PM

r353121