This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Implement regbankselect for G_ASSERT_ZEXT
ClosedPublic

Authored by paquette on Jan 28 2021, 4:22 PM.

Details

Summary

This adds generic regbankselect support for G_ASSERT_ZEXT.

It inherits whatever register bank the source was given, always, on all targets.

Register bank selection traverses the blocks in a function in reverse post-order, and then traverses the instructions in each block top-down. So, I think that at the point where we run into these, the source register bank should be decided.

This also adds some AArch64-specific code which makes sure we can handle G_ASSERT_ZEXT when deciding on register banks for G_STORE, G_PHI, ... etc.

Diff Detail

Event Timeline

paquette created this revision.Jan 28 2021, 4:22 PM
paquette requested review of this revision.Jan 28 2021, 4:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2021, 4:22 PM
Herald added a subscriber: wdng. · View Herald Transcript
aemerson accepted this revision.Jan 28 2021, 4:40 PM
aemerson added inline comments.
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
627

I think we should assert here that we expect G_ASSERT_ZEXT, because I suppose in future more hint instructions may not have the same form as copies (the doc didn't specify that hints in general can always be treated as copies).

633

s/Hint/ASSERT_ZEXT

This revision is now accepted and ready to land.Jan 28 2021, 4:40 PM
This revision was automatically updated to reflect the committed changes.
arsenm added inline comments.Jan 28 2021, 6:45 PM
llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
630–631

I'm not sure this is actually true, it just happens to be true with the basic implementation now