This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeVectorTypes] Improve SplitVecRes_INSERT_SUBVECTOR to handle subvector being in the high half of the split or not at element 0 of the low half.
ClosedPublic

Authored by craig.topper on Feb 26 2021, 2:46 PM.

Details

Summary

This function isn't exercised in lit tests today today according to
the code coverage report. But will be after the tests in D97543 and
D97559.

Posting this patch to help a crash that Fraser hit.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 26 2021, 2:46 PM
craig.topper requested review of this revision.Feb 26 2021, 2:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 26 2021, 2:46 PM

Hah, I was going to make the same change on Monday.

LGTM but the other reviewers know the code here better, and I'll wait for the tests before accepting.

RKSimon added inline comments.Feb 27 2021, 2:47 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
1265

typo /

1269

Should we be using LoVT.getVectorNumElements() to compute the boundary?

Address review comments.

Are tests available now?

Add test case that previously crashed

Run update_llc_test_checks.py which updates some other tests that were falling back to memory before.

LGTM @frasercrmck Are you happy with this?

yubing added a subscriber: yubing.Mar 1 2021, 11:47 PM
frasercrmck accepted this revision.Mar 2 2021, 1:16 AM

LGTM other than my final nit.

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
1271

While we're changing these lines, I'm not sure this style of parentheses around subexpressions is common?

This revision is now accepted and ready to land.Mar 2 2021, 1:16 AM
uabelho added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
1271

Since IdxVal is unsigned the condition

IdxVal >= 0

is always true. Gcc warns about this.