This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] When splitting gathers/scatters in type legalization, set MMO size to UnknownSize
ClosedPublic

Authored by craig.topper on Mar 18 2020, 2:47 PM.

Details

Summary

Gather/scatter don't access one memory location, they access multiple disjoint locations. So using a fixed size isn't accurate. But we don't have a way to represent the true behavior so just use UnknownSize.

Previously we "split" the memory VT and use that size for the MMO of each half. But the memory VT is scalar so splitting usually just returned the original scalar VT, but on 32-bit X86 if the scalar VT was i64 it probably returned i32?

Diff Detail

Event Timeline

craig.topper created this revision.Mar 18 2020, 2:47 PM
efriedma accepted this revision.Mar 18 2020, 3:23 PM

LGTM

We could theoretically be more aggressive here, but it's unlikely to matter.

This revision is now accepted and ready to land.Mar 18 2020, 3:23 PM
RKSimon accepted this revision.Mar 18 2020, 3:36 PM

Makes sense to me

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2020, 4:19 PM