This is an archive of the discontinued LLVM Phabricator instance.

[DAG] scalarizeExtractedVectorLoad - replace getABITypeAlign with allowsMemoryAccess (PR45116)
ClosedPublic

Authored by RKSimon on Sep 25 2021, 11:49 AM.

Details

Summary

One of the cases identified in PR45116 - we don't need to limit extracted loads to ABI alignment, we can use allowsMemoryAccess - which tests using getABITypeAlign, but also checks if a target permits (fast) misaligned memory loads by checking allowsMisalignedMemoryAccesses as a fallback.

I've also cleaned up the alignment calculation code - if we have a constant extraction index then the alignment can be based on an offset from the original vector load alignment, but for non-constant indices we should assume the worst (single element alignment only).

Diff Detail

Event Timeline

RKSimon created this revision.Sep 25 2021, 11:49 AM
RKSimon requested review of this revision.Sep 25 2021, 11:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2021, 11:49 AM
RKSimon updated this revision to Diff 375063.Sep 25 2021, 12:10 PM
RKSimon edited the summary of this revision. (Show Details)
dmgreen accepted this revision.Sep 28 2021, 4:39 AM

This sounds OK to me, providing I'm understanding these alignments vs base alignments correctly. LGTM

This revision is now accepted and ready to land.Sep 28 2021, 4:39 AM

Thanks @dmgreen - I'll keep this open for a few days in case anyone else has any further comments.

This revision was landed with ongoing or failed builds.Oct 1 2021, 1:08 PM
This revision was automatically updated to reflect the committed changes.