This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] Use TypeSize for the stack offset.
AcceptedPublic

Authored by HsiangKai on Nov 19 2020, 5:37 PM.

Details

Summary

The return value type of getSizeInBits() is TypeSize now. Keep the type of the offset as TypeSize to enable concat_vectors to handle scalable vector objects correctly.

Diff Detail

Event Timeline

HsiangKai created this revision.Nov 19 2020, 5:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2020, 5:37 PM
HsiangKai requested review of this revision.Nov 19 2020, 5:37 PM
HsiangKai updated this revision to Diff 306574.Nov 19 2020, 5:56 PM

Change looks sensible but please add a test.

craig.topper added inline comments.Nov 24 2020, 7:10 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
1423

Does this assert need to be updated so that it doesn't implicitly cast TypeByteSize to an unsigned? I assume that will print a warning about assuming fixed size.

HsiangKai updated this revision to Diff 314310.Jan 3 2021, 6:31 PM
HsiangKai marked an inline comment as done.Jan 3 2021, 7:38 PM
evandro accepted this revision.Jan 4 2021, 6:45 PM
evandro added a subscriber: evandro.

LGTM

This revision is now accepted and ready to land.Jan 4 2021, 6:45 PM

As before I still believe there should be a test to protect this fix as presumably you're doing it for a reason.

As before I still believe there should be a test to protect this fix as presumably you're doing it for a reason.

I agree. I encountered the bug when implementing some vector instructions in the downstream. Currently, we are changing the way to implement these vector instructions. We could not trigger it any more under the new implementation. So, I have no idea how to create the test case now. I will not land this commit until I could find a way to test it.