This is an archive of the discontinued LLVM Phabricator instance.

[DAGCombiner][X86] Disable narrowExtractedVectorLoad if the element type size isn't byte sized
ClosedPublic

Authored by craig.topper on Feb 28 2020, 11:50 AM.

Details

Summary

The address calculation for the offset assumes that you can calculate the offset by multiplying the index by the store size of the element. But that only works if the element'ss store size is exactly its real size since we store vectors tightly packed in memory. There are improvements we could make to this like special casing extracting element 0. I think we could also handle cases where the extracted VT is byte sized and the index is aligned with the extract element count.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 28 2020, 11:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2020, 11:50 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
craig.topper marked an inline comment as done.Feb 28 2020, 11:52 AM
craig.topper added inline comments.
llvm/test/CodeGen/X86/avx512-extract-subvector-load-store.ll
624–630

I think this is because we're now hitting scalarizing code in the type legalizer.

RKSimon accepted this revision.Mar 1 2020, 1:27 PM

LGTM for correctness - are you intending to improve the codegen later on?

This revision is now accepted and ready to land.Mar 1 2020, 1:27 PM
This revision was automatically updated to reflect the committed changes.