This is an archive of the discontinued LLVM Phabricator instance.

DAG: Avoid stack lowering if bitcast has an illegal vector result type
ClosedPublic

Authored by arsenm on Jan 13 2023, 5:07 PM.

Details

Summary

A bitcast of <10 x i32> to <5 x i64> was ending up on the
stack. Instead of doing that, handle the case where the new type
doesn't evenly divide but the elements do. Extract the individual
elements and pad with undef.

Avoids stack usage for bitcasts involving <5 x i64>. In some of these
cases, later optimizations actually eliminated the stack objects but
left behind the unused temporary stack object to final emission.

Fixes: SWDEV-377548

Diff Detail

Event Timeline

arsenm created this revision.Jan 13 2023, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2023, 5:07 PM
arsenm requested review of this revision.Jan 13 2023, 5:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2023, 5:07 PM
Herald added a subscriber: wdng. · View Herald Transcript
RKSimon added inline comments.Jan 14 2023, 2:10 PM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
4888

replace with Ops.append() ?

arsenm updated this revision to Diff 489351.Jan 15 2023, 6:08 AM

Use append

RKSimon accepted this revision.Jan 15 2023, 8:37 AM

LGTM

This revision is now accepted and ready to land.Jan 15 2023, 8:37 AM