This is an archive of the discontinued LLVM Phabricator instance.

Set correct MMO offset on scalarized load pieces
ClosedPublic

Authored by greened on Sep 20 2018, 8:41 AM.

Details

Summary

When scalarizing a load, be sure to update the offset in the MachineMemOperand
for each scalar load.

Diff Detail

Repository
rL LLVM

Event Timeline

greened created this revision.Sep 20 2018, 8:41 AM

Found this by inspection, so no testcase.

craig.topper added inline comments.Sep 21 2018, 9:41 PM
lib/Target/X86/X86ISelLowering.cpp
19890

I'm not sure if this is needed. getAlignment for loads defers to MachineMemOperand::getAlignment which calls MinAlign(getBaseAlignment(), Offset)

arsenm added a subscriber: arsenm.Sep 22 2018, 6:14 AM
arsenm added inline comments.
lib/Target/X86/X86ISelLowering.cpp
19889

Why doesn't this use TLI::scalarizeVectorLoad?

greened added inline comments.Sep 24 2018, 12:02 PM
lib/Target/X86/X86ISelLowering.cpp
19889

I don't know. Perhaps we can look at refactoring after fixing this bug.

19890

I was just following the example of similar code in the file. If we think it's unnecessary, I guess that's ok but it seems good to me to make this kind of thing explicit, if for no other reason than to make others feel comfortable when they look at this code two years from now.

This revision is now accepted and ready to land.Oct 2 2018, 9:38 PM
greened closed this revision.Oct 4 2018, 7:12 AM

Closed with r343776.